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 SetEvtInfo(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) {fRequirePdgCode=kTRUE; fPdgCode=pdg;}
74 void SetProdVtxRangeX (Double32_t xmin, Double32_t xmax) {fProdVtxXMin =xmin; fProdVtxXMax =xmax;}
75 void SetProdVtxRangeY (Double32_t ymin, Double32_t ymax) {fProdVtxYMin =ymin; fProdVtxYMax =ymax;}
76 void SetProdVtxRangeZ (Double32_t zmin, Double32_t zmax) {fProdVtxZMin =zmin; fProdVtxZMax =zmax;}
77 void SetDecayVtxRangeX (Double32_t xmin, Double32_t xmax) {fDecayVtxXMin =xmin; fDecayVtxXMax =xmax;}
78 void SetDecayVtxRangeY (Double32_t ymin, Double32_t ymax) {fDecayVtxYMin =ymin; fDecayVtxYMax =ymax;}
79 void SetDecayVtxRangeZ (Double32_t zmin, Double32_t zmax) {fDecayVtxZMin =zmin; fDecayVtxZMax =zmax;}
80 void SetDecayLengthRange (Double32_t rmin, Double32_t rmax) {fDecayLengthMin=rmin; fDecayLengthMax=rmax;}
81 void SetDecayRxyRange (Double32_t rmin, Double32_t rmax) {fDecayRxyMin =rmin; fDecayRxyMax =rmax;}
82 void SetDecayChannel (TDecayChannel* dc) {fDecayChannel = dc ;}
85 kCutCharge, // ischarged cut
86 kCutPrimSec, // isprimary cut
87 kCutPDGCode, // PDG code cut
88 kCutProdVtxXMin, // production vertex cut
89 kCutProdVtxXMax, // production vertex cut
90 kCutProdVtxYMin, // production vertex cut
91 kCutProdVtxYMax, // production vertex cut
92 kCutProdVtxZMin, // production vertex cut
93 kCutProdVtxZMax, // production vertex cut
94 kCutDecVtxXMin, // decay vertex cut
95 kCutDecVtxXMax, // decay vertex cut
96 kCutDecVtxYMin, // decay vertex cut
97 kCutDecVtxYMax, // decay vertex cut
98 kCutDecVtxZMin, // decay vertex cut
99 kCutDecVtxZMax, // decay vertex cut
100 kCutDecLgthMin, // decay length cut
101 kCutDecLgthMax, // decay length cut
102 kCutDecRxyMin, // transverse decay length cut
103 kCutDecRxyMax, // transverse decay length cut
104 kCutDecayChannel, // decay channel reuired
105 kNCuts, // number of single selections
106 kNStepQA=2 // number of QA steps (before/after the cuts)
110 Bool_t fIsAODMC ; // flag for standard MC or MC from AOD tree
111 AliVEvent* fMCInfo ; // pointer to the MC event information
112 Bool_t fRequireIsCharged; // require charged particle
113 Bool_t fRequireIsNeutral; // require neutral particle
114 Bool_t fRequireIsPrimary; // require primary particle
115 Bool_t fRequireIsSecondary; // require secondary particle
116 Bool_t fRequirePdgCode; // require check of the PDG code
117 Int_t fPdgCode ; // particle PDG code
118 Double32_t fProdVtxXMin; // min X of particle production vertex
119 Double32_t fProdVtxYMin; // min Y of particle production vertex
120 Double32_t fProdVtxZMin; // min Z of particle production vertex
121 Double32_t fProdVtxXMax; // max X of particle production vertex
122 Double32_t fProdVtxYMax; // max Y of particle production vertex
123 Double32_t fProdVtxZMax; // max Z of particle production vertex
124 Double32_t fDecayVtxXMin; // min X of particle decay vertex
125 Double32_t fDecayVtxYMin; // min Y of particle decay vertex
126 Double32_t fDecayVtxZMin; // min Z of particle decay vertex
127 Double32_t fDecayVtxXMax; // max X of particle decay vertex
128 Double32_t fDecayVtxYMax; // max Y of particle decay vertex
129 Double32_t fDecayVtxZMax; // max Z of particle decay vertex
130 Double32_t fDecayLengthMin; // min decay length (absolute)
131 Double32_t fDecayLengthMax; // max decay length (absolute)
132 Double32_t fDecayRxyMin; // min decay length in transverse plane wrt (0,0,0)
133 Double32_t fDecayRxyMax; // max decay length in transverse plane wrt (0,0,0)
134 TDecayChannel* fDecayChannel; // decay channel
137 TH1F* fhCutStatistics; // Histogram: statistics of what cuts the tracks did not survive
138 TH2F* fhCutCorrelation; // Histogram: 2d statistics plot
139 TH1F* fhQA[kNCuts][kNStepQA]; // QA Histograms
140 TArrayF* fCutValues; // array of cut values
141 TBits* fBitmap ; // stores single selection decisions
143 void SelectionBitMap(AliMCParticle* obj); // for MC got from Kinematics
144 void SelectionBitMap(AliAODMCParticle* obj); // for MC got from AOD
145 void FillHistograms(TObject* obj, Bool_t afterCuts);
146 void AddQAHistograms(TList *qaList) ;
147 void DefineHistograms();
149 ClassDef(AliCFParticleGenCuts,2);