1 #ifndef ALIANALYSISHELPERJETTASKS_H
2 #define ALIANALYSISHELPERJETTASKS_H
11 class AliGenPythiaEventHeader;
13 class AliGenEventHeader;
17 // Helper Class that contains a lot of
18 // usefull static functions jet matchin pythia access etc.
22 class AliAnalysisHelperJetTasks : public TObject {
24 AliAnalysisHelperJetTasks() : TObject() {;}
25 virtual ~AliAnalysisHelperJetTasks(){;}
28 enum {kMaxJets = 6}; // needed for array size not to fragemnt memory on the heap by many new/delete
39 kPhysicsSelection = 1<<8,
46 kTotalSelections = (1<<15) - 1};
48 enum Trigger {kAcceptAll = 0,kMB1,kMB2,kMB3,kSPDGFO,kTrigger}; //
49 // same as in PWG0Helper
50 enum MCProcessType { kInvalidProcess = -1, kND = 0x1, kDD = 0x2, kSD = 0x4, kOnePart = 0x8 };
52 static AliGenPythiaEventHeader* GetPythiaEventHeader(const AliMCEvent *mcEvent);
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,
56 const AliAODJet *recJets,
57 const Int_t &kRecJets,
60 Int_t iDebug = 0, Float_t maxDist = 0.3);
62 static void GetClosestJets(const TList *genJetsList,const Int_t &kGenJets,
63 const TList *recJetsList,const Int_t &kRecJets,
64 TArrayI &iGenIndex,TArrayI &iRecIndex,
65 Int_t iDebug = 0,Float_t maxDist = 0.3);
67 static void GetJetMatching(const TList *genJetsList, const Int_t &kGenJets,
68 const TList *recJetsList, const Int_t &kRecJets,
69 TArrayI &iMatchIndex, TArrayF &fPtFraction,
70 Int_t iDebug = 0, Float_t maxDist = 0.3, Int_t mode=1);
72 static Double_t GetFractionOfJet(const AliAODJet *recJet,const AliAODJet *genJet,Int_t mode=1);
75 static void MergeOutputDirs(const char* cFiles,const char* cPattern,const char *cOutFile,Bool_t bUpdate = false); // merges all directories containing the pattern
77 static void MergeOutput(char* cFiles, char* cDir = "",char *cList = "",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
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
79 static Bool_t PrintDirectorySize(const char* currFile,Int_t iDetail = -1); // print the size of the output on a given file
80 static Bool_t GetEventShapes(TVector3 &n01,const TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes);
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; }
86 static Bool_t Selected(Bool_t bSet = kFALSE,Bool_t bNew = kTRUE); // static function to store the state of selection from service task
87 static Double_t ReactionPlane(Bool_t bSet = kFALSE,Double_t fNew = 0);
88 static Int_t GetPhiBin(Double_t phi,Int_t fNRPbins);
90 static Bool_t IsPileUp(); // Wrapper for SelectInfo with PileUp
91 static Bool_t IsCosmic(); // Wrapper for SelectInfo with cosmic
92 static Bool_t TestSelectInfo(UInt_t iMask); // Wrapper for testing the SelectInfo bitmask
93 static Bool_t TestEventClass(Int_t iClass); // Wrapper for testing the SelectInfo bitmask
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
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
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);
103 static Int_t fgLastProcessType; // stores the raw value of the last process type extracted
105 ClassDef(AliAnalysisHelperJetTasks, 7)
108 #endif // ALIANALYSISHELPERJETTASKS_H