|
|
![]() |
STAR SSD |
- SOFTWARE |
How to extract SSD histograms from the hist branch |
|||
Here we assume that you were able to run the bfc chain with the SSD makers and to save the histo branch. There are several macros available in StRoot/macros directories (especially the analysis subdirectory) which are useful.
To list all the histograms in the hist branch one can use thebfcread_hist_list_all.C macros with the root file as argument :
root4star [0] .x bfcread_hist_list_all.C("st_pulser_6102005_raw_1090001.hist.root")
bfcread_hist_list_all.C, input hist file = st_pulser_6102005_raw_1090001.hist.root
bfcread_hist_list_all.C, top level directory in hist file = bfcTree
Warning in : no dictionary for class StChain is available
Note: File "/afs/rhic.bnl.gov/star/packages/DEV/.sl302_gcc323/lib/StarClassLibrary.so" already loaded
TreeName = bfcTree
FOUND Tree bfcTree in file st_pulser_6102005_raw_1090001.hist.root
Branch histBranch is MAIN in tree
Branch=histBranch file /afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.hist.root
Branch=dstBranch file /afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.dst.root
Branch=runcoBranch file /afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.runco.root
** Branch=histBranch Mode=READ File=/afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.hist.root Opened **
StInfo: *********** Event Info **********************
StInfo: Run: -1 Event -1 TimeStamp 20330101. 0 Bunch 0:0
StInfo: EvtSize: 0 InpTrig: 0 OutTrig: 0
StInfo: *********************************************
Here is list of all histograms:
0 - IO/.make/IO_Root/.data/bfcTree/histBranch .StBranch
1 - IO/.make/IO_Root/.data/bfcTree/histBranch/geantHist Tag $Name: $ $Id: St_geant_Maker.h,v 1.35 2005/04/13 22:27:11 fisyak Exp $ built Apr 26 2005 23:19:27
1 - IO/.make/IO_Root/.data/bfcTree/histBranch/scm_sptHist Tag $Name: $ $Id: StSsdPointMaker.h,v 1.8 2005/06/07 11:55:09 reinnart Exp $ built Jun 7 2005 08:03:02
1 - IO/.make/IO_Root/.data/bfcTree/histBranch/EventQAHist Tag $Name: $ $Id: StEventQAMaker.h,v 2.10 2004/12/13 15:52:36 genevb Exp $ built May 27 2005 23:25:13
--- geantHist
Hist name: GeantPVtxX ==> Title: geant vertex: primary X (cm)
Hist name: GeantPVtxY ==> Title: geant vertex: primary Y (cm)
Hist name: GeantPVtxZ ==> Title: geant vertex: primary Z (cm)
--- scm_sptHist
Hist name: Noise_p ==> Title: Noise Distribution
Hist name: SN_p ==> Title: Signal/Noise (p)
Hist name: NumberOfStrips_p ==> Title: Strips per Cluster
Hist name: ChargeElectron_p ==> Title: Total Cluster Charge
Hist name: Noise_n ==> Title: Noise Distribution
Hist name: SN_n ==> Title: Signal/Noise
Hist name: NumberOfStrips_n ==> Title: Strips per Cluster
Hist name: ChargeElectron_n ==> Title: Total Cluster Charge
Hist name: matchingHisto ==> Title: Matching Adc (1p-1n)
Hist name: ProjectionOrtho ==> Title: Perfect Matching Deviation
Hist name: kind ==> Title: Kind of hits
Hist name: matchingHisto_1 ==> Title: Matching Adc (1p-1n) for ladder 1
Hist name: matchingHisto_2 ==> Title: Matching Adc (1p-1n) for ladder 2
Hist name: matchingHisto_3 ==> Title: Matching Adc (1p-1n) for ladder 3
.
.
.
Hist name: matchingHisto_19 ==> Title: Matching Adc (1p-1n) for ladder 19
Hist name: matchingHisto_20 ==> Title: Matching Adc (1p-1n) for ladder 20
Hist name: occupancy_wafer ==> Title: occupancy per wafer
Hist name: occupancy_chip ==> Title: occupancy per chip
Hist name: noise_chip ==> Title: mean noise per chip
Hist name: noise_wafer ==> Title: mean noise per wafer
Hist name: noise_chip_P ==> Title: mean noise per chip for the P Side
Hist name: noise_chip_N ==> Title: mean noise per chip for the N Side
--- EventQAHist
Hist name: QaInnerSectorDeDx ==> Title: Inner Sector De/Dx Distribution
Hist name: QaOuterSectorDeDx ==> Title: Outer Sector De/Dx Distribution
Hist name: QaDedxAllSectors ==> Title: dE/dx for all TPC sectors
Hist name: StEQaTrigWord ==> Title: StE trigger word
Hist name: StEQaTrigBits ==> Title: StE trigger bits
One can clearly see that some SSD histograms are saved in the scm_sptHist directory.To extract them, one can use the bfcread_hist_extract.C with some arguments : the first one is the root filename, the second the subdirectory we want to extract the histograms from (scm_spt in our case) and the last is the name of the top directory (bfcTree) :
root4star [0] .x bfcread_hist_extract.C("st_pulser_6102005_raw_1090001.hist.root","scm_spt","bfcTree")
bfcread_hist_extract.C, input hist file = st_pulser_6102005_raw_1090001.hist.root
bfcread_hist_extract.C, directory name for hist = scm_spt
bfcread_hist_extract.C, top level directory in hist file = bfcTree
Warning in : no dictionary for class StChain is available
Warning in : no dictionary for class StIOMaker is available
Note: File "/afs/rhic.bnl.gov/star/packages/DEV/.sl302_gcc323/lib/StarClassLibrary.so" already loaded
TreeName = bfcTree
FOUND Tree bfcTree in file st_pulser_6102005_raw_1090001.hist.root
Branch histBranch is MAIN in tree
Branch=histBranch file /afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.hist.root
Branch=dstBranch file /afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.dst.root
Branch=runcoBranch file /afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.runco.root
** Branch=histBranch Mode=READ File=/afs/rhic.bnl.gov/star/users/lmartin/FromCVS/st_pulser_6102005_raw_1090001.hist.root Opened **
StInfo: *********** Event Info **********************
StInfo: Run: -1 Event -1 TimeStamp 20330101. 0 Bunch 0:0
StInfo: EvtSize: 0 InpTrig: 0 OutTrig: 0
StInfo: *********************************************
Beg: FindHists, dList pointer = 0
Mid: FindHists, dList pointer = 0
Mid: FindHists, test pointer = 0
Mid2: FindHists, dList pointer = 0
Mid2: FindHists, test pointer = 0
FindHists - found hist. in histBranch, with name: scm_spt
FindHists, dList pointer = 0xb3410d8
ListHists: Total No. Histograms Copied = 37
Output hist file: st_pulser_6102005_raw_1090001_scm_spt.hist.root
Extracting: 1. Noise_p : Noise Distribution
Extracting: 2. SN_p : Signal/Noise (p)
Extracting: 3. NumberOfStrips_p : Strips per Cluster
Extracting: 4. ChargeElectron_p : Total Cluster Charge
Extracting: 5. Noise_n : Noise Distribution
Extracting: 6. SN_n : Signal/Noise
Extracting: 7. NumberOfStrips_n : Strips per Cluster
Extracting: 8. ChargeElectron_n : Total Cluster Charge
Extracting: 9. matchingHisto : Matching Adc (1p-1n)
Extracting: 10. ProjectionOrtho : Perfect Matching Deviation
Extracting: 11. kind : Kind of hits
Extracting: 12. matchingHisto_1 : Matching Adc (1p-1n) for ladder 1
Extracting: 13. matchingHisto_2 : Matching Adc (1p-1n) for ladder 2
Extracting: 14. matchingHisto_3 : Matching Adc (1p-1n) for ladder 3
Extracting: 15. matchingHisto_4 : Matching Adc (1p-1n) for ladder 4
Extracting: 16. matchingHisto_5 : Matching Adc (1p-1n) for ladder 5
Extracting: 17. matchingHisto_6 : Matching Adc (1p-1n) for ladder 6
Extracting: 18. matchingHisto_7 : Matching Adc (1p-1n) for ladder 7
Extracting: 19. matchingHisto_8 : Matching Adc (1p-1n) for ladder 8
Extracting: 20. matchingHisto_9 : Matching Adc (1p-1n) for ladder 9
Extracting: 21. matchingHisto_10 : Matching Adc (1p-1n) for ladder 10
Extracting: 22. matchingHisto_11 : Matching Adc (1p-1n) for ladder 11
Extracting: 23. matchingHisto_12 : Matching Adc (1p-1n) for ladder 12
Extracting: 24. matchingHisto_13 : Matching Adc (1p-1n) for ladder 13
Extracting: 25. matchingHisto_14 : Matching Adc (1p-1n) for ladder 14
Extracting: 26. matchingHisto_15 : Matching Adc (1p-1n) for ladder 15
Extracting: 27. matchingHisto_16 : Matching Adc (1p-1n) for ladder 16
Extracting: 28. matchingHisto_17 : Matching Adc (1p-1n) for ladder 17
Extracting: 29. matchingHisto_18 : Matching Adc (1p-1n) for ladder 18
Extracting: 30. matchingHisto_19 : Matching Adc (1p-1n) for ladder 19
Extracting: 31. matchingHisto_20 : Matching Adc (1p-1n) for ladder 20
Extracting: 32. occupancy_wafer : occupancy per wafer
Extracting: 33. occupancy_chip : occupancy per chip
Extracting: 34. noise_chip : mean noise per chip
Extracting: 35. noise_wafer : mean noise per wafer
Extracting: 36. noise_chip_P : mean noise per chip for the P Side
Extracting: 37. noise_chip_N : mean noise per chip for the N Side
The extracted histograms are listed and saved in a new root file with a filename equal to the input file plus the histogram dir name appended (st_pulser_6102005_raw_1090001_scm_spt.hist.root in our example).