1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //////////////////////////////////////////////////////////////////////
17 // AliCFParticleGenCut implementation
18 // This class is designed to handle
19 // particle selection at generated level.
21 // added support for MC in AOD tree (2008-11-04)
22 // added a bool flag for the alternative (standard MC) vs (AOD MC).
24 // author : R. Vernet (renaud.vernet@cern.ch)
25 //////////////////////////////////////////////////////////////////////
28 #ifndef ALICFPARTICLEGENCUTS_H
29 #define ALICFPARTICLEGENCUTS_H
31 #include "AliCFCutBase.h"
45 class AliAODMCParticle;
48 class AliCFParticleGenCuts : public AliCFCutBase
51 AliCFParticleGenCuts() ;
52 AliCFParticleGenCuts (const Char_t* name, const Char_t* title) ;
53 AliCFParticleGenCuts (const AliCFParticleGenCuts& c) ;
54 AliCFParticleGenCuts& operator=(const AliCFParticleGenCuts& c) ;
55 virtual ~AliCFParticleGenCuts() { };
56 virtual Bool_t IsSelected(TObject* obj) ;
57 Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
58 virtual void SetMCEventInfo(const TObject* mcEvent) ;
59 void SetAODMC(Bool_t flag) {fIsAODMC=flag;}
61 Bool_t IsPrimaryCharged(AliVParticle *mcPart);
62 Bool_t IsPrimary(AliMCParticle *mcPart) ;
63 Bool_t IsPrimary(AliAODMCParticle *mcPart) ;
65 static Bool_t IsCharged(AliVParticle *mcPart);
66 static Bool_t IsA(AliMCParticle *mcPart, Int_t pdg, Bool_t abs=kFALSE);
67 static Bool_t IsA(AliAODMCParticle *mcPart, Int_t pdg, Bool_t abs=kFALSE);
69 void SetRequireIsCharged () {fRequireIsCharged =kTRUE; fRequireIsNeutral =kFALSE;}
70 void SetRequireIsNeutral () {fRequireIsNeutral =kTRUE; fRequireIsCharged =kFALSE;}
71 void SetRequireIsPrimary () {fRequireIsPrimary =kTRUE; fRequireIsSecondary=kFALSE;}
72 void SetRequireIsSecondary () {fRequireIsSecondary=kTRUE; fRequireIsPrimary =kFALSE;}
73 void SetRequirePdgCode (Int_t pdg, Bool_t useAbsolute=kFALSE) {
74 fRequirePdgCode=kTRUE;
76 fRequireAbsolutePdg=useAbsolute;
78 void SetProdVtxRangeX (Double32_t xmin, Double32_t xmax) {fProdVtxXMin =xmin; fProdVtxXMax =xmax;}
79 void SetProdVtxRangeY (Double32_t ymin, Double32_t ymax) {fProdVtxYMin =ymin; fProdVtxYMax =ymax;}
80 void SetProdVtxRangeZ (Double32_t zmin, Double32_t zmax) {fProdVtxZMin =zmin; fProdVtxZMax =zmax;}
81 void SetProdVtxRange2D (Bool_t b=kFALSE) {fProdVtxRange2D = b;}
82 void SetDecayVtxRangeX (Double32_t xmin, Double32_t xmax) {fDecayVtxXMin =xmin; fDecayVtxXMax =xmax;}
83 void SetDecayVtxRangeY (Double32_t ymin, Double32_t ymax) {fDecayVtxYMin =ymin; fDecayVtxYMax =ymax;}
84 void SetDecayVtxRangeZ (Double32_t zmin, Double32_t zmax) {fDecayVtxZMin =zmin; fDecayVtxZMax =zmax;}
85 void SetDecayLengthRange (Double32_t rmin, Double32_t rmax) {fDecayLengthMin=rmin; fDecayLengthMax=rmax;}
86 void SetDecayRxyRange (Double32_t rmin, Double32_t rmax) {fDecayRxyMin =rmin; fDecayRxyMax =rmax;}
87 void SetDecayChannel (TDecayChannel* dc) {fDecayChannel = dc ;}
90 kCutCharge, // ischarged cut
91 kCutPrimSec, // isprimary cut
92 kCutPDGCode, // PDG code cut
93 kCutProdVtxXMin, // production vertex cut
94 kCutProdVtxXMax, // production vertex cut
95 kCutProdVtxYMin, // production vertex cut
96 kCutProdVtxYMax, // production vertex cut
97 kCutProdVtxZMin, // production vertex cut
98 kCutProdVtxZMax, // production vertex cut
99 kCutDecVtxXMin, // decay vertex cut
100 kCutDecVtxXMax, // decay vertex cut
101 kCutDecVtxYMin, // decay vertex cut
102 kCutDecVtxYMax, // decay vertex cut
103 kCutDecVtxZMin, // decay vertex cut
104 kCutDecVtxZMax, // decay vertex cut
105 kCutDecLgthMin, // decay length cut
106 kCutDecLgthMax, // decay length cut
107 kCutDecRxyMin, // transverse decay length cut
108 kCutDecRxyMax, // transverse decay length cut
109 kCutDecayChannel, // decay channel reuired
110 kNCuts, // number of single selections
111 kNStepQA=2 // number of QA steps (before/after the cuts)
115 Bool_t fIsAODMC ; // flag for standard MC or MC from AOD tree
116 AliVEvent* fMCInfo ; // pointer to the MC event information
117 Bool_t fRequireIsCharged; // require charged particle
118 Bool_t fRequireIsNeutral; // require neutral particle
119 Bool_t fRequireIsPrimary; // require primary particle
120 Bool_t fRequireIsSecondary; // require secondary particle
121 Bool_t fRequirePdgCode; // require check of the PDG code
122 Bool_t fRequireAbsolutePdg; // use the PDG code absolute value, used also for the decay channel
123 Bool_t fProdVtxRange2D; // cut an ellipse in xy plane
124 Int_t fPdgCode ; // particle PDG code
125 Double32_t fProdVtxXMin; // min X of particle production vertex
126 Double32_t fProdVtxYMin; // min Y of particle production vertex
127 Double32_t fProdVtxZMin; // min Z of particle production vertex
128 Double32_t fProdVtxXMax; // max X of particle production vertex
129 Double32_t fProdVtxYMax; // max Y of particle production vertex
130 Double32_t fProdVtxZMax; // max Z of particle production vertex
131 Double32_t fDecayVtxXMin; // min X of particle decay vertex
132 Double32_t fDecayVtxYMin; // min Y of particle decay vertex
133 Double32_t fDecayVtxZMin; // min Z of particle decay vertex
134 Double32_t fDecayVtxXMax; // max X of particle decay vertex
135 Double32_t fDecayVtxYMax; // max Y of particle decay vertex
136 Double32_t fDecayVtxZMax; // max Z of particle decay vertex
137 Double32_t fDecayLengthMin; // min decay length (absolute)
138 Double32_t fDecayLengthMax; // max decay length (absolute)
139 Double32_t fDecayRxyMin; // min decay length in transverse plane wrt (0,0,0)
140 Double32_t fDecayRxyMax; // max decay length in transverse plane wrt (0,0,0)
141 TDecayChannel* fDecayChannel; // decay channel : if fRequireAbsolutePdg, the antiparticle channel will be checked as well
144 TH1F* fhCutStatistics; // Histogram: statistics of what cuts the tracks did not survive
145 TH2F* fhCutCorrelation; // Histogram: 2d statistics plot
146 TH1F* fhQA[kNCuts][kNStepQA]; // QA Histograms
147 TH2F* fhProdVtxXY[2]; // Histogram: production vertex in tranzverse plane
148 TArrayF* fCutValues; // array of cut values
149 TBits* fBitmap ; // stores single selection decisions
151 void SelectionBitMap(AliMCParticle* obj); // for MC got from Kinematics
152 void SelectionBitMap(AliAODMCParticle* obj); // for MC got from AOD
153 void FillHistograms(TObject* obj, Bool_t afterCuts);
154 void AddQAHistograms(TList *qaList) ;
155 void DefineHistograms();
157 ClassDef(AliCFParticleGenCuts,2);