25 #include "AliAODTrack.h" 26 #include "AliESDtrack.h" 27 #include "AliAnalysisManager.h" 28 #include "AliInputEventHandler.h" 29 #include "AliMCEventHandler.h" 30 #include "AliAODHandler.h" 34 #include "TObjString.h" 35 #include "AliMCEvent.h" 36 #include "AliAODEvent.h" 37 #include "AliESDEvent.h" 38 #include "AliCentrality.h" 39 #include "AliMultSelection.h" 43 #include "AliGenCocktailEventHeader.h" 44 #include "AliGenDPMjetEventHeader.h" 45 #include "AliGenPythiaEventHeader.h" 46 #include "AliGenHijingEventHeader.h" 47 #include "AliTriggerAnalysis.h" 49 #include "AliVCaloCells.h" 50 #include "AliAODMCParticle.h" 51 #include "AliAODMCHeader.h" 52 #include "AliEMCALTriggerPatchInfo.h" 67 "SelectSpecialTrigger",
68 "SelectSpecialSubTriggerClass",
77 AliAnalysisCuts(name,title),
80 fDoLightOutput(kFALSE),
83 fDetectorCentrality(0),
84 fModCentralityClass(0),
85 fEnableVertexCut(kTRUE),
89 fMultiplicityMethod(0),
91 fSpecialSubTrigger(0),
92 fRemovePileUp(kFALSE),
93 fPastFutureRejectionLow(0),
94 fPastFutureRejectionHigh(0),
95 fDoPileUpRejectV0MTPCout(0),
96 fFPileUpRejectV0MTPCout(0),
97 fRejectExtraSignals(0),
98 fOfflineTriggerMask(0),
103 fNotRejectedStart(NULL),
104 fNotRejectedEnd(NULL),
105 fGeneratorNames(NULL),
106 fPeriodEnum(kNoPeriod),
113 fDoCentralityFlat(0),
114 fPathWeightsFlatCent(
""),
115 fNameHistoNotFlatCentrality(
""),
116 fDoReweightHistoMCPi0(kFALSE),
117 fDoReweightHistoMCEta(kFALSE),
118 fDoReweightHistoMCK0s(kFALSE),
119 fPathTrFReweighting(
""),
120 fNameHistoReweightingPi0(
""),
121 fNameHistoReweightingEta(
""),
122 fNameHistoReweightingK0s(
""),
126 fHistoEventCuts(NULL),
127 fHistoPastFutureBits(NULL),
129 hCentralityNotFlat(NULL),
132 hNPileupVertices(NULL),
133 hPileupVertexToPrimZ(NULL),
134 hPileupVertexToPrimZSPDPileup(NULL),
135 hPileupVertexToPrimZTrackletvsHits(NULL),
136 hEventPlaneAngle(NULL),
139 hTriggerClassSelected(NULL),
140 hTriggerClassesCorrelated(NULL),
141 hReweightMCHistPi0(NULL),
142 hReweightMCHistEta(NULL),
143 hReweightMCHistK0s(NULL),
147 fAddedSignalPDGCode(0),
149 fTriggerSelectedManually(kFALSE),
150 fSpecialTriggerName(
""),
151 fSpecialSubTriggerName(
""),
152 fNSpecialSubTriggerOptions(0),
153 hSPDClusterTrackletBackgroundBefore(NULL),
154 hSPDClusterTrackletBackground(NULL),
156 fCorrTaskSetting(
""),
158 fTriggerPatchInfo(NULL),
159 fMainTriggerPatchEMCAL(NULL),
160 fCaloTriggersName(
""),
161 fCaloTriggerPatchInfoName(
""),
163 fTriggersEMCALSelected(-1),
164 fEMCALTrigInitialized(kFALSE),
165 fSecProdBoundary(1.0),
168 fMaxFacPtHardSingleParticle(1.5),
169 fMimicTrigger(kFALSE),
170 fRejectTriggerOverlap(kFALSE),
171 fDoMultiplicityWeighting(kFALSE),
172 fPathReweightingMult(
""),
173 fNameHistoReweightingMultData(
""),
174 fNameHistoReweightingMultMC(
""),
175 hReweightMultData(NULL),
176 hReweightMultMC(NULL),
182 fUtils =
new AliAnalysisUtils();
191 AliAnalysisCuts(ref),
296 fUtils =
new AliAnalysisUtils();
336 TH1::AddDirectory(kFALSE);
429 hTriggerClass->GetXaxis()->SetBinLabel( 9,
"kMUL7/kMuonLikePB");
430 hTriggerClass->GetXaxis()->SetBinLabel(10,
"kMUU7/kMuonUnlikePB");
434 hTriggerClass->GetXaxis()->SetBinLabel(14,
"kPHI7/kPHI8/kPHOSPb");
443 hTriggerClass->GetXaxis()->SetBinLabel(23,
"kMuonSingleLowPt8");
444 hTriggerClass->GetXaxis()->SetBinLabel(24,
"kMuonSingleHighPt8");
445 hTriggerClass->GetXaxis()->SetBinLabel(25,
"kMuonLikeLowPt8");
446 hTriggerClass->GetXaxis()->SetBinLabel(26,
"kMuonUnlikeLowPt8");
447 hTriggerClass->GetXaxis()->SetBinLabel(27,
"kMuonUnlikeLowPt0");
455 hTriggerClass->GetXaxis()->SetBinLabel(35,
"failed Physics Selection");
456 hTriggerClass->GetXaxis()->SetBinLabel(36,
"mimickedTrigger");
514 TH1::AddDirectory(kTRUE);
527 if(mcEvent && event->IsA()==AliESDEvent::Class()){
529 AliMCEventHandler* mcHandler =
dynamic_cast<AliMCEventHandler*
> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
534 if (!mcHandler->InitOk() ){
538 if (!mcHandler->TreeK() ){
562 if(event->IsA()==AliESDEvent::Class()){
563 AliTriggerAnalysis fTriggerAnalysis;
564 fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((
AliESDEvent*)event, AliTriggerAnalysis::kV0AND);
591 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
592 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
593 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
598 if(event->IsA()==AliESDEvent::Class()){
602 for(
Int_t i=0; i<nPileVert;i++){
603 const AliESDVertex* pv = ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
604 Int_t nc2 = pv->GetNContributors();
609 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
621 if(
fUtils->IsPileUpMV(event)){
627 if(
fUtils->IsFirstEventInChunk(event)){
633 if(
fUtils->IsPileUpEvent(event)){
639 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
648 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
654 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
687 AliEventplane *EventPlane =
event->GetEventplane();
712 AliInfo(
"Entering loading of weights for centrality flattening");
735 AliInfo(
"Entering loading of weights for multiplicity weighting");
769 AliInfo(
"Entering loading of histograms for weighting");
835 AliInfo(
"Centrality flattening was enabled");
840 AliInfo(
"Multiplicity weighting was enabled");
844 AliInfo(
"Particle Weighting was enabled");
849 AliInfo(Form(
"Set Event Cut Number: %s",analysisCutSelection.Data()));
850 if(analysisCutSelection.Length()!=
kNCuts) {
851 AliError(Form(
"Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(),
kNCuts));
854 if(!analysisCutSelection.IsAlnum()){
855 AliError(
"Cut selection is not alphanumeric");
862 TString analysisCutSelectionLowerCase = Form(
"%s",analysisCutSelection.Data());
863 analysisCutSelectionLowerCase.ToLower();
864 const char *cutSelection = analysisCutSelectionLowerCase.Data();
865 #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0' 898 }
else return kFALSE;
904 }
else return kFALSE;
910 }
else return kFALSE;
916 }
else return kFALSE;
922 }
else return kFALSE;
928 }
else return kFALSE;
934 }
else return kFALSE;
940 }
else return kFALSE;
943 AliError(
"Cut id out of range");
947 AliError(
"Cut id %d not recognized");
961 printf(
"\nEvent cutnumber \n");
963 printf(
"%d",
fCuts[ic]);
967 printf(
"Running in pp mode \n");
970 printf(
"\t only events triggered by V0OR will be analysed \n");
972 printf(
"\t only events where SDD was present will be analysed \n");
976 printf(
"\t only events triggered by V0AND will be analysed \n");
978 printf(
"\t only events where SDD was present will be analysed and triggered by VOAND\n");
989 printf(
"Running in PbPb mode \n");
991 printf(
"\t centrality selection based on V0M \n");
993 printf(
"\t centrality selection based on Cl1 \n");
1011 printf(
"\t only events triggered by kMB, kCentral, kSemiCentral will be analysed \n");
1019 printf(
"Running in pPb mode \n");
1021 printf(
"\t centrality selection based on V0A \n");
1023 printf(
"\t centrality selection based on Cl1 \n");
1033 printf(
"\t only events triggered by kINT7 will be analysed \n");
1040 else printf(
"\t No vertex cut \n");
1043 printf(
"\t Doing pile up removal \n");
1045 printf(
"\t Doing extra pile up removal V0M vs TPCout \n");
1049 printf(
"MC event cuts: \n");
1053 printf(
"\t maximum factor between jet and pt hard = %2.2f \n",
fMaxFacPtHard);
1146 AliError(Form(
"SetHeavyIon not defined %d",isHeavyIon));
1156 if(minCentrality<0||minCentrality>20){
1157 AliError(Form(
"minCentrality not defined %d",minCentrality));
1169 if(maxCentrality<0||maxCentrality>20){
1170 AliError(Form(
"maxCentrality not defined %d",maxCentrality));
1181 switch(selectSpecialTrigger){
1211 fOfflineTriggerMask=AliVEvent::kPHI7 | AliVEvent::kPHI1 | AliVEvent::kPHI8 | AliVEvent::kPHOSPb;
1238 AliError(
"Warning: Special Trigger Not known");
1249 switch(selectSpecialSubTriggerClass){
1260 AliError(
"Warning: Special Subtrigger Class Not known");
1264 switch(selectSpecialSubTriggerClass){
1289 AliError(
"Warning: Special Subtrigger Class Not known");
1293 switch(selectSpecialSubTriggerClass){
1354 AliError(
"Warning: Special Subtrigger Class Not known");
1358 switch(selectSpecialSubTriggerClass){
1405 AliError(
"Warning: Special Subtrigger Class Not known");
1409 switch(selectSpecialSubTriggerClass){
1458 AliError(
"Warning: Special Subtrigger Class Not known");
1462 switch(selectSpecialSubTriggerClass){
1490 AliError(
"Warning: Special Subtrigger Class Not known");
1494 switch(selectSpecialSubTriggerClass){
1538 AliError(
"Warning: Special Subtrigger Class Not known");
1542 switch(selectSpecialSubTriggerClass){
1634 AliError(
"Warning: Special Subtrigger Class Not known");
1638 switch(selectSpecialSubTriggerClass){
1716 AliError(
"Warning: Special Subtrigger Class Not known");
1740 switch(removePileUp){
1874 AliError(
"RemovePileUpCut not defined");
1883 switch(extraSignal){
1897 AliError(Form(
"Extra Signal Rejection not defined %d",extraSignal));
1932 AliError(Form(
"Vertex Cut not defined %d",vertexCut));
1979 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
1981 AliWarning (
"AliMultSelection object not found !");
1985 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
1986 else return MultSelection->GetMultiplicityPercentile(
"V0M");
1987 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
1990 AliCentrality *fESDCentrality = (AliCentrality*)esdEvent->GetCentrality();
1992 if(
fIsHeavyIon==2)
return fESDCentrality->GetCentralityPercentile(
"V0A");
1993 else return fESDCentrality->GetCentralityPercentile(
"V0M");
2001 AliMultSelection *MultSelection = (AliMultSelection*)aodEvent->FindListObject(
"MultSelection");
2003 AliWarning (
"AliMultSelection object not found !");
2007 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
2008 else return MultSelection->GetMultiplicityPercentile(
"V0M",kTRUE);
2009 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2012 if(aodEvent->GetHeader()){
return ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();}
2027 Int_t primaryTracksPP[9] = { 0, 2, 5, 10, 15,
2042 if(centrality<0 && !mcEvent)
return kFALSE;
2044 Int_t centralityC=0;
2046 centralityC=
Int_t(centrality/10);
2052 centralityC=
Int_t(centrality);
2055 }
else return kFALSE;
2058 centralityC=
Int_t(centrality);
2061 }
else return kFALSE;
2064 Int_t PrimaryTracks10[11][2] =
2078 Int_t PrimaryTracksLHC11h10[11][2] =
2092 Int_t PrimaryTracksLHC15o10[11][2] =
2106 Int_t PrimaryTracksLHC10h5[21][2] =
2130 Int_t PrimaryTracksLHC11h5[21][2] =
2154 Int_t PrimaryTracksLHC15o5[21][2] =
2178 Int_t PrimaryTracksLHC17n10[11][2] =
2194 if(event->IsA()==AliESDEvent::Class()) column = 0;
2195 if(event->IsA()==AliAODEvent::Class()) column = 1;
2211 centralityC=
Int_t(centrality/10);
2213 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o10[0][column])
return kFALSE;
2215 }
else return kFALSE;
2224 centralityC=
Int_t(centrality/10);
2239 centralityC =
Int_t(centrality);
2241 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o5[0][column])
return kFALSE;
2243 }
else return kFALSE;
2252 centralityC=
Int_t(centrality);
2255 }
else return kFALSE;
2259 Int_t PrimaryTracksLHC11h10AltMin[11][2] =
2273 Int_t PrimaryTracksLHC11h10AltMax[11][2] =
2287 Int_t PrimaryTracksLHC11h5AltMin[21][2] =
2311 Int_t PrimaryTracksLHC11h5AltMax[21][2] =
2340 if(nprimaryTracks > PrimaryTracksLHC11h10AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h10AltMax[
fCentralityMin][column])
2348 centralityC=
Int_t(centrality/10);
2358 if(nprimaryTracks > PrimaryTracksLHC11h5AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h5AltMax[
fCentralityMin][column])
2365 centralityC=
Int_t(centrality);
2368 }
else return kFALSE;
2378 Double_t fVertexZ=
event->GetPrimaryVertex()->GetZ();
2382 fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ();
2386 fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ();
2389 if(TMath::Abs(fVertexZ)>
fMaxVertexZ)
return kFALSE;
2393 if (TMath::Abs(fVertexZ-fVertexZSPD) > 0.1)
return kFALSE;
2396 if(!
fUtils->IsVertexSelected2013pA(event))
return kFALSE;
2407 TBits fIR1 =
event->GetHeader()->GetIRInt1InteractionMap();
2408 TBits fIR2 =
event->GetHeader()->GetIRInt2InteractionMap();
2409 UShort_t bunchCrossings =
event->GetBunchCrossNumber();
2411 for(
Int_t i = 0; i<180;i++){
2412 if(fIR1.TestBitNumber(i))
2417 Bool_t isOutOfBunchPileup = 0;
2420 if(pf1 < -89) pf1 = -89;
2421 if(pf2 > 89) pf2 = 89;
2422 Int_t pf2maxForT0 = pf2;
2424 for (
Int_t i=pf1;i<=pf2;i++) {
2426 if (i<=pf2maxForT0) isOutOfBunchPileup|=fIR2.TestBitNumber(90+i);
2427 if (i>0 && i<=ir1skip)
continue;
2428 isOutOfBunchPileup|=fIR1.TestBitNumber(90+i);
2430 return isOutOfBunchPileup;
2436 Bool_t isPileUpV0MTPCout=0;
2441 multV0M =
event->GetVZEROData()->GetMTotV0A();
2443 multV0M =
event->GetVZEROData()->GetMTotV0A() +
event->GetVZEROData()->GetMTotV0C() ;
2448 if (multV0M < valFunc ) isPileUpV0MTPCout=1;
2451 return isPileUpV0MTPCout;
2460 if (fESDEvent->GetPrimaryVertex() != NULL){
2461 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
2463 return fESDEvent->GetPrimaryVertex()->GetNContributors();
2467 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
2468 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2470 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
2472 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
2481 if (fAODEvent->GetPrimaryVertex() != NULL){
2482 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
2483 return fAODEvent->GetPrimaryVertex()->GetNContributors();
2486 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
2487 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2488 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
2490 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
2503 AliGenCocktailEventHeader *cHeader = 0x0;
2504 Bool_t headerFound = kFALSE;
2525 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2526 if(cHeader) headerFound = kTRUE;
2534 TList *genHeaders = 0x0;
2535 if(cHeader) genHeaders = cHeader->GetHeaders();
2536 AliGenEventHeader* gh = 0;
2537 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2538 gh = (AliGenEventHeader*)genHeaders->At(i);
2539 TString GeneratorName = gh->GetName();
2540 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2541 Bool_t eventAccepted = kTRUE;
2542 TParticle * jet = 0;
2543 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(gh)->NTriggerJets();
2546 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2547 dynamic_cast<AliGenPythiaEventHeader*
>(gh)->TriggerJet(ijet, tmpjet);
2548 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2551 eventAccepted= kFALSE;
2555 if (jet)
delete jet;
2557 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2558 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2559 if (!particle)
continue;
2560 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2562 eventAccepted= kFALSE;
2570 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2572 70, 85, 99, 115, 132,
2573 150, 169, 190, 212, 235,
2575 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2576 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2577 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2578 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2580 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2581 if (bin < 20) weight = weightsBins[bin];
2584 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2586 70, 85, 99, 115, 132,
2587 150, 169, 190, 212, 235,
2589 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2590 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2591 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2592 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2595 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2596 if (bin < 20) weight = weightsBins[bin];
2599 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2601 70, 85, 99, 115, 132,
2602 150, 169, 190, 212, 235,
2604 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2605 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2606 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2607 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2609 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2610 if (bin < 20) weight = weightsBins[bin];
2614 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2617 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2618 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2619 1.933238e-05, 1.562895e-05};
2621 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2622 if (bin < 12) weight = weightsBins[bin];
2625 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2626 84, 117, 152, 191, 1000000,
2628 21, 28, 36, 45, 57 };
2629 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2630 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2631 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2632 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2636 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2637 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2638 if (bin < 19) weight = weightsBins[bin];
2641 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2642 84, 117, 152, 191, 1000000,
2644 21, 28, 36, 45, 57 };
2646 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2647 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2648 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2649 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2652 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2653 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2654 if (bin < 19) weight = weightsBins[bin];
2657 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2659 70, 85, 99, 115, 132,
2660 150, 169, 190, 212, 235,
2662 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2663 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2664 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2665 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2667 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2668 if (bin < 20) weight = weightsBins[bin];
2671 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2672 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2674 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2675 if (bin < 5) weight = weightsBins[bin];
2678 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2679 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2681 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2682 if (bin < 6) weight = weightsBins[bin];
2685 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2686 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2688 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2689 if (bin < 7) weight = weightsBins[bin];
2692 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2693 84, 117, 152, 191, 234,
2695 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2696 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2698 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2699 if (bin < 10) weight = weightsBins[bin];
2701 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2702 Double_t weightsBins[20] = {1.565930E+01, 4.598350E+00, 2.081240E+00, 7.744650E-01, 2.644240E-01, 1.002330E-01, 2.979190E-02, 9.696490E-03, 3.950930E-03, 1.333040E-03, 5.210630E-04, 1.927180E-04, 9.235930E-05, 4.346820E-05, 2.120660E-05, 1.073260E-05, 5.701210E-06, 3.047490E-06, 1.664780E-06, 2.123400E-06};
2704 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2705 if (bin < 20) weight = weightsBins[bin];
2707 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2708 Double_t weightsBins[20] = {2.723740E+01, 8.127540E+00, 3.934400E+00, 1.492720E+00, 5.268010E-01, 2.033790E-01, 6.361520E-02, 2.256080E-02, 9.638840E-03, 3.372890E-03, 1.381980E-03, 5.121390E-04, 2.613120E-04, 1.260940E-04, 6.393150E-05, 3.386080E-05, 1.926040E-05, 1.046950E-05, 5.895950E-06, 8.658420E-06};
2710 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2711 if (bin < 20) weight = weightsBins[bin];
2713 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2714 Double_t weightsBins[20] = {2.716550E+01, 8.121430E+00, 3.932100E+00, 1.492830E+00, 5.272190E-01, 2.023090E-01, 6.371860E-02, 2.245360E-02, 9.590340E-03, 3.369300E-03, 1.384470E-03, 5.119390E-04, 2.606910E-04, 1.259110E-04, 6.408650E-05, 3.396290E-05, 1.917340E-05, 1.044610E-05, 5.882680E-06, 8.672390E-06};
2716 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2717 if (bin < 20) weight = weightsBins[bin];
2722 if (weight == -1)
return kFALSE;
2723 else return eventAccepted;
2728 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2729 TString eventHeaderName = eventHeader->ClassName();
2730 Bool_t eventAccepted = kFALSE;
2731 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2732 eventAccepted = kTRUE;
2734 if(event->IsA()==AliAODEvent::Class()){
2735 AliAODMCHeader *mch = NULL;
2738 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
2740 Int_t nGenerators = mch->GetNCocktailHeaders();
2741 if ( nGenerators > 0 ){
2742 for(
Int_t igen = 0; igen < nGenerators; igen++)
2744 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
2745 TString name = eventHeaderGen->GetName();
2746 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
2747 eventAccepted = kTRUE;
2748 eventHeader = eventHeaderGen;
2757 TParticle * jet = 0;
2758 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->NTriggerJets();
2759 Float_t ptHard =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
2761 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2762 dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->TriggerJet(ijet, tmpjet);
2763 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2766 eventAccepted= kFALSE;
2771 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2772 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2773 if (!particle)
continue;
2774 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2776 eventAccepted= kFALSE;
2784 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2786 70, 85, 99, 115, 132,
2787 150, 169, 190, 212, 235,
2789 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2790 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2791 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2792 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2794 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2795 if (bin < 20) weight = weightsBins[bin];
2798 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2800 70, 85, 99, 115, 132,
2801 150, 169, 190, 212, 235,
2803 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2804 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2805 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2806 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2809 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2810 if (bin < 20) weight = weightsBins[bin];
2813 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2815 70, 85, 99, 115, 132,
2816 150, 169, 190, 212, 235,
2818 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2819 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2820 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2821 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2823 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2824 if (bin < 20) weight = weightsBins[bin];
2828 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2831 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2832 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2833 1.933238e-05, 1.562895e-05};
2835 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2836 if (bin < 12) weight = weightsBins[bin];
2839 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2840 84, 117, 152, 191, 1000000,
2842 21, 28, 36, 45, 57 };
2843 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2844 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2845 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2846 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2850 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2851 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2852 if (bin < 19) weight = weightsBins[bin];
2855 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2856 84, 117, 152, 191, 1000000,
2858 21, 28, 36, 45, 57 };
2860 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2861 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2862 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2863 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2866 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2867 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2868 if (bin < 19) weight = weightsBins[bin];
2871 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2873 70, 85, 99, 115, 132,
2874 150, 169, 190, 212, 235,
2876 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2877 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2878 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2879 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2881 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2882 if (bin < 20) weight = weightsBins[bin];
2885 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2886 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2888 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2889 if (bin < 5) weight = weightsBins[bin];
2892 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2893 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2895 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2896 if (bin < 6) weight = weightsBins[bin];
2899 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2900 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2902 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2903 if (bin < 7) weight = weightsBins[bin];
2906 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2907 84, 117, 152, 191, 234,
2909 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2910 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2912 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2913 if (bin < 10) weight = weightsBins[bin];
2915 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2916 Double_t weightsBins[20] = {2.723740E+01, 8.127540E+00, 3.934400E+00, 1.492720E+00, 5.268010E-01, 2.033790E-01, 6.361520E-02, 2.256080E-02, 9.638840E-03, 3.372890E-03, 1.381980E-03, 5.121390E-04, 2.613120E-04, 1.260940E-04, 6.393150E-05, 3.386080E-05, 1.926040E-05, 1.046950E-05, 5.895950E-06, 8.658420E-06};
2918 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2919 if (bin < 20) weight = weightsBins[bin];
2921 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2922 Double_t weightsBins[20] = {2.716550E+01, 8.121430E+00, 3.932100E+00, 1.492830E+00, 5.272190E-01, 2.023090E-01, 6.371860E-02, 2.245360E-02, 9.590340E-03, 3.369300E-03, 1.384470E-03, 5.119390E-04, 2.606910E-04, 1.259110E-04, 6.408650E-05, 3.396290E-05, 1.917340E-05, 1.044610E-05, 5.882680E-06, 8.672390E-06};
2924 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2925 if (bin < 20) weight = weightsBins[bin];
2927 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2928 Double_t weightsBins[20] = { 16.1083, 4.60917, 2.15196, 0.782021, 0.26541,
2929 0.0978374, 0.0294286, 0.00989457, 0.0040615, 0.00135787,
2930 0.000531766, 0.000188772, 9.23331e-05, 4.30245e-05, 2.10196e-05,
2931 1.06695e-05, 5.78742e-06, 3.02897e-06, 1.62702e-06, 2.12118e-06 };
2934 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2935 if (bin < 20) weight = weightsBins[bin];
2940 if (weight == -1)
return kFALSE;
2941 else return eventAccepted;
2956 AliGenCocktailEventHeader *cHeader = 0x0;
2957 Bool_t headerFound = kFALSE;
2975 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2976 if(cHeader) headerFound = kTRUE;
2985 TList *genHeaders = 0x0;
2986 if(cHeader) genHeaders = cHeader->GetHeaders();
2987 AliGenEventHeader* gh = 0;
2988 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2989 gh = (AliGenEventHeader*)genHeaders->At(i);
2990 TString GeneratorName = gh->GetName();
2991 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2992 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(gh);
2993 NTrials = gPythia->Trials();
2994 XSection = gPythia->GetXsection();
2999 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3001 TString eventHeaderName = eventHeader->ClassName();
3002 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3003 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader);
3004 NTrials = gPythia->Trials();
3005 XSection = gPythia->GetXsection();
3012 if(event->IsA()==AliAODEvent::Class()){
3013 AliAODMCHeader *mch = NULL;
3016 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3018 Int_t nGenerators = mch->GetNCocktailHeaders();
3019 if ( nGenerators > 0 ){
3020 for(
Int_t igen = 0; igen < nGenerators; igen++)
3022 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3023 TString name = eventHeaderGen->GetName();
3024 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3025 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen);
3026 NTrials = gPythia->Trials();
3027 XSection = gPythia->GetXsection();
3047 AliGenCocktailEventHeader *cHeader = 0x0;
3048 Bool_t headerFound = kFALSE;
3063 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3064 if(cHeader) headerFound = kTRUE;
3071 TList *genHeaders = 0x0;
3072 if(cHeader) genHeaders = cHeader->GetHeaders();
3073 AliGenEventHeader* gh = 0;
3074 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3075 gh = (AliGenEventHeader*)genHeaders->At(i);
3076 TString GeneratorName = gh->GetName();
3077 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3078 return dynamic_cast<AliGenPythiaEventHeader*
>(gh)->
GetPtHard();
3082 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3084 TString eventHeaderName = eventHeader->ClassName();
3085 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3086 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
3090 if(event->IsA()==AliAODEvent::Class()){
3091 AliAODMCHeader *mch = NULL;
3094 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3096 Int_t nGenerators = mch->GetNCocktailHeaders();
3097 if ( nGenerators > 0 ){
3098 for(
Int_t igen = 0; igen < nGenerators; igen++)
3100 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3101 TString name = eventHeaderGen->GetName();
3102 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3103 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen)->
GetPtHard();
3122 Int_t runRangesEMCalL0 [52] = { 144871, 145288, 146375, 146382,
3124 150209, 153056, 153911, 153915,
3125 158135, 158136, 158178, 158182, 160683,
3126 160764, 161139, 161256, 161379, 161457,
3127 161525, 161556, 161558, 161609, 161630,
3129 173731, 177144, 177147, 177653, 177724, 178327,
3148 Double_t thresholdEMCalL0[51] = { 2.11, 3.43, 1.71, 2.05,
3150 1.94, 3.39, 4.01, 5.25, 5.5,
3151 2.05, 5.50, 2.05, 5.50, 2.05, 1.71, 5.50, 1.71, 5.50, 1.71, 5.50, 1.71, 5.50, 1.71, 5.50, 1.71,
3152 2.01, 1.75, 1.52, 2.01, 1.52, 1.85,
3171 Double_t spreadEMCalL0[51] = { 0., 0., 0, 0,
3174 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
3175 0., 0., 0., 0., 0.2, 0.2,
3194 Int_t runRangesEMCalL1[21] = { 179796,
3213 Double_t thresholdEMCalL1[20] = { 9.5,
3231 Double_t spreadEMCalL1[20] = { 1.0,
3250 Int_t runRangesEMCalL1G2[20] = { 195180,
3268 Double_t thresholdEMCalL1G2[19] = { 7.2,
3285 Double_t spreadEMCalL1G2[19] = { 0.3,
3303 Int_t runnumber =
event->GetRunNumber();
3306 if (runnumber < runRangesEMCalL0[0])
return kTRUE;
3308 while (!(runnumber >= runRangesEMCalL0[binRun] && runnumber < runRangesEMCalL0[binRun+1] ) && binRun < 51 ){
3312 if (binRun==51)
return kFALSE;
3313 Double_t threshold = thresholdEMCalL0[binRun];
3315 if (isMC && spreadEMCalL0[binRun] != 0.){
3316 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3317 triggerSmearing->SetParameter(0, 1/(spreadEMCalL0[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3318 triggerSmearing->SetParameter(1, thresholdEMCalL0[binRun]);
3319 triggerSmearing->SetParameter(2, spreadEMCalL0[binRun]);
3320 threshold = triggerSmearing->GetRandom();
3321 delete triggerSmearing;
3326 TClonesArray * arrClustersMimic = NULL;
3328 nclus =
event->GetNumberOfCaloClusters();
3330 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3331 if(!arrClustersMimic)
3332 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3333 nclus = arrClustersMimic->GetEntries();
3336 if(nclus == 0)
return kFALSE;
3339 Bool_t eventIsAccepted = kFALSE;
3340 for(
Int_t i = 0; i < nclus; i++){
3341 AliVCluster* clus = NULL;
3342 if(event->IsA()==AliESDEvent::Class()){
3343 if(arrClustersMimic)
3344 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3346 clus =
event->GetCaloCluster(i);
3347 }
else if(event->IsA()==AliAODEvent::Class()){
3348 if(arrClustersMimic)
3349 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3351 clus =
event->GetCaloCluster(i);
3355 if(arrClustersMimic)
delete clus;
3358 if (!clus->IsEMCAL()) {
3359 if(arrClustersMimic)
delete clus;
3362 if (clus->GetM02()<0.1) {
3363 if(arrClustersMimic)
delete clus;
3366 if (clus->GetNCells()<2) {
3367 if(arrClustersMimic)
delete clus;
3370 if (clus->E() > threshold ){
3372 eventIsAccepted = kTRUE;
3374 if(arrClustersMimic)
3377 return eventIsAccepted;
3384 if (runnumber < runRangesEMCalL1[0])
return kTRUE;
3386 while (!(runnumber >= runRangesEMCalL1[binRun] && runnumber < runRangesEMCalL1[binRun+1] ) && binRun < 3 ){
3390 if (binRun==20)
return kFALSE;
3391 Double_t threshold = thresholdEMCalL1[binRun];
3393 if (isMC && spreadEMCalL1[binRun] != 0.){
3394 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3395 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3396 triggerSmearing->SetParameter(1, thresholdEMCalL1[binRun]);
3397 triggerSmearing->SetParameter(2, spreadEMCalL1[binRun]);
3398 threshold = triggerSmearing->GetRandom();
3399 delete triggerSmearing;
3404 TClonesArray * arrClustersMimic = NULL;
3407 nclus =
event->GetNumberOfCaloClusters();
3409 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3410 if(!arrClustersMimic)
3411 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3412 nclus = arrClustersMimic->GetEntries();
3415 if(nclus == 0)
return kFALSE;
3418 Bool_t eventIsAccepted = kFALSE;
3419 for(
Int_t i = 0; i < nclus; i++){
3420 AliVCluster* clus = NULL;
3421 if(event->IsA()==AliESDEvent::Class()){
3422 if(arrClustersMimic)
3423 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3425 clus =
event->GetCaloCluster(i);
3426 }
else if(event->IsA()==AliAODEvent::Class()){
3427 if(arrClustersMimic)
3428 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3430 clus =
event->GetCaloCluster(i);
3433 if(arrClustersMimic)
delete clus;
3436 if (!clus->IsEMCAL()) {
3437 if(arrClustersMimic)
delete clus;
3440 if (clus->GetM02()<0.1) {
3441 if(arrClustersMimic)
delete clus;
3444 if (clus->GetNCells()<2) {
3445 if(arrClustersMimic)
delete clus;
3448 if (clus->E() > threshold ){
3450 eventIsAccepted = kTRUE;
3452 if(arrClustersMimic)
3455 return eventIsAccepted;
3457 if (runnumber < runRangesEMCalL1G2[0])
return kTRUE;
3459 while (!(runnumber >= runRangesEMCalL1G2[binRun] && runnumber < runRangesEMCalL1G2[binRun+1] ) && binRun < 2 ){
3463 if (binRun==19)
return kFALSE;
3464 Double_t threshold = thresholdEMCalL1G2[binRun];
3465 if (isMC && spreadEMCalL1G2[binRun] != 0.){
3466 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3467 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1G2[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3468 triggerSmearing->SetParameter(1, thresholdEMCalL1G2[binRun]);
3469 triggerSmearing->SetParameter(2, spreadEMCalL1G2[binRun]);
3470 threshold = triggerSmearing->GetRandom();
3471 delete triggerSmearing;
3476 TClonesArray * arrClustersMimic = NULL;
3478 nclus =
event->GetNumberOfCaloClusters();
3480 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3481 if(!arrClustersMimic)
3482 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3483 nclus = arrClustersMimic->GetEntries();
3486 if(nclus == 0)
return kFALSE;
3489 Bool_t eventIsAccepted = kFALSE;
3490 for(
Int_t i = 0; i < nclus; i++){
3491 AliVCluster* clus = NULL;
3492 if(event->IsA()==AliESDEvent::Class()){
3493 if(arrClustersMimic)
3494 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3496 clus =
event->GetCaloCluster(i);
3497 }
else if(event->IsA()==AliAODEvent::Class()){
3498 if(arrClustersMimic)
3499 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3501 clus =
event->GetCaloCluster(i);
3504 if(arrClustersMimic)
delete clus;
3507 if (!clus->IsEMCAL()) {
3508 if(arrClustersMimic)
delete clus;
3511 if (clus->GetM02()<0.1) {
3512 if(arrClustersMimic)
delete clus;
3515 if (clus->GetNCells()<2) {
3516 if(arrClustersMimic)
delete clus;
3519 if (clus->E() > threshold ){
3521 eventIsAccepted = kTRUE;
3523 if(arrClustersMimic)
3526 return eventIsAccepted;
3543 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3546 UInt_t isSelected = AliVEvent::kAny;
3548 if (fInputHandler==NULL)
return kFALSE;
3549 if( fInputHandler->GetEventSelection() ||
event->IsA()==AliAODEvent::Class()) {
3551 TString firedTrigClass =
event->GetFiredTriggerClasses();
3592 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3594 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3596 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3600 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3601 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3603 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3604 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3611 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3613 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3615 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
3618 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3619 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3620 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
3623 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3625 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3628 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3629 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3634 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3635 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3636 if (firedTrigClass.Contains(
"7EG1")) isSelected = 0;
3638 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3639 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3640 if (firedTrigClass.Contains(
"8EG1")) isSelected = 0;
3642 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3643 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3645 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3646 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3650 if (isSelected != 0 ){
3682 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3683 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3684 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3688 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3689 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3690 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3694 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3695 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3696 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3701 for (
Int_t i=0; i<ClassesList->GetEntriesFast(); i++){
3702 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3703 if (firedTrigClass.Contains(NameClass->GetString())) CheckClass+=
"1";
3704 else CheckClass+=
"0";
3706 if(CheckClass.Contains(
"0")) isSelected = 0;
3713 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3715 Bool_t mimickedTrigger = kTRUE;
3722 if (mimickedTrigger){
3723 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)
hTriggerClass->Fill(0);
3724 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)
hTriggerClass->Fill(1);
3725 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)
hTriggerClass->Fill(2);
3726 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)
hTriggerClass->Fill(3);
3727 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)
hTriggerClass->Fill(4);
3728 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)
hTriggerClass->Fill(5);
3729 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)
hTriggerClass->Fill(6);
3731 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)
hTriggerClass->Fill(7);
3733 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)
hTriggerClass->Fill(8);
3735 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)
hTriggerClass->Fill(9);
3737 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)
hTriggerClass->Fill(10);
3739 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)
hTriggerClass->Fill(11);
3740 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)
hTriggerClass->Fill(12);
3741 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)
hTriggerClass->Fill(13);
3744 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)
hTriggerClass->Fill(14);
3745 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)
hTriggerClass->Fill(15);
3746 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)
hTriggerClass->Fill(16);
3747 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)
hTriggerClass->Fill(17);
3748 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)
hTriggerClass->Fill(18);
3749 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)
hTriggerClass->Fill(19);
3750 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)
hTriggerClass->Fill(20);
3752 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)
hTriggerClass->Fill(21);
3753 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClass->Fill(22);
3754 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClass->Fill(23);
3755 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)
hTriggerClass->Fill(24);
3756 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClass->Fill(25);
3757 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClass->Fill(26);
3758 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)
hTriggerClass->Fill(27);
3759 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)
hTriggerClass->Fill(28);
3760 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)
hTriggerClass->Fill(29);
3761 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)
hTriggerClass->Fill(30);
3762 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)
hTriggerClass->Fill(31);
3763 if (!fInputHandler->IsEventSelected())
hTriggerClass->Fill(34);
3769 if (mimickedTrigger){
3801 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClassSelected->Fill(22);
3802 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClassSelected->Fill(23);
3804 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClassSelected->Fill(25);
3805 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClassSelected->Fill(26);
3815 if(!isSelected)
return kFALSE;
3817 if (!mimickedTrigger )
return kFALSE;
3844 if(rejection == 0)
return;
3846 AliGenCocktailEventHeader *cHeader = 0x0;
3847 AliAODMCHeader *cHeaderAOD = 0x0;
3848 Bool_t headerFound = kFALSE;
3849 AliMCEvent *fMCEvent = 0x0;
3850 TClonesArray *fMCEventAOD = 0x0;
3851 if(event->IsA()==AliMCEvent::Class()){
3852 if(dynamic_cast<AliMCEvent*>(event)){
3853 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(
dynamic_cast<AliMCEvent*
>(event)->GenEventHeader());
3854 fMCEvent =
dynamic_cast<AliMCEvent*
>(event);
3855 if(cHeader) headerFound = kTRUE;
3858 if(event->IsA()==AliAODEvent::Class()){
3859 cHeaderAOD =
dynamic_cast<AliAODMCHeader*
>(
event->FindListObject(AliAODMCHeader::StdBranchName()));
3860 fMCEventAOD =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
3861 if(cHeaderAOD) headerFound = kTRUE;
3864 if (
fDebugLevel > 0 ) cout <<
"event starts here" << endl;
3866 TList *genHeaders = 0x0;
3867 if(cHeader) genHeaders = cHeader->GetHeaders();
3869 genHeaders = cHeaderAOD->GetCocktailHeaders();
3870 if(genHeaders->GetEntries()==1){
3875 AliGenEventHeader* gh = 0;
3877 Int_t firstindexA = 0;
3878 Int_t lastindexA = -1;
3879 if(rejection == 1 || rejection == 3)
fnHeaders = 1;
3881 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3882 gh = (AliGenEventHeader*)genHeaders->At(i);
3883 TString GeneratorName = gh->GetName();
3884 lastindexA = lastindexA + gh->NProduced();
3885 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3886 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3887 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3888 if (
fDebugLevel > 0 ) cout << GeneratorInList.Data() << endl;
3889 if(GeneratorInList.Contains(GeneratorName) ){
3891 if (GeneratorInList.BeginsWith(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
3894 if (
fDebugLevel > 2 )cout <<
"number of produced particle: " << gh->NProduced() << endl;
3895 if (
fDebugLevel > 2 )cout <<
"pdg-code of first particle: " << fMCEvent->Particle(firstindexA)->GetPdgCode() << endl;
3897 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindexA+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
3901 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3902 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3906 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3907 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3922 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA));
3925 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0){
3926 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA+10));
3932 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3933 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3937 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3938 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3954 if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
3961 firstindexA = firstindexA + gh->NProduced();
3970 if(rejection == 1 || rejection == 3){
3972 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
3973 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
3978 Int_t firstindex = 0;
3979 Int_t lastindex = -1;
3982 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3983 gh = (AliGenEventHeader*)genHeaders->At(i);
3984 TString GeneratorName = gh->GetName();
3985 lastindex = lastindex + gh->NProduced();
3986 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3987 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3988 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3989 if(GeneratorInList.Contains(GeneratorName) ){
3990 if (GeneratorInList.Contains(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
3994 if (
fDebugLevel > 0 ) cout <<
"produced " << gh->NProduced() <<
" with box generator" << endl;
3995 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindex+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
3996 if (
fDebugLevel > 0 ) cout <<
"one of them was a pi0 or eta" << endl;
4001 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4003 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4008 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4010 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4015 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4029 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex));
4032 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0) {
4033 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex+10));
4041 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4046 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4048 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4053 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4067 }
else if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4071 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4078 firstindex = firstindex + gh->NProduced();
4081 for (
Int_t i = 0; i < number; i++){
4091 fNotRejectedEnd[0] =
static_cast<AliMCEvent*
>(event)->GetNumberOfPrimaries()-1;
4108 if(index < 0)
return 0;
4111 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
4112 if(!mcEvent)
return 0;
4113 if(index >= mcEvent->GetNumberOfPrimaries()){
4114 if( ((TParticle*)mcEvent->Particle(index))->GetMother(0) < 0)
return 0;
4122 if(i == 0) accepted = 2;
4125 if (debug > 1 && !accepted) cout <<
"rejected:" << index << endl;
4127 else if(InputEvent->IsA()==AliAODEvent::Class()){
4128 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
4129 if (AODMCTrackArray){
4130 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4131 if(!aodMCParticle)
return 0;
4132 if(!aodMCParticle->IsPrimary()){
4133 if( aodMCParticle->GetMother() < 0)
return 0;
4136 index = TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
4140 if(i == 0) accepted = 2;
4153 if (mcEvent){isMC = kTRUE;}
4181 Int_t runnumber =
event->GetRunNumber();
4182 if ((runnumber>=144871) && (runnumber<=146860)) {
4184 AliVCaloCells *cells =
event->GetEMCALCells();
4185 const Short_t nCells = cells->GetNumberOfCells();
4187 if (event->IsA()==AliESDEvent::Class()) AliAnalysisManager::GetAnalysisManager()->LoadBranch(
"EMCALCells.");
4189 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
4190 if (!fInputHandler)
return 3;
4193 Int_t nCellCount[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
4194 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
4195 Short_t cellId = cells->GetCellNumber(iCell);
4196 Double_t cellE = cells->GetCellAmplitude(cellId);
4197 Int_t sm = cellId / (24*48);
4198 if (cellE>0.1) ++nCellCount[sm];
4201 Bool_t fIsLedEvent = kFALSE;
4202 if (nCellCount[4] > 100) {
4203 fIsLedEvent = kTRUE;
4205 if ((runnumber>=146858) && (runnumber<=146860)) {
4206 if ((fInputHandler->IsEventSelected() & AliVEvent::kMB) && (nCellCount[3]>=21))
4207 fIsLedEvent = kTRUE;
4208 else if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC1) && (nCellCount[3]>=35))
4209 fIsLedEvent = kTRUE;
4219 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
4220 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
4221 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
4226 if(event->IsA()==AliESDEvent::Class()){
4230 for(
Int_t i=0; i<nPileVert;i++){
4231 const AliESDVertex* pv= ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
4232 Int_t nc2 = pv->GetNContributors();
4237 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
4251 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
4255 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4261 if(
fUtils->IsPileUpEvent(event) ){
4265 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4286 AliEventplane *EventPlane =
event->GetEventplane();
4299 AliInfo(
"Inside the GetWeightForCentralityFlattening function");
4302 if(!event || event->IsA()==AliESDEvent::Class()){
4305 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
4307 centrality = fESDCentrality->GetCentralityPercentile(
"V0M");
4310 }
else if(event->IsA()==AliAODEvent::Class()){
4313 if(aodEvent->GetHeader()){
4314 centrality = ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();
4320 Float_t GetValueForWeight = 1.;
4323 Bool_t CorrCentrLoop = kFALSE;
4329 CorrCentrLoop = kTRUE;
4333 CorrCentrLoop = kTRUE;
4335 CorrCentrLoop = kFALSE;
4338 if (CorrCentrLoop && GetValueForWeight != 0. && maximum !=0. && isfinite(GetValueForWeight) && isfinite(maximum) ){
4339 weightCentrality = maximum/GetValueForWeight;
4340 if (!isfinite(GetValueForWeight)) weightCentrality = 1.;
4341 if (!isfinite(weightCentrality)) weightCentrality = 1.;
4344 return weightCentrality;
4363 if (relativeErrorData < 0.2 && relativeErrorMC < 0.2 ){
4364 if (isfinite(valueMultData) && isfinite(valueMultMC) ){
4365 weightMult = valueMultData/valueMultMC;
4384 if(index < 0)
return 0;
4392 if (kCaseGen == 0)
return 1;
4397 if(!event || event->IsA()==AliESDEvent::Class()){
4398 mesonPt = ((TParticle*)mcEvent->Particle(index))->Pt();
4400 PDGCode = ((TParticle*)mcEvent->Particle(index))->GetPdgCode();
4401 }
else if(event->IsA()==AliAODEvent::Class()){
4402 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4403 if (AODMCTrackArray){
4404 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4405 mesonPt = aodMCParticle->Pt();
4407 PDGCode = aodMCParticle->GetPdgCode();
4413 Float_t functionResultMC = 1.;
4424 Float_t functionResultData = 1;
4436 if (PDGCode == 111 || PDGCode == 221){
4437 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
4438 weight = functionResultData/functionResultMC;
4439 if ( kCaseGen == 3){
4440 if (PDGCode == 111){
4445 if (PDGCode == 221){
4451 if (!isfinite(functionResultData)) weight = 1.;
4452 if (!isfinite(weight)) weight = 1.;
4454 }
else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
4455 weight = functionResultMC;
4471 printf(
" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),-0.465);
4474 printf(
" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),0.465);
4477 else printf(
" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(
GetCutNumber()).
Data());
4489 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
4497 AliEMCALTriggerPatchInfo *patch;
4498 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4500 if (patch->IsMainTrigger()) {
4517 if (event->IsA()==AliESDEvent::Class()){
4527 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
4533 if (event->IsA()==AliESDEvent::Class()){
4565 AliEMCALTriggerPatchInfo *patch;
4567 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4572 if (patch->IsGammaHigh()){
4576 if (patch->IsGammaLow()){
4580 if (patch->IsJetHigh()){
4584 if (patch->IsJetLow()){
4588 if (patch->IsLevel0()){
4599 AliDebug(2,
"Patch summary: ");
4600 AliDebug(2, Form(
"Number of patches: %d", nPatch));
4601 AliDebug(2, Form(
"Level0: [%d]" ,nL0));
4602 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
4603 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
4615 SETBIT(triggers,
kG1);
4617 SETBIT(triggers,
kG2);
4619 SETBIT(triggers,
kJ1);
4621 SETBIT(triggers,
kJ2);
4623 SETBIT(triggers,
kL0);
4642 TClonesArray *arr = 0;
4644 if (!sname.IsNull()) {
4645 arr =
dynamic_cast<TClonesArray*
>(
event->FindListObject(sname));
4647 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
4657 TString objname(arr->GetClass()->GetName());
4658 TClass cls(objname);
4659 if (!cls.InheritsFrom(clname)) {
4660 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
4661 GetName(), cls.GetName(), name, clname));
4670 if (eventpos < 0)
return kFALSE;
4671 TParticle* particle = (TParticle *)mcEvent->Particle(eventpos);
4672 if (!particle)
return kFALSE;
4673 if (TMath::Abs(particle->GetPdgCode()) == 11 ){
4674 if (particle->GetMother(0) != -1){
4675 TParticle* particleMother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4676 if (particleMother){
4677 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4678 particle = particleMother;
4682 if (particle->GetMother(0) != -1){
4683 Double_t deltaX = particle->Vx() - prodVtxX;
4684 Double_t deltaY = particle->Vy() - prodVtxY;
4685 Double_t deltaZ = particle->Vz() - prodVtxZ;
4688 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4691 Bool_t dalitzCand = kFALSE;
4693 TParticle* firstmother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4694 if (!firstmother)
return kFALSE;
4695 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4696 Bool_t intDecay = kFALSE;
4697 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4698 if ( intDecay && TMath::Abs(particle->GetPdgCode()) == 11 ){
4703 Long_t source = particle->GetMother(0);
4704 Bool_t foundExcludedPart = kFALSE;
4705 Bool_t foundShower = kFALSE;
4706 Int_t pdgCodeMotherPrev = 0;
4707 Int_t pdgCodeMotherPPrevMother = 0;
4715 TParticle* mother = (TParticle *)mcEvent->Particle(source);
4716 source = mother->GetMother(0);
4718 Int_t pdgCodeMother = mother->GetPdgCode();
4720 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4721 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4722 foundShower = kTRUE;
4725 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4726 foundShower = kTRUE;
4738 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4739 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4740 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312
4742 foundExcludedPart = kTRUE;
4745 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4746 pdgCodeMotherPrev = pdgCodeMother;
4747 if (source == -1) depth = 20;
4753 if (foundExcludedPart){
4759 }
else if (foundShower){
4774 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4775 if (AODMCTrackArray == NULL)
return kFALSE;
4776 AliAODMCParticle* currentParticle = AODMCParticle;
4777 if (TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4778 if (currentParticle->GetMother() != -1){
4779 AliAODMCParticle* particleMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4780 if (particleMother){
4781 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4782 currentParticle = particleMother;
4786 if (currentParticle->GetMother() > -1){
4787 Double_t deltaX = currentParticle->Xv() - prodVtxX;
4788 Double_t deltaY = currentParticle->Yv() - prodVtxY;
4789 Double_t deltaZ = currentParticle->Zv() - prodVtxZ;
4792 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4794 Bool_t dalitzCand = kFALSE;
4796 AliAODMCParticle* firstmother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4797 if (!firstmother)
return kFALSE;
4798 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4799 Bool_t intDecay = kFALSE;
4800 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4801 if ( intDecay && TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4806 Long_t source = currentParticle->GetMother();
4807 Bool_t foundExcludedPart = kFALSE;
4808 Bool_t foundShower = kFALSE;
4809 Int_t pdgCodeMotherPrev = 0;
4810 Int_t pdgCodeMotherPPrevMother = 0;
4818 AliAODMCParticle* mother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(source));
4819 source = mother->GetMother();
4821 Int_t pdgCodeMother = mother->GetPdgCode();
4823 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4824 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4825 foundShower = kTRUE;
4828 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4829 foundShower = kTRUE;
4841 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4842 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4843 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312)
4845 foundExcludedPart = kTRUE;
4848 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4849 pdgCodeMotherPrev = pdgCodeMother;
4850 if (source == -1) depth = 20;
4856 if (foundExcludedPart){
4862 }
else if (foundShower){
4877 if (particle != NULL && mcEvent != NULL){
4878 Int_t pdgSecondary = 0;
4882 Long_t motherID = particle->GetMother(0);
4883 Long_t grandMotherID = -1;
4887 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4889 if (grandMotherID > -1){
4891 pdgSecondary = mcEvent->Particle(grandMotherID)->GetPdgCode();
4898 Long_t motherID = particle->GetMother(0);
4899 Long_t grandMotherID = -1;
4900 Long_t greatGrandMotherID = -1;
4904 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4906 if (grandMotherID > -1){
4908 greatGrandMotherID = mcEvent->Particle(grandMotherID)->GetMother(0);
4910 if (greatGrandMotherID > -1){
4912 pdgSecondary = mcEvent->Particle(greatGrandMotherID)->GetPdgCode();
4918 if (TMath::Abs(pdgSecondary) == 3122 )
4921 else if ( TMath::Abs(pdgSecondary) == 310 )
4924 else if ( TMath::Abs(pdgSecondary) == 130 )
4927 else if ( TMath::Abs(pdgSecondary) == 221 )
4930 else if ( TMath::Abs(pdgSecondary) != 0 )
4940 if (particle != NULL && aodmcArray != NULL){
4941 Int_t pdgSecondary = 0;
4945 Long_t motherID = particle->GetMother();
4946 Long_t grandMotherID = -1;
4950 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4952 if (grandMotherID > -1){
4954 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetPdgCode();
4961 Long_t motherID = particle->GetMother();
4962 Long_t grandMotherID = -1;
4963 Long_t greatGrandMotherID = -1;
4967 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4969 if (grandMotherID > -1){
4971 greatGrandMotherID = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetMother();
4973 if (greatGrandMotherID > -1){
4975 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(greatGrandMotherID))->GetPdgCode();
4981 if (TMath::Abs(pdgSecondary) == 3122 )
4984 else if ( TMath::Abs(pdgSecondary) == 310 )
4987 else if ( TMath::Abs(pdgSecondary) == 130 )
4990 else if ( TMath::Abs(pdgSecondary) == 221 )
4993 else if ( TMath::Abs(pdgSecondary) != 0 )
5003 if (periodName.CompareTo(
"") == 0){
5006 if (periodName.CompareTo(
"") == 0) {
5009 AliError(
"No correct period could be set, periodName string empty");
5014 if (periodName.CompareTo(
"LHC10b") == 0 || periodName.CompareTo(
"LHC10c") == 0 || periodName.CompareTo(
"LHC10d") == 0 || periodName.CompareTo(
"LHC10e") == 0 ||
5015 periodName.CompareTo(
"LHC10f") == 0 || periodName.CompareTo(
"LHC10g") == 0 || periodName.CompareTo(
"LHC10bg") == 0
5019 }
else if (periodName.CompareTo(
"LHC10h") == 0) {
5022 }
else if (periodName.CompareTo(
"LHC11a") == 0) {
5025 }
else if (periodName.CompareTo(
"LHC11b") == 0) {
5028 }
else if (periodName.CompareTo(
"LHC11c") == 0 || periodName.CompareTo(
"LHC11d") == 0 || periodName.CompareTo(
"LHC11e") == 0 || periodName.CompareTo(
"LHC11f") == 0 ||
5029 periodName.CompareTo(
"LHC11g") == 0
5033 }
else if (periodName.CompareTo(
"LHC11h") == 0) {
5036 }
else if (periodName.CompareTo(
"LHC12a") == 0 || periodName.CompareTo(
"LHC12b") == 0 || periodName.CompareTo(
"LHC12c") == 0 || periodName.CompareTo(
"LHC12d") == 0 ||
5037 periodName.CompareTo(
"LHC12e") == 0 || periodName.CompareTo(
"LHC12f") == 0 || periodName.CompareTo(
"LHC12g") == 0 || periodName.CompareTo(
"LHC12h") == 0 ||
5038 periodName.CompareTo(
"LHC12i") == 0 || periodName.CompareTo(
"LHC12ai") == 0
5042 }
else if (periodName.CompareTo(
"LHC13b") == 0 || periodName.CompareTo(
"LHC13c") == 0 || periodName.CompareTo(
"LHC13bc") == 0){
5045 }
else if (periodName.CompareTo(
"LHC13d") == 0 || periodName.CompareTo(
"LHC13e") == 0 || periodName.CompareTo(
"LHC13de") == 0){
5048 }
else if (periodName.CompareTo(
"LHC13f") == 0 ){
5051 }
else if (periodName.CompareTo(
"LHC13g") == 0 ){