]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/JetTasks/AliAnalysisTaskUE.h
IsHeavyIon flag, added Centrality Selection, Add mising Cut for Nch, extra histograms...
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliAnalysisTaskUE.h
1 #ifndef ALIANALYSISTASKUE_H
2 #define ALIANALYSISTASKUE_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ////////////////////////////////////////////////////////////////////////
8 //
9 // Analysis class for Underlying Event studies
10 //
11 // Look for correlations on the tranverse regions to 
12 // the leading charged jet
13 //
14 // This class needs as input AOD with track and Jets.
15 // The output is a list of histograms
16 //
17 // AOD can be either connected to the InputEventHandler  
18 // for a chain of AOD files 
19 // or 
20 // to the OutputEventHandler
21 // for a chain of ESD files, so this case class should be 
22 // in the train after the Jet finder
23 //
24 //    Arian.Abrahantes.Quintana@cern.ch 
25 //    Ernesto.Lopez.Torres@cern.ch
26 //    vallero@physi.uni-heidelberg.de
27 // 
28 ////////////////////////////////////////////////////////////////////////
29
30 #include "AliAnalysisTask.h"
31
32 class AliAnalyseUE;
33 class AliHistogramsUE;
34 class AliAODEvent;
35 class AliAODInputHandler;
36 class AliESDEvent;
37 class TH1F;
38 class TH2F;
39 class TH1I;
40 class TProfile;
41 class TTree;
42 class TVector3;
43
44 class  AliAnalysisTaskUE : public AliAnalysisTask
45   {
46   public:
47     AliAnalysisTaskUE(const char* name="AliAnalysisTaskUE");
48     virtual           ~AliAnalysisTaskUE() {if ( fListOfHistos ) delete fListOfHistos; }
49     AliAnalysisTaskUE(const  AliAnalysisTaskUE &det);
50     AliAnalysisTaskUE&   operator=(const  AliAnalysisTaskUE &det);
51        
52     // return instance of the singleton
53     static  AliAnalysisTaskUE* Instance();
54       
55     // Implementation of interace methods
56     virtual     Bool_t Notify();
57     virtual     void   ConnectInputData(Option_t *);
58     virtual     void   CreateOutputObjects();
59     virtual     void   Exec(Option_t *option);
60     virtual     void   Terminate(Option_t *);
61
62     //  Setters/Getters
63     virtual     void         SetDebugLevel( Int_t level )  { fDebug = level; }
64     virtual     Int_t        GetDebugLevel() const  { return fDebug; }
65     
66     void        SetPtRangeInHist( Int_t bin, Double_t min, Double_t max ) {
67                         fBinsPtInHist = bin; 
68                         fMinJetPtInHist = min; 
69                         fMaxJetPtInHist = max; 
70                         }
71
72     // Read AODs
73     void          SelectAODBranch(const char* val)      { fAODBranch = val;   }
74     virtual       TString        GetAODBranch() const   { return fAODBranch;   }
75     virtual       AliAODEvent*   GetAOD() const         { return fAOD; } 
76
77     // Setters/Getters for MC
78     void        SetConstrainDistance(Bool_t val1, Double_t val2){ fMinDistance = val2; fConstrainDistance = val1;}
79     void        SetSimulateChJetPt(){fSimulateChJetPt = kTRUE;}
80     void        SetUseAODMCParticle(){fUseAliStack = kFALSE;}
81     void        SetUseMCBranch(){fUseMCParticleBranch = kTRUE;}
82
83     virtual Bool_t      GetConstrainDistance()   const  {return fConstrainDistance;}
84     virtual Double_t    GetMinDistance()         const  {return fMinDistance;}
85     virtual Bool_t      GetSimulateChJetPt()     const  {return fSimulateChJetPt;}
86     virtual Bool_t      GetUseAODMCParticle()    const  {return fUseAliStack;}
87     virtual Bool_t      GetUseMCParticleBranch() const  {return fUseMCParticleBranch;}
88
89     //Setters for Events QA
90     void  SetZVertex( Double_t val ) { fZVertex = val; }
91     void  SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
92     
93     // Setters/Getters for UE Analysis
94     void   SetAnaTopology( Int_t val )       { fAnaType = val;    }
95     void   SetConePosition(Int_t val)        { fConePosition= val; }
96     void   SetConeRadius( Double_t val )     { fConeRadius = val; }
97     void   SetDoNotNormalizeQuantities()     { fIsNorm2Area = kFALSE; }
98     void   SetFilterBit( UInt_t val )        { fFilterBit = val;  }
99     void   SetJetsOnFly( Bool_t val )        { fJetsOnFly = val;  }
100     void   SetPtSumOrdering( Int_t val )     { fOrdering = val;   }
101     void   SetRegionType( Int_t val )        { fRegionType = val; }
102     void   SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
103     void   SetUseChPartJet( Int_t val )      { fUseChPartJet = val; }
104     void   SetUseNegativeChargeType()        { fUsePositiveCharge = kFALSE; }
105     void   SetUseSingleCharge()              { fUseSingleCharge = kTRUE; } 
106     
107     virtual Int_t     GetAnaTopology()              const     { return fAnaType; }
108     virtual Int_t     GetConePosition()             const     { return fConePosition; }
109     virtual Double_t  GetConeRadius()               const     { return fConeRadius; }
110     virtual Bool_t    GetDoNotNormalizeQuantities() const     { return fIsNorm2Area; }
111     virtual UInt_t    GetFilterBit()                const     { return fFilterBit;  }
112     virtual Bool_t    GetJetsOnFly()                const     { return fJetsOnFly;  }
113     virtual Int_t     GetPtSumOrdering()            const     { return fOrdering;   }
114     virtual Int_t     GetRegionType()               const     { return fRegionType; }
115     virtual Bool_t    GetUseChargeHadrons()         const     { return fUseChargeHadrons; }
116     virtual Int_t     GetUseChPartJet()             const     { return fUseChPartJet; }
117     virtual Bool_t    GetUseNegativeChargeType()    const     { return fUsePositiveCharge; }
118     virtual Bool_t    GetUseSingleCharge()          const     { return fUseSingleCharge; } 
119     
120     // Jet cuts
121     void   SetJet1EtaCut( Double_t val )      { fJet1EtaCut = val; }
122     void   SetJet2DeltaPhiCut( Double_t val ) { fJet2DeltaPhiCut = val; }
123     void   SetJet2RatioPtCut( Double_t val )  { fJet2RatioPtCut = val; }
124     void   SetJet3PtCut( Double_t val )       { fJet3PtCut = val; }
125     void   SetPtMinChPartJet( Double_t val )  { fChJetPtMin = val; }
126     
127     virtual Double_t   GetJet1EtaCut()       const      { return fJet1EtaCut; }
128     virtual Double_t   GetJet2DeltaPhiCut()  const      { return fJet2DeltaPhiCut; }
129     virtual Double_t   GetJet2RatioPtCut()   const      { return fJet2RatioPtCut; }
130     virtual Double_t   GetJet3PtCut()        const      { return fJet3PtCut; }
131     virtual Double_t   GetPtMinChPartJet()   const      { return fChJetPtMin; }
132     
133     // track cuts
134     void   SetTrackEtaCut( Double_t val ) { fTrackEtaCut = val; }
135     void   SetTrackPtCut( Double_t val )  { fTrackPtCut = val; }
136
137     virtual Double_t   GetTrackEtaCut() const     { return fTrackEtaCut; }
138     virtual Double_t   GetTrackPtCut()  const     { return fTrackPtCut; }
139     
140
141     AliHistogramsUE*    fHistosUE;        //! points to AliHistogramsUE class   
142   protected:
143   static AliAnalysisTaskUE*     fgTaskUE;        // Pointer to single instance
144
145   private:
146     void         AddSettingsTree();    
147     void         AnalyseUE();
148     void         FillAvePartPtRegion( Double_t leadingE, Double_t ptMax, Double_t ptMin );
149     void         FillMultRegion( Double_t leadingE, Double_t nTrackPtmax, Double_t nTrackPtmin, Double_t ptMin );
150     void         FillSumPtRegion( Double_t leadingE, Double_t ptMax, Double_t ptMin );
151     TObjArray*   FindChargedParticleJets();
152     Int_t        IsTrackInsideRegion(TVector3 *jetVect, TVector3 *partVect);
153     void         QSortTracks(TObjArray &a, Int_t first, Int_t last);
154     void         SetRegionArea(TVector3 *jetVect);
155     TObjArray*   SortChargedParticles();
156     void         WriteSettings();
157     
158     AliAnalyseUE*       fAnaUE;           //! points to AliAnalyseUE class
159     AliAODEvent*        fAOD;             //! AOD Event 
160     TString             fAODBranch;       //  Jet branch name from standard AOD
161     Int_t               fDebug;           //  Debug flag
162     TList*              fListOfHistos;    //  Output list of histograms
163     
164     // Config
165     Int_t               fBinsPtInHist;     //  # bins for Pt histos range
166     Bool_t              fIsNorm2Area;      // Apply Area Normalization to collected observables
167     Double_t            fMaxJetPtInHist;   //  max Jet Pt value for histo range
168     Double_t            fMinJetPtInHist;   //  min Jet Pt value for histo range
169     
170     // For MC
171     Bool_t              fConstrainDistance;    // Constrain Distance between rec jet and pyth
172     Double_t            fMinDistance;          // Minimum distance between rec jet and pyth
173     Bool_t              fSimulateChJetPt;      // Naive simulation of charged jet Pt from original Jet in MC Header
174     Bool_t              fUseAliStack;          // Use AliSatck for particle info otherwise "mcparticles" branch in AOD
175     Bool_t              fUseMCParticleBranch;  // Run Over mcparticles branch in AOD
176     
177     // Cuts Events type
178     Int_t               fnTracksVertex;        // QA tracks pointing to principal vertex (= 3 default) 
179     Double_t            fZVertex;              // Position of Vertex in Z direction
180     
181     // Cuts UE analysis
182     Int_t               fAnaType;              // Analysis type on jet topology: 
183                                                   //     1=inclusive  (default) 
184                                                   //     2=back to back inclusive
185                                                   //     3=back to back exclusive
186                                                   //     4=Pt max (max Pt track in region)
187                                                   //     5=gama jet (back to back) ???
188                                                   //  Minimum bias
189                                                   //     31 = Semi jet (charged leading particle jets)
190                                                   //     32 = Random jetcone  ?
191                                                   //     33 = Swiss chees   ?
192     
193     
194     Int_t               fConePosition;         // This parameter set how will cone center in transversal zone will be set
195                                                   //    1 : To be used in any jet topology (default value)
196                                                   //        eta_cone = eta_leadingjet
197                                                   //        phi_cone = phi_leadingjet + - 90
198                                                   //    2 : To be used in multiple jet topology (code will cry otherwise)
199                                                   //        eta_cone = (eta_leadingjet + eta_subleadingjet)/2
200                                                   //        phi_cone = phi_leadingjet + - 90
201     
202     Double_t            fConeRadius;           // if selected Cone-like region type, set Radius (=0.7 default)
203     
204     UInt_t              fFilterBit;            // Select tracks from an specific track cut (default 0xFF all track selected)
205     
206     Bool_t              fJetsOnFly;            // if jets are reconstructed on the fly from AOD tracks (see ConnectInputData() )
207     
208     // UE analysis is conducted in different type of regions
209     // Transverse are those like defined in: R. Field Acta Physica Polonica B. Vol 36 No. 2 pg 167 (2005) 
210     // Cone regions like defined in: Phys. Rev. D 70, 072002 (2004)
211     Int_t               fRegionType;           // 1 = transverse regions (default)
212                                                // 2 = cone regions   
213     
214
215
216     Bool_t              fUseChargeHadrons;     // Only use charge hadrons
217     Bool_t              fUseChPartJet;         // Use "Charged Particle Jet" instead of jets from AOD see FindChargedParticleJets()
218     
219     // Theoreticians ask for tools charge-aware
220     // especially those which are related to multiplicity and MC-tunings
221     // see arXiv:hep-ph/0507008v3
222     Bool_t              fUsePositiveCharge;    //If Single type of charge used then set which one (=kTRUE default positive)
223     Bool_t              fUseSingleCharge;      //Make analysis for a single type of charge (=kFALSE default)
224     
225     Int_t               fOrdering;             //  Pt and multiplicity summation ordering:
226                         //     1=CDF-like -independent sorting according quantity to be scored: Double sorting- (default)
227                         //        if Pt summation will be scored take Pt minimum between both zones and 
228                         //        fill Pt Max. and Min. histog. accordingly
229                         //        if Multiplicity summation will be scored take Mult. minimum between both zones and 
230                         //        fill Mult Max and Min histog. accordingly
231                         //       Bib:
232                         //     2=Marchesini-like (Only Pt sorting: Single sorting)
233                         //        sort only according Pt summation scored, find minimum between both zones and
234                         //        fill Pt and Multiplicity Max and Min summation histog. following only this criterium
235                         //        Bib: Phys. Rev. D 38, 3419 (1988)
236                         //     3=Nameless pt per track single sorting
237                         //        sort according to pt per track scored in each transverse zone 
238                         //        lowest values indicates minimum zone.   
239                         //     4=User Selection sorting (NOTE: USER must implement it within cxx)
240    
241     
242     // Jet cuts 
243     Double_t            fChJetPtMin;       // Min Pt for charged Particle Jet
244     Double_t            fJet1EtaCut;       // |jet1 eta| < fJet1EtaCut   (fAnaType = 1,2,3)
245     Double_t            fJet2DeltaPhiCut;  // |Jet1.Phi - Jet2.Phi| < fJet2DeltaPhiCut (fAnaType = 2,3)
246     Double_t            fJet2RatioPtCut;   // Jet2.Pt/Jet1Pt > fJet2RatioPtCut  (fAnaType = 2,3)
247     Double_t            fJet3PtCut;        // Jet3.Pt < fJet3PtCut  (fAnaType = 3)
248
249     // track cuts
250     Double_t            fTrackEtaCut;      // Eta cut on tracks in the regions (fRegionType=1)
251     Double_t            fTrackPtCut;       // Pt cut of tracks in the regions
252    
253     // MC cross-section 
254     Double_t            fAvgTrials;        // average trials used to fill the fh1Trials histogram in case we do not have trials on a event by event basis
255     
256     /*
257     // Histograms
258     TH1F*  fhNJets;                  //! number of reco. jets or leading particles
259     TH1F*  fhEleadingPt;             //! pT distribution of leading-jet (leading-particle)
260     
261     TH1F*  fhMinRegPtDist;           //! pT distribution in MIN region
262     TH1F*  fhRegionMultMin;          //! average pT in MIN region
263     TH1F*  fhMinRegAvePt;            //! sum pT in MIN region
264     TH1F*  fhMinRegSumPt;            //! maximum particle pT in MAX region
265     TH1F*  fhMinRegMaxPtPart;        //! sum pT vs. multiplicity in MIN region
266     TH1F*  fhMinRegSumPtvsMult;      //!
267     
268     TH2F*  fhdNdEtaPhiDist;          //! phi and eta correlation with leading-jet (leading particle)
269     TH2F*  fhFullRegPartPtDistVsEt;  //! particle pT distribution vs. transverse energy in FULL region
270     TH2F*  fhTransRegPartPtDistVsEt; //! particle pT distribution vs. transverse energy in TRANSVERSE (MIN+MAX) region 
271     
272     TH1F*  fhRegionSumPtMaxVsEt;     //! sum pT vs. transverse energy in MAX region
273     TH1I*  fhRegionMultMax;          //! multiplicity in MAX region 
274     TH1F*  fhRegionMultMaxVsEt;      //! multiplicity vs. transverse energy in MAX region
275     TH1F*  fhRegionSumPtMinVsEt;     //! sum pT vs. transverse energy in MIN region
276     TH1F*  fhRegionMultMinVsEt;      //! multiplicity vs. transverse energy in MIN region
277     TH1F*  fhRegionAveSumPtVsEt;     //! average sum pT in 2 regions
278     TH1F*  fhRegionDiffSumPtVsEt;    //! difference sum pT in 2 regions
279     
280     TH1F*  fhRegionAvePartPtMaxVsEt; //! average particle pT vs. transverse energy in MAX region
281     TH1F*  fhRegionAvePartPtMinVsEt; //! average particle pT vs. transverse energy in MIN region
282     TH1F*  fhRegionMaxPartPtMaxVsEt; //! maximum particle pT vs. transverse energy in MAX region
283     
284     TH2F*  fhRegForwardMult;         //! multiplicity in FORWARD region
285     TH2F*  fhRegForwardSumPtvsMult;  //! sum pT vs. multiplicity in FORWARD region
286     TH2F*  fhRegBackwardMult;        //! multiplicity in BACKWARD region
287     TH2F*  fhRegBackwardSumPtvsMult; //! sum pT vs. multiplicity in BACKWARD region
288     TH2F*  fhRegForwardPartPtDistVsEt; //! particle pT distribution vs. transverse energy in FORWARD region
289     TH2F*  fhRegBackwardPartPtDistVsEt; //! particle pT distribution vs. transverse energy in BACKWARD
290     TH2F*  fhRegTransMult;         //! multiplicity in TRANSVERSE (MIN+MAX) region
291     TH2F*  fhRegTransSumPtVsMult;    //! sum pT vs. multiplicity in TRANSVERSE (MIN+MAX) region
292     TH2F*  fhMinRegSumPtJetPtBin;    //!
293     TH2F*  fhMaxRegSumPtJetPtBin;    //!
294     TH1F*  fhVertexMult;             //! vertex multiplicity
295  
296     TProfile*  fh1Xsec;             //! cross-section from MC   
297     TH1F*  fh1Trials;               //! number of trials from MC
298     */
299
300     ClassDef( AliAnalysisTaskUE, 6); // Analysis task for Underlying Event analysis
301   };
302
303 #endif
304
305