Description of the ECAL online pi0 calibration
The aim of the following document is to provide description of pi0-online
calibration from the expert usage point of view. The structure, programs
called and their command line parameters are summarized here. Please, consult
Shift Manual for shift instruction how to run
The scheme( PS) presents main steps of pi0 calibration.
It includes :
pi0 Server program
Selection of the energetic pi0 candidates from the data flow.
The information about pi0 candidate is sent to the gatherer.
After the ECAL reconstruction is performed (by online CARE), the selection
of all clusters passing the cuts specified in the table below is performed.
The event is considered if the number of such clusters in the event is
greater 1 and less then PI0nclusters. The
invariant mass is calculated for each 2 selected clusters. The pair is
accepted as pi0 candidate if the invariant mass is larger than PI0histlow
less than PI0histhigh. The information about
candidate is saved into RHP ntuple.
For background estimations the clusters are combined one from previous
accepted event. The candidates from mixed events are saved into different
but similar RHP ntuple.
For online cross-check of server the control
histograms are provided. Both ntuples and histograms are read by
The standalone operation differs from the one which works within SLT
by the output flag : the standalone code rejects all events while
the one for SLT accept everything.
by the CARE cuts : the standalone code uses the offline (ARTE) constants
while SLT has harder cuts
the upper limit on transverse energy of the clusters is used only
in SLT code but not in standalone code
Source/Executable Location, Compatibility with Other Packages
The code is located in the /afs/desy.de/group/hera-b/ECAL/pi0
The pi0pack provides library for standalone operation :
and for operation together with SLT code :
The include files could be found in the directory pi0pack/include.
The file LASTUPDATE shows compatibilities with other libraries.
The description of RHP ntuple could be found in :
To create a executable for the standalone run as well as for default
SLT one should ask SLT expert.
He/she has to be remined about :
only EVA_ECAL, ECAL_CARE, ECAL_PI0 packs
are required except the major ones (like TGS, EVA_ALL, EVATRANSFER)
the additional care_config.C with "offline cuts" routine must
be compiled and linked; it can be found at saserver
Command Line Options
There are few more code specific parameters in addition to the standard
||Pt or Ktrig lower limit
|| > 0.3 GeV
||Minimum transverse momentum of a gamma. If the applied value is less
than 200 it's treated as transverse momentum in GeV otherwise as Ktrig
||Pt upper limit
|| <1 GeV
||Maximum transverse momentum of a gamma (standalone executable only)
|| > 0.5 GeV
||Ratio of the central cell energy to the total cluster energy.
||Distance between clusters
|| > 2 cells
||Distance between clusters in a pair, measured in cells. If the clusters
are in different ECAL parts, the larger cell size is taken.
|| < 20
||Number of clusters in the event.
||Histogram low limit
||Low limit of pi0 window for Ntuples and control histograms
||Histogram high limit
||High limit of pi0 window for Ntuples and control histograms
||Histogram number of bins
||Number of bins for control histograms with invariant masses
||Get real data or simulate it
||Valid only in standalone mode.
If set to any non zero value N, the pi0 program will simulate
N clusters instead of get it from data. Could be useful for tests
All default values of cuts and parameters should be sufficient and in
general not to be changed.
To change parameter one should ask for a DAQ expert assistance. The
(non-default) parameters are read in from the file /online/SLT/pro/etc/pi0.par
located on hbols machine, can be
access by hbonline user.
To change the parameters as a command line option one should use the
During operation the RHP-ntuples are created. The set of Control
histograms are created as well. Both ntuples and histograms are
accumulated by gatherer process.
Place in DAQ
The executable is manipulated by standard DAQ and runs on SLP level.
Control histograms are filled on-line for the monitoring purposes. The
numeration is defined by standard DQ-rules. Any histogram (its number)
should be defined in the database (consult DAQ expert). The definitions
are given in /afs/desy.de/group/hera-b/ECAL/pi0/common/include/pi0_hist.h
|CLusterX vs ClusterY
||2-dimensional histogram with the coordinates of clusters which gave
an entry in pi0-ntuple.
|Invariant mass - all channels together
||Invariant mass in the pi0 ntuple, sum for all channels
|Background - all channels together
||Invariant mass for pairs where one cluster comes from the current event
and another one from previous event, sum for all channels
|Number of clusters in event
||Clusters multiplicity in an event
|Cluster energy, all found
||Energy spectrum of all clusters found
|Cluster energy, in mass region
||Energy spectrum of clusters which are included in pairs with the invariant
mass in the pi0 region
|Number of events processed, accepted
||First bin of the histogram shows the number of events processed by
the second bin is the number of events where at least one
candidate is found.
|Number of clusters versus BX
||The number of clusters versus BX.
|Number of triggers versus BX
||The number of triggers versus BX.
The histograms are read out by the gatherer program and then can be
viewed on-line with HbDisplay program (PI0
or be extracted afterwards from database with hbrowser
(28.06.2002: Go to hb-cr** as hbshift. Then to
/online/DISPLAY/pro/Linux_intel_glibc/bin/ directory and Start hbrowser
../../etc/hbrowser. Select DQ_PROD_4/ECAL. At the very end
of the list there are PI0 histograms. Choose one. Select below the
appropriate run. Hbrower takes time)
For any problems ask DAQ expert assistance.
Program collects RHP-ntuples and histograms from SLP-servers and saves
them on disk. The control histograms
are published for HbDisplay and saved to DQ database.
The code works within the standard DQ frame. The general functions
are provided by Online library and the pi0 specific part is a storage of
data on the disk. For that the binary files of machine independent format
are created. The usage of local disk is essential to speed up a process.
The control histograms are collected and published in usual for DQ way.
They are saved into DQ database as well.
The base code is located in the standard ONLINE library repository.
See DQ page or contact DQ expert for more information. The pi0 specific
part is located in :
WARNING (28.06.2002): now gatherer
is responsibility of DAQ group, check with them where the codes are and
that they have the newest SaveManager sources !!!
The location of the main gatherer_pi0 sources
Command Line Options
No pi0 specific command line options are available. The path
to the binary files is defined in the main pi0-gatherer routine.
The following standard parameters might be usefull for gatherer timing
optimization (the values in brackets are checked for June 2002 pi0
The RHP-ntuples are saved in the binary files on the local disk of
the DAQ-defined machine. At the moment(26.04.2000) it is hbdaq3:/data/herab/pi0/
The binary file with data ntuple specified has *DATA* word in the name
while background ntuple specified with *BKGR*. Further the binary files
are saved on the HERA-B tapes : /acs/share3/ecal/onlinePI0/pi0*data* where
each file contains set of the data and background ntuples for the period
limited by one calibration. The format of the file is "tar"-file. Some
of the files might be gziped which is specified in the name of the file.
During operation the gatherer_pi0.log file is created in the same directory,
which allows to control process.
Place in DAQ
The gatherer is started with standard DAQ scheme.
The third step of the procedure takes care of analysis of the pi0-ntuples.
On that step the search of pi0 signal is performed for every good channel
and the correction of calibration factor is obtained.
The program consist of 17 iterations which differ by requirement to
the quality and position of the channels. On each step the data and background
ntuples are read from binary files and transformed to HBOOK histograms.
In most cases there is one histogram per channel, but for some iterations
the channels from the same readout board are combined into one histogram.
The data histograms are fitted by sum of Gaussian and background histogram.
The obtained position of pi0 signal if it is seen transformed into the
correction of calibration factor. Using the value of the calibration constant
used for data taking the new one is calculated. The result is saved into
the file and used for new iterations. At the end the results are checked
with offline ARTE and saved into /ECAL_CALIB database. The cuts for the
each iterations are specified in the kumac file and are self-explaining.
Check of Fit Quality
The histograms with number of events greater then 70 are considered
for fit. The pi0 peak is described by Gaussian function while background
is presented by histogram made from ntuple with invariant mass of clusters
from different events(BKGR). In case there is not enough events in the
background histogram(less than 50) background is described by polinom of
To check the fit has any sense the following criteria are checked :
In case BKGR fit was not performed and number of events in this histogram
was more than 30% of data events, the channels is considered as non-calibrated.
Otherwise FUNC method is applied. If it also didn't pass check given channel
is called non-calibrated as well.
Mass value is inside histogram limit ( 35 - 235 MeV/C^2 )
The width of pi0 is physical ( 4 - 30 Mev )
Estimated number of pi0 ( Gaussian normalization factor ) is not twice
greater than number of events and greater than 10% of ( Number of events
- Number of events in background histogram)
The chi2 value of fit should be less than 200 if background histogram is
used and 50 for polynomial dependence. It of course is chosen in dependence
on number of bins(30) in histograms
The signal to square-root of background where background is calculated
in the 3 sigma region under the peak should be more than 5
The data histogram with background subtracted should have a clear peak.
For this the deviation of data from the fit value is calculated in each
bin and normalized on number of pi0 found. The quadratic sum for all bins
must be less than 0.32.
The procedure invokes by : font color=red>/afs/desy.de/group/hera-b/ECAL/pi0/fit/fitproceed
script on the hb-af0* machines which performs all necessary operations.The
script has to be edited every time for correct database settings (major,
minor) and for the correct mark(DATE) of the output files.
The executable could be found in the /afs/desy.de/group/hera-b/ECAL/pi0/fit/$BINTYPE/bin/pi0fit
directory for the Linux_intel machines
The kumacs files are :
Command Line Options
||Must be specified unless -makeKumac is used
||Pass the kumac file with cuts to be applied
||Must be specified unless -kumac is used
||Create kumac file with default cuts
||Print a short explanation of the command line parameters and stop program
||Allows to pass set of channels to be considered as bad ones
||Set a level of printouts
||Set a major number for the ECAL database revision
||Set a minor number for the ECAL database revision
At the end of each iterations the program returns :
pi0fit.his file with result histograms for
each channel and ntuple with results of the fit per channel. The numeration
of channels and histograms is 100*FEDID+CHAN.
newIteration.gain file with new sensitivity
contants for each channel. The format of the file is :
sensitivity (Float) xmod(Int) ymod(Int) chmod(Int) error(Float) channgeable(Bool)
where (xmod, ymod, chmod) start from 1 and present the numeration of
the channel. The sensitivity is presented in GeV/ADC. The last parameter
is used for iterations.
gain.coeff file with ratio of coefficient
to the old value. The format of the file is :
ratio_New_Old(Float) xmod(Int) ymod(int) chmod(Int) error(Float)
If the fitproceed script is invoked
the output files are copied to the /hb/ecal2/pi0/fit/iterations/ directory
with specification of the date.
Place in DAQ
The program invokes manually as soon as enough data for the complete
calibration is collected.
Cross-Check with ARTE
cross check is performed to see the effect of procedure on the standard
reconstruction of the data.
The standard ARTE job is built and used for that step. All parameters
used correspond to the standard reconstruction. The procedure to reconstruct
is similar to the online version. The clusters are considered if the Et
> 0.3 GeV. No cut on the number of energetic clusters in the event is applied.
The job is built every time with latest ARTE version. Consult the ARTE
manual for details.
Place in DAQ
manual check after the new set of calibration constants is obtained.
pi0 Update of DataBase information
After the calibration constants checked with latest ARTE version the information
is passed to the ECAL database (/ECAL_CALIB).
At the same time it is distributed with keytable.
To avoid conflict with data taking the update of database is done manually
between HERA luminosity runs ( when no run is being taken).
The update is performed by means of the /afs/desy.de/group/hera-b/ECAL/publisher
Meaning of database tables ECPI0SLT, ECPI0ONL
As the output of the program the tables ECPI0SLT,
ECPI0ONL are updated in the /ECAL_CALIB database. They contains
Table discription TabInfo and row ECpi0 for each channel.
For each raw there are several parameters in addition to the status,
sensitivity and error on sensitivity. Most of parameters are obtained from
the fit of final iteration so they include calibration contants of previous
iterations performed on the same set of data. However the latest correction
is made on this bases (except channels with fit=0).
The fitting function is Gaussian (pi0 signal) + background (mixed events).
The parameters meaning is following :
||mean of Gaussian (final fit)
||error of mean of Gaussian (final fit)
||width of Gaussian (final fit)
||error of width of Gaussian (final fit)
||Number of pi0 in the signal (final fit)
||error of the number of pi0 in the signal (final fit)
||Normalization of background histograms, 4 parameter in the fit (final
||error of Normalization of background histograms (final fit)
||Chi-squared of final fit
||number of degree of freedom.
||Ratio of obtained sensitivity to the one used for the data collection
||2*emass/0.135 * OldSensitivity
||Internal variable, 0 means that the calibration constant was fixed
during previous iterations
||type of final fit : -1 - means channels was not considered
0 - no fit found
1 - fit with background histogram
2 - fit with polinomial of second power
Last update 26.04.2000