]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/PartCorrDep/AliAnalysisTaskTaggedPhotons.h
Fix for the problem during PbPb run of Nov 2010 (Indra)
[u/mrichter/AliRoot.git] / PWG4 / PartCorrDep / AliAnalysisTaskTaggedPhotons.h
1 #ifndef ALIANALYSISTASKTAGGEDPHOTONS_H
2 #define ALIANALYSISTASKTAGGEDPHOTONS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice     */
5 //______________________________________________________________________________
6 // Analysis for PHOS Tagged Photons 
7 // marks photons making pi0 with any other photon
8 // and calculates necessary corrections for fake pairs and
9 // decay partners escaped acceptance. If MC info is present 
10 // fills set of controll histograms.
11 //
12 //*-- Dmitry Blau 
13 //////////////////////////////////////////////////////////////////////////////
14
15 #include "AliAnalysisTaskSE.h"  
16
17 class AliStack ; 
18 class AliESDEvent ; 
19 //class AliAODEvent ; 
20 class TH1D ; 
21 class TH1I ; 
22 class TH2D ;
23 class TH2F ;
24 class TH3D ;
25 class AliPHOSGeoUtils;
26 class AliEMCALGeoUtils;
27 class AliAODPWG4Particle;
28
29 class AliAnalysisTaskTaggedPhotons : public AliAnalysisTaskSE {
30
31 public:
32   AliAnalysisTaskTaggedPhotons() ;
33   AliAnalysisTaskTaggedPhotons(const char *name) ;
34   AliAnalysisTaskTaggedPhotons(const AliAnalysisTaskTaggedPhotons& ap) ;   
35   AliAnalysisTaskTaggedPhotons& operator = (const AliAnalysisTaskTaggedPhotons& ap) ;
36   virtual ~AliAnalysisTaskTaggedPhotons() ;
37    
38   virtual void UserCreateOutputObjects(); 
39   virtual void Init() ; 
40   virtual void LocalInit() { Init() ; }
41   virtual void UserExec(Option_t * opt = "") ;
42   virtual void Terminate(Option_t * opt = "") ;
43
44   void SetDebugLevel(Int_t level) { fDebug = level ; }
45   void SetPHOS(Bool_t isPHOS=kTRUE){fPHOS=isPHOS ;} //Which calirimeter to analyze
46   
47   void SetPhotonId(Float_t threshold) { fPhotonId = threshold ; }
48   void SetMinEnergyCut(Float_t threshold) { fMinEnergyCut = threshold; }
49
50   //Parameterization of pi0 peak position
51   void SetPi0MeanParameters(Float_t p0, Float_t p1, Float_t p2, Float_t p3)
52       { fPi0MeanP0 = p0; fPi0MeanP1 = p1; fPi0MeanP2 = p2; fPi0MeanP3 = p3;}
53   //Parameterization of pi0 peak width    
54   void SetPi0SigmaParameters(Float_t p0, Float_t p1, Float_t p2){ fPi0SigmaP0 = p0; fPi0SigmaP1 = p1;fPi0SigmaP2 = p2; }
55
56 protected:
57   Float_t GetPhotonId() const { return fPhotonId ; }
58   Int_t   GetFiducialArea(Float_t * pos)const ; //what kind of fiducial area hit the photon
59   Bool_t  IsSamePi0(const AliAODPWG4Particle *p1, const AliAODPWG4Particle *p2) const; //Check MC genealogy
60   Bool_t  IsInPi0Band(Double_t m, Double_t pt)const; //Check if invariant mass is within pi0 peak
61   Bool_t  TestDisp(Double_t l0, Double_t l1, Double_t e)const  ;
62   Bool_t  TestTOF(Double_t /*t*/,Double_t /*en*/)const{return kTRUE;} 
63   Bool_t  TestCharged(Double_t dr,Double_t en)const ;
64   void    InitGeometry() ;  //read reotation matrixes from ESD/AOD
65
66 private:
67
68   AliPHOSGeoUtils  *fPHOSgeom;   //!PHOS geometry
69   AliEMCALGeoUtils *fEMCALgeom;  //!EMCAL geometry
70
71   AliStack        *fStack ;      //Pointer to MC stack
72   Bool_t           fPHOS ;       //Choose Calorimeter: PHOS/EMCAL
73
74   // task parameters
75   Float_t   fPhotonId ;          // threshold for photon identification (Bayesian)
76   Float_t   fMinEnergyCut;       // min energy of partner photon
77   Float_t   fPi0MeanP0;          // Parameterization of pi0 mass:
78   Float_t   fPi0MeanP1;          // m_mean_pi0 = p[0] + p[1]*pt + p[2]*pt^2 + p[3]*pt^3
79   Float_t   fPi0MeanP2;          // m_mean_pi0 = p[0] + p[1]*pt + p[2]*pt^2 + p[3]*pt^3
80   Float_t   fPi0MeanP3;          // m_mean_pi0 = p[0] + p[1]*pt + p[2]*pt^2 + p[3]*pt^3
81
82   Float_t   fPi0SigmaP0;        // sigma_m_pi0 = sqrt ( p0*p0/x + p1*p1 + p2*p2/x/x)
83   Float_t   fPi0SigmaP1;      // sigma_m_pi0 = sqrt ( p0*p0/x + p1*p1 + p2*p2/x/x)
84   Float_t   fPi0SigmaP2;      // sigma_m_pi0 = sqrt ( p0*p0/x + p1*p1 + p2*p2/x/x)
85
86   //Fiducial area parameters
87   Float_t fZmax ;               //Rectangular
88   Float_t fZmin ;               //area
89   Float_t fPhimax ;             //covered by
90   Float_t fPhimin ;             //full calorimeter
91
92   TList   * fOutputList ;        // output data list
93   TList   * fEventList ;         //  event list for mixed InvMass
94
95   // Histograms
96   //Reconstructed spectra
97   TH1D    * fhRecAll[4];               // Spectrum of all reconstructed particles
98   TH1D    * fhRecAllArea1;             // Spectrum of rec particles in Fid. Area 1
99   TH1D    * fhRecAllArea2;             // Spectrum of rec particles in Fid. Area 2
100   TH1D    * fhRecAllArea3;             // Spectrum of rec particles in Fid. Area 3
101
102   //Sort registered particles spectra according MC information
103   TH1D    * fhRecPhoton;               // Spectrum of rec. with primary==22 and no PID criteria
104   TH1D    * fhRecOther;                // Spectrum of rec. with primary!=22 and no PID criteria
105   TH1D    * fhRecPhotonPID[4];         // Spectrum of rec. with primary==22 and different PID criteria
106   TH1D    * fhRecOtherPID[4];          // Spectrum of rec. with primary!=22 and different PID criteria
107   TH1D    * fhRecPhotPi0 ;             // Spectrum of rec. photons from pi0 decays
108   TH1D    * fhRecPhotEta ;             // Spectrum of rec. photons from eta decays
109   TH1D    * fhRecPhotOmega ;           // Spectrum of rec. photons from omega decays
110   TH1D    * fhRecPhotEtapr ;           // Spectrum of rec. photons from eta prime decays
111   TH1D    * fhRecPhotConv ;            // Spectrum of rec. photons from conversion
112   TH1D    * fhRecPhotHadron ;          // Spectrum of rec. photons from hadron-matter interactions
113   TH1D    * fhRecPhotDirect ;          // Spectrum of rec. photons direct or no primary
114   TH1D    * fhRecPhotOther ;           // Spectrum of rec. photons from other hadron decays
115
116   //MC tagging: reasons of partner loss etc.
117   TH1D  * fhDecWMCPartner ;         //pi0 decay photon which partner should be registered according to MC
118   TH1D  * fhDecWMissedPartnerNotPhoton ; //Decay photon with missed non-photon partner
119   TH1D  * fhDecWMissedPartnerAll ;  //Decay photons with partner missed due to some reason (sum of below)
120   TH1D  * fhDecWMissedPartnerEmin;  //Decay photons with partner missed due to low energy
121   TH1D  * fhDecWMissedPartnerConv;  //Decay photons with partner missed due to conversion
122   TH1D  * fhDecWMissedPartnerStack;  //Decay photons with partner not present in Stack
123   TH1D  * fhDecWMissedPartnerGeom0; //Decay photons with partner missed due geometry
124   TH1D  * fhDecWMissedPartnerGeom1; //Decay photons with partner missed due geometry Fid. area. 1
125   TH1D  * fhDecWMissedPartnerGeom2; //Decay photons with partner missed due geometry Fid. area. 2
126   TH1D  * fhDecWMissedPartnerGeom3; //Decay photons with partner missed due geometry Fid. area. 3
127
128   //MC tagging: Decay partners spectra
129   TH1D  * fhPartnerMCReg ;       //Spectrum of decay partners which should be registered (MC)
130   TH1D  * fhPartnerMissedEmin ;  //Spectrum of decay partners lost due to Emin cut  
131   TH1D  * fhPartnerMissedConv ;  //Spectrum of decay partners lost due to conversion
132   TH1D  * fhPartnerMissedGeo  ;  //Spectrum of decay partners lost due to acceptance
133
134   //Tagging
135   TH1D  * fhTaggedAll ;      //Spectrum of all tagged photons
136   TH1D  * fhTaggedArea1 ;    //Spectrum of all tagged photons Fid. area1
137   TH1D  * fhTaggedArea2 ;    //Spectrum of all tagged photons Fid. area2
138   TH1D  * fhTaggedArea3 ;    //Spectrum of all tagged photons Fid. area3
139   TH1D  * fhTaggedPID[4] ;   //Spectrum of tagged photons for different PID criteria
140   TH1D  * fhTaggedMult ;     //Spectrum of multiply tagged photons
141
142   //Tagging: use MC information if available
143   TH1D *  fhTaggedMCTrue ;     //Spectrum of correctly tagged pi0 decay photons
144   TH1D *  fhMCMissedTagging ;  //Spectrum of pi0 decay photons missed tagging due to wrong pair mass
145   TH1D *  fhMCFakeTagged ;     //Spectrum of photons wrongly tagged according to MC
146
147   //Invariant mass distributions for fake corrections
148   TH2D * fhInvMassReal[4] ;    //Two-photon inv. mass vs first photon pt
149   TH2D * fhInvMassMixed[4] ;   //Two-photon inv. mass vs first photon pt
150   TH2D * fhMCMissedTaggingMass ; //Inv mass of pairs missed tagging
151   
152   //Conversion and annihilation radius distributions
153   TH1D * fhConversionRadius ;      // Radis of photon production (conversion)
154   TH1D * fhInteractionRadius ;     // Radis of photon production (hadron interaction)
155
156   TH1D    * fhEvents;                  //  number of processed Events
157  
158   ClassDef(AliAnalysisTaskTaggedPhotons, 1);   // a PHOS photon analysis task 
159 };
160 #endif // ALIANALYSISTASKTAGGEDPHOTONS_H