Fix Coverity
[u/mrichter/AliRoot.git] / PWG4 / Base / AliAnalysisHelperJetTasks.h
CommitLineData
f3050824 1#ifndef ALIANALYSISHELPERJETTASKS_H
2#define ALIANALYSISHELPERJETTASKS_H
f3050824 3#include "TObject.h"
6f3f79de 4
f3050824 5class AliMCEvent;
db6bcb0e 6class AliAODJet;
59543510 7class AliVEvent;
519378fb 8class TString;
c74e9b54 9class TArrayI;
c0ff24c6 10class TArrayF;
f3050824 11class AliGenPythiaEventHeader;
6f3f79de 12class TVector3;
955d29ba 13class AliGenEventHeader;
f3050824 14
aeb249fb 15
16//
17// Helper Class that contains a lot of
18// usefull static functions jet matchin pythia access etc.
19//
20
f3050824 21
22class AliAnalysisHelperJetTasks : public TObject {
23 public:
24 AliAnalysisHelperJetTasks() : TObject() {;}
25 virtual ~AliAnalysisHelperJetTasks(){;}
383d44fd 26
27
3dc5a1a4 28 enum {kMaxJets = 6}; // needed for array size not to fragemnt memory on the heap by many new/delete
45a11aef 29
30
31 enum { kNone = 1<<0,
32 kBunchBunch = 1<<1,
33 kBunchEmpty = 1<<2,
34 kEmptyEmpty= 1<<3,
3493c3a9 35 kV0A=1<<4,
36 kV0C=1<<5,
37 kNoV0BG=1<<6,
38 kSPDFO=1<<7,
39 kPhysicsSelection = 1<<8,
40 kVertexIn = 1<<9,
41 kIsCosmic = 1<<10,
42 kIsPileUp = 1<<11,
43 kIsMCND=1<<12,
44 kIsMCDD=1<<13,
45 kIsMCSD=1<<14,
46 kTotalSelections = (1<<15) - 1};
59543510 47
7fa8b2da 48 enum Trigger {kAcceptAll = 0,kMB1,kMB2,kMB3,kSPDGFO,kTrigger}; //
955d29ba 49 // same as in PWG0Helper
50 enum MCProcessType { kInvalidProcess = -1, kND = 0x1, kDD = 0x2, kSD = 0x4, kOnePart = 0x8 };
51
aeb249fb 52 static AliGenPythiaEventHeader* GetPythiaEventHeader(const AliMCEvent *mcEvent);
955d29ba 53 static void PrintStack(AliMCEvent *mcEvent,Int_t iFirst = 0,Int_t iLast = 0,Int_t iMaxPrint = 10);
54 static void GetClosestJets(AliAODJet *genJets,
55 const Int_t &kGenJets,
aeb249fb 56 const AliAODJet *recJets,
955d29ba 57 const Int_t &kRecJets,
58 Int_t *iGenIndex,
59 Int_t *iRecIndex,
c74e9b54 60 Int_t iDebug = 0, Float_t maxDist = 0.3);
61
aeb249fb 62 static void GetClosestJets(const TList *genJetsList,const Int_t &kGenJets,
63 const TList *recJetsList,const Int_t &kRecJets,
c74e9b54 64 TArrayI &iGenIndex,TArrayI &iRecIndex,
65 Int_t iDebug = 0,Float_t maxDist = 0.3);
a7ac11bf 66
aeb249fb 67 static void GetJetMatching(const TList *genJetsList, const Int_t &kGenJets,
68 const TList *recJetsList, const Int_t &kRecJets,
a7ac11bf 69 TArrayI &iMatchIndex, TArrayF &fPtFraction,
739e606a 70 Int_t iDebug = 0, Float_t maxDist = 0.3, Int_t mode=1);
a7ac11bf 71
739e606a 72 static Double_t GetFractionOfJet(const AliAODJet *recJet,const AliAODJet *genJet,Int_t mode=1);
c74e9b54 73
955d29ba 74
57cd3e7c 75 static void MergeOutputDirs(const char* cFiles,const char* cPattern,const char *cOutFile,Bool_t bUpdate = false); // merges all directories containing the pattern
c6049d04 76
04152663 77 static void MergeOutput(const char* cFiles,const char* cDir = "",const char *cList = "",const char* cOutFile ="allpt.root",Bool_t bUpdate = false); // Merges the files in the input text file needs the two histograms fh1PtHard_Trials, fh1Xsec and the name of the input list
955d29ba 78 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
1aa3886d 79 static Bool_t PrintDirectorySize(const char* currFile,Int_t iDetail = -1); // print the size of the output on a given file
aeb249fb 80 static Bool_t GetEventShapes(TVector3 &n01,const TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes);
955d29ba 81
82 static MCProcessType GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
83 static MCProcessType GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
84 static Int_t GetLastProcessType() { return fgLastProcessType; }
59543510 85
86 static Bool_t Selected(Bool_t bSet = kFALSE,Bool_t bNew = kTRUE); // static function to store the state of selection from service task
2c7fd246 87 static Double_t ReactionPlane(Bool_t bSet = kFALSE,Double_t fNew = 0);
40445651 88 static Int_t GetPhiBin(Double_t phi,Int_t fNRPbins);
f2dd0695 89
90 static Bool_t IsPileUp(); // Wrapper for SelectInfo with PileUp
91 static Bool_t IsCosmic(); // Wrapper for SelectInfo with cosmic
45a11aef 92 static Bool_t TestSelectInfo(UInt_t iMask); // Wrapper for testing the SelectInfo bitmask
f4132e7d 93 static Bool_t TestEventClass(Int_t iClass); // Wrapper for testing the SelectInfo bitmask
f2dd0695 94
95 static UInt_t SelectInfo(Bool_t bSet = kFALSE,UInt_t iNew = 0); // static function to store the state bitmask of the selection from service task
f4132e7d 96 static Int_t EventClass(Bool_t bSet = kFALSE,Int_t iNew = 0); // static function to store the event class of the selection from service task
59543510 97
98 // these methods have been essentially copied from PWG0/AliTriggerAnalysis and expanded to use with AOD
99 static Bool_t IsTriggerFired(const AliVEvent* aEsd, Trigger trigger);
59543510 100
f3050824 101 private:
102
955d29ba 103 static Int_t fgLastProcessType; // stores the raw value of the last process type extracted
104
739e606a 105 ClassDef(AliAnalysisHelperJetTasks, 7)
f3050824 106};
107
108#endif // ALIANALYSISHELPERJETTASKS_H