]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetJTJT.h
ad267cd7d6821937dfe5c206371f2c5cb64df843
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / UserTasks / AliAnalysisTaskJetJTJT.h
1 #ifndef ALIANALYSISTASKJETJTJT_H
2 #define ALIANALYSISTASKJETJTJT_H
3
4 class TH1;
5 class TH2;
6 class TH3;
7 class TGraphErrors;
8 class TProfile;
9 class AliJetContainer;
10 class AliParticleContainer;
11 class AliClusterContainer;
12 class JTJTEfficiency;
13
14
15 #include "AliAnalysisTaskEmcalJet.h"
16
17
18 class AliAnalysisTaskJetJTJT : public AliAnalysisTaskEmcalJet {
19  public:
20
21   AliAnalysisTaskJetJTJT();
22   AliAnalysisTaskJetJTJT(const char *name);
23   virtual ~AliAnalysisTaskJetJTJT();
24
25   void                        UserCreateOutputObjects();
26   void                        Terminate(Option_t *option);
27
28   void SetTrackArrayName( char *c ) { fTrackArrayName = c; }
29
30   void setCentBinBorders( int n, Double_t *c);
31   void setTriggPtBorders( int n, Double_t *c);
32   void setAssocPtBorders( int n, Double_t *c);
33   void setDebug(int n) {debug = n; }
34   void setRunPeriod(const char *period) {runPeriod = period; cout << "RunPeriod set to " << runPeriod << endl;}
35   //AliJetContainer            *AddJetContainer(const char *n, TString defaultCutType = "", Float_t jetRadius = 0.4);
36
37
38  protected:
39   void                        ExecOnce();
40   Bool_t                      FillHistograms()   ;
41   Bool_t                      Run()              ;
42   void                        CheckClusTrackMatching();
43   Double_t                    getJt(AliVTrack *track, AliEmcalJet *jet, int reverse);
44   Double_t                    getJt(AliVParticle *track, AliEmcalJet *jet, int reverse);
45
46
47   // General histograms
48   TH1                       **fHistTracksPt;            //!Track pt spectrum
49   TH1                       **fHistTracksJt;            //!Track jt spectrum
50   TH1                       **fHistClustersPt;          //!Cluster pt spectrum
51   TH1                       **fHistLeadingJetPt;        //!Leading jet pt spectrum
52   TH1                       ***fHistJetsPt;             //!Jet pt spectrum
53   TH1                       ***fHistBackgroundDone;     //!Background test
54
55   //Jt histograms
56   TH1                       ****fHistJTPta;                     //!Jet Jt spectrum
57   TH1                       ****fHistLogJTPta;                  //!Logarithmic Jet Jt spectrum
58   TH1                       ****fHistJTPta_all;                 //!All particles Jt spectrum
59   TH1                       ****fHistJTBg;                      //!Jt background
60   TH1                       ****fHistLogJTBg;                   //!Logarithmic Jt background
61
62
63   //Background statistics
64
65   TH1                       ***fHistBgMulti;            //!Multiplicity in background cone
66   TH1                       ***fHistBgPt;               //!Background pt distribution
67
68   //Jet statistics
69   TH1                       ***fHistJetEta;             //!Jet eta distribution
70   TH1                       ***fHistJetMulti;           //!Multiplicity in jet                          
71   TH1                       ***fHistJetTracksPt;                //!Track pT in jet                              
72   TProfile                  **fhTrackingEfficiency;     //!Tracking efficiency
73
74   Int_t fNpttBins;
75   Int_t fNptaBins;
76
77   AliJetContainer            *fJetsCont;                   //!Jets
78   //AliJetContainer            **fJetsConts;              //!Jets
79   //Int_t                    nJetsConts;
80   AliParticleContainer       *fTracksCont;                 //!Tracks
81   AliClusterContainer        *fCaloClustersCont;           //!Clusters  
82
83  private:
84   //TVector *EtaGapThresholds;
85   //TVector *RGapThresholds;
86   //TVector *KlongBorders;
87   //TVector *XeBorders;
88
89
90
91   TClonesArray *fTracks;  //! tracks array
92   TString    fTrackArrayName; // track constituents array name
93   TString    runPeriod; // run period name
94   JTJTEfficiency *fEfficiency; //! AliJ Efficiency
95
96
97   //TVector *CentBinBorders;
98   //TVector *TriggPtBorders;
99   //TVector *AssocPtBorders;
100   Double_t CentBinBorders[10];
101   Double_t TriggPtBorders[10];
102   Double_t AssocPtBorders[10];
103   AliAnalysisTaskJetJTJT(const AliAnalysisTaskJetJTJT&);            // not implemented
104   AliAnalysisTaskJetJTJT &operator=(const AliAnalysisTaskJetJTJT&); // not implemented
105
106   Int_t debug;
107
108   ClassDef(AliAnalysisTaskJetJTJT, 3) // jet sample analysis task
109
110
111
112 };
113
114 class JTJTEfficiency {  // this part can occurr anywhere inside the outer accolades
115         #define JUNUSED(expr) do { (void)(expr); } while (0)
116         public:
117         enum Mode { kNotUse, kPeriod, kRunNumber, kAuto };
118         enum { kJTPCOnly, kJRaa, kJGlobalTightDCA, kJGlobalDCA, kJGlobalSDD , kJHybrid, kJNTrackCuts };
119
120
121
122         JTJTEfficiency();
123         JTJTEfficiency(const JTJTEfficiency& obj);
124         JTJTEfficiency& operator=(const JTJTEfficiency& obj);
125         void SetMode( int i ){ fMode = i; }
126         void SetDataPath(TString s ){ fDataPath=s; }
127         void SetPeriodName(TString s ){ fPeriodStr=s; cout << "Eff: Run Period is set to " << fPeriodStr << endl; }
128         TString GetName() const { return fName; }
129         double GetCorrection( double pt, int icut, double cent ) const ;
130         void SetRunNumber( Long64_t runnum ){ fRunNumber=runnum; }
131
132         TString GetEffName() ;
133         TString GetEffFullName() ;
134         bool   Load();
135         void   PrintOut() const {
136             cout<<fInputRootName<<endl;
137         }
138         //void Write();
139
140     private:
141         int      fMode;             // Mode. see enum Mode
142         int      fPeriod;           // Data Period index
143         //AliJTrackCut fTrackCut;     // Track Cut Object. TODO:why not pointer?
144         //AliJRunTable fRunTable;     // run Table. TODO:why not pointer?
145
146         TString fDataPath;          // locaction of eff files
147         TString fName;              // name of efficiency. usually empty
148         TString fPeriodStr;         // DATA period
149         TString fMCPeriodStr;       // MC period
150         Long64_t fRunNumber;        // Runnumber
151         TString fTag;               // Tags to distinguish special eff file
152         TString fInputRootName;     // name of input
153
154         TFile * fInputRoot;         // input file  
155         TDirectory * fEffDir[3];    // root directory of efficiency. only second item of fEffDir with "Efficiency" is being used.
156         TGraphErrors * fCorrection[20][20][20]; // Storage of Correction factor 
157         TAxis * fCentBinAxis;     // Bin of Centrality. replace with AliJBin?
158
159
160
161 };
162
163 #endif