]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskHJetEmbed.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / UserTasks / AliAnalysisTaskHJetEmbed.h
1 #ifndef ALIANALYSISTASKHJETEMBED_H
2 #define ALIANALYSISTASKHJETEMBED_H
3
4 #include <vector>
5
6 class TH2F;
7 class TH1F;
8 class TF1;
9 class TH3F;
10 class THnSparse;
11 class TClonesArray;
12 class TObject;
13 class TString;
14 class AliNamedString;
15 class AliAODEvent;
16 class AliESDEvent;
17 class AliMCEvent;
18 class AliRhoParameter;
19 class TRandom3;
20 class AliEmcalJet;
21 class AliVTrack;
22
23 template<class T> class TParameter;
24
25 #include "AliAnalysisTaskSE.h"
26
27 class AliAnalysisTaskHJetEmbed : public AliAnalysisTaskSE {
28  public:
29   AliAnalysisTaskHJetEmbed();
30   AliAnalysisTaskHJetEmbed(const char *name);
31   virtual ~AliAnalysisTaskHJetEmbed();
32
33   void UserCreateOutputObjects();
34   void UserExec(Option_t *option);
35   void Terminate(Option_t *);
36   void PrintConfig();
37
38   void SetMaxVtxZ(Double_t z)                     { fMaxVtxZ=z;                     }
39   void SetCollisionSystem(char *s)                { fCollisionSystem=s;             }
40   void SetRunPeriod(char *p)                      { fPeriod=p;                      }
41   void SetMCParticleArrName(char *s)              { fMCParticleArrName=s;           }
42   void SetTrackArrName(char *s)                   { fTrackArrName=s;                }
43   void SetTrkPtRange(Double_t min, Double_t max)  { fMinTrkPt=min; fMaxTrkPt=max;   }
44   void SetTrkPhiRange(Double_t min, Double_t max) { fMinTrkPhi=min; fMaxTrkPhi=max; }
45   void SetTrkEtaRange(Double_t min, Double_t max) { fMinTrkEta=min; fMaxTrkEta=max; }
46   void SetTTtype(Int_t type)                      { fTTtype=type;                   }
47   void SetRadius(Double_t rad)                    { fRadius=rad;                    }
48   void SetPLJetArrName(char *s)                   { fPLJetArrName=s;                }
49   void SetDLJetArrName(char *s)                   { fDLJetArrName=s;                }
50   void SetJetArrName(char *s)                     { fJetArrName=s;                  }
51   void SetRhoName(char *s)                        { fRhoName=s;                     }
52   void SetRunQA(Bool_t run)                       { fRunQA=run;                     }
53   void SetRunPL(Bool_t run)                       { fRunPL=run;                     }
54   void SetRunDL(Bool_t run)                       { fRunDL=run;                     }
55   void SetRunHJet(Bool_t run)                     { fRunHJet=run;                   }
56   void SetRunMatch(Bool_t run)                    { fRunMatch=run;                  }
57   void SetTTRanges(Double_t *min, Double_t *max)
58   {
59     for(Int_t i=0; i<kNTT; i++)
60       {
61         fMinTTPt[i] = min[i];
62         fMaxTTPt[i] = max[i];
63       }
64   }
65
66
67
68 protected:
69   void         RunQA();
70   void         RunHJet(const Double_t minPt, const Double_t maxPt);
71   void         RunMatch(const TClonesArray *tracks, const Int_t leadingIndex);
72   void         FillHJetCor(const TClonesArray *tracks, const Int_t leadingIndex, const TClonesArray *jetArray, THnSparse *hTT, THnSparse *hn, Bool_t isBkg = kFALSE);
73   Int_t        FindGeoMatchedJet(const AliEmcalJet* jet, const TClonesArray *jetArray, Double_t &dR);
74   Int_t        FindEnergyMatchedJet(const AliEmcalJet* jet, const TClonesArray *jetArray, Double_t &dR, Double_t &fraction);
75   Bool_t       AcceptTrack(const AliVParticle *track);
76   Bool_t       IsGoodJet(const AliEmcalJet* jet);
77   Double_t     GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz, const Double_t jetPx, const Double_t jetPy, const Double_t jetPz);
78   Double_t     GetDPhi(const Double_t phi1, const Double_t phi2);
79   Double_t     CalculateDPhi(const Double_t phi1, const Double_t phi2);
80   Double_t     GetJetDistance(const AliEmcalJet *jet1, const AliEmcalJet* jet2);
81
82   enum { kNTrig = 3  };
83   enum { kNTT = 4 };
84
85  private:
86   Int_t             fVerbosity;            //! Control output
87   Int_t             fAnaType;              //  0-local; 1-grid
88   TString           fPeriod;               //  Run period
89   TString           fCollisionSystem;      //  Collision system
90   AliVEvent         *fEvent;               //! Input event 
91   Int_t             fTriggerType;          //! Trigger type of the event
92   Double_t          fCentrality;           //! V0M for current event
93   Double_t          fMaxVtxZ;              //  Maximum z of vertices
94   TString           fMCParticleArrName;    //
95   TClonesArray      *fMCParticleArray;     //!
96   TString           fTrackArrName;         //  Name of the input track array
97   TClonesArray      *fTrackArray;          //! Array of input tracks
98   Int_t             fTriggerTrkIndex;      //! Index of the trigger track in the event 
99   Double_t          fMinTrkPt;             //
100   Double_t          fMaxTrkPt;             //
101   Double_t          fMinTrkEta;            //
102   Double_t          fMaxTrkEta;            //
103   Double_t          fMinTrkPhi;            //
104   Double_t          fMaxTrkPhi;            //
105   Int_t             fTTtype;               //
106   Double_t          fMinTTPt[kNTT];        //
107   Double_t          fMaxTTPt[kNTT];        //
108   Double_t          fRadius;               //  Jet radius
109   TString           fJetArrName;           //  Name of the found jet array
110   TString           fPLJetArrName;         //  Name of the embedded PYTHIA jet array on particle level
111   TString           fDLJetArrName;         //  Name of the embedded PYTHIA jet array on detector level
112   TClonesArray      *fJetArray;            //! Array of the found jets
113   TClonesArray      *fPLJetArray;          //! Array of the embedded PYTHIA jet array on particle level
114   TClonesArray      *fDLJetArray;          //! Array of the embedded PYTHIA jet array on detector level
115   TString           fRhoName;              //  Name of the rho parameter
116   AliRhoParameter   *fRho;                 //! Rho parameter
117   Double_t          fRhoValue;             //! Value of the rho parameter
118   AliNamedString    *fPtHardBinName;       //!Pt hard bin param
119   Int_t             fPtHardBin;            //!        
120   TRandom3          *fRandom;              //!
121
122   Bool_t            fRunQA;                //  Flag to run QA
123   Bool_t            fRunHJet;              //  Flag to run h+jet 
124   Bool_t            fRunMatch;             //  Flag to run matching
125   Bool_t            fRunPL;                //
126   Bool_t            fRunDL;                //
127
128   TList             *fOutputList;                //! Output list
129   TH1F              *fhEventStat;                //!
130   TH1F              *fhPtHardBins;               //!
131
132   TH1F              *fhVtxZ[kNTrig];             //!
133   TH1F              *fhCentrality[kNTrig];       //!
134   TH2F              *fhRhoVsCent[kNTrig];        //!
135
136   // QA histograms
137   THnSparse         *fhPLJetPtVsCent[kNTrig];    //!
138   THnSparse         *fhDLJetPtVsCent[kNTrig];    //!
139
140   // HJet
141   THnSparse         *fhPLTT[kNTrig];             //!
142   THnSparse         *fhDLTT[kNTrig];             //!          
143   THnSparse         *fhPLHJet[kNTrig];           //!
144   THnSparse         *fhDLHJet[kNTrig];           //!
145   THnSparse         *fhTTPtQA[kNTrig];           //!
146   THnSparse         *fhTTPt[kNTrig];             //!
147   THnSparse         *fhHJet[kNTrig];             //!
148
149
150   // Matching
151   THnSparse         *fhJetPtGeoMatch[kNTrig];    //!
152   THnSparse         *fhJetPtEnMatch[kNTrig];     //!
153
154   THnSparse         *fhJetPhiGeoMatch[kNTrig];   //!
155   THnSparse         *fhJetPhiEnMatch[kNTrig];    //!
156
157   AliAnalysisTaskHJetEmbed(const AliAnalysisTaskHJetEmbed&);            // not implemented
158   AliAnalysisTaskHJetEmbed &operator=(const AliAnalysisTaskHJetEmbed&); // not implemented
159
160   ClassDef(AliAnalysisTaskHJetEmbed, 3);
161 };
162
163 #endif
164
165