How To Analyse The Cosmic Dch Data
All the data taken from the L.A.B. and IR2 cosmics runs are kept on tape. The tape labels are QX0368 to QX0385 and QX0408 to QX0449. Each tape can hold up to 800 Mbytes but with compression the practical limit is 1.1 Gbytes. The contents of each tape is stored in a file called QX0***.list in the $BFROOT/data/data03/dcdata/dch directory. The contents
of a file will look like this:
QX0382.list
SEQ 1 run1882.xtc-new 156
SEQ 2 run1886.xtc-new 70
SEQ 3 run1887.xtc-new 110
The first line is the name of the file. Subsequent lines have 4 entries:
- 1.
- The keyword SEQ.
- 2.
- The sequence number of the file on the tape.
- 3.
- The name of the run file. The suffix xtc-new indicates the file is stored in the new xtc format..
- 4.
- The size of the file in Mbytes.
To see the list of runs taken look at the LAB cosmic data page or the IR2 cosmic data page.
To find out which tape contains a run, cd to $BFROOT/data/data03/dcdata/dch and issue the command:
findrun xxxx
where xxxx is the run number. This will return the tape number as well as the information given above.
To find information about a run, execute the runinfo command with a run number as a parameter. You will find it useful to define runinfo as an alias: alias runinfo ``$BFROOT/data/data03/dcdata/dch/runinfo'' and then execute the
command.
runinfo 2262
This will produce an output like this:
Searching for run 2262 on tape...
QX0421 SEQ 3 run2262.xtc-new 351
Searching for ntuples for run 2262 ...
0cp
10cp
20cp
40cp
30cp
Use above numbers as second parameter for historevive
Searching for Chebychev calibrations...
2262-161.cheby.cal
2262.cheby.cal
Searching for Masa calibrations...
ls: No match.
- cd to $BFROOT/data/data03/dcdata/dch
- Run the revive command. For example to revive run 2105:
revive 2105
This will stage in the file from the correct tape and create a link run2105.xtc-new (if the file was stored in the new xtc format) or run2105.xtc if stored in the old format. You can then use this link or create a link in your own
directory.
There are currently 3 data ``formats''. All the old xtc files have been converted to the new format so you should not need to worry about old files.
Although the data format has not changed, it is not currently possible to read data written by DataFlow V2 and DataFlow V3 with the same executable.
Runs written after run 2140 require code compatible with DataFlow V3. See ``DchProto with DataFlow V3'' to find out how to make an executable for DataFlow
V3 data and ``DchProto with DataFlow V2'' for DataFlow V2 data.
How do I build DchProto with DataFlow V3?
The code to read and process the data (DchProto) is not part of the official release. At the moment you need two executables: one to read the old data taken with DataFlow V2 (runs < 2140) and one to read the new data (runs 2140).
To setup to read the new data with release V7.7.1 you need to execute the following commands:
###########################################################################
srtpath 7.7.1 $BFARCH
newrel -s /nfs/farm/babar/work/${USER} -t 7.7.1 p771
rmdir /nfs/farm/babar/work/${USER}/p771/tmp
#
srtpath 7.7.1 $BFARCH
cd p771
#
gmake clean
gmake database.deleteboot DEFINE_BOOTFILE_RULES=yes
gmake database.import
#
setboot
#
addpkg workdir
addpkg -h DchProto
# fixes some floating point errors.
addpkg DcxReco V00-02-20
#
gmake database.config
#
rm gmake.log
gmake spec >& gmake.log
showtag >>& gmake.log
#
showtag
###########################################################################
You now have to edit GNUmakefile and AppOepBuild.cc in ./DchProto. Remove the ``//dfv3'' comments in 5 places. Then issue the following commands from the p771 directory:
###########################################################################
#
gmake workdir.setup
gmake clean
gmake lib
gmake DchProto.bin
#
###########################################################################
Now go to ``DchProto Specific Files'' to finish the setup.
How do I build DchProto with DataFlow V2?
###########################################################################
srtpath 7.7.1 $BFARCH
newrel -s /nfs/farm/babar/work/${USER} -t 7.7.1 p771
rmdir /nfs/farm/babar/work/${USER}/p771/tmp
#
srtpath 7.7.1 $BFARCH
cd p771
#
gmake clean
gmake database.deleteboot DEFINE_BOOTFILE_RULES=yes
gmake database.import
#
setboot
#
addpkg workdir
addpkg -h DchProto
#
addpkg OdfOffline V00-01-06
addpkg OepCommon V00-02-10
addpkg OepFramework V00-05-04
#
gmake database.config
#
rm gmake.log
gmake spec >& gmake.log
showtag >>& gmake.log
#
showtag
#
gmake workdir.setup
gmake clean
gmake lib
gmake DchProto.bin
#
###########################################################################
Now go to ``DchProto Specific Files'' to finish the setup.
DchProto Specific Files
When you have completed ``DchProto with DataFlow V3'' or
``DchProto with DataFlow V2'', you now have to set up the DchProto specific files. From the p771/DchProto directory run the installFiles.sh script with the run you want to use. You only need to do this once when you set up the
release.
cd DchProto
source installFiles.sh 2156
cd ../
Before running you need to do two things:
- Make a link to the data file in workdir. The revive command puts all its links in
$BFROOT/data/data03/dcdata/dch with names like run2151.xtc-new (see the output from runinfo). For example make a link:
ln -fs $BFROOT/data/data03/dcdata/dch/run2151.xtc-new 2151
- Edit the tcl script. The things you usually want to change are:
- 1.
- The name of the output histogram in GenBuildEnv
- 2.
- The name of the time-to-distance calibration file in DchBuildEnv. The calibration files are in $BFROOT/doc/CentralTracker/commissioning/data/Calibration/ and contain the run number. There are currently two types, Chebyshev and Masa. Use
the Chebyshev by default.
- 3.
- If the data was taken with the magnetic field on, set isCosmic in DchBuildEnv to false.
- 4.
- The value of T0offset in DchCosmicT0Builder. For IR2 data it should be 1680; for L.A.B. data it should be 0.
Everything else is optional and is described below.
Now (important) issue the setboot command:
setboot
Now you can run the executable:
- time testDchOep -b 1000000 -f <link_to_datafile> -n<events><tcl_file>
- For example: time testDchOep -b 1000000 -f 2151 -n 30 proto_oep.tcl
How do I run DchProto on runs 2262 to 2291?
Runs 2262 to 2269 had an incorrect calibration file (162 instead of 161). This affected the charge and the T0. To correct for this you need to run the offline version of the online feature extraction and a special time-to-distance
calibration file. To do this:
- Edit AppOepBuild.cc in DchProto directory and comment in the line:
add(new DchFEXModule);
- Recompile.
- make a link in workdir to the correct calibration file:
ln -fs $BFROOT/detector/dch/DchIR2/calibration/cal161/calibration.out calibration.out
- Add the DchFEX module to your TCL file (see ``Example TCL file'').
- Use time-to-distance calibration files which contain the string ``-161''. For example, the 2278-161.cheby.cal file.
How do I run DchProto using the Dch Trigger Times?
- Edit AppOepBuild.cc in DchProto directory and add the line: add(new DcxT0Finder( "DcxT0Finder", "Find the t0s")); before the line containing DchMakeHits.
- Recompile.
- If you do not want the Scintillator trigger times, disable the DchCosmicT0Builder module.
- Comment in the DchT0Finder module to your TCL file (see ``Example TCL file'').
Example TCL file
The following is an example of a TCL file. It was used to create the ntuples for run 2149.
###########################################################################
#
# Tcl file for running on B-Field data in IR2 with Release 7.7.1
#
###########################################################################
#
#----------------------
# DchProtoEventFilter
#----------------------
mod talk DchProtoEventFilter
FirstEvent set 1
exit
#----------------------
# DchBuildEnv
#----------------------
module talk DchBuildEnv
isCosmic set true
zPM set 999
usedb set true
mapfile set DchMaps/dch_thru.map
mapconfig set ir2_2roms_thru
timeToDistCalib set file:/afs/slac/g/babar/doc/CentralTracker/commissioning/
data/Calibration/2149.cheby.cal
exit
#----------------------
# DchTrackFinder
#----------------------
module disable DchTrackFinder
#----------------------
# DcxTrackFinder
#----------------------
module talk DcxTrackFinder
verbose set false
exit
#----------------------
# DcxTimeOrder
#----------------------
module talk DcxTimeOrder
verbose set false
exit
#----------------------
# DchCosmicT0Builder
#----------------------
module talk DchCosmicT0Builder
verbose set false
T0offset set 1680
exit
#----------------------
# DchT0Finder
#----------------------
#module talk DchT0Finder
# c0 set -100
#exit
#----------------------
# ProAnalysisModule
#----------------------
module talk ProAnalysisModule
verbose set false
dchTrkList set DchTrackFinder
doRefit set false
WaveForm set false
exit
#----------------------
# WfAnalysisModule
#----------------------
module disable WfAnalysisModule
#----------------------
# DchHist
#----------------------
module disable DchHist
#----------------------
# GenBuildEnv
#----------------------
mod talk GenBuildEnv
histFileName set ir2_2149_0cp.hsto
exit
#----------------------
# DchMakeHits
#----------------------
module talk DchMakeHits
chargeCut set 50
exit
#----------------------
# DchFEXModule
#----------------------
module disable DchFEX
#module talk DchFEX
# calConstsFile set calibration.out
#exit
#//gra module talk DchGra
#//gra DchHitBW set True
#//gra DchHoT set True
#//gra DchTrk set True
#//gra background set white
#//gra exit
path enable AllPath
exit
See Tables 2.8 and 2.8.
Table 1: TCL Parmeters
| Parameter |
Values |
Default |
Meaning |
| DchProtoEventFilter |
| FirstEvent |
Integer |
1 |
The first event to be processed |
| DchFEX |
| calConstsFile |
string |
Calibration run 109 |
File containing Calibration constants |
|
ProAnalysisModule
|
| dchTrkList |
string |
DchTrackfinder |
List of tracks to be used |
| doRefit |
bool |
true |
Refit track with each Hot removed and store in ntuple |
| WaveForm |
bool |
false |
store waveform samples in ntuple |
| findResAdd |
real (cm) |
0.0 |
Add in quadrature to t2d resolution function |
| fitResScale |
real |
1.0 |
Scale the t2d resolution function |
| WfAnalysisModule |
| dchTrkList |
string |
DchTrackFinder |
|
| WaveFormData |
string |
Default |
|
| rawWaveForms |
bool |
false |
|
| Slewing |
bool |
false |
|
| Scan |
bool |
false |
|
| Dip |
bool |
false |
|
| Check |
bool |
false |
|
| trueDch |
bool |
false |
|
| ProReadCalib |
| inputFileCalib |
string |
run1180 |
|
| inputOnlineCalib |
string |
calibration.out |
|
| driftmodel |
integer |
8 (masa) |
|
| onlineCalib |
bool |
false |
|
| applyt0 |
bool |
false |
|
| applyAGain |
bool |
false |
|
| correctGain |
bool |
false |
|
| ProSetTimeModule |
| startTime |
date |
01Jan1998 00:00:00 |
|
| DcxTrackFinder |
| firstevt |
real |
0.0 |
|
| c0 |
real |
4.4 |
|
| vprop |
real (cm/ns) |
26.0 |
|
| cresol |
real (cm) |
0.018 |
|
| trkRecoTrkList |
string |
DchTrackFinder |
|
| gEventList |
string |
Default |
|
| dchHitList |
string |
Default |
|
| DcxTimeOrder |
| c0 |
real |
4.4 |
|
| vprop |
real (cm/ns) |
26.0 |
|
| cresol |
real (cm) |
0.018 |
|
| trkRecoTrkList |
string |
DchTrackFinder |
|
| gEventList |
string |
Default |
|
| dchHitList |
string |
Default |
|
| vpmcorr |
real |
20.0 |
|
| zpmcorr |
bool |
false |
|
|
Table 2: TCL Parameters
| Parameter |
Values |
Default |
Meaning |
| DcxT0Finder |
| c0 |
real |
4.4 |
|
| vprop |
real (cm/ns) |
26.0 |
|
| cresol |
real (cm) |
0.018 |
|
| dchdigiList |
string |
Default |
|
| DchCosmicT0Builder |
| debug |
integer |
0 |
|
| minT0 |
real (ns) |
1200.0 |
|
| maxT0 |
real (ns) |
 |
|
| T0offset |
real (ns) |
0.0 |
|
| dchCosmicTime |
string |
Default |
|
| DchTrackFinder |
| trkDchList |
string |
Default |
|
| DchHist |
| dchDigiList |
string |
Default |
|
| trkRecoTrkList |
string |
DchTrackFinder |
|
| gVertexList |
string |
default |
|
| DchMakeHits |
| chargeCut |
real |
0.0 |
Minimum charge required to make a hit |
| dchDigiList |
string |
Default |
Input list of digis |
| dchHitList |
string |
Default |
Output list of hits |
|
Apparently graphics is broken in 7.7.1 but here is the procedure:
- Comment in the DchGra module in the TCL file (see ``Example TCL file'').
- Make sure usedb is set to true in the DchBuildEnv Module in the TCL file.
- Comment in lines marked ``//gra'' in AppOepBuild.cc in the DchProto directory. Do the same for lines marked ``#//gra''.
- Remake DchProto (gmake DchProto.lib ; gmake DchProto.bin).
- In the workdir, execute the command:
source GraDisplay/setup.csh
- Run the executable as before.
See Table 4.1.
Table 3: Description of the variables in the ntuples generated from the runs.
| Variable |
Description |
| nTrgTime |
Number of triggers [0,4] |
| trgTime(nTrgTime) |
Trigger times |
| BunchT0 |
Trigger time used in code |
| evtTime |
Time stamp (seconds) |
| damage |
Error Flag |
| Ntrk |
Number of tracks |
| chisqDof(Ntrk) |
/Ndof (Ndof=nActive-4) |
| nActive(Ntrk) |
Number hits on track |
| phi0(Ntrk) |
 |
| tandip(Ntrk) |
Tan( ) |
| z0(Ntrk) |
Z0 (at closest approach to Z axis) |
| d0(Ntrk) |
Doca (at closest approach to Z axis) |
| Pt(Ntrk) |
PT |
| Ndigi |
Number of Hits on track |
| tkmat(Ndigi) |
Track Number the HOT belongs to |
| layer(Ndigi) |
Layer Number |
| wire(Ndigi) |
Wire Number |
| time(Ndigi) |
Corrected measured time |
| doca(Ndigi) |
Doca of the track from the wire |
| drift(Ndigi) |
Hit drift distance (from t2d relation) |
| x(Ndigi) |
x coordinate of Hot after fit |
| y(Ndigi) |
y |
| z(Ndigi) |
z |
| xwire(Ndigi) |
x wire coordinates at the fitted z position |
| ywire(Ndigi) |
y |
| Eangle(Ndigi) |
Entrance Angle |
| dEdX(Ndigi) |
Charge from PID |
| Charge(Ndigi) |
Charge from waveform |
| dX(Ndigi) |
Track path length in cell |
| Nref |
Number of hits on refitted tracks |
| refdoca(Nref) |
Refitted doca |
| tResid(Nref) |
Refdoca-drift |
| refresid(Nref) |
abs(refdoca)-abs(drift) |
| refchisqdof(Nref) |
/Ndof |
| refnactive(Nref) |
Number hits on track |
| refphi(Nref) |
 |
| refd0(Nref) |
d0 |
| refz0(Nref) |
Z0 |
| reftandip(Nref) |
Tan( ) |
| reftrkerr(Nref) |
Error on refdoca (from track fit) |
| nHit |
Number of TDC hits in the event |
| hittime(nHit) |
Time |
| idigi(nHit) |
Index on nAllDigi |
| nAllDigi |
Total number of digis |
| hitlayer(nAllDigi) |
Layer number |
| hitwire(nAllDigi) |
Wire numberr |
| hitbad(nAllDigi) |
Digi Status (1=bad WF; 2=error; 4=bad pedestal) |
| hitChanMap(nAllDigi) |
Compacted FEE/ROM/chip/channel number |
| hitCharge(nAllDigi) |
Charge |
| ampXX(nAllDigi) |
Amplitude of the waveform bin XX(from 0 and 31) |
| Nmis |
Number of hits expected on track and not found |
| misWire(Nmis) |
Wire Number |
| misLayer(Nmis) |
Layer Number |
| misDoca(Nmis) |
Measured track doca to the wire |
| misTmat(Nmis) |
Track that expected the hit |
|
The ntuples have names like ir2_2343_10cp. This provides four pieces of information. The prefixes:
- The environment.
- oep: Data taken in the L.A.B.
- ir2: Data taken in standalone mode in IR2.
- babar: Data taken with other detectors in IR2.
- The Run Number.
- The Offset. The ntuples are split into units of 10000 events. The number indicates the first thousand'th event in the ntuple. For example ``10'' indicates the ntuple started at event 10000.
- Processing Options:
- c or m: indicates a chebyshev or masa function was used for the t-2-d function.
- p: indicates that the number of hits in the ntuple was ``pruned'' by demanding a minimum charge. This was set at 50.
To see if a run has been processed, use the historevive command with the run number as an option:
To recover the ntuples you use the historevivecommand with one of the numbers printed out above as a second option:
- cd to $BFROOT/data/data03/dcdata/dch/ntuple
- Run the historevive command. For example:
historevive 2099 8
- This will create a link in $BFROOT/data/data03/dcdata/dch/ntuple to the real data file with the prefix ir2 (for data taken in IR2) or oep (for data taken in the LAB). For example: ir2_2099_8
The ntuples were created by using DchProto.
To use paw on more than one ntuple, you can chain them together. For example, if you have links to ntuples called ir2_2099_0, ir2_2099_4 and ir2_2099_8, you can use the following commands:
- PAW> CHAIN dedx ir2_2099_0 ir2_2099_4 ir2_2099_8
- PAW> cd //dedx
- PAW> nt/pl //dedx/1.charge
- PAW> etc...
You can find the postscript version of this information in:
$BFROOT/doc/CentralTracker/commissioning/analysis/analysis.ps
You can find the HTML version of this information in:
$BFROOT/doc/CentralTracker/commissioning/analysis/analysis.html
This document was generated using the LaTeX2HTML translator Version 98.1p1 release (March 2nd, 1998)
Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html -split 0 -t How To Analyse Dch Cosmic Data analysis.tex.
The translation was initiated by Fergus Wilson on 1998-12-15
Fergus Wilson
1998-12-15
|