]> git.uio.no Git - u/mrichter/AliRoot.git/blob - CORRFW/AliCFParticleGenCuts.h
Usage of 2D histograms of residuals (Marian)
[u/mrichter/AliRoot.git] / CORRFW / AliCFParticleGenCuts.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 //////////////////////////////////////////////////////////////////////
17 // AliCFParticleGenCut implementation
18 // This class is designed to handle 
19 // particle selection at generated level.
20 //
21 // added support for MC in AOD tree (2008-11-04)
22 // added a bool flag for the alternative (standard MC) vs (AOD MC).
23 //
24 // author : R. Vernet (renaud.vernet@cern.ch)
25 //////////////////////////////////////////////////////////////////////
26
27
28 #ifndef ALICFPARTICLEGENCUTS_H
29 #define ALICFPARTICLEGENCUTS_H
30
31 #include "AliCFCutBase.h"
32
33 class AliMCEvent;
34 class TObject;
35 class AliMCParticle;
36 class AliStack;
37 class TList;
38 class TH1F;
39 class TH2F;
40 class TBits;
41 class TArrayF;
42 class TDecayChannel;
43 class AliVParticle;
44 class AliVEvent;
45 class AliAODMCParticle;
46
47
48 class AliCFParticleGenCuts : public AliCFCutBase
49 {
50  public :
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;}
60
61   Bool_t IsPrimaryCharged(AliVParticle *mcPart);
62   Bool_t IsPrimary(AliMCParticle    *mcPart) ;
63   Bool_t IsPrimary(AliAODMCParticle *mcPart) ;
64   //static checkers
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);
68
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 ;}
83
84   enum { 
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)
107   };
108
109  private:
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 
135
136   //QA histos
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
142
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();
148
149   ClassDef(AliCFParticleGenCuts,2);
150 };
151
152 #endif