3 #include "TDirectory.h"
10 #include "TSeqCollection.h"
11 #include "TMethodCall.h"
14 #include "AliMCEvent.h"
16 #include "AliESDEvent.h"
17 #include "AliAODJet.h"
18 #include "AliAODEvent.h"
20 #include "AliGenEventHeader.h"
21 #include "AliGenCocktailEventHeader.h"
22 #include <AliGenDPMjetEventHeader.h>
23 #include "AliGenPythiaEventHeader.h"
26 #include "AliAnalysisHelperJetTasks.h"
27 #include "TMatrixDSym.h"
28 #include "TMatrixDSymEigen.h"
31 ClassImp(AliAnalysisHelperJetTasks)
33 Int_t AliAnalysisHelperJetTasks::fgLastProcessType = -1;
36 AliGenPythiaEventHeader* AliAnalysisHelperJetTasks::GetPythiaEventHeader(AliMCEvent *mcEvent){
39 AliGenEventHeader* genHeader = mcEvent->GenEventHeader();
40 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
43 AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(genHeader);
45 if (!genCocktailHeader) {
46 AliWarningGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),"Unknown header type (not Pythia or Cocktail)");
47 // AliWarning(Form("%s %d: Unknown header type (not Pythia or Cocktail)",(char*)__FILE__,__LINE__));
50 TList* headerList = genCocktailHeader->GetHeaders();
51 for (Int_t i=0; i<headerList->GetEntries(); i++) {
52 pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
57 AliWarningGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),"Pythia event header not found");
61 return pythiaGenHeader;
66 void AliAnalysisHelperJetTasks::PrintStack(AliMCEvent *mcEvent,Int_t iFirst,Int_t iLast,Int_t iMaxPrint){
68 AliStack *stack = mcEvent->Stack();
70 Printf("%s%d No Stack available",(char*)__FILE__,__LINE__);
74 static Int_t iCount = 0;
75 if(iCount>iMaxPrint)return;
76 Int_t nStack = stack->GetNtrack();
77 if(iLast == 0)iLast = nStack;
78 else if(iLast > nStack)iLast = nStack;
81 Printf("####################################################################");
82 for(Int_t np = iFirst;np<iLast;++np){
83 TParticle *p = stack->Particle(np);
84 Printf("Nr.%d --- Status %d ---- Mother1 %d Mother2 %d Daughter1 %d Daughter2 %d ",
85 np,p->GetStatusCode(),p->GetMother(0),p->GetMother(1),p->GetDaughter(0),p->GetDaughter(1));
86 Printf("Eta %3.3f Phi %3.3f ",p->Eta(),p->Phi());
88 Printf("---------------------------------------");
96 void AliAnalysisHelperJetTasks::GetClosestJets(AliAODJet *genJets,const Int_t &kGenJets,
97 AliAODJet *recJets,const Int_t &kRecJets,
98 Int_t *iGenIndex,Int_t *iRecIndex,
99 Int_t iDebug,Float_t maxDist){
102 // Relate the two input jet Arrays
106 // The association has to be unique
107 // So check in two directions
108 // find the closest rec to a gen
109 // and check if there is no other rec which is closer
110 // Caveat: Close low energy/split jets may disturb this correlation
113 // Idea: search in two directions generated e.g (a--e) and rec (1--3)
114 // Fill a matrix with Flags (1 for closest rec jet, 2 for closest rec jet
115 // in the end we have something like this
129 // Only entries with "3" match from both sides
131 // In case we have more jets than kmaxjets only the
132 // first kmaxjets are searched
134 // use kMaxJets for a test not to fragemnt the memory...
136 for(int i = 0;i < kGenJets;++i)iGenIndex[i] = -1;
137 for(int j = 0;j < kRecJets;++j)iRecIndex[j] = -1;
143 const Int_t nGenJets = TMath::Min(kMaxJets,kGenJets);
144 const Int_t nRecJets = TMath::Min(kMaxJets,kRecJets);
146 if(nRecJets==0||nGenJets==0)return;
148 // UShort_t *iFlag = new UShort_t[nGenJets*nRecJets];
149 UShort_t iFlag[kMaxJets*kMaxJets];
150 for(int i = 0;i < nGenJets;++i){
151 for(int j = 0;j < nRecJets;++j){
152 iFlag[i*nGenJets+j] = 0;
158 // find the closest distance to the generated
159 for(int ig = 0;ig<nGenJets;++ig){
160 Float_t dist = maxDist;
161 if(iDebug>1)Printf("Gen (%d) p_T %3.3f eta %3.3f ph %3.3f ",ig,genJets[ig].Pt(),genJets[ig].Eta(),genJets[ig].Phi());
162 for(int ir = 0;ir<nRecJets;++ir){
163 Double_t dR = genJets[ig].DeltaR(&recJets[ir]);
164 if(iDebug>1)Printf("Rec (%d) p_T %3.3f eta %3.3f ph %3.3f ",ir,recJets[ir].Pt(),recJets[ir].Eta(),recJets[ir].Phi());
165 if(iDebug>1)Printf("Distance (%d)--(%d) %3.3f ",ig,ir,dR);
171 if(iRecIndex[ig]>=0)iFlag[ig*nGenJets+iRecIndex[ig]]+=1;
176 for(int ir = 0;ir<nRecJets;++ir){
177 Float_t dist = maxDist;
178 for(int ig = 0;ig<nGenJets;++ig){
179 Double_t dR = genJets[ig].DeltaR(&recJets[ir]);
185 if(iGenIndex[ir]>=0)iFlag[iGenIndex[ir]*nGenJets+ir]+=2;
190 // check for "true" correlations
192 if(iDebug>1)Printf(">>>>>> Matrix");
194 for(int ig = 0;ig<nGenJets;++ig){
195 for(int ir = 0;ir<nRecJets;++ir){
197 if(iDebug>1)printf("Flag[%d][%d] %d ",ig,ir,iFlag[ig*nGenJets+ir]);
200 // we have a uniqie correlation
201 if(iFlag[ig*nGenJets+ir]==3){
207 // we just take the correlation from on side
208 if((iFlag[ig*nGenJets+ir]&2)==2){
211 if((iFlag[ig*nGenJets+ir]&1)==1){
216 if(iDebug>1)printf("\n");
221 void AliAnalysisHelperJetTasks::MergeOutputDirs(const char* cFiles,const char* cPattern,const char *cOutFile,Bool_t bUpdate){
222 // Routine to merge only directories containing the pattern
224 TString outFile(cOutFile);
225 if(outFile.Length()==0)outFile = Form("%s.root",cPattern);
231 while(in1>>cFile){// only open the first file
232 Printf("Adding %s",cFile);
233 TFile *f1 = TFile::Open(cFile);
238 if(fileList.GetEntries()){// open the first file
239 TFile* fIn = dynamic_cast<TFile*>(fileList.At(0));
241 Printf("Input File not Found");
243 // fetch the keys for the directories
244 TList *ldKeys = fIn->GetListOfKeys();
245 for(int id = 0;id < ldKeys->GetEntries();id++){
246 // check if it is a directory
247 TKey *dKey = (TKey*)ldKeys->At(id);
248 TDirectory *dir = dynamic_cast<TDirectory*>(dKey->ReadObj());
250 TString dName(dir->GetName());
251 if(dName.Contains(cPattern)){
252 // open new file if first match
254 if(bUpdate)fOut = new TFile(outFile.Data(),"UPDATE");
255 else fOut = new TFile(outFile.Data(),"RECREATE");
257 // merge all the stuff that is in this directory
258 TList *llKeys = dir->GetListOfKeys();
263 TDirectory *dOut = fOut->mkdir(dir->GetName());
265 for(int il = 0;il < llKeys->GetEntries();il++){
266 TKey *lKey = (TKey*)llKeys->At(il);
267 TObject *object = dynamic_cast<TObject*>(lKey->ReadObj());
268 // from TSeqCollections::Merge
270 // If current object is not mergeable just skip it
271 if (!object->IsA()) {
274 callEnv.InitWithPrototype(object->IsA(), "Merge", "TCollection*");
275 if (!callEnv.IsValid()) {
278 // Current object mergeable - get corresponding objects in input lists
279 tmplist = new TList();
280 for(int i = 1; i < fileList.GetEntries();i++){
281 TDirectory *fInTmp = dynamic_cast<TDirectory*>(fileList.At(i));
283 Printf("File %d not found",i);
286 TDirectory *dTmp = (TDirectory*)fInTmp->Get(dName.Data());
288 Printf("Directory %s not found",dName.Data());
291 TObject* oTmp = (TObject*)dTmp->Get(object->GetName());
293 Printf("Object %s not found",object->GetName());
298 callEnv.SetParam((Long_t) tmplist);
299 callEnv.Execute(object);
300 delete tmplist;tmplist = 0;
302 object->Write(object->GetName(),TObject::kSingleKey);
313 void AliAnalysisHelperJetTasks::MergeOutput(char* cFiles, char* cDir, char *cList,char *cOutFile,Bool_t bUpdate){
315 // This is used to merge the analysis-output from different
316 // data samples/pt_hard bins
317 // in case the eventweigth was set to xsection/ntrials already, this
318 // is not needed. Both methods only work in case we do not mix different
319 // pt_hard bins, and do not have overlapping bins
321 const Int_t nMaxBins = 12;
322 // LHC08q jetjet100: Mean = 1.42483e-03, RMS = 6.642e-05
323 // LHC08r jetjet50: Mean = 2.44068e-02, RMS = 1.144e-03
324 // LHC08v jetjet15-50: Mean = 2.168291 , RMS = 7.119e-02
325 // const Float_t xsection[nBins] = {2.168291,2.44068e-02};
327 Float_t xsection[nMaxBins];
328 Float_t nTrials[nMaxBins];
329 Float_t sf[nMaxBins];
330 TList *lIn[nMaxBins];
331 TDirectory *dIn[nMaxBins];
332 TFile *fIn[nMaxBins];
340 fIn[ibTotal] = TFile::Open(cFile);
342 dIn[ibTotal] = gDirectory;
345 dIn[ibTotal] = (TDirectory*)fIn[ibTotal]->Get(cDir);
348 Printf("%s:%d No directory %s found, exiting...",__FILE__,__LINE__,cDir);
353 lIn[ibTotal] = (TList*)dIn[ibTotal]->Get(cList);
354 Printf("Merging file %s %s",cFile, cDir);
356 Printf("%s:%d No list %s found, exiting...",__FILE__,__LINE__,cList);
360 TH1* hTrials = (TH1F*)lIn[ibTotal]->FindObject("fh1Trials");
362 Printf("%s:%d fh1PtHard_Trials not found in list, exiting...",__FILE__,__LINE__);
365 TProfile* hXsec = (TProfile*)lIn[ibTotal]->FindObject("fh1Xsec");
367 Printf("%s:%d fh1Xsec not found in list, exiting...",__FILE__,__LINE__);
370 xsection[ibTotal] = hXsec->GetBinContent(1);
371 nTrials[ibTotal] = hTrials->Integral();
372 sf[ibTotal] = xsection[ibTotal]/ nTrials[ibTotal];
377 Printf("%s:%d No files found for mergin, exiting",__FILE__,__LINE__);
382 if(bUpdate)fOut = new TFile(cOutFile,"UPDATE");
383 else fOut = new TFile(cOutFile,"RECREATE");
384 TDirectory *dOut = fOut->mkdir(dIn[0]->GetName());
386 TList *lOut = new TList();
387 lOut->SetName(lIn[0]->GetName());
389 // for the start scale all...
390 for(int ie = 0; ie < lIn[0]->GetEntries();++ie){
392 THnSparse *hnAdd = 0;
393 for(int ib = 0;ib < ibTotal;++ib){
394 // dynamic cast does not work with cint
395 TObject *h = lIn[ib]->At(ie);
396 if(h->InheritsFrom("TH1")){
399 h1Add = (TH1*)h1->Clone(h1->GetName());
400 h1Add->Scale(sf[ib]);
403 h1Add->Add(h1,sf[ib]);
406 else if(h->InheritsFrom("THnSparse")){
407 THnSparse *hn = (THnSparse*)h;
409 hnAdd = (THnSparse*)hn->Clone(hn->GetName());
410 hnAdd->Scale(sf[ib]);
413 hnAdd->Add(hn,sf[ib]);
419 if(h1Add)lOut->Add(h1Add);
420 else if(hnAdd)lOut->Add(hnAdd);
423 lOut->Write(lOut->GetName(),TObject::kSingleKey);
427 Bool_t AliAnalysisHelperJetTasks::PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials){
429 // get the cross section and the trails either from pyxsec.root or from pysec_hists.root
430 // This is to called in Notify and should provide the path to the AOD/ESD file
432 TString file(currFile);
436 if(file.Contains("root_archive.zip#")){
437 Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact);
438 Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
439 file.Replace(pos+1,20,"");
442 // not an archive take the basename....
443 file.ReplaceAll(gSystem->BaseName(file.Data()),"");
445 Printf("%s",file.Data());
450 TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")); // problem that we cannot really test the existance of a file in a archive so we have to lvie with open error message from root
452 // next trial fetch the histgram file
453 fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
455 // not a severe condition but inciate that we have no information
459 // find the tlist we want to be independtent of the name so use the Tkey
460 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
465 TList *list = dynamic_cast<TList*>(key->ReadObj());
470 fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
471 fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
474 } // no tree pyxsec.root
476 TTree *xtree = (TTree*)fxsec->Get("Xsection");
482 Double_t xsection = 0;
483 xtree->SetBranchAddress("xsection",&xsection);
484 xtree->SetBranchAddress("ntrials",&ntrials);
493 Bool_t AliAnalysisHelperJetTasks::PrintDirectorySize(const char* currFile){
495 TFile *fIn = TFile::Open(currFile);
497 // not a severe condition but inciate that we have no information
500 // find the tlists we want to be independtent of the name so use the Tkey
501 TList* keyList = fIn->GetListOfKeys();
502 Float_t memorySize = 0;
503 Float_t diskSize = 0;
505 for(int i = 0;i < keyList->GetEntries();i++){
506 TKey* ikey = (TKey*)keyList->At(i);
508 // TList *list = dynamic_cast<TList*>(key->ReadObj());
509 // TNamed *name = dynamic_cast<TNamed*>(ikey->ReadObj());
510 TDirectory *dir = dynamic_cast<TDirectory*>(ikey->ReadObj());
516 Printf("%03d : %60s %8d %8d ",i,dir->GetName(),ikey->GetObjlen(),ikey->GetNbytes());
517 TList * dirKeyList = dir->GetListOfKeys();
518 for(int j = 0;j<dirKeyList->GetEntries();j++){
519 TKey* jkey = (TKey*)dirKeyList->At(j);
520 TList *list = dynamic_cast<TList*>(jkey->ReadObj());
522 memorySize += (Float_t)jkey->GetObjlen()/1024./1024.;
523 diskSize += (Float_t)jkey->GetNbytes()/1024./1024.;
525 Printf("%03d/%03d: %60s %5.2f MB %5.2f MB",i,j,list->GetName(),(Float_t)jkey->GetObjlen()/1024./1024.,(Float_t)jkey->GetNbytes()/1024./1024.);
528 Printf("%03d/%03d: %60s %5.2f MB %5.2f MB",i,j,jkey->GetName(),(Float_t)jkey->GetObjlen()/1024./1024.,(Float_t)jkey->GetNbytes()/1024./1024.);
533 Printf("Total %5.2f MB %5.2f MB",memorySize,diskSize);
538 Bool_t AliAnalysisHelperJetTasks::Selected(Bool_t bSet,Bool_t bNew){
539 static Bool_t bSelected = kTRUE; // if service task is not run we acccpet all
546 Bool_t AliAnalysisHelperJetTasks::IsCosmic(){
547 return ((SelectInfo()&kIsCosmic)==kIsCosmic);
550 Bool_t AliAnalysisHelperJetTasks::IsPileUp(){
551 return ((SelectInfo()&kIsPileUp)==kIsPileUp);
555 Bool_t AliAnalysisHelperJetTasks::TestSelectInfo(UInt_t iMask){
556 return ((SelectInfo()&iMask)==iMask);
560 Bool_t AliAnalysisHelperJetTasks::TestEventClass(Int_t iMask){
561 if(iMask==0)return kTRUE;
562 return (EventClass()==iMask);
566 UInt_t AliAnalysisHelperJetTasks::SelectInfo(Bool_t bSet,UInt_t iNew){
567 static UInt_t iSelectInfo = 0; //
575 Int_t AliAnalysisHelperJetTasks::EventClass(Bool_t bSet,Int_t iNew){
576 static Int_t iEventClass = 0; //
586 //___________________________________________________________________________________________________________
588 Bool_t AliAnalysisHelperJetTasks::GetEventShapes(TVector3 &n01, TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes)
591 // Event shape calculation
592 // sona.pochybova@cern.ch
594 const Int_t kTracks = 1000;
595 if(nTracks>kTracks)return kFALSE;
597 //variables for thrust calculation
598 TVector3 pTrackPerp[kTracks];
606 Double_t psum102 = 0;
607 Double_t psum103 = 0;
609 Double_t thrust[kTracks];
611 Double_t thrust02[kTracks];
613 Double_t thrust03[kTracks];
616 //Sphericity calculation variables
635 //loop for thrust calculation
638 for(Int_t i = 0; i < nTracks; i++)
640 pTrackPerp[i].SetXYZ(pTrack[i].X(), pTrack[i].Y(), 0);
641 psum2 += pTrackPerp[i].Mag();
644 //additional starting axis
646 n02 = pTrack[1].Unit();
649 n03 = pTrack[2].Unit();
652 //switches for calculating thrust for different starting points
657 //indexes for iteration of different starting points
662 //maximal number of iterations
663 // Int_t nMaxIter = 100;
665 for(Int_t k = 0; k < nTracks; k++)
669 psum.SetXYZ(0., 0., 0.);
671 for(Int_t i = 0; i < nTracks; i++)
673 psum1 += (TMath::Abs(n01.Dot(pTrackPerp[i])));
674 if (n01.Dot(pTrackPerp[i]) > 0) psum += pTrackPerp[i];
675 if (n01.Dot(pTrackPerp[i]) < 0) psum -= pTrackPerp[i];
677 thrust[l1] = psum1/psum2;
681 psum02.SetXYZ(0., 0., 0.);
683 for(Int_t i = 0; i < nTracks; i++)
685 psum102 += (TMath::Abs(n02.Dot(pTrackPerp[i])));
686 if (n02.Dot(pTrackPerp[i]) > 0) psum02 += pTrackPerp[i];
687 if (n02.Dot(pTrackPerp[i]) < 0) psum02 -= pTrackPerp[i];
689 thrust02[l2] = psum102/psum2;
693 psum03.SetXYZ(0., 0., 0.);
695 for(Int_t i = 0; i < nTracks; i++)
697 psum103 += (TMath::Abs(n03.Dot(pTrackPerp[i])));
698 if (n03.Dot(pTrackPerp[i]) > 0) psum03 += pTrackPerp[i];
699 if (n03.Dot(pTrackPerp[i]) < 0) psum03 -= pTrackPerp[i];
701 thrust03[l3] = psum103/psum2;
704 //check whether thrust value converged
705 if(TMath::Abs(th-thrust[l1]) < 10e-7){
709 if(TMath::Abs(th02-thrust02[l2]) < 10e-7){
713 if(TMath::Abs(th03-thrust03[l3]) < 10e-7){
717 //if it didn't, continue with the calculation
736 //if thrust values for all starting direction converged check if to the same value
737 if(switch2 == 0 && switch1 == 0 && switch3 == 0){
738 if(TMath::Abs(th-th02) < 10e-7 && TMath::Abs(th-th03) < 10e-7 && TMath::Abs(th02-th03) < 10e-7){
740 AliInfoGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),Form("===== THRUST VALUE FOUND AT %d :: %f\n", k, th));
743 //if they did not, reset switches
754 // Printf("========== %d +++ th :: %f=============\n", l1, th);
755 // Printf("========== %d +++ th2 :: %f=============\n", l2, th02);
756 // Printf("========== %d +++ th3 :: %f=============\n", l3, th03);
760 //if no common limitng value was found, take the maximum and take the corresponding thrust axis
761 if(switch1 == 1 && switch2 == 1 && switch3 == 1){
762 eventShapes[0] = TMath::Max(thrust[l1-1], thrust02[l2-1]);
763 eventShapes[0] = TMath::Max(eventShapes[0], thrust03[l3-1]);
764 if(TMath::Abs(eventShapes[0]-thrust[l1-1]) < 10e-7)
766 if(TMath::Abs(eventShapes[0]-thrust02[l2-1]) < 10e-7)
768 if(TMath::Abs(eventShapes[0]-thrust03[l3-1]) < 10e-7)
770 Printf("NO LIMITING VALUE FOUND :: MAXIMUM = %f\n", eventShapes[0]);
774 //other event shapes variables
776 for(Int_t j = 0; j < nTracks; j++)
778 s00 = s00 + (pTrack[j].Px()*pTrack[j].Px())/pTrack[j].Mag();
779 s01 = s01 + (pTrack[j].Px()*pTrack[j].Py())/pTrack[j].Mag();
780 s02 = s02 + (pTrack[j].Px()*pTrack[j].Pz())/pTrack[j].Mag();
782 s10 = s10 + (pTrack[j].Py()*pTrack[j].Px())/pTrack[j].Mag();
783 s11 = s11 + (pTrack[j].Py()*pTrack[j].Py())/pTrack[j].Mag();
784 s12 = s12 + (pTrack[j].Py()*pTrack[j].Pz())/pTrack[j].Mag();
786 s20 = s20 + (pTrack[j].Pz()*pTrack[j].Px())/pTrack[j].Mag();
787 s21 = s21 + (pTrack[j].Pz()*pTrack[j].Py())/pTrack[j].Mag();
788 s22 = s22 + (pTrack[j].Pz()*pTrack[j].Pz())/pTrack[j].Mag();
790 ptot += pTrack[j].Mag();
807 TMatrixDSymEigen eigen(m);
808 TVectorD eigenVal = eigen.GetEigenValues();
810 Double_t sphericity = (3/2)*(eigenVal(2)+eigenVal(1));
811 eventShapes[1] = sphericity;
813 Double_t aplanarity = (3/2)*(eigenVal(2));
814 eventShapes[2] = aplanarity;
816 c = 3*(eigenVal(0)*eigenVal(1)+eigenVal(0)*eigenVal(2)+eigenVal(1)*eigenVal(2));
824 //__________________________________________________________________________________________________________________________
825 // Trigger Decisions copid from PWG0/AliTriggerAnalysis
828 Bool_t AliAnalysisHelperJetTasks::IsTriggerFired(const AliVEvent* aEv, Trigger trigger)
830 // checks if an event has been triggered
831 // no usage of ofline trigger here yet
833 // here we do a dirty hack to take also into account the
834 // missing trigger bits and Bunch crossing paatern for real data
837 if(aEv->InheritsFrom("AliESDEvent")){
838 const AliESDEvent *esd = (AliESDEvent*)aEv;
848 if(esd->GetFiredTriggerClasses().Contains("CINT1B-"))return kTRUE;
849 // does the same but without or'ed V0s
850 if(esd->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
851 if(esd->GetFiredTriggerClasses().Contains("CINT6B-"))return kTRUE;
852 // this is for simulated data
853 if(esd->GetFiredTriggerClasses().Contains("MB1"))return kTRUE;
858 if(esd->GetFiredTriggerClasses().Contains("MB2"))return kTRUE;
863 if(esd->GetFiredTriggerClasses().Contains("MB3"))return kTRUE;
868 if(esd->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
869 if(esd->GetFiredTriggerClasses().Contains("CINT6B-"))return kTRUE;
870 if(esd->GetFiredTriggerClasses().Contains("GFO"))return kTRUE;
875 Printf("IsEventTriggered: ERROR: Trigger type %d not implemented in this method", (Int_t) trigger);
880 else if(aEv->InheritsFrom("AliAODEvent")){
881 const AliAODEvent *aod = (AliAODEvent*)aEv;
891 if(aod->GetFiredTriggerClasses().Contains("CINT1B"))return kTRUE;
892 // does the same but without or'ed V0s
893 if(aod->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
895 if(aod->GetFiredTriggerClasses().Contains("MB1"))return kTRUE;
900 if(aod->GetFiredTriggerClasses().Contains("MB2"))return kTRUE;
905 if(aod->GetFiredTriggerClasses().Contains("MB3"))return kTRUE;
910 if(aod->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
911 if(aod->GetFiredTriggerClasses().Contains("GFO"))return kTRUE;
916 Printf("IsEventTriggered: ERROR: Trigger type %d not implemented in this method", (Int_t) trigger);
925 AliAnalysisHelperJetTasks::MCProcessType AliAnalysisHelperJetTasks::GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug) {
927 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader);
929 if (!pythiaGenHeader) {
930 // printf(" AliAnalysisHelperJetTasks::GetProcessType : Unknown gen Header type). \n");
931 return kInvalidProcess;
935 Int_t pythiaType = pythiaGenHeader->ProcessType();
936 fgLastProcessType = pythiaType;
937 MCProcessType globalType = kInvalidProcess;
941 printf(" AliAnalysisHelperJetTasks::GetProcessType : Pythia process type found: %d \n",pythiaType);
945 if(pythiaType==92||pythiaType==93){
948 else if(pythiaType==94){
951 //else if(pythiaType != 91){ // also exclude elastic to be sure... CKB??
959 AliAnalysisHelperJetTasks::MCProcessType AliAnalysisHelperJetTasks::GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug) {
961 // get the process type of the event.
964 // can only read pythia headers, either directly or from cocktalil header
965 AliGenDPMjetEventHeader* dpmJetGenHeader = dynamic_cast<AliGenDPMjetEventHeader*>(aHeader);
967 if (!dpmJetGenHeader) {
968 printf(" AliAnalysisHelperJetTasks::GetDPMjetProcessType : Unknown header type (not DPMjet or). \n");
969 return kInvalidProcess;
972 Int_t dpmJetType = dpmJetGenHeader->ProcessType();
973 fgLastProcessType = dpmJetType;
974 MCProcessType globalType = kInvalidProcess;
978 printf(" AliAnalysisHelperJetTasks::GetDPMJetProcessType : DPMJet process type found: %d \n",dpmJetType);
982 if (dpmJetType == 1 || dpmJetType == 4) { // explicitly inelastic plus central diffraction
985 else if (dpmJetType==5 || dpmJetType==6) {
988 else if (dpmJetType==7) {