"http://www.slac.stanford.edu/icon/up_motif_gr.gif">
How To Analyse The Cosmic Dch Data
These instructions work on shire. They probably work on percheron. Do not use vesta or flora.
The data exists in two places. The DCH standalone data taken in 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.
The data taken with other detectors is kept in the directory /nfs/babar/cosmics/theTapes.
To see the list of runs taken look at the DCH LAB cosmic data page or the DCH IR2 cosmic data page or the Integrated IR2
cosmic data page.
To find out which tape contains a run, cd to $BFROOT/data/data03/dcdata/dch or the /nfs/babar/cosmics/theTapes 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 any run (standalone or integrated), 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 870
This will produce an output like this:
Searching for DCH Standalone run 0870 on tape...
findrun: 0870 not found.
Searching for Integrated run 0870 on tape...
QJ2161 SEQ 10 babar-0870.xtc 281
Searching for ntuples for run 870 ...
0cp
40cp
20cp
10cp
30cp
wf_0c
Use above numbers as second parameter for historevive
Searching for Chebychev calibrations...
babar-0870.cheby.cal
Searching for Masa calibrations...
ls: No match.
- cd to $BFROOT/data/data03/dcdata/dch or /nfs/babar/cosmics/theTapes
- 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.8.2 you need to execute the following commands:
###########################################################################
srtpath 7.8.2 $BFARCH
newrel -s /nfs/farm/babar/work/${USER} -t 7.8.2 pro782
rmdir /nfs/farm/babar/work/${USER}/pro782/tmp
#
srtpath 7.8.2 $BFARCH
cd pro782
#
gmake clean
gmake database.deleteboot DEFINE_BOOTFILE_RULES=yes
gmake database.import
#
setboot
#
addpkg workdir
addpkg -h DchProto
addpkg DcxReco V00-02-22
#
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.
How do I build DchProto with DataFlow V2?
###########################################################################
srtpath 7.8.2 $BFARCH
newrel -s /nfs/farm/babar/work/${USER} -t 7.8.2 pro782
rmdir /nfs/farm/babar/work/${USER}/pro782/tmp
#
srtpath 7.8.2 $BFARCH
cd pro782
#
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 pro782/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. Files for DCH standalone files are called something
like 2270.cheby.cal; files for integrated runs are called something like babar-0870.cheby.cal.
There are currently two types, Chebyshev and Masa. Use the Chebyshev by default.
- 3.
- If the data was taken with the magnetic field off, set doLineFit in DchBuildEnv to true.
- 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 2292?
Runs 2262 to 2292 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:
- You will need DchOep V00-03-08 or later. Go to ./pro782 and execute the command addpkg DchOep V00-03-08.
- Edit AppOepBuild.cc in DchProto directory and comment in the line:
add(new DchFEXModule);
- Recompile (gmake lib and gmake DchProto.bin).
- 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 the DchProto directory and comment in the line: add(new DcxT0Finder( "DcxT0Finder", "Find the t0s"));
- Edit AppOepBuild.cc and add the line #include "DcxReco/DcxT0Finder.hh"
- Recompile.
- If you do not want the Scintillator trigger times, disable the DchCosmicT0Builder module.
- Comment in the DcxT0Finder 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
#
###########################################################################
#
source PARENT/FrameScripts/sourceFoundFile.tcl
sourceFoundFile FrameScripts/setProduction.tcl
sourceFoundFile Bear/BearInitAppSequence.tcl
sourceFoundFile DchOepSequences/DchOepCosmicInitSequence.tcl
sourceFoundFile DchSequence/DchCosmicRecoSequence.tcl
#
#----------------------
# DchProtoEventFilter
#----------------------
module talk DchProtoEventFilter
FirstEvent set 1
exit
#----------------------
# DchBuildEnv
#----------------------
set CalDir "/afs/slac.stanford.edu/g/babar/doc/CentralTracker/commissioning/data/Calibration"
module talk DchBuildEnv
doLineFit set false
usedb set true
mapfile set DchMaps/dch_thru.map
mapconfig set ir2_2roms_thru
timeToDistCalib set file:/afs/slac.stanford.edu/g/babar/doc/CentralTracker/commissioning/data/Calibration/2156.cheby.cal
exit
#----------------------
# BdbSetTime
#----------------------
module talk BdbSetTime
StartDate set 01/01/1998
UseSpecifiedTime set true
exit
#----------------------
# DchTrackFinder
#----------------------
module disable DchTrackFinder
#----------------------
# DcxTrackFinder
#----------------------
module talk DcxTrackFinder
verbose set true
exit
#----------------------
# DcxTimeOrder
#----------------------
module talk DcxTimeOrder
verbose set false
exit
#----------------------
# DchCosmicT0Builder
#----------------------
module talk DchCosmicT0Builder
verbose set false
T0offset set 1680
exit
#----------------------
# ProAnalysisModule
#----------------------
module talk ProAnalysisModule
verbose set false
dchTrkList set DchTrackFinder
doRefit set false
WaveForm set false
exit
#----------------------
# WfAnalysisModule
#----------------------
module disable WfAnalysisModule
#----------------------
# HbkTupleEnv
#----------------------
module talk HbkTupleEnv
histFileName set ntp/ir2_2156_0cp.hsto
exit
#----------------------
# DchMakeHits
#----------------------
module talk DchMakeHits
chargeCut set 50
exit
#----------------------
# DchFEXModule
#----------------------
module disable DchFEX
module talk DchFEX
calConstsFile set calibration.out
exit
#----------------------
# DchGra
#----------------------
#//gra module talk DchGra
#//gra DchHitBW set True
#//gra DchHoT set True
#//gra DchTrk set True
#//gra background set white
#//gra exit
#----------------------
# DcxT0Finder
#----------------------
#module talk DcxT0Finder
# c0 set -100
#exit
path enable AllPath
path list
exit
See Tables 3.8 and 3.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 |
|
| 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 |
|
- 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'' in the makefile.
- Remake DchProto (gmake DchProto.lib ; gmake DchProto.bin).
- In the workdir, execute the command:
source GraDisplay/setup.csh
- Run the executable as before.
This is all guess work:
- Displaying Hits
- Select _Observers/_Edit/_DchObs_0/_DchData. You can select what you want to display:
- DchGhit
- Geant Hits?
- DchHitBW
- hits projected on rear endplate (green).
- DchHitCT
- hits projected onto central plane (z=0) (red).
- DchHitFW
- hits projected on forward endplate (blue).
- DchWire
- the wires associated with hits (blue).
- Displaying Geometry
- Select _Observers/_Edit/_DchObs_0/_DchGeom. You can select what you want to display:
- DchAll
- All the wires.
- DchEndcap
- The inner and outer cylinder.
- DchBarrel
- Don't know (broken).
- Displaying Events
- Click Continue. The next evnet will be displayed.
- Displaying All Events
- Click Setup. Select time interval between events (pause time). Click Apply. To start automatic display, click green start; to stop, click red STOP.
- Postscript
- To generate a postscript file for the next event displayed, select Print PS. To turn off, deselect Print PS. To generate a postscript file for the current event, click with right mouse button on display and select postscript.
Afille called out.ps will be generated.
- Editing the display
- All the display functions work in the same way (except when they don't):
- 1.
- Click with the right hand mouse button on the display.
- 2.
- Select the action from list.
- 3.
- Hold down the CTRL key and drag with mouse pointer.
See Table 5.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 can use the historevive command 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
or you can use the historevivenew to stage in all the ntuples for this run or a list of runs:
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/www/Detector/CentralTracker/commissioning/analysis/analysis782.ps
You can find the HTML version of this information in:
$BFROOT/www/Detector/CentralTracker/commissioning/analysis/analysis782.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 Analayse the DCH Cosmic Data analysis782.tex.
The translation was initiated by Fergus Wilson on 1999-02-18
Fergus Wilson
1999-02-18
|