]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/CaloTrackCorrBase/AliCaloTrackMCReader.h
Add option to check the real acceptance of the calorimeters for MC particles
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / AliCaloTrackMCReader.h
1 #ifndef ALICALOTRACKMCREADER_H
2 #define ALICALOTRACKMCREADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice     */
5
6 //_________________________________________________________________________
7 // Class for reading data (Kinematics) in order to do prompt gamma 
8 // or other particle  correlations
9 // Separates generated particles into charged (CTS) 
10 // and neutral (PHOS or EMCAL acceptance)
11 //
12 // Now, it only works with data stored in Kinematics.root and 
13 // not in filtered Kinematics branch in AODs
14 //
15 //*-- Author: Gustavo Conesa (LNF-INFN) 
16 //////////////////////////////////////////////////////////////////////////////
17
18 //-- Author: Gustavo Conesa (INFN-LNF)
19
20 // --- ROOT system ---
21 class TArrayI   ;
22 class TParticle ;
23
24 // --- AliRoot system ---
25 #include "AliCaloTrackReader.h" 
26 class AliVCluster ;
27 class AliAODTrack ;
28 class AliAODEvent ;
29 class AliMCEvent  ;
30 class AliVEvent   ;
31
32 class AliCaloTrackMCReader : public AliCaloTrackReader {
33   
34  public: 
35   
36   AliCaloTrackMCReader() ;          // ctor
37   virtual ~AliCaloTrackMCReader() ; // virtual dtor
38
39   // Main methos in source file
40   
41   void   CheckOverlap(Float_t anglethres, Int_t imom, Int_t & iPrimary, Int_t & index, TLorentzVector & mom, Int_t & pdg);
42
43   void   FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector & momentum) ;
44
45   Bool_t FillInputEvent(Int_t iEntry, const char * currentFileName) ;
46   
47   void   InitParameters();
48   
49   void   MakePi0Decay(TLorentzVector p0, TLorentzVector &p1, TLorentzVector &p2) const ;//, Double_t &angle);
50
51   void   Print(const Option_t * opt) const; 
52   
53   void   SetCaloClusterPID   (Int_t pdgCode, AliVCluster *calo ) const ;
54   
55   void   SetTrackChargeAndPID(Int_t pdgCode, AliAODTrack *track) const ;
56   
57   void   SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) ;
58
59   // Data members setters and getters
60   
61   AliVEvent*  GetInputEvent()               const { return (AliVEvent *) GetMC()   ; }
62   
63   void      GetVertex(Double_t v[3]) const ;
64   Double_t* GetVertex(Int_t evtIndex) const {return fVertex[evtIndex];}
65   void      GetVertex(Double_t vertex[3], Int_t evtIndex) const 
66   { vertex[0]=fVertex[evtIndex][0];  vertex[1]=fVertex[evtIndex][1];  vertex[2]=fVertex[evtIndex][2]; }  
67   
68   // Particle type, status, arrays 
69   void      AddNeutralParticlesArray(TArrayI & array)  
70       { fNeutralParticlesArray   = new TArrayI(array) ; }
71   TArrayI * GetNeutralParticlesArray()      const { return  fNeutralParticlesArray ; }
72   Bool_t    SkipNeutralParticles(Int_t pdg) const ;
73   
74   void      AddChargedParticlesArray(TArrayI & array)  
75       { fChargedParticlesArray   = new TArrayI(array) ; }
76   TArrayI * GetChargedParticlesArray()      const { return  fChargedParticlesArray ; }
77   Bool_t    KeepChargedParticles(Int_t pdg) const ;
78
79   void      AddStatusArray(TArrayI & array)  
80       { fStatusArray   = new TArrayI(array) ; }
81   TArrayI * GetStatusArray()                const { return  fStatusArray           ; }
82   
83   void      SwitchOnStatusSelection()             { fKeepAllStatus = kFALSE        ; }
84   void      SwitchOffStatusSelection()            { fKeepAllStatus = kTRUE         ; }
85   Bool_t    KeepParticleWithStatus(Int_t status) const ;
86   
87   void      SwitchOnOnlyGeneratorParticles()      { fOnlyGeneratorParticles = kTRUE  ; }
88   void      SwitchOffOnlyGeneratorParticles()     { fOnlyGeneratorParticles = kFALSE ; }
89   
90   // Pi0 Overlapps, decays 
91   
92   void      SwitchOnPi0Decay()                    { fDecayPi0 = kTRUE              ; } 
93   void      SwitchOffPi0Decay()                   { fDecayPi0 = kFALSE             ; } 
94   Int_t     IsPi0DecaySwitchedOn()          const { return fDecayPi0               ; }   
95   
96   void      SwitchOnOverlapCheck()                { fCheckOverlap = kTRUE          ; }
97   void      SwitchOffOverlapCheck()               { fCheckOverlap = kFALSE         ; }
98
99   Float_t   GetEMCALOverlapAngle()          const { return fEMCALOverlapAngle      ; }
100   void      SetEMCALOverlapAngle(Float_t angle)   { fEMCALOverlapAngle = angle     ; }
101   
102   Float_t   GetPHOSOverlapAngle()           const { return fPHOSOverlapAngle       ; }
103   void      SetPHOSOverlapAngle (Float_t angle)   { fPHOSOverlapAngle  = angle     ; }
104     
105   
106 private:
107
108   Bool_t    fDecayPi0 ;              // If not decayed, decay pi0 by hand
109   TArrayI * fNeutralParticlesArray ; // Do not keep neutral particles of this list in calorimeter.
110   TArrayI * fChargedParticlesArray ; // Keep charged particles of this list in calorimeter.
111   TArrayI * fStatusArray ;           // Keep particles with status of the list.
112   Bool_t    fKeepAllStatus ;         // Do or do not select particles depending on their status code.
113   Bool_t    fCheckOverlap;           // Check of overlapped photons from pi0 enter the calorimeter
114   Float_t   fEMCALOverlapAngle;      // Aperture angle of photons from decay that is not resolved by EMCAL, in radians
115   Float_t   fPHOSOverlapAngle;       // Aperture angle of photons from decay that is not resolved by PHOS, in radians
116   Int_t     fIndex2ndPhoton;         // Check overlap of first decay photon already done, internal use.
117   Bool_t    fOnlyGeneratorParticles; // Use particles only generated by PYTHIA/HERWIG/... and not by the MC tranport G3/G4/FLUKA ...
118   
119   AliCaloTrackMCReader(              const AliCaloTrackMCReader & r) ; // cpy ctor      
120   AliCaloTrackMCReader & operator = (const AliCaloTrackMCReader & r) ; // cpy assignment
121   
122   ClassDef(AliCaloTrackMCReader,4)
123 } ;
124
125
126 #endif //ALICALOTRACKMCREADER_H
127
128
129