AliPhysics  8d00e07 (8d00e07)
AliTrackletTaskMulti.h
Go to the documentation of this file.
1 #ifndef ALITRACKLETTASKMULTI_H
2 #define ALITRACKLETTASKMULTI_H
3 
5 // Class AliTrackletTaskMulti //
6 // Analysis task to produce data and MC histos needed for tracklets //
7 // dNdEta extraction in multiple bins in one go //
8 // Author: ruben.shahoyan@cern.ch //
9 // Hacker: roberto.preghenella@bo.infn.it (R+) //
11 
12 class TH1F;
13 class TH2F;
14 class TH3F;
15 class AliESDEvent;
16 class TList;
17 class TNtuple;
18 
19 class AliMCParticle;
20 class AliITSMultRecBg;
21 class AliESDTrackCuts;
22 
23 #include "AliAnalysisTaskSE.h"
24 #include "AliVEvent.h"
25 #include <TMath.h>
26 
28  public:
32  //
33  enum { // define here id's of the standard histos in corresponding TObjArray* fHistosTr...
34  kHEtaZvCut, // histo zv vs eta for tracklets passing final selection (dist<1 or |dPhi|<narrowWindow ...)
35  kHDPhiDTheta, // measured dTheta vs dPhi
36  kHDPhiSDThetaX, // dTheta (1/sin^2 scaled if needed) vs dPhi (bending subtracted)
37  kHWDist, // Weighted distance
38  // kHEtaZvSPD1, // histo zv vs eta for SPD1 single clusters
39  kHWDvEta, // WDist vs eta
40  kNStandardH // number of standard histos per centrality bin
41  };
42  enum { // define here id's of any custom histos to be added to fHistosCustom
43  kHStat, // job info (meaning of bins defined in the enum below)
44  //
45  kHStatCent, // events per centrality bin with real values on the axis
46  kHStatCentBin, // events per centrality bin
47  kHCentDistNoSel, // events per centrality percentile before selection
48  kHCentDist, // events per centrality percentile
49  //
50  kHNPrimMeanMC, // <n> primaries per mult bin
51  kHNPrim2PartMC, // <n> prim per part.pair per mult bin
52  kHNPrim2BCollMC, // <n> prim per bin.coll per mult bin
53  kHNPrim2PartNpMC, // <n> prim per n part vs npart
54  kHNPrim2BCollNpMC, // <n> prim per n part vs npart
55  kHNPartMC, // n.part.pairs according to MC
56  kHNPartMeanMC, // <n> part pairs per mult bin
57  kHNBCollMC, // n.bin.colls according to MC
59  //
60  kHNPrimEta2All, // NPrim |eta|<2 all gen events
61  kHNPrimEta2Vt, // NPrim |eta|<2 events with vtx
62  kHNPrimEta2Sel, // NPrim |eta|<2 events after selection
63  kHNPrimEta2SelVt, // NPrim |eta|<2 events passing selection with vertex
64  kHNCorrMCEta2, // Ntracklets |eta|<2 vs NPrim |eta|<2
65  //
66  //
67  kHZVtxNoSel, // Z vertex distribution before event selection
68  kHV0NoSel, // V0 before selection
69  kHNClSPD2NoSel, // NSPD2 before selection
70  kHZDCZEMNoSel, // ZDC ZEM before selection
71  //
72  kHZVtxMCNoPhSel, // Z vertex distribution MC before physics selection
73  kHZVtxMCNoVtSel, // Z vertex distribution MC before rec.vertex selection
74  kHZVtxMC, // Z vertex distribution MC after all selections
75  kHZVtx, // Z vertex distribution
76  kHV0, // V0 before selection
77  kHNClSPD2, // NSPD2 before selection
78  kHZDCZEM, // ZDC ZEM before selection
79  //
80  kHPrimPDG, // PDG code of prim tracklet
81  kHSecPDG, // PDG code of sec tracklet
82  kHPrimParPDG, // PDG code of prim tracklet parent
83  kHSecParPDG, // PDG code of sec tracklet parent
84  kHPdgPrimMC, // PDG code of primary species
85  //
86  kHClUsedInfoL0, // used clusters of lr0
87  kHClUsedInfoL1, // used clusters of lr1
88  kHClAllInfoL0, // all clusters of lr0
89  kHClAllInfoL1, // all clusters of lr1
90  //
91  kHMltEstTrITSTPC, // mult distribution with kTrackletsITSTPC
92  kHMltEstTrITSSA, // mult distribution with kTrackletsITSSA
93  kHMltEstTr, // mult distribution with tracklets
94  kHMltMC, // mult distribution for MC primaries
95  //
96  kHEtaPhi, // traklets eta/phi
97  // These MUST be last one: this is just beginning of many histos (one per bin)
98  kHZVEtaPrimMC, // Zv gen vs eta for all primary tracks (true MC multiplicity) in all events
99  kHZVrEtaPrimMC=kHZVEtaPrimMC+50, // Zv rec vs eta for all primary tracks (true MC multiplicity) in sel. events
100  kHZVResMC =kHZVrEtaPrimMC+50, // zv resolution
101  kHPtPrimMC =kHZVResMC+50 // pT distribution
102  }; // custom histos
103 
104  // bins for saved parameters
105  enum {kDummyBin,
106  kEvTot0, // events read
107  kEvTot, // events read after vertex quality selection
108  kOneUnit, // just 1 to track primate merges
109  kNWorkers, // n workers
110  //
111  kCentVar, // cetrality var. used
112  kDPhi, // dphi window
113  kDTht, // dtheta window
114  kNStd, // N.standard deviations to keep
115  kPhiShift, // bending shift
116  kThtS2, // is dtheta scaled by 1/sin^2
117  kThtCW, // on top of w.dist cut cut also on 1 sigma dThetaX
118  kPhiOvl, // overlap params
119  kZEtaOvl, // overlap params
120  kNoOvl, // flag that overlap are suppressed
121  //
122  kPhiRot, // rotation phi
123  kInjScl, // injection scaling
124  kEtaMin, // eta cut
125  kEtaMax, // eta cut
126  kZVMin, // min ZVertex to process
127  kZVMax, // max ZVertex to process
128  //
129  kDPiSCut, // cut on dphi used to extract signal (when WDist is used in analysis, put it equal to kDPhi
130  kNStdCut, // cut on weighted distance (~1) used to extract signal
131  //
132  kMCV0Scale, // scaling value for V0 in MC
133  //
134  kNEvSDMC, // number of pure SD event from MC
135  // here we put entries for each mult.bin
138  kEvProcData, // events with data mult.object (ESD or reco) passing all selections
139  kEvProcInj, // events Injected, total
140  kEvProcRot, // events Rotated
141  kEvProcMix, // events Mixed
142  kEvCentBin, // events in centrality bin (w/o any selection)
143  kEvPassPS, // events passed ev.sel + trigger
144  kEvPassVtx, // and having vertex (not necessarily in needed range)
146  };
147 
148  //
149  AliTrackletTaskMulti(const char *name = "AliTrackletTaskMulti");
150  virtual ~AliTrackletTaskMulti();
151 
152  virtual void UserCreateOutputObjects();
153  virtual void UserExec(Option_t *option);
154  virtual void Terminate(Option_t *);
155  void RegisterStat();
156  //
157  void SetTriggerSelection(UInt_t sel=AliVEvent::kINT7) {fTrigSel = sel;}
159  void SetCentPercentiles(Double_t *arr, Int_t nbins);
160  //
161  void CheckCentralityVar(const char* var);
163  void SetUseCentralityVar(const char* v="V0M") {CheckCentralityVar(v); fUseCentralityVar = v;}
164  void SetUseMC(Bool_t mc = kFALSE) {fUseMC = mc;}
166  TObjArray* BookHistosSet(const char* pref, UInt_t selHistos=0xffffffff);
168  void AddHisto(TObjArray* histos, TObject* h, Int_t at=-1);
169  Bool_t FillHistosSet(TObjArray* histos, double eta, /*double phi,double theta,*/double dphi,double dtheta,double dthetaX,double dist,double weight);
170  // RS
171  void SetNStdDev(Float_t f=1.) {fNStdDev = f<1e-5 ? 1e-5:f;}
173  void SetCutOnDThetaX(Bool_t v=kFALSE) {fCutOnDThetaX = v;}
174  void SetPhiWindow(float w=0.08) {fDPhiWindow = w<1e-5 ? 1e-5:w;}
175  void SetThetaWindow(float w=0.025) {if (w<0) fCutOnDThetaX=kTRUE; fDThetaWindow = TMath::Abs(w)<1e-5 ? 1e-5:TMath::Abs(w);}
176  void SetPhiShift(float w=0.0045) {fDPhiShift = w;}
177  void SetPhiOverlapCut(float w=0.005) {fPhiOverlapCut = w;}
178  void SetZetaOverlapCut(float w=0.05) {fZetaOverlap = w;}
179  void SetPhiRot(float w=0) {fPhiRot = w;}
180  void SetInjScale(Float_t s=1.) {fInjScale = s>0? s:1.;}
182  //
183  void SetDPhiSCut(Float_t c=0.06) {fDPhiSCut = c;}
184  void SetNStdCut(Float_t c=1.0) {fNStdCut = c;}
185  void SetScaleMCV0(Float_t s=1.0) {fMCV0Scale = s;}
186  //
187  void SetEtaCut(Float_t etaCut) {fEtaMax = TMath::Abs(etaCut); fEtaMin= -fEtaMax;}
188  void SetEtaMin(Float_t etaMin) {fEtaMin = etaMin;}
189  void SetEtaMax(Float_t etaMax) {fEtaMax = etaMax;}
194  //
197  Bool_t GetDoRotation() const {return fDoRotation;}
198  //
199  void SetDoNormalReco(Bool_t v=kTRUE) {fDoNormalReco = v;}
200  void SetDoInjection(Bool_t v=kTRUE) {fDoInjection = v;}
201  void SetDoRotation(Bool_t v=kTRUE) {fDoRotation = v;}
202  //
205  void SetReweightStack(Int_t v=0) {fReweightStack=v;} // R+HACK
206  void SetReweightFlag(Int_t v=0) {fReweightFlag=v;} // R+HACK
208  void Print(Option_t* option) const;
209  //
210  protected:
211  void InitMultReco();
212  Bool_t HaveCommonParent(const float* clLabs0,const float* clLabs1);
213  void FillHistos(Int_t type, const AliMultiplicity* mlt);
214  void FillMCPrimaries();
215  void FillSpecies(Int_t primsec, Int_t id);
216  void FillClusterInfo();
217  void FillClusterInfoFromMult(const AliMultiplicity* mlt, double zVertex);
218  Int_t GetPdgBin(Int_t pdgCode);
219  void CheckReconstructables();
220  Int_t GetCentralityBin(Float_t percentile) const;
221  void ReweightStack(double weight); // R+HACK
222  float GetPrimaryWeight(Int_t i); // R+HACK
223  //
224  protected:
225  TList* fOutput; // output list send on output slot 1
226  //
227  Bool_t fDoNormalReco; // do normal reco
228  Bool_t fDoInjection; // do injection
229  Bool_t fDoRotation; // do rotation
230  //
233  //
237  //
242  //
246  //
247  // Settings for the reconstruction
248  // tracklet reco settings
249  Float_t fEtaMin; // histos filled only for this eta range
250  Float_t fEtaMax; // histos filled only for this eta range
251  Float_t fPhiMin; // histos filled only for this phi range
252  Float_t fPhiMax; // histos filled only for this phi range
253  Float_t fZVertexMin; // min Z vtx to process
254  Float_t fZVertexMax; // max Z vtx to process
255  //
256  Bool_t fScaleDTBySin2T; // request dTheta scaling by 1/sin^2(theta)
257  Bool_t fCutOnDThetaX; // if true, apart from NStdDev cut apply also the cut on dThetaX
258  Float_t fNStdDev; // cut on weighted distance
259  Float_t fDPhiWindow; // max dPhi
260  Float_t fDThetaWindow; // max dTheta
261  Float_t fDPhiShift; // mean bend
262  Float_t fPhiOverlapCut; // overlaps cut in phi
263  Float_t fZetaOverlap; // overlaps cut in Z
264  Float_t fPhiRot; // rotate L1 wrt L2
265  Float_t fInjScale; // scaling factor for injection
266  Bool_t fRemoveOverlaps; // request overlaps removal
267  //
268  Float_t fDPhiSCut; // cut on signal dphiS
269  Float_t fNStdCut; // cut on signal weighted distance
270  Float_t fMCV0Scale; // scaling factor for V0 in MC
271  //
272  UInt_t fTrigSel; // requested trigger (to be changed to AliBits)
273 
274  AliITSMultRecBg *fMultReco;
276  AliStack* fStack;
277  AliMCEvent* fMCEvent;
280  //
283  Float_t fNPart; // number of participant pairs from MC
284  Float_t fNBColl; // number of bin. collision from MC
285  Int_t fCurrCentBin; // current centrality bin
286  Int_t fNCentBins; // N of mult bins
287  TArrayF fCentPerc; // centrality in percentiles
288  TString fUseCentralityVar; // what is used to determine the centrality
291  Bool_t fUseSpecialOutput; // flag to open special output
292  Int_t fReweightStack; // flag to reweight stack
293  Int_t fReweightFlag; // reweight scaling factor
294  Double_t fEtaBinWidth; // Bin width in Eta
295  //
296  static const char* fgCentSelName[];
297  static const char* fgkPDGNames[];
298  static const Int_t fgkPDGCodes[];
299  //
300  private:
301  AliTrackletTaskMulti(const AliTrackletTaskMulti&); // not implemented
302  AliTrackletTaskMulti& operator=(const AliTrackletTaskMulti&); // not implemented
303 
304  ClassDef(AliTrackletTaskMulti, 1);
305 };
306 
307 
308 #endif
void SetEtaMax(Float_t etaMax)
TObjArray * fHistosTrInj
all tracklets in data
Bool_t HaveCommonParent(const float *clLabs0, const float *clLabs1)
void SetPhiMax(Float_t phiMax)
double Double_t
Definition: External.C:58
Definition: External.C:260
Definition: External.C:236
Float_t fNPart
N of signal tracklets |eta|<2.
void SetEtaMin(Float_t etaMin)
void SetUseSpecialOutput(Bool_t v=kTRUE)
Int_t GetPdgBin(Int_t pdgCode)
void SetRemoveOverlaps(Bool_t w=kFALSE)
Bool_t FillHistosSet(TObjArray *histos, double eta, double dphi, double dtheta, double dthetaX, double dist, double weight)
static const char * fgCentSelName[]
static const char * fgkPDGNames[]
centrality types
void Print(Option_t *option) const
void AddHisto(TObjArray *histos, TObject *h, Int_t at=-1)
Int_t GetCentralityBin(Float_t percentile) const
void SetThetaWindow(float w=0.025)
TObjArray * fHistosTrSec
primary
Double_t phiMin
Float_t fVtxMC[3]
ESD vertex.
TObjArray * fHistosCustom
Secondary Reconstructable.
void SetPhiWindow(float w=0.08)
TCanvas * c
Definition: TestFitELoss.C:172
void SetUseCentralityVar(Int_t v)
Bool_t fUseSpecialOutput
rec.vertex is good
Bool_t GetDoInjection() const
void SetReweightFlag(Int_t v=0)
Int_t fNTreta2
N of primaries |eta|<2.
void SetDoInjection(Bool_t v=kTRUE)
Bool_t GetDoNormalReco() const
AliTrackletTaskMulti(const char *name="AliTrackletTaskMulti")
void SetDoNormalReco(Bool_t v=kTRUE)
AliITSMultRecBg * fMultReco
TObjArray * fHistosTrPrim
rotated
int Int_t
Definition: External.C:63
void CheckCentralityVar(const char *var)
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
void SetCentPercentiles(Float_t *arr, Int_t nbins)
Bool_t GetUseSpecialOutput() const
void SetTriggerSelection(UInt_t sel=AliVEvent::kINT7)
Double_t phiMax
TObjArray * fHistosTrRot
injected
virtual void UserExec(Option_t *option)
AliMCEvent * fMCEvent
MC stack.
void SetPhiMin(Float_t phiMin)
TObjArray * fHistosTrCombU
combinatorials
void SetUseMC(Bool_t mc=kFALSE)
static const Int_t fgkPDGCodes[]
pdg names
AliStack * fStack
tree of recpoints
void FillHistos(Int_t type, const AliMultiplicity *mlt)
void SetZVertexMax(Float_t z)
AliTrackletTaskMulti & operator=(const AliTrackletTaskMulti &)
void FillSpecies(Int_t primsec, Int_t id)
Bool_t fVtxOK
did current event pass phys.sel.?
Float_t fEtaMin
custom histos
void SetDPhiSCut(Float_t c=0.06)
void SetUseCentralityVar(const char *v="V0M")
Int_t fNPrimMCeta2
MC gen vertex.
void ReweightStack(double weight)
void SetInjScale(Float_t s=1.)
TTree * fRPTree
mult.reco object
TObjArray * BookHistosSet(const char *pref, UInt_t selHistos=0xffffffff)
void SetEtaCut(Float_t etaCut)
void SetReweightStack(Int_t v=0)
void SetDoRotation(Bool_t v=kTRUE)
void SetNStdCut(Float_t c=1.0)
const char Option_t
Definition: External.C:48
void FillClusterInfoFromMult(const AliMultiplicity *mlt, double zVertex)
void SetNStdDev(Float_t f=1.)
void SetPhiOverlapCut(float w=0.005)
Float_t fESDVtx[3]
MC Event.
void SetCutOnDThetaX(Bool_t v=kFALSE)
TObjArray * fHistosTrRcblSec
Primary Reconstructable.
void SetScaleMCV0(Float_t s=1.0)
void SetPhiShift(float w=0.0045)
const Int_t nbins
TObjArray * fHistosTrRcblPrim
combinatorials uncorrelated
bool Bool_t
Definition: External.C:53
virtual void Terminate(Option_t *)
void SetZVertexMin(Float_t z)
TObjArray * fHistosTrComb
secondary
void SetCheckReconstructables(Bool_t c=kFALSE)
virtual void UserCreateOutputObjects()
Bool_t GetDoRotation() const
void SetZetaOverlapCut(float w=0.05)
void SetScaleDThetaBySin2T(Bool_t v=kFALSE)
void SetEtaBinWidth(Double_t w)