SSD Slow Simulation

Detector Response Simulators
The detector response simulation packages in STARreside outside the GEANTframework. They are actually invoked at the event reconstruction step. Typically there are two or three categories of response simulators:

a) Fast simulators
    which smear the hit position coordinates and assign hit uncertainties based on parameterized analytical functions. The fast simulators run extremely fast and are good for quick studies that do not need detailed implementation of the detector. They are also  relatively  easy  to  implement;  we  already  have  an  HFT  fast  simulator  in  place  for  all subsystems。

b)  Slow  simulators
    which  simulates hits  at  the  ADC  level (usually  obtained  from sampling parameterized response functions. A slow simulator is a must when accurate acceptance and  efficiency  numbers  are  requested  in  physics  analysis.  A  slow  simulator  is  also  used  in embedding。

c) Very  Slow  simulators
    which  track  individual  electrons through  the  detector  body;  from  their  generation  to  the  readout.  This  is  usually  very  time consuming and one utilizes this method only in small-scale productions in order to determineor verifythe functions used in the first two methods.

SSD Slow  Simulation
1: Introduction
Amodule specific to the SSD has been developed in order to have a more realistic description of the behavior of a silicon microstrip wafer : the SSD Lazy Simulator (SLS). The main goal of this module is to convert geant hits into sequences of amplitudes on strips.

2: SSD  Slow  Simulation Maker
StRoot /StSsdSimulationMaker/

3:Description(from Jonathan)

www.star.bnl.gov/public/ssd/STAR_informatique/Embedding.html
www.star.bnl.gov/public/ssd/STAR_informatique/simulators.html
www.star.bnl.gov/public/ssd/STAR_informatique/sdm_sls_spa_d.pdf

bfc chain option

Read Simulation Code note
1>Pedestal substraction
Because of the inner structure of QDC or ADC,  Signal always contained with ped+real signal .so Pedestal substraction is   extract real signal .
2>Zero suppression
DAQ  record all the  signals ,but most of them are not the real signal ,so ,we set a ADC discrimination threshold to suppress fake signal .
3>doDaqSimulation(from StSsdBarrel)
This function is used to do pedestal substraction and zero suppression . simulate DAQ record  data process .
4>RemoveTriangle(xlSmear[0],xlSmear[1])
This function used to remove that triangle dead area

Extract histogram from .hist.root file

To list all the histograms in the hist branch one can use the "bfcread_hist_list_all.C" macros with the root file as argument
root4star [0] .x bfcread_hist_list_all.C("dev14_1track_1000events.hist.root")
bfcread_hist_list_all.C, input hist file = dev14_1track_1000events.hist.root
bfcread_hist_list_all.C, top level directory in hist file = bfcTree
<StIOMaker::Open() file dev14_1track_1000events.hist.root
<StIOMaker::Load() trying to GetClass(StTreeMaker) case 1
<StTreeMaker(IO_Root)::Init> TreeName = bfcTree
<StTreeMaker(IO_Root)::Init> FOUND Tree bfcTree in file dev14_1track_1000events.hist.root
<StTreeMaker(IO_Root)::Init> Branch histBranch is MAIN in tree
<StBranch::UpdateFile> Branch=histBranch file ./dev14_1track_1000events.hist.root
<StBranch::UpdateFile> Branch=eventBranch file ./dev14_1track_1000events.event.root
<StBranch::UpdateFile> Branch=runcoBranch file ./dev14_1track_1000events.runco.root
<StBranch::UpdateFile> Branch=McEventBranch file ./dev14_1track_1000events.McEvent.root
** <StBranch::Open> Branch=histBranch   Mode=READ       File=./dev14_1track_1000events.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: *********************************************
StQAInfo: StIOMaker:  Event: 1  Run: -1  EventId: -1
Here is list of all histograms:
  0 - IO/.make/IO_Root/.data/bfcTree/histBranch .StBranch

  1 - IO/.make/IO_Root/.data/bfcTree/histBranch/sls_stripHist   Tag $Name:  $ $Id: St_sls_Maker.h,v 1.13 2008/08/12 22:48:38 bouchet Exp $ built Oct  2 2013 13:40:12

  1 - IO/.make/IO_Root/.data/bfcTree/histBranch/SsdPointHist    Tag $Name:  $ $Id: StSsdPointMaker.h,v 1.36 2008/04/15 21:05:23 bouchet Exp $ built Jul 23 2013 09:59:30

  1 - IO/.make/IO_Root/.data/bfcTree/histBranch/dEdxY2Hist      Tag $Name:  $ $Id: StdEdxY2Maker.h,v 1.26 2012/09/14 13:45:40 fisyak Exp $ built Aug  8 2013 23:17:37

  1 - IO/.make/IO_Root/.data/bfcTree/histBranch/StAssociationMakerHist  Tag $Name:  $ $Id: StAssociationMaker.h,v 1.25 2011/04/01 19:40:07 perev Exp $ built Aug  8 2013 23:08:58

 --- sls_stripHist
 Hist name: hRejected ==> Title: hits after removal / hits GEANT
 --- SsdPointHist
 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: ClusNvsClusP ==> Title: Number of clusters on the n-side vs Number of clusters on the p-side
 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: ClustMapP ==> Title: Number of clusters on the p-side per wafer and ladder
 Hist name: ClustMapN ==> Title: Number of clusters on the n-side per wafer and ladder
 Hist name: MatchedClusterP ==> Title: #frac{# clusters matched}{# clusters reconstructed} , wafers on p-side
 Hist name: MatchedClusterN ==> Title: #frac{# clusters matched}{# clusters reconstructed} , wafers on n-side
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_0 ==> Title: Matching Adc (1p-1n) for ladder = 1
 Hist name: matchingHisto_1 ==> Title: Matching Adc (1p-1n) for ladder = 2
 Hist name: matchingHisto_2 ==> Title: Matching Adc (1p-1n) for ladder = 3
 Hist name: matchingHisto_3 ==> Title: Matching Adc (1p-1n) for ladder = 4
 Hist name: matchingHisto_4 ==> Title: Matching Adc (1p-1n) for ladder = 5
 Hist name: matchingHisto_5 ==> Title: Matching Adc (1p-1n) for ladder = 6
 Hist name: matchingHisto_6 ==> Title: Matching Adc (1p-1n) for ladder = 7
 Hist name: matchingHisto_7 ==> Title: Matching Adc (1p-1n) for ladder = 8
 Hist name: matchingHisto_8 ==> Title: Matching Adc (1p-1n) for ladder = 9
 Hist name: matchingHisto_9 ==> Title: Matching Adc (1p-1n) for ladder = 10
 Hist name: matchingHisto_10 ==> Title: Matching Adc (1p-1n) for ladder = 11
 Hist name: matchingHisto_11 ==> Title: Matching Adc (1p-1n) for ladder = 12
 Hist name: matchingHisto_12 ==> Title: Matching Adc (1p-1n) for ladder = 13
 Hist name: matchingHisto_13 ==> Title: Matching Adc (1p-1n) for ladder = 14
 Hist name: matchingHisto_14 ==> Title: Matching Adc (1p-1n) for ladder = 15
 Hist name: matchingHisto_15 ==> Title: Matching Adc (1p-1n) for ladder = 16
 Hist name: matchingHisto_16 ==> Title: Matching Adc (1p-1n) for ladder = 17
 Hist name: matchingHisto_17 ==> Title: Matching Adc (1p-1n) for ladder = 18
 Hist name: matchingHisto_18 ==> Title: Matching Adc (1p-1n) for ladder = 19
 Hist name: matchingHisto_19 ==> Title: Matching Adc (1p-1n) for ladder = 20
--- dEdxY2Hist
 Hist name: ZOfBadHits0 ==> Title: Z of rejected clusters  because it is not used in track fit
 Hist name: ZOfBadHits1 ==> Title: Z of rejected clusters  because it is flagged
 Hist name: ZOfBadHits2 ==> Title: Z of rejected clusters  because track length is inf
 Hist name: ZOfBadHits3 ==> Title: Z of rejected clusters  because it does not pass check
 Hist name: ZOfBadHits4 ==> Title: Z of rejected clusters  because dx is out interval [0.5,25]
 Hist name: ZOfBadHits5 ==> Title: Z of rejected clusters  because Sector/Row gain < 0
 Hist name: ZOfBadHits6 ==> Title: Z of rejected clusters  because drift distance < min || drift distance > max
 Hist name: ZOfBadHits7 ==> Title: Z of rejected clusters  because dE < 0 or dx < 0
 Hist name: ZOfBadHits8 ==> Title: Z of rejected clusters  because Edge effect
 Hist name: ZOfBadHits9 ==> Title: Z of rejected clusters  because Anode Voltage problem
 Hist name: ZOfBadHits10 ==> Title: Z of rejected clusters  because Total no.of rejected clusters
 Hist name: ZOfGoodHits ==> Title: Z of accepted clusters
 Hist name: PhiOfBadHits ==> Title: Phi of rejected clusters
 Hist name: TracklengthInTpcTotal ==> Title: Total track in TPC
 Hist name: TracklengthInTpc ==> Title: Track length in TPC used for dE/dx
 Hist name: TdEdxP70 ==> Title: log10(dE/dx(I70)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm
 Hist name: TdEdxP70pi ==> Title: log10(dE/dx(I70)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm |nSigmaPion| < 1
 Hist name: TdEdxP70e ==> Title: log10(dE/dx(I70)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm |nSigmaElectron| < 1
 Hist name: TdEdxP70K ==> Title: log10(dE/dx(I70)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm |nSigmaKaon| < 1
 Hist name: TdEdxP70P ==> Title: log10(dE/dx(I70)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm |nSigmaProton| < 1
 Hist name: TdEdxPF ==> Title: log10(dE/dx(fit)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm
 Hist name: TdEdxPFpi ==> Title: log10(dE/dx(Ifit)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm and Prob > 68.3
 Hist name: TdEdxPFe ==> Title: log10(dE/dx(Ifit)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm and Prob > 68.3
 Hist name: TdEdxPFK ==> Title: log10(dE/dx(Ifit)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm and Prob > 68.3
 Hist name: TdEdxPFP ==> Title: log10(dE/dx(Ifit)(keV/cm)) versus log10(p(GeV/c)) for Tpc TrackLength > 40 cm and Prob > 68.3
 Hist name: HitsUsage ==> Title: log10(No.of Used in dE/dx hits) versus log10(Total no. of Tpc Hits
 --- StAssociationMakerHist
 Hist name: TpcLocalHitResolution ==> Title: Delta Z Vs Delta X for Nearby Hits
 Hist name: SvtHitResolution ==> Title: Delta Z Vs Delta X for Nearby Hits
 Hist name: SsdHitResolution ==> Title: Delta Z Vs Delta X for Nearby Hits
 Hist name: FtpcHitResolution ==> Title: Delta Z Vs Delta X for Nearby Hits

we can clearly see that some SSD histograms are saved in the <span style="color: rgb(255, 0, 0);">sls_strip</span>Hist and SsdPointHist 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 (SsdPoint or <span style="color: rgb(255, 0, 0);">sls_strip</span>  in our case) and the last is the name of the top directory (bfcTree) :

root4star [0] .x bfcread_hist_extract.C("dev14_1track_1000events.hist.root","S$
bfcread_hist_extract.C, input hist file = dev14_1track_1000events.hist.root
bfcread_hist_extract.C, directory name for hist = SsdPoint
bfcread_hist_extract.C, top level directory in hist file = bfcTree
<StIOMaker::Open() file dev14_1track_1000events.hist.root
<StIOMaker::Load() trying to GetClass(StTreeMaker) case 1
<StTreeMaker(IO_Root)::Init> TreeName = bfcTree
<StTreeMaker(IO_Root)::Init> FOUND Tree bfcTree in file dev14_1track_1000events.hist.root
<StTreeMaker(IO_Root)::Init> Branch histBranch is MAIN in tree
<StBranch::UpdateFile> Branch=histBranch file ./dev14_1track_1000events.hist.root
<StBranch::UpdateFile> Branch=eventBranch file ./dev14_1track_1000events.event.root
<StBranch::UpdateFile> Branch=runcoBranch file ./dev14_1track_1000events.runco.root
<StBranch::UpdateFile> Branch=McEventBranch file ./dev14_1track_1000events.McEvent.root
** <StBranch::Open> Branch=histBranch   Mode=READ       File=./dev14_1track_1000events.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: *********************************************
StQAInfo: StIOMaker:  Event: 1  Run: -1  EventId: -1
StInfo:  Beg: FindHists, dList pointer = 0
StInfo:  Mid: FindHists, dList pointer = 0
StInfo:  Mid: FindHists, test pointer =  0
StInfo:  Mid2: FindHists, dList pointer = 0
StInfo:  Mid2: FindHists, test pointer =  0
StInfo:  FindHists - found hist. in histBranch, with name:  SsdPoint
StInfo:  FindHists, dList pointer = 0xbda3d58
StInfo:  **** Now in StHistUtil::SetDefaultPrintList  ****
StInfo:  All histograms in directory will be printed/drawn, no list set
StInfo:  ListHists: Total No. Histograms Copied  = 36
Output hist file: dev14_1track_1000events_SsdPoint.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. ClusNvsClusP : Number of clusters on the n-side vs Number of clusters on the p-side
Extracting: 6. Noise_n : Noise Distribution
Extracting: 7. SN_n : Signal/Noise
Extracting: 8. NumberOfStrips_n : Strips per Cluster
Extracting: 9. ChargeElectron_n : Total Cluster Charge
Extracting: 10. ClustMapP : Number of clusters on the p-side per wafer and ladder
Extracting: 11. ClustMapN : Number of clusters on the n-side per wafer and ladder
Extracting: 12. MatchedClusterP : #frac{# clusters matched}{# clusters reconstructed} , wafers on p-side
Extracting: 13. MatchedClusterN : #frac{# clusters matched}{# clusters reconstructed} , wafers on n-side
Extracting: 14. matchingHisto : Matching Adc (1p-1n)
Extracting: 15. ProjectionOrtho : Perfect Matching Deviation
Extracting: 16. kind : Kind of hits
Extracting: 17. matchingHisto_0 : Matching Adc (1p-1n) for ladder = 1
Extracting: 18. matchingHisto_1 : Matching Adc (1p-1n) for ladder = 2
Extracting: 19. matchingHisto_2 : Matching Adc (1p-1n) for ladder = 3
Extracting: 20. matchingHisto_3 : Matching Adc (1p-1n) for ladder = 4
Extracting: 21. matchingHisto_4 : Matching Adc (1p-1n) for ladder = 5
Extracting: 22. matchingHisto_5 : Matching Adc (1p-1n) for ladder = 6
Extracting: 23. matchingHisto_6 : Matching Adc (1p-1n) for ladder = 7
Extracting: 24. matchingHisto_7 : Matching Adc (1p-1n) for ladder = 8
Extracting: 25. matchingHisto_8 : Matching Adc (1p-1n) for ladder = 9
Extracting: 26. matchingHisto_9 : Matching Adc (1p-1n) for ladder = 10
Extracting: 27. matchingHisto_10 : Matching Adc (1p-1n) for ladder = 11
Extracting: 28. matchingHisto_11 : Matching Adc (1p-1n) for ladder = 12
Extracting: 29. matchingHisto_12 : Matching Adc (1p-1n) for ladder = 13
Extracting: 30. matchingHisto_13 : Matching Adc (1p-1n) for ladder = 14
Extracting: 31. matchingHisto_14 : Matching Adc (1p-1n) for ladder = 15
Extracting: 32. matchingHisto_15 : Matching Adc (1p-1n) for ladder = 16
Extracting: 33. matchingHisto_16 : Matching Adc (1p-1n) for ladder = 17
Extracting: 34. matchingHisto_17 : Matching Adc (1p-1n) for ladder = 18
Extracting: 35. matchingHisto_18 : Matching Adc (1p-1n) for ladder = 19
Extracting: 36. matchingHisto_19 : Matching Adc (1p-1n) for ladder = 20
//------------------------------
please read this link
http://www.star.bnl.gov/public/ssd/STAR_informatique/extract_histos.html