CbmRoot
|
#include <CbmFastSim.h>
Public Types | |
enum | EParticleType { kEle = 0, kPio, kKao, kPro, kMuo, kGam } |
enum | EEfficiencyMethod { kIgnoreFluct = 0, kInterpolate, kAverage, kFactorize, kLastDim } |
Public Member Functions | |
CbmFastSim (bool persist=true) | |
~CbmFastSim () | |
void | Register () |
virtual InitStatus | Init () |
virtual void | InitTask () |
virtual void | Finish () |
virtual void | Exec (Option_t *opt) |
void | SetLookupEfficiency (THnBase *nom, THnBase *denom, EParticleType part) |
void | SetLookupResolutionP (TH2F *obj, EParticleType part) |
void | SetEfficiencyMethod (EEfficiencyMethod method) |
void | SetSeed (unsigned int seed=65539) |
Private Member Functions | |
Bool_t | PassEfficiencyFilter (Int_t pdg, Double_t *vals, Int_t *coord) |
Double_t | GetEfficiency (Int_t idx, Double_t *vals, Int_t *coord) |
Bool_t | Smearing (TLorentzVector *p4, Int_t pdg) |
Double_t | AnalyzeMap (TH2F *map, Double_t refValue) |
virtual Bool_t | IsSelected (TObject *sel, Int_t opt) |
virtual void | SetParContainers () |
CbmFastSim (const CbmFastSim &obj) | |
CbmFastSim & | operator= (const CbmFastSim &obj) |
ClassDef (CbmFastSim, 1) | |
Private Attributes | |
TRandom3 * | fRand |
TDatabasePDG * | fdbPdg |
EEfficiencyMethod | fMethod = kIgnoreFluct |
TClonesArray * | fFastTracks = NULL |
THnBase * | fEFF [fgkNParts] |
THnBase * | fEFFdenom [fgkNParts] |
TH1 * | fEFFproj [fgkNParts][10] |
TH2F * | fRFp [fgkNParts] |
Static Private Attributes | |
static const Int_t | fgkNParts = 8 |
Definition at line 27 of file CbmFastSim.h.
Enumerator | |
---|---|
kIgnoreFluct | |
kInterpolate | |
kAverage | |
kFactorize | |
kLastDim |
Definition at line 32 of file CbmFastSim.h.
Enumerator | |
---|---|
kEle | |
kPio | |
kKao | |
kPro | |
kMuo | |
kGam |
Definition at line 30 of file CbmFastSim.h.
CbmFastSim::CbmFastSim | ( | bool | persist = true | ) |
CbmFastSim::~CbmFastSim | ( | ) |
Destructor
destructor
Definition at line 74 of file CbmFastSim.cxx.
References fFastTracks, and fRand.
|
private |
|
private |
smear the refValue according to a TH2 map
check smearing map
get axes
find y-bin for mc variable
for under- or overflow, apply gaussian smearing with 2% resolution by this electrons are handled without bremsstrahlung (TODO: add crystal ball smearing) NOTE: in general this should not happen often, you have to provide smearing maps with large momentum ranges
get histogram array and calculate offset
get randomly smeared value: y-axis translates into x-axis (generated into reconstructed)
Definition at line 409 of file CbmFastSim.cxx.
References fRand.
Referenced by Smearing().
|
private |
|
virtual |
Virtual method Exec
exec, executed once per event
get mc stack of generated particles
Reset output array
array of variables and coordinates used for look-up tables
loop over the full mc stack
get generated mc particle
process only known and charged particles
collect mc truth variables NOTE: TVector3 & TLorentzVector return phi from -pi to pi, while TPartilce (base of CbmMCTrack) in 0 to 2pi
apply efficiency cuts based on mc truth quantities for pt, theta, phi NOTE: special case for efficiency map of conversion electrons
smear the momentum components according to the resolution (diff. btw. gen. & rec.)
start vertex
smearing in p
Add smeared track to output tree IMPORTANT NOTE: set MC index as FirstMother
Definition at line 211 of file CbmFastSim.cxx.
References fdbPdg, fFastTracks, CbmStack::GetNtrack(), CbmStack::GetParticle(), PassEfficiencyFilter(), and Smearing().
|
virtual |
finish
Definition at line 203 of file CbmFastSim.cxx.
|
private |
Calculate the efficieny from the integrated projections of the map
find bin or use coordinates
method dependent
protect against first(last) bin NOTE: interpolation cannot be done for values smaller(larger) bin center
efficiency is 0. for this particle (e.g. outside acceptance)
efficiency is 0. for this particle (e.g. outside acceptance)
Definition at line 523 of file CbmFastSim.cxx.
References fEFF, fEFFproj, fMethod, kAverage, kFactorize, kIgnoreFluct, kInterpolate, and kLastDim.
Referenced by PassEfficiencyFilter().
|
virtual |
Virtual method Init
loop over all particle species
TODO: include muons
method dependent scaling, normalisation, ...
NOTE: do not fill projections
NOTE: only last dimension is used for efficiency
NOTE: use all ndim 1D-histograms
NOTE: use all ndim 1D-histograms, but dim=j>0 are scaled to max=1
NOTE: prepare a single 3D-histogram
prepare histograms for smearing
Definition at line 104 of file CbmFastSim.cxx.
References PairAnalysisHelper::CumulateSlicesX(), fEFF, fEFFdenom, fEFFproj, fgkNParts, fMethod, fRFp, kAverage, kFactorize, kIgnoreFluct, kInterpolate, kLastDim, and Register().
Referenced by InitTask().
|
virtual |
Definition at line 101 of file CbmFastSim.cxx.
References Init().
|
privatevirtual |
no efficiency map added?
array of variables used for look-up table
collect mc truth variables NOTE: TVector3 & TLorentzVector return phi from -pi to pi, while TPartilce (base of CbmMCTrack) in 0 to 2pi
find bin for mc pt, theta, phi
clean up
Definition at line 594 of file CbmFastSim.cxx.
References fEFF, fRand, kEle, kGam, kGamma, kKao, kMuo, kPio, and kPro.
|
private |
|
private |
function for selection and smearing
no efficiency map added?
debug
find bin for mc pt, theta, phi
lookup efficiency and check for statistical error beeing less than 30%
check statistical fluctuations
Definition at line 305 of file CbmFastSim.cxx.
References fEFF, fMethod, fRand, GetEfficiency(), kEle, kGam, kGamma, kIgnoreFluct, kKao, kMuo, kPio, and kPro.
Referenced by Exec().
void CbmFastSim::Register | ( | ) |
register output
Definition at line 90 of file CbmFastSim.cxx.
References fFastTracks.
Referenced by Init().
|
inline |
Definition at line 60 of file CbmFastSim.h.
References fMethod.
void CbmFastSim::SetLookupEfficiency | ( | THnBase * | nom, |
THnBase * | denom, | ||
EParticleType | part | ||
) |
calculate lookup efficiencies
Definition at line 455 of file CbmFastSim.cxx.
|
inline |
Definition at line 59 of file CbmFastSim.h.
References fRFp.
|
privatevirtual |
Get parameter containers
Definition at line 184 of file CbmFastSim.cxx.
void CbmFastSim::SetSeed | ( | unsigned int | seed = 65539 | ) |
|
private |
|
private |
Definition at line 66 of file CbmFastSim.h.
Referenced by Exec(), and Smearing().
|
private |
input objects
Definition at line 83 of file CbmFastSim.h.
Referenced by CbmFastSim(), GetEfficiency(), Init(), IsSelected(), PassEfficiencyFilter(), and SetLookupEfficiency().
|
private |
Definition at line 84 of file CbmFastSim.h.
Referenced by CbmFastSim(), Init(), and SetLookupEfficiency().
|
private |
Definition at line 85 of file CbmFastSim.h.
Referenced by CbmFastSim(), GetEfficiency(), and Init().
|
private |
Output array of Candidates
Definition at line 80 of file CbmFastSim.h.
Referenced by Exec(), Register(), and ~CbmFastSim().
|
staticprivate |
Definition at line 67 of file CbmFastSim.h.
Referenced by CbmFastSim(), and Init().
|
private |
Definition at line 68 of file CbmFastSim.h.
Referenced by GetEfficiency(), Init(), PassEfficiencyFilter(), and SetEfficiencyMethod().
|
private |
Definition at line 65 of file CbmFastSim.h.
Referenced by AnalyzeMap(), IsSelected(), PassEfficiencyFilter(), SetSeed(), and ~CbmFastSim().
|
private |
Definition at line 87 of file CbmFastSim.h.
Referenced by CbmFastSim(), Init(), SetLookupResolutionP(), and Smearing().