]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGJE/AliPWG4HighPtSpectra.h
fix mem leak. Open all files
[u/mrichter/AliRoot.git] / PWGJE / AliPWG4HighPtSpectra.h
CommitLineData
fdceab34 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
26class TH1I;
b5cc0c6d 27class TH1F;
fdceab34 28class TH1D;
a337a5a9 29class TH2F;
b4691ee7 30class TProfile;
31class TFile;
32class TList;
33
67ebd013 34//class AliCFManager;
fdceab34 35class AliESDtrackCuts;
36class AliESDEvent;
9477b466 37class AliAODEvent;
38class AliVEvent;
39class AliVVertex;
b4691ee7 40class AliMCEvent;
cce400da 41class AliStack;
b4691ee7 42class AliGenPythiaEventHeader;
03372fd1 43class AliGenHijingEventHeader;
fdceab34 44
45class AliPWG4HighPtSpectra : public AliAnalysisTask {
b5cc0c6d 46 public:
fdceab34 47
48 enum {
ec555a3c 49 kStepReconstructed = 0,
2b553e6f 50 kStepSecondaries = 1,
51 kStepReconstructedMC = 2,
52 kStepMCAcceptance = 3
fdceab34 53 };
54
55 AliPWG4HighPtSpectra();
56 AliPWG4HighPtSpectra(const Char_t* name);
67ebd013 57 // AliPWG4HighPtSpectra& operator= (const AliPWG4HighPtSpectra& c);
58 // AliPWG4HighPtSpectra(const AliPWG4HighPtSpectra& c);
59 ~AliPWG4HighPtSpectra() {;};
fdceab34 60
61 // ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects
e5abcde9 62 virtual void LocalInit();
fdceab34 63 virtual void ConnectInputData(Option_t *);
64 virtual void CreateOutputObjects();
65 virtual void Exec(Option_t *option);
66 virtual void Terminate(Option_t *);
b4691ee7 67 virtual Bool_t Notify(); //Copied from AliAnalysisTaskJetSpectrum2
fdceab34 68
2b553e6f 69 Bool_t IsPbPb() {return fIsPbPb;} //is PbPb data?
cce400da 70 Bool_t SelectEvent(); //decides if event is used for analysis
9477b466 71 Int_t CalculateCentrality(AliVEvent *event);
cce400da 72
2b553e6f 73 //Setters
74 void SetIsPbPb(Bool_t cs) {fIsPbPb = cs;}
75 void SetCentralityClass(int cent) {fCentClass=cent;}
5d87a047 76 void SetTriggerMask(UInt_t t) {fTriggerMask=t;}
2b553e6f 77
fdceab34 78 // CORRECTION FRAMEWORK RELATED FUNCTIONS
67ebd013 79 void SetCFManagerPos(const AliCFManager* io1) {fCFManagerPos = io1;} // global correction manager
80 const AliCFManager * GetCFManagerPos() const {return fCFManagerPos;} // get corr manager
81 void SetCFManagerNeg(const AliCFManager* io2) {fCFManagerNeg = io2;} // global correction manager
82 const AliCFManager * GetCFManagerNeg() const {return fCFManagerNeg;} // get corr manager
2b553e6f 83
84 //if fTrackType=0 (Global)
85 //if fTrackType=1 (TPConly)
86 //if fTrackType=2 (TPConly constrained)
34fc6450 87 void SetTrackType(Int_t trackType) {fTrackType = trackType;}
fdceab34 88 //AliESDtrackCuts setters
9477b466 89 void SetCuts(AliESDtrackCuts* trackCuts) {fTrackCuts = trackCuts;} // Needs to be specified for ESD analysis, not for AOD analysis
90 void SetFilterMask(Int_t filtermask) {fFilterMask = filtermask;} // Needs to be specified for AOD analysis, not for ESD analysis
327d12da 91 void SetCutsReject(AliESDtrackCuts* trackCuts) {fTrackCutsReject = trackCuts;}
03372fd1 92 void SelectHIJINGOnly(Bool_t b) {fbSelectHIJING = b;}
93
94 Bool_t IsHIJINGParticle(Int_t label);
2b553e6f 95
96 void SetSigmaConstrainedMax(Double_t sigma) {fSigmaConstrainedMax=sigma;}
fdceab34 97
98 // Data types
99 Bool_t IsReadAODData() const {return fReadAODData;}
b5cc0c6d 100 void SetReadAODData(Bool_t flag=kTRUE) {fReadAODData=flag;}
b4691ee7 101
9477b466 102 Bool_t IsUsingPythiaInfo() const {return fNoPythiaInfo;}
103 void SetNoPythiaInfo() {fNoPythiaInfo=kTRUE;}
104
b4691ee7 105 static AliGenPythiaEventHeader* GetPythiaEventHeader(AliMCEvent *mcEvent);
03372fd1 106 static AliGenHijingEventHeader* GetHijingEventHeader(AliMCEvent *mcEvent);
107
b4691ee7 108 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
03372fd1 109
110
b5cc0c6d 111
fdceab34 112 protected:
9477b466 113 Bool_t fReadAODData ; // flag for AOD/ESD input files
114 Bool_t fNoPythiaInfo ; // flag to skip reading pyxsec.root and plotting output
115 const AliCFManager *fCFManagerPos ; //! pointer to the CF manager for positive charged particles
116 const AliCFManager *fCFManagerNeg ; //! pointer to the CF manager for negative charged particles
67ebd013 117
cce400da 118 AliESDEvent *fESD; //! ESD object
9477b466 119 AliAODEvent *fAOD; //! AOD object
120 AliMCEvent *fMC; //! MC event object, only used in ESD analysis
cce400da 121 AliStack *fStack; //! stack object
122
9477b466 123 const AliVVertex *fVtx; //! vertex object
34fc6450 124
5d87a047 125 UInt_t fTriggerMask; // Trigger mask to select events
126 Bool_t fIsPbPb; // kTRUE if PbPb
127 Int_t fCentClass; // Select only events from predefined centrality class
34fc6450 128
129 Int_t fTrackType; // Type of track to be used in analysis
9477b466 130 //AliESDtrackCuts options and FilterMask. The former is must be setted in AddTaskPWG4HighPTSpectra.C for ESD analysis, the latter must be setted in AddTaskPWG4HighPTSpectra.C for AOD analysis. The AliESDtrackCuts correspond with different steps in container.
1f329128 131 AliESDtrackCuts *fTrackCuts; // trackCuts applied to global tracks
327d12da 132 AliESDtrackCuts *fTrackCutsReject; // trackCuts to reject tracks (hybrid case)
9477b466 133 Int_t fFilterMask; // Filtermask specifying track cuts. See https://twiki.cern.ch/twiki/bin/view/ALICE/PWGPPAODTrackCuts for values.
2b553e6f 134
03372fd1 135 Bool_t fbSelectHIJING; //Select only particles from HIJING event
136
2b553e6f 137 Double_t fSigmaConstrainedMax; // max sigma on constrained fit
fdceab34 138
139 private:
1f329128 140 AliPWG4HighPtSpectra(const AliPWG4HighPtSpectra&);
141 AliPWG4HighPtSpectra& operator=(const AliPWG4HighPtSpectra&);
fdceab34 142
b4691ee7 143 Float_t fAvgTrials; // Average number of trials
144
fdceab34 145 // Histograms
146 //Number of events
b4691ee7 147 TList *fHistList; //! List of output histograms
1f329128 148 TH1F *fNEventAll; //! Event counter
149 TH1F *fNEventSel; //! Event counter: Selected events for analysis
2b553e6f 150 TH1F *fNEventReject; //! Book keeping of reason of rejecting events
151
152 TH1F *fh1Centrality; //! Centrality
b5cc0c6d 153
b4691ee7 154 TProfile* fh1Xsec; //! pythia cross section and trials
155 TH1F* fh1Trials; //! trials which are added
156 TH1F* fh1PtHard; //! pt hard of the event
157 TH1F* fh1PtHardTrials; //! pt hard of the event
158
a337a5a9 159 TH2F *fPtRelUncertainty1PtPrim; //! Pt vs relUncertainty1Pt for primary particles
160 TH2F *fPtRelUncertainty1PtSec; //! Pt vs relUncertainty1Pt for secondary particles
161
2b553e6f 162 ClassDef(AliPWG4HighPtSpectra,3);
fdceab34 163};
164
165#endif