Search/Navigation:
Related:
SLAC/EPP
/HPS Public
Jefferson Lab/Hall B
/HPS Run Wiki
S30XL-LESA/LDMX
...
Setup the ROOT environment. I do not cover how to build and install ROOT.
No Format |
---|
export ROOTSYS=/my/root # put path to your ROOT here
source $ROOTSYS/bin/thisroot.sh
export PATH=$ROOTSYS/bin:$PATH
|
Build LCIO with the ROOT class dictionaries.
No Format |
---|
cd /a/work/dir
svn co svn://svn.freehep.org/lcio/trunk lcio/trunk
cd lcio/trunk
mkdir build; cd build
cmake -D BUILD_ROOTDICT=1 -D ROOT_DIR=$ROOTSYS ..
make install
cd ../
export LCIO=`pwd`
export LD_LIBRARY_PATH=$LCIO/lib:$ROOTSYS/lib
|
Once ROOT and LCIO are setup, you'll want to create a setup script that contains something like the following...
No Format |
---|
export ROOTSYS=/my/root # put path to your ROOT here
source $ROOTSYS/bin/thisroot.sh
export PATH=$ROOTSYS/bin:$PATH
export LCIO=/path/to/lcio/trunk/
export LD_LIBRARY_PATH=$LCIO/lib:$ROOTSYS/lib
|
...
No Format |
---|
cd ../examples/cpp/rootDict
root
.L anajob.C
anajob("/nfs/slac/g/hps3/data/testrun/runs/recon/hps_001365.evio.0-rec.slcio")
|
...
The anajob.C example should produce event dumps that look like this...
No Format |
---|
///////////////////////////////////
EVENT: 442
RUN: 0
DETECTOR: HPS-TestRun-v2
COLLECTIONS: (see below)
///////////////////////////////////
---------------------------------------------------------------------------
COLLECTION NAME COLLECTION TYPE NUMBER OF ELEMENTS
===========================================================================
ConfirmedMCParticles MCParticle 0
EcalCalHits CalorimeterHit 0
EcalClusters Cluster 0
EcalReadoutHits RawCalorimeterHit 3
FPGAData LCGenericObject 7
HelicalTrackHitRelations LCRelation 10
HelicalTrackHits TrackerHit 5
HelicalTrackMCRelations LCRelation 0
MatchedTracks Track 1
RotatedHTHRelation LCRelation 5
RotatedHelicalTrackHits TrackerHit 5
RotatedMCRelations LCRelation 0
SVTFittedRawTrackerHits LCRelation 135
SVTRawTrackerHits TrackerRawData 135
SVTShapeFitParameters LCGenericObject 135
SeededMCParticles MCParticle 0
StripClusterer_SiTrackerHitStrip1DTrackerHit 10
TriggerBank LCGenericObject 1
---------------------------------------------------------------------------
|
...
I have modified the LCIO copy of of anajob.C to produce some histograms from Track information. This script can be accessed here. This example reads a collection from an LCIO file and creates a collection of Tracks. Then it histograms some basic information from these objects. It can be used as a basis for further analysis work.
...
First the environment needs to be setup so that ROOT can find the LCIO class dictionary.
No Format |
---|
gSystem->Load("${LCIO}/lib/liblcio.so");
gSystem->Load("${LCIO}/lib/liblcioDict.so");
|
Then from the ROOT command line...
No Format |
---|
.L writeEventTree.C
writeEventTree("/nfs/slac/g/hps3/data/testrun/runs/recon/hps_001365.evio.0-rec.slcio");
|
...
Now load a browser to look at the file.
No Format |
---|
TBrowser b;
|
Or try to read it back.
No Format |
---|
.L readEventTree.C
readEventTree("lcioEventTree.root")
|
...