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,char *cOutFile){
222 // Routine to merge only directories containing the pattern
224 TString outFile(cOutFile);
225 if(outFile.Length()==0)outFile = Form("%s.root",cPattern);
231 if(in1>>cFile){// only open the first file
232 fileList.Add(TFile::Open(cFile));
236 if(fileList.GetEntries()){// open the first file
237 TFile* fIn = dynamic_cast<TFile*>(fileList.At(0));
239 Printf("Input File not Found");
241 // fetch the keys for the directories
242 TList *ldKeys = fIn->GetListOfKeys();
243 for(int id = 0;id < ldKeys->GetEntries();id++){
244 // check if it is a directory
245 TKey *dKey = (TKey*)ldKeys->At(id);
246 TDirectory *dir = dynamic_cast<TDirectory*>(dKey->ReadObj());
248 TString dName(dir->GetName());
249 if(dName.Contains(cPattern)){
250 // open new file if first match
252 fOut = new TFile(outFile.Data(),"RECREATE");
254 // merge all the stuff that is in this directory
255 TList *llKeys = dir->GetListOfKeys();
258 for(int il = 0;il < llKeys->GetEntries();il++){
259 TKey *lKey = (TKey*)llKeys->At(id);
260 TObject *object = dynamic_cast<TObject*>(lKey->ReadObj());
261 // from TSeqCollections::Merge
263 // If current object is not mergeable just skip it
264 if (!object->IsA()) {
267 callEnv.InitWithPrototype(object->IsA(), "Merge", "TCollection*");
268 if (!callEnv.IsValid()) {
271 // Current object mergeable - get corresponding objects in input lists
272 tmplist = new TList();
273 for(int i = 1; i < fileList.GetEntries();i++){
274 TDirectory *fInTmp = dynamic_cast<TDirectory*>(fileList.At(i));
276 Printf("File %d not found",i);
279 TDirectory *dTmp = (TDirectory*)fInTmp->Get(dName.Data());
281 Printf("Directory %s not found",dName.Data());
284 TObject* oTmp = (TObject*)dTmp->Get(object->GetName());
286 Printf("Object %s not found",object->GetName());
291 callEnv.SetParam((Long_t) tmplist);
292 callEnv.Execute(object);
293 delete tmplist;tmplist = 0;
306 void AliAnalysisHelperJetTasks::MergeOutput(char* cFiles, char* cDir, char *cList,char *cOutFile,Bool_t bUpdate){
308 // This is used to merge the analysis-output from different
309 // data samples/pt_hard bins
310 // in case the eventweigth was set to xsection/ntrials already, this
311 // is not needed. Both methods only work in case we do not mix different
312 // pt_hard bins, and do not have overlapping bins
314 const Int_t nMaxBins = 12;
315 // LHC08q jetjet100: Mean = 1.42483e-03, RMS = 6.642e-05
316 // LHC08r jetjet50: Mean = 2.44068e-02, RMS = 1.144e-03
317 // LHC08v jetjet15-50: Mean = 2.168291 , RMS = 7.119e-02
318 // const Float_t xsection[nBins] = {2.168291,2.44068e-02};
320 Float_t xsection[nMaxBins];
321 Float_t nTrials[nMaxBins];
322 Float_t sf[nMaxBins];
323 TList *lIn[nMaxBins];
324 TDirectory *dIn[nMaxBins];
325 TFile *fIn[nMaxBins];
333 fIn[ibTotal] = TFile::Open(cFile);
335 dIn[ibTotal] = gDirectory;
338 dIn[ibTotal] = (TDirectory*)fIn[ibTotal]->Get(cDir);
341 Printf("%s:%d No directory %s found, exiting...",__FILE__,__LINE__,cDir);
346 lIn[ibTotal] = (TList*)dIn[ibTotal]->Get(cList);
347 Printf("Merging file %s %s",cFile, cDir);
349 Printf("%s:%d No list %s found, exiting...",__FILE__,__LINE__,cList);
353 TH1* hTrials = (TH1F*)lIn[ibTotal]->FindObject("fh1Trials");
355 Printf("%s:%d fh1PtHard_Trials not found in list, exiting...",__FILE__,__LINE__);
358 TProfile* hXsec = (TProfile*)lIn[ibTotal]->FindObject("fh1Xsec");
360 Printf("%s:%d fh1Xsec not found in list, exiting...",__FILE__,__LINE__);
363 xsection[ibTotal] = hXsec->GetBinContent(1);
364 nTrials[ibTotal] = hTrials->Integral();
365 sf[ibTotal] = xsection[ibTotal]/ nTrials[ibTotal];
370 Printf("%s:%d No files found for mergin, exiting",__FILE__,__LINE__);
375 if(bUpdate)fOut = new TFile(cOutFile,"UPDATE");
376 else fOut = new TFile(cOutFile,"RECREATE");
377 TDirectory *dOut = fOut->mkdir(dIn[0]->GetName());
379 TList *lOut = new TList();
380 lOut->SetName(lIn[0]->GetName());
382 // for the start scale all...
383 for(int ie = 0; ie < lIn[0]->GetEntries();++ie){
385 THnSparse *hnAdd = 0;
386 for(int ib = 0;ib < ibTotal;++ib){
387 // dynamic cast does not work with cint
388 TObject *h = lIn[ib]->At(ie);
389 if(h->InheritsFrom("TH1")){
392 h1Add = (TH1*)h1->Clone(h1->GetName());
393 h1Add->Scale(sf[ib]);
396 h1Add->Add(h1,sf[ib]);
399 else if(h->InheritsFrom("THnSparse")){
400 THnSparse *hn = (THnSparse*)h;
402 hnAdd = (THnSparse*)hn->Clone(hn->GetName());
403 hnAdd->Scale(sf[ib]);
406 hnAdd->Add(hn,sf[ib]);
412 if(h1Add)lOut->Add(h1Add);
413 else if(hnAdd)lOut->Add(hnAdd);
416 lOut->Write(lOut->GetName(),TObject::kSingleKey);
420 Bool_t AliAnalysisHelperJetTasks::PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials){
422 // get the cross section and the trails either from pyxsec.root or from pysec_hists.root
423 // This is to called in Notify and should provide the path to the AOD/ESD file
425 TString file(currFile);
429 if(file.Contains("root_archive.zip#")){
430 Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact);
431 Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
432 file.Replace(pos+1,20,"");
435 // not an archive take the basename....
436 file.ReplaceAll(gSystem->BaseName(file.Data()),"");
438 Printf("%s",file.Data());
443 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
445 // next trial fetch the histgram file
446 fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
448 // not a severe condition but inciate that we have no information
452 // find the tlist we want to be independtent of the name so use the Tkey
453 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
458 TList *list = dynamic_cast<TList*>(key->ReadObj());
463 fXsec = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
464 fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
467 } // no tree pyxsec.root
469 TTree *xtree = (TTree*)fxsec->Get("Xsection");
475 Double_t xsection = 0;
476 xtree->SetBranchAddress("xsection",&xsection);
477 xtree->SetBranchAddress("ntrials",&ntrials);
486 Bool_t AliAnalysisHelperJetTasks::PrintDirectorySize(const char* currFile){
488 TFile *fIn = TFile::Open(currFile);
490 // not a severe condition but inciate that we have no information
493 // find the tlists we want to be independtent of the name so use the Tkey
494 TList* keyList = fIn->GetListOfKeys();
495 Float_t memorySize = 0;
496 Float_t diskSize = 0;
498 for(int i = 0;i < keyList->GetEntries();i++){
499 TKey* ikey = (TKey*)keyList->At(i);
501 // TList *list = dynamic_cast<TList*>(key->ReadObj());
502 // TNamed *name = dynamic_cast<TNamed*>(ikey->ReadObj());
503 TDirectory *dir = dynamic_cast<TDirectory*>(ikey->ReadObj());
509 Printf("%03d : %60s %8d %8d ",i,dir->GetName(),ikey->GetObjlen(),ikey->GetNbytes());
510 TList * dirKeyList = dir->GetListOfKeys();
511 for(int j = 0;j<dirKeyList->GetEntries();j++){
512 TKey* jkey = (TKey*)dirKeyList->At(j);
513 TList *list = dynamic_cast<TList*>(jkey->ReadObj());
515 memorySize += (Float_t)jkey->GetObjlen()/1024./1024.;
516 diskSize += (Float_t)jkey->GetNbytes()/1024./1024.;
518 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.);
521 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.);
526 Printf("Total %5.2f MB %5.2f MB",memorySize,diskSize);
531 Bool_t AliAnalysisHelperJetTasks::Selected(Bool_t bSet,Bool_t bNew){
532 static Bool_t bSelected = kTRUE; // if service task is not run we acccpet all
539 Bool_t AliAnalysisHelperJetTasks::IsCosmic(){
540 return ((SelectInfo()&kIsCosmic)==kIsCosmic);
543 Bool_t AliAnalysisHelperJetTasks::IsPileUp(){
544 return ((SelectInfo()&kIsPileUp)==kIsPileUp);
548 Bool_t AliAnalysisHelperJetTasks::TestSelectInfo(UInt_t iMask){
549 return ((SelectInfo()&iMask)==iMask);
553 UInt_t AliAnalysisHelperJetTasks::SelectInfo(Bool_t bSet,UInt_t iNew){
554 static UInt_t iSelectInfo = 0; //
562 //___________________________________________________________________________________________________________
564 Bool_t AliAnalysisHelperJetTasks::GetEventShapes(TVector3 &n01, TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes)
567 // Event shape calculation
568 // sona.pochybova@cern.ch
570 const Int_t kTracks = 1000;
571 if(nTracks>kTracks)return kFALSE;
573 //variables for thrust calculation
574 TVector3 pTrackPerp[kTracks];
582 Double_t psum102 = 0;
583 Double_t psum103 = 0;
585 Double_t thrust[kTracks];
587 Double_t thrust02[kTracks];
589 Double_t thrust03[kTracks];
592 //Sphericity calculation variables
611 //loop for thrust calculation
614 for(Int_t i = 0; i < nTracks; i++)
616 pTrackPerp[i].SetXYZ(pTrack[i].X(), pTrack[i].Y(), 0);
617 psum2 += pTrackPerp[i].Mag();
620 //additional starting axis
622 n02 = pTrack[1].Unit();
625 n03 = pTrack[2].Unit();
628 //switches for calculating thrust for different starting points
633 //indexes for iteration of different starting points
638 //maximal number of iterations
639 // Int_t nMaxIter = 100;
641 for(Int_t k = 0; k < nTracks; k++)
645 psum.SetXYZ(0., 0., 0.);
647 for(Int_t i = 0; i < nTracks; i++)
649 psum1 += (TMath::Abs(n01.Dot(pTrackPerp[i])));
650 if (n01.Dot(pTrackPerp[i]) > 0) psum += pTrackPerp[i];
651 if (n01.Dot(pTrackPerp[i]) < 0) psum -= pTrackPerp[i];
653 thrust[l1] = psum1/psum2;
657 psum02.SetXYZ(0., 0., 0.);
659 for(Int_t i = 0; i < nTracks; i++)
661 psum102 += (TMath::Abs(n02.Dot(pTrackPerp[i])));
662 if (n02.Dot(pTrackPerp[i]) > 0) psum02 += pTrackPerp[i];
663 if (n02.Dot(pTrackPerp[i]) < 0) psum02 -= pTrackPerp[i];
665 thrust02[l2] = psum102/psum2;
669 psum03.SetXYZ(0., 0., 0.);
671 for(Int_t i = 0; i < nTracks; i++)
673 psum103 += (TMath::Abs(n03.Dot(pTrackPerp[i])));
674 if (n03.Dot(pTrackPerp[i]) > 0) psum03 += pTrackPerp[i];
675 if (n03.Dot(pTrackPerp[i]) < 0) psum03 -= pTrackPerp[i];
677 thrust03[l3] = psum103/psum2;
680 //check whether thrust value converged
681 if(TMath::Abs(th-thrust[l1]) < 10e-7){
685 if(TMath::Abs(th02-thrust02[l2]) < 10e-7){
689 if(TMath::Abs(th03-thrust03[l3]) < 10e-7){
693 //if it didn't, continue with the calculation
712 //if thrust values for all starting direction converged check if to the same value
713 if(switch2 == 0 && switch1 == 0 && switch3 == 0){
714 if(TMath::Abs(th-th02) < 10e-7 && TMath::Abs(th-th03) < 10e-7 && TMath::Abs(th02-th03) < 10e-7){
716 AliInfoGeneral(Form(" %s:%d",(char*)__FILE__,__LINE__),Form("===== THRUST VALUE FOUND AT %d :: %f\n", k, th));
719 //if they did not, reset switches
730 // Printf("========== %d +++ th :: %f=============\n", l1, th);
731 // Printf("========== %d +++ th2 :: %f=============\n", l2, th02);
732 // Printf("========== %d +++ th3 :: %f=============\n", l3, th03);
736 //if no common limitng value was found, take the maximum and take the corresponding thrust axis
737 if(switch1 == 1 && switch2 == 1 && switch3 == 1){
738 eventShapes[0] = TMath::Max(thrust[l1-1], thrust02[l2-1]);
739 eventShapes[0] = TMath::Max(eventShapes[0], thrust03[l3-1]);
740 if(TMath::Abs(eventShapes[0]-thrust[l1-1]) < 10e-7)
742 if(TMath::Abs(eventShapes[0]-thrust02[l2-1]) < 10e-7)
744 if(TMath::Abs(eventShapes[0]-thrust03[l3-1]) < 10e-7)
746 Printf("NO LIMITING VALUE FOUND :: MAXIMUM = %f\n", eventShapes[0]);
750 //other event shapes variables
752 for(Int_t j = 0; j < nTracks; j++)
754 s00 = s00 + (pTrack[j].Px()*pTrack[j].Px())/pTrack[j].Mag();
755 s01 = s01 + (pTrack[j].Px()*pTrack[j].Py())/pTrack[j].Mag();
756 s02 = s02 + (pTrack[j].Px()*pTrack[j].Pz())/pTrack[j].Mag();
758 s10 = s10 + (pTrack[j].Py()*pTrack[j].Px())/pTrack[j].Mag();
759 s11 = s11 + (pTrack[j].Py()*pTrack[j].Py())/pTrack[j].Mag();
760 s12 = s12 + (pTrack[j].Py()*pTrack[j].Pz())/pTrack[j].Mag();
762 s20 = s20 + (pTrack[j].Pz()*pTrack[j].Px())/pTrack[j].Mag();
763 s21 = s21 + (pTrack[j].Pz()*pTrack[j].Py())/pTrack[j].Mag();
764 s22 = s22 + (pTrack[j].Pz()*pTrack[j].Pz())/pTrack[j].Mag();
766 ptot += pTrack[j].Mag();
783 TMatrixDSymEigen eigen(m);
784 TVectorD eigenVal = eigen.GetEigenValues();
786 Double_t sphericity = (3/2)*(eigenVal(2)+eigenVal(1));
787 eventShapes[1] = sphericity;
789 Double_t aplanarity = (3/2)*(eigenVal(2));
790 eventShapes[2] = aplanarity;
792 c = 3*(eigenVal(0)*eigenVal(1)+eigenVal(0)*eigenVal(2)+eigenVal(1)*eigenVal(2));
800 //__________________________________________________________________________________________________________________________
801 // Trigger Decisions copid from PWG0/AliTriggerAnalysis
804 Bool_t AliAnalysisHelperJetTasks::IsTriggerFired(const AliVEvent* aEv, Trigger trigger)
806 // checks if an event has been triggered
807 // no usage of ofline trigger here yet
809 // here we do a dirty hack to take also into account the
810 // missing trigger bits and Bunch crossing paatern for real data
813 if(aEv->InheritsFrom("AliESDEvent")){
814 const AliESDEvent *esd = (AliESDEvent*)aEv;
824 if(esd->GetFiredTriggerClasses().Contains("CINT1B-"))return kTRUE;
825 // does the same but without or'ed V0s
826 if(esd->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
827 if(esd->GetFiredTriggerClasses().Contains("CINT6B-"))return kTRUE;
828 // this is for simulated data
829 if(esd->GetFiredTriggerClasses().Contains("MB1"))return kTRUE;
834 if(esd->GetFiredTriggerClasses().Contains("MB2"))return kTRUE;
839 if(esd->GetFiredTriggerClasses().Contains("MB3"))return kTRUE;
844 if(esd->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
845 if(esd->GetFiredTriggerClasses().Contains("CINT6B-"))return kTRUE;
846 if(esd->GetFiredTriggerClasses().Contains("GFO"))return kTRUE;
851 Printf("IsEventTriggered: ERROR: Trigger type %d not implemented in this method", (Int_t) trigger);
856 else if(aEv->InheritsFrom("AliAODEvent")){
857 const AliAODEvent *aod = (AliAODEvent*)aEv;
867 if(aod->GetFiredTriggerClasses().Contains("CINT1B"))return kTRUE;
868 // does the same but without or'ed V0s
869 if(aod->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
871 if(aod->GetFiredTriggerClasses().Contains("MB1"))return kTRUE;
876 if(aod->GetFiredTriggerClasses().Contains("MB2"))return kTRUE;
881 if(aod->GetFiredTriggerClasses().Contains("MB3"))return kTRUE;
886 if(aod->GetFiredTriggerClasses().Contains("CSMBB"))return kTRUE;
887 if(aod->GetFiredTriggerClasses().Contains("GFO"))return kTRUE;
892 Printf("IsEventTriggered: ERROR: Trigger type %d not implemented in this method", (Int_t) trigger);
901 AliAnalysisHelperJetTasks::MCProcessType AliAnalysisHelperJetTasks::GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug) {
903 AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader);
905 if (!pythiaGenHeader) {
906 // printf(" AliAnalysisHelperJetTasks::GetProcessType : Unknown gen Header type). \n");
907 return kInvalidProcess;
911 Int_t pythiaType = pythiaGenHeader->ProcessType();
912 fgLastProcessType = pythiaType;
913 MCProcessType globalType = kInvalidProcess;
917 printf(" AliAnalysisHelperJetTasks::GetProcessType : Pythia process type found: %d \n",pythiaType);
921 if(pythiaType==92||pythiaType==93){
924 else if(pythiaType==94){
927 //else if(pythiaType != 91){ // also exclude elastic to be sure... CKB??
935 AliAnalysisHelperJetTasks::MCProcessType AliAnalysisHelperJetTasks::GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug) {
937 // get the process type of the event.
940 // can only read pythia headers, either directly or from cocktalil header
941 AliGenDPMjetEventHeader* dpmJetGenHeader = dynamic_cast<AliGenDPMjetEventHeader*>(aHeader);
943 if (!dpmJetGenHeader) {
944 printf(" AliAnalysisHelperJetTasks::GetDPMjetProcessType : Unknown header type (not DPMjet or). \n");
945 return kInvalidProcess;
948 Int_t dpmJetType = dpmJetGenHeader->ProcessType();
949 fgLastProcessType = dpmJetType;
950 MCProcessType globalType = kInvalidProcess;
954 printf(" AliAnalysisHelperJetTasks::GetDPMJetProcessType : DPMJet process type found: %d \n",dpmJetType);
958 if (dpmJetType == 1 || dpmJetType == 4) { // explicitly inelastic plus central diffraction
961 else if (dpmJetType==5 || dpmJetType==6) {
964 else if (dpmJetType==7) {