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 (for standalone DCH runs) or the
/nfs/babar/cosmics/theTapes (for integrated runs) 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
babar-0870.chebyLR.cal
Searching for Masa calibrations...
ls: No match.
- cd to $BFROOT/data/data03/dcdata/dch (for Dch standalone runs) or
/nfs/babar/cosmics/theTapes (for BaBar integrated runs).
- 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''.
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 (DCH Standalone runs < 2140)
and one to read the new data (DCH standalone runs
2140 and all
IR2 integrated data).
As more and more releases are made our ability to read V2 data will
degrade. If you want to use V2 data, look at the prescription in:
$BFROOT/www/Detector/CentralTracker/commissioning/analysis/analysis782.ps
To setup to read the new data with release V7.12.4 you need to execute
the following commands:
###########################################################################
srtpath 7.12.4 $BFARCH
newrel -s /nfs/farm/babar/work/${USER} -t 7.12.4 pro7124
rmdir /nfs/farm/babar/work/${USER}/pro7124/tmp
#
srtpath 7.12.4 $BFARCH
cd pro7124
#
gmake clean
gmake database.deleteboot DEFINE_BOOTFILE_RULES=yes
gmake database.import
#
setboot
#
# needed for DCH geometry corrections
addpkg DchEnv V00-03-29
addpkg DchGeom V00-04-06
#
# needed for asymmetric t2d functions
addpkg DchCalib V00-02-17
addpkg DchCond V00-02-20
addpkg DchData RS100399
#
# needed for DchHitAdder
addpkg DcxReco V00-02-31
#
addpkg workdir
addpkg -h DchProto
#
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.
Database diskspace problems
The loading of the database can fail for an infinite number of
reasons. A common reason is that the disk is full. To get round this,
find an empty disk. The available disks are called /nfs/objyserv2/u[1-10]/databases; do not use u2. Then execute the
following commands (in this example, on disk 10):
mkdir /nfs/objyserv2/u10/databases/$USER
chmod 775 /nfs/objyserv2/u10/databases/$USER
Then edit your .bbobjy file (this should be in the release
directory or your top level directory) and add the line:
FDB_DIR_BASE = /nfs/objyserv2/u10/databases
Now rebuild the database as before. Remember to delete the old
database so that space is freed up for others. For example, to delete
your database on disk 4:
rm -rf /nfs/objyserv2/u4/databases/$USER
DchProto Specific Files
When you have completed
``DchProto with DataFlow V3''
you now have to set up the DchProto specific files. From the
pro7124/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 ../
Updating The DCH Geometry
The default DCH database assumes that the chamber has the ideal
geometry (athough the sense wires do have a 200 micron sagitta from
V7.12.1 onwards). Alignment measurements show the chamber is not
perfect and studies using the corrected geometry show improved
resolutions and systematics.
To add the corrections to the database, go to your workdir and
issue the command:
../DchEnv/loaddefl.csh
You should see something like:
Loading end-plate deflections --- Dch
To return to the default configuration (perfect alignment, 200 micron
sagitta) issue the command:
../DchEnv/default.csh
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:
- make a link in workdir to the correct calibration file:
ln -fs $BFROOT/detector/dch/DchIR2/calibration/cal161/calibration.out
calibration.out
- Enable 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"));
- If you do not want the Scintillator trigger times, disable the
DchCosmicT0Builder module.
- Enable the DcxT0Finder module to your TCL file (see
``Example TCL file'').
The crude way to see routine ErrLogger messages is to comment out the
following line in AppOepBuild.cc and recompile:
theFramework->actions()->append(new AppActionErrLogger);
To get the ntuple trigger blocks filled, set the tcl parameter
doTrigger to true in module ProAnalysisModule.
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 L1TOepSequences/L1TOepTCtoDigiSequence.tcl
sourceFoundFile L1TOepSequences/L1TOepModScanSequence.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 dch_thru
timeToDistCalib set file:$CalDir/2156.cheby.cal
exit
#$----------------------
# BdbSetTime
#----------------------
module disabl BdbSetTme
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
doTrigger 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 disable DcxT0Finder
#module talk DcxT0Finder
# c0 set -100
#exit
path enable AllPath
path list
exit
See Tables 3.11 and 3.11.
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.
- Remake DchProto withe the following commands:
gmake DchProto.clean
gmake DchProto.lib CPPFLAGS+=-DGRAPHICS
gmake DchProto.bin CPPFLAGS+=-DGRAPHICS
- In the workdir, execute the command:
source GraDisplay/setup.csh
- Run the executable as before.
This is all guess work:
- Displaying Hits
- Select b
_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 (part 1).
| Variable |
Description |
| nTrgTime |
Number of triggers [0,4] |
| trgTime(nTrgTime) |
Trigger times |
| BunchT0 |
Trigger time used in code |
| damage |
Error Flag |
| evtSec |
Time stamp (seconds) |
| evtNsec |
Time stamp (seconds) |
| Ntrk |
Number of tracks |
| chisqDof(Ntrk) |
/Ndof (Ndof=nActive-5) |
| nActive(Ntrk) |
Number hits on track |
| phi0(Ntrk) |
(at closest approach to Z axis) |
| tandip(Ntrk) |
tan( )
(at closest approach to Z axis) |
| 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 |
| wireAmbig(Ndigi) |
Wire Ambiguity |
| 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 |
| refresid(Nref) |
abs(refdoca)-abs(drift) |
| tResid(Nref) |
Refdoca-drift |
| refchisqdof(Nref) |
/Ndof |
| refnactive(Nref) |
Number hits on track |
| refphi(Nref) |
(at the hit) |
| refd0(Nref) |
d0 (at the hit) |
| refz0(Nref) |
Z0 (at the hit) |
| reftandip(Nref) |
Tan( )
(at the hit) |
| 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 |
| hitstatus(nAllDigi) |
Status (See ``Some Ntuple Variables'') |
| 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 |
|
Table 4:
Description of the variables in the
ntuples generated from the runs (part 2).
| Variable |
Description |
| trgtsf |
TSF |
| tsftick(trgtsf) |
|
| tsfpvtc(trgtsf) |
|
| tsfphi(trgtsf) |
|
| tsfslay(trgtsf) |
|
| tsfaddr(trgtsf) |
|
| tsflut(trgtsf) |
|
| trgptd |
PTD |
| ptdtick(trgptd) |
|
| ptdpvtc(trgptd) |
|
| ptdphi(trgptd) |
|
| ptdslay(trgptd) |
|
| ptdscore(trgptd) |
|
| trgblt |
BLT |
| blttick(trgblt) |
|
| bltatrk(trgblt) |
|
| bltbtrk(trgblt) |
|
| trggltin |
GLT in |
| gltintick(trggltin) |
|
| gltinab(trggltin) |
|
| gltinapifr(trggltin) |
|
| gltinEG(trggltin) |
|
| gltinMG(trggltin) |
|
| gltinXY(trggltin) |
|
| trggltout |
GLT out |
| gltouttick(trggltout) |
|
| gltrawl(trggltout) |
|
| gltobj1(trggltout) |
|
| gltobj2(trggltout) |
|
|
Some Ntuple variables
- HitStatus
- Bit 0: Bad Waveform; Bit 1: Bad Pedestal; Bit 2
Clipped Waveform; Bit 3: Raw Waveform Appended.
- Damage
- A number between 0-31 representing the lowest bit set
in the OEP transition damage word:
enum Value {
PCI_ParityError = 0, damage1 = 1,
PCI_TargetAbort = 2, PCI_MasterAbort = 3,
damage4 = 4, I960_BusFault = 5,
I960_MemoryFault = 6, PayloadTruncated = 7,
damage8 = 8, MUQ_NAQ = 9,
InvalidTransition = 10, TransitionTimout = 11,
OutOfOrder = 12, OutofSynch = 13,
FEX_Error = 14, damage15 = 15,
CLINK_NotReady = 16, FEE_Full = 17,
PC_FULL = 18, CLINKB_NotReady = 19,
CLINKA_NotReady = 20, WriteInProgress = 21,
CLINK_NotEnabled = 22, CLINKA_Throttled = 23,
DLINKA_NotReady = 24, DLINKA_TimeOut = 25,
DLINKA_Overflow = 26, DLINKA_NoStartbit = 27,
DLINKB_NotReady = 28, DLINKB_TimeOut = 29,
DLINKB_Overflow = 30, DLINKB_NoStartbit = 31};
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 or a: indicates a chebyshev or
masa function was used for the t-2-d function;
asymmetric Chebyshev 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/analysis7124.ps
You can find the HTML version of this information in:
$BFROOT/www/Detector/CentralTracker/commissioning/analysis/analysis7124.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 analysis7124.tex.
The translation was initiated by Fergus Wilson on 1999-03-24
Fergus Wilson
1999-03-24
|