]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/AliPWG4HighPtSpectra.h
From Salvatore
[u/mrichter/AliRoot.git] / PWGJE / AliPWG4HighPtSpectra.h
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //-----------------------------------------------------------------------
17 // Author : Marta Verweij - UU
18 //-----------------------------------------------------------------------
19
20 #ifndef ALIPWG4HIGHPTSPECTRA_H
21 #define ALIPWG4HIGHPTSPECTRA_H
22
23 #include "AliAnalysisTask.h"
24 #include "AliCFManager.h"
25
26 class TH1I;
27 class TH1F;
28 class TH1D;
29 class TH2F;
30 class TProfile;
31 class TFile;
32 class TList;
33
34 //class AliCFManager;
35 class AliESDtrackCuts;
36 class AliESDEvent;
37 class AliESDVertex;
38 class AliMCEvent;
39 class AliStack;
40 class AliGenPythiaEventHeader;
41 class AliGenHijingEventHeader;
42
43 class AliPWG4HighPtSpectra : public AliAnalysisTask {
44  public:
45
46   enum {
47     kStepReconstructed          = 0,
48     kStepSecondaries            = 1,
49     kStepReconstructedMC        = 2,
50     kStepMCAcceptance           = 3
51   };
52
53   AliPWG4HighPtSpectra();
54   AliPWG4HighPtSpectra(const Char_t* name);
55   // AliPWG4HighPtSpectra& operator= (const AliPWG4HighPtSpectra& c);
56   //  AliPWG4HighPtSpectra(const AliPWG4HighPtSpectra& c);
57   ~AliPWG4HighPtSpectra() {;};
58
59   // ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects
60   virtual void   LocalInit();
61   virtual void   ConnectInputData(Option_t *);
62   virtual void   CreateOutputObjects();
63   virtual void   Exec(Option_t *option);
64   virtual void   Terminate(Option_t *);
65   virtual Bool_t Notify(); //Copied from AliAnalysisTaskJetSpectrum2
66
67   Bool_t IsPbPb() {return fIsPbPb;}  //is PbPb data?
68   Bool_t SelectEvent();    //decides if event is used for analysis
69   Int_t CalculateCentrality(AliESDEvent *esd);
70
71   //Setters
72   void SetIsPbPb(Bool_t cs)                {fIsPbPb = cs;}
73   void SetCentralityClass(int cent)        {fCentClass=cent;}
74   void SetTriggerMask(UInt_t t)             {fTriggerMask=t;}
75  
76   // CORRECTION FRAMEWORK RELATED FUNCTIONS
77   void     SetCFManagerPos(const AliCFManager* io1) {fCFManagerPos = io1;}   // global correction manager 
78   const AliCFManager * GetCFManagerPos() const {return fCFManagerPos;}           // get corr manager 
79   void     SetCFManagerNeg(const AliCFManager* io2) {fCFManagerNeg = io2;}   // global correction manager 
80   const AliCFManager * GetCFManagerNeg() const {return fCFManagerNeg;}            // get corr manager
81
82   //if fTrackType=0 (Global)
83   //if fTrackType=1 (TPConly)
84   //if fTrackType=2 (TPConly constrained)
85   void SetTrackType(Int_t trackType) {fTrackType = trackType;}
86   //AliESDtrackCuts setters
87   void SetCuts(AliESDtrackCuts* trackCuts) {fTrackCuts = trackCuts;}
88   void SetCutsReject(AliESDtrackCuts* trackCuts) {fTrackCutsReject = trackCuts;}
89   void SelectHIJINGOnly(Bool_t b)    {fbSelectHIJING = b;}
90
91   Bool_t IsHIJINGParticle(Int_t label);
92
93   void SetSigmaConstrainedMax(Double_t sigma) {fSigmaConstrainedMax=sigma;}
94
95   // Data types
96   Bool_t IsReadAODData()   const {return fReadAODData;}
97   void   SetReadAODData(Bool_t flag=kTRUE) {fReadAODData=flag;}
98
99   static AliGenPythiaEventHeader*  GetPythiaEventHeader(AliMCEvent *mcEvent);
100   static AliGenHijingEventHeader*  GetHijingEventHeader(AliMCEvent *mcEvent);
101
102   static Bool_t PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials);// get the cross section and the trails either from pyxsec.root or from pysec_hists.root
103
104
105   
106  protected:
107   Bool_t              fReadAODData ;       // flag for AOD/ESD input files
108   const AliCFManager  *fCFManagerPos    ;  // pointer to the CF manager for positive charged particles
109   const AliCFManager  *fCFManagerNeg    ;  // pointer to the CF manager for negative charged particles
110  
111   AliESDEvent *fESD;      //! ESD object
112   AliMCEvent  *fMC;       //! MC event object
113   AliStack    *fStack;    //! stack object
114
115   const AliESDVertex   *fVtx;     //! vertex object
116
117   UInt_t      fTriggerMask;          // Trigger mask to select events 
118   Bool_t      fIsPbPb;               // kTRUE if PbPb
119   Int_t       fCentClass;            // Select only events from predefined centrality class
120
121   Int_t   fTrackType;     // Type of track to be used in analysis
122   //AliESDtrackCuts options. Must be setted in AddTaskPWG4HighPTSpectra.C. They correspond with different steps in container.
123   AliESDtrackCuts *fTrackCuts;           // trackCuts applied to global tracks
124   AliESDtrackCuts *fTrackCutsReject;     // trackCuts to reject tracks (hybrid case)
125
126   Bool_t fbSelectHIJING; //Select only particles from HIJING event
127
128   Double_t fSigmaConstrainedMax;  // max sigma on constrained fit
129
130  private:
131   AliPWG4HighPtSpectra(const AliPWG4HighPtSpectra&);
132   AliPWG4HighPtSpectra& operator=(const AliPWG4HighPtSpectra&);
133
134   Float_t fAvgTrials;             // Average number of trials
135
136   // Histograms
137   //Number of events
138   TList *fHistList;             //! List of output histograms
139   TH1F  *fNEventAll;            //! Event counter
140   TH1F  *fNEventSel;            //! Event counter: Selected events for analysis
141   TH1F  *fNEventReject;         //! Book keeping of reason of rejecting events
142
143   TH1F *fh1Centrality;                         //! Centrality
144
145   TProfile*     fh1Xsec;                       //! pythia cross section and trials
146   TH1F*         fh1Trials;                     //! trials which are added
147   TH1F*         fh1PtHard;                     //! pt hard of the event
148   TH1F*         fh1PtHardTrials;               //! pt hard of the event
149
150   TH2F *fPtRelUncertainty1PtPrim;              //! Pt vs relUncertainty1Pt for primary particles
151   TH2F *fPtRelUncertainty1PtSec;               //! Pt vs relUncertainty1Pt for secondary particles
152
153   ClassDef(AliPWG4HighPtSpectra,3);
154 };
155
156 #endif