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){
1382 AliError(
"Warning: Special Subtrigger Class Not known");
1386 switch(selectSpecialSubTriggerClass){
1433 AliError(
"Warning: Special Subtrigger Class Not known");
1437 switch(selectSpecialSubTriggerClass){
1486 AliError(
"Warning: Special Subtrigger Class Not known");
1490 switch(selectSpecialSubTriggerClass){
1518 AliError(
"Warning: Special Subtrigger Class Not known");
1522 switch(selectSpecialSubTriggerClass){
1566 AliError(
"Warning: Special Subtrigger Class Not known");
1570 switch(selectSpecialSubTriggerClass){
1662 AliError(
"Warning: Special Subtrigger Class Not known");
1666 switch(selectSpecialSubTriggerClass){
1744 AliError(
"Warning: Special Subtrigger Class Not known");
1768 switch(removePileUp){
1902 AliError(
"RemovePileUpCut not defined");
1911 switch(extraSignal){
1925 AliError(Form(
"Extra Signal Rejection not defined %d",extraSignal));
1960 AliError(Form(
"Vertex Cut not defined %d",vertexCut));
2007 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
2009 AliWarning (
"AliMultSelection object not found !");
2013 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
2014 else return MultSelection->GetMultiplicityPercentile(
"V0M");
2015 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2018 AliCentrality *fESDCentrality = (AliCentrality*)esdEvent->GetCentrality();
2020 if(
fIsHeavyIon==2)
return fESDCentrality->GetCentralityPercentile(
"V0A");
2021 else return fESDCentrality->GetCentralityPercentile(
"V0M");
2029 AliMultSelection *MultSelection = (AliMultSelection*)aodEvent->FindListObject(
"MultSelection");
2031 AliWarning (
"AliMultSelection object not found !");
2035 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
2036 else return MultSelection->GetMultiplicityPercentile(
"V0M",kTRUE);
2037 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2040 if(aodEvent->GetHeader()){
return ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();}
2055 Int_t primaryTracksPP[9] = { 0, 2, 5, 10, 15,
2070 if(centrality<0 && !mcEvent)
return kFALSE;
2072 Int_t centralityC=0;
2074 centralityC=
Int_t(centrality/10);
2080 centralityC=
Int_t(centrality);
2083 }
else return kFALSE;
2086 centralityC=
Int_t(centrality);
2089 }
else return kFALSE;
2092 Int_t PrimaryTracks10[11][2] =
2106 Int_t PrimaryTracksLHC11h10[11][2] =
2120 Int_t PrimaryTracksLHC15o10[11][2] =
2134 Int_t PrimaryTracksLHC10h5[21][2] =
2158 Int_t PrimaryTracksLHC11h5[21][2] =
2182 Int_t PrimaryTracksLHC15o5[21][2] =
2206 Int_t PrimaryTracksLHC17n10[11][2] =
2222 if(event->IsA()==AliESDEvent::Class()) column = 0;
2223 if(event->IsA()==AliAODEvent::Class()) column = 1;
2239 centralityC=
Int_t(centrality/10);
2241 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o10[0][column])
return kFALSE;
2243 }
else return kFALSE;
2252 centralityC=
Int_t(centrality/10);
2267 centralityC =
Int_t(centrality);
2269 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o5[0][column])
return kFALSE;
2271 }
else return kFALSE;
2280 centralityC=
Int_t(centrality);
2283 }
else return kFALSE;
2287 Int_t PrimaryTracksLHC11h10AltMin[11][2] =
2301 Int_t PrimaryTracksLHC11h10AltMax[11][2] =
2315 Int_t PrimaryTracksLHC11h5AltMin[21][2] =
2339 Int_t PrimaryTracksLHC11h5AltMax[21][2] =
2368 if(nprimaryTracks > PrimaryTracksLHC11h10AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h10AltMax[
fCentralityMin][column])
2376 centralityC=
Int_t(centrality/10);
2386 if(nprimaryTracks > PrimaryTracksLHC11h5AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h5AltMax[
fCentralityMin][column])
2393 centralityC=
Int_t(centrality);
2396 }
else return kFALSE;
2406 Double_t fVertexZ=
event->GetPrimaryVertex()->GetZ();
2410 fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ();
2414 fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ();
2417 if(TMath::Abs(fVertexZ)>
fMaxVertexZ)
return kFALSE;
2421 if (TMath::Abs(fVertexZ-fVertexZSPD) > 0.1)
return kFALSE;
2424 if(!
fUtils->IsVertexSelected2013pA(event))
return kFALSE;
2435 TBits fIR1 =
event->GetHeader()->GetIRInt1InteractionMap();
2436 TBits fIR2 =
event->GetHeader()->GetIRInt2InteractionMap();
2437 UShort_t bunchCrossings =
event->GetBunchCrossNumber();
2439 for(
Int_t i = 0; i<180;i++){
2440 if(fIR1.TestBitNumber(i))
2445 Bool_t isOutOfBunchPileup = 0;
2448 if(pf1 < -89) pf1 = -89;
2449 if(pf2 > 89) pf2 = 89;
2450 Int_t pf2maxForT0 = pf2;
2452 for (
Int_t i=pf1;i<=pf2;i++) {
2454 if (i<=pf2maxForT0) isOutOfBunchPileup|=fIR2.TestBitNumber(90+i);
2455 if (i>0 && i<=ir1skip)
continue;
2456 isOutOfBunchPileup|=fIR1.TestBitNumber(90+i);
2458 return isOutOfBunchPileup;
2464 Bool_t isPileUpV0MTPCout=0;
2469 multV0M =
event->GetVZEROData()->GetMTotV0A();
2471 multV0M =
event->GetVZEROData()->GetMTotV0A() +
event->GetVZEROData()->GetMTotV0C() ;
2476 if (multV0M < valFunc ) isPileUpV0MTPCout=1;
2479 return isPileUpV0MTPCout;
2488 if (fESDEvent->GetPrimaryVertex() != NULL){
2489 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
2491 return fESDEvent->GetPrimaryVertex()->GetNContributors();
2495 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
2496 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2498 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
2500 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
2509 if (fAODEvent->GetPrimaryVertex() != NULL){
2510 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
2511 return fAODEvent->GetPrimaryVertex()->GetNContributors();
2514 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
2515 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2516 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
2518 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
2531 AliGenCocktailEventHeader *cHeader = 0x0;
2532 Bool_t headerFound = kFALSE;
2553 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2554 if(cHeader) headerFound = kTRUE;
2562 TList *genHeaders = 0x0;
2563 if(cHeader) genHeaders = cHeader->GetHeaders();
2564 AliGenEventHeader* gh = 0;
2565 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2566 gh = (AliGenEventHeader*)genHeaders->At(i);
2567 TString GeneratorName = gh->GetName();
2568 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2569 Bool_t eventAccepted = kTRUE;
2570 TParticle * jet = 0;
2571 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(gh)->NTriggerJets();
2574 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2575 dynamic_cast<AliGenPythiaEventHeader*
>(gh)->TriggerJet(ijet, tmpjet);
2576 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2579 eventAccepted= kFALSE;
2583 if (jet)
delete jet;
2585 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2586 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2587 if (!particle)
continue;
2588 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2590 eventAccepted= kFALSE;
2598 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2600 70, 85, 99, 115, 132,
2601 150, 169, 190, 212, 235,
2603 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2604 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2605 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2606 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2608 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2609 if (bin < 20) weight = weightsBins[bin];
2612 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2614 70, 85, 99, 115, 132,
2615 150, 169, 190, 212, 235,
2617 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2618 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2619 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2620 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2623 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2624 if (bin < 20) weight = weightsBins[bin];
2627 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2629 70, 85, 99, 115, 132,
2630 150, 169, 190, 212, 235,
2632 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2633 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2634 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2635 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2637 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2638 if (bin < 20) weight = weightsBins[bin];
2642 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2645 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2646 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2647 1.933238e-05, 1.562895e-05};
2649 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2650 if (bin < 12) weight = weightsBins[bin];
2653 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2654 84, 117, 152, 191, 1000000,
2656 21, 28, 36, 45, 57 };
2657 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2658 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2659 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2660 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2664 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2665 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2666 if (bin < 19) weight = weightsBins[bin];
2669 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2670 84, 117, 152, 191, 1000000,
2672 21, 28, 36, 45, 57 };
2674 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2675 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2676 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2677 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2680 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2681 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2682 if (bin < 19) weight = weightsBins[bin];
2685 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2687 70, 85, 99, 115, 132,
2688 150, 169, 190, 212, 235,
2690 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2691 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2692 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2693 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2695 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2696 if (bin < 20) weight = weightsBins[bin];
2699 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2700 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2702 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2703 if (bin < 5) weight = weightsBins[bin];
2706 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2707 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2709 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2710 if (bin < 6) weight = weightsBins[bin];
2713 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2714 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2716 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2717 if (bin < 7) weight = weightsBins[bin];
2720 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2721 84, 117, 152, 191, 234,
2723 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2724 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2726 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2727 if (bin < 10) weight = weightsBins[bin];
2729 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};
2730 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};
2732 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2733 if (bin < 20) weight = weightsBins[bin];
2735 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};
2736 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};
2738 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2739 if (bin < 20) weight = weightsBins[bin];
2741 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};
2742 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};
2744 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2745 if (bin < 20) weight = weightsBins[bin];
2750 if (weight == -1)
return kFALSE;
2751 else return eventAccepted;
2756 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2757 TString eventHeaderName = eventHeader->ClassName();
2758 Bool_t eventAccepted = kFALSE;
2759 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2760 eventAccepted = kTRUE;
2762 if(event->IsA()==AliAODEvent::Class()){
2763 AliAODMCHeader *mch = NULL;
2766 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
2768 Int_t nGenerators = mch->GetNCocktailHeaders();
2769 if ( nGenerators > 0 ){
2770 for(
Int_t igen = 0; igen < nGenerators; igen++)
2772 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
2773 TString name = eventHeaderGen->GetName();
2774 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
2775 eventAccepted = kTRUE;
2776 eventHeader = eventHeaderGen;
2785 TParticle * jet = 0;
2786 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->NTriggerJets();
2787 Float_t ptHard =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
2789 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2790 dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->TriggerJet(ijet, tmpjet);
2791 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2794 eventAccepted= kFALSE;
2799 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2800 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2801 if (!particle)
continue;
2802 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2804 eventAccepted= kFALSE;
2812 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2814 70, 85, 99, 115, 132,
2815 150, 169, 190, 212, 235,
2817 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2818 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2819 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2820 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2822 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2823 if (bin < 20) weight = weightsBins[bin];
2826 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2828 70, 85, 99, 115, 132,
2829 150, 169, 190, 212, 235,
2831 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2832 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2833 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2834 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2837 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2838 if (bin < 20) weight = weightsBins[bin];
2841 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2843 70, 85, 99, 115, 132,
2844 150, 169, 190, 212, 235,
2846 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2847 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2848 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2849 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2851 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2852 if (bin < 20) weight = weightsBins[bin];
2856 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2859 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2860 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2861 1.933238e-05, 1.562895e-05};
2863 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2864 if (bin < 12) weight = weightsBins[bin];
2867 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2868 84, 117, 152, 191, 1000000,
2870 21, 28, 36, 45, 57 };
2871 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2872 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2873 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2874 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2878 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2879 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2880 if (bin < 19) weight = weightsBins[bin];
2883 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2884 84, 117, 152, 191, 1000000,
2886 21, 28, 36, 45, 57 };
2888 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2889 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2890 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2891 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2894 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2895 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2896 if (bin < 19) weight = weightsBins[bin];
2899 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2901 70, 85, 99, 115, 132,
2902 150, 169, 190, 212, 235,
2904 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2905 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2906 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2907 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2909 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2910 if (bin < 20) weight = weightsBins[bin];
2913 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2914 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2916 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2917 if (bin < 5) weight = weightsBins[bin];
2920 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2921 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2923 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2924 if (bin < 6) weight = weightsBins[bin];
2927 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2928 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2930 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2931 if (bin < 7) weight = weightsBins[bin];
2934 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2935 84, 117, 152, 191, 234,
2937 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2938 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2940 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2941 if (bin < 10) weight = weightsBins[bin];
2943 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};
2944 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};
2946 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2947 if (bin < 20) weight = weightsBins[bin];
2949 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};
2950 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};
2952 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2953 if (bin < 20) weight = weightsBins[bin];
2955 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};
2956 Double_t weightsBins[20] = { 16.1083, 4.60917, 2.15196, 0.782021, 0.26541,
2957 0.0978374, 0.0294286, 0.00989457, 0.0040615, 0.00135787,
2958 0.000531766, 0.000188772, 9.23331e-05, 4.30245e-05, 2.10196e-05,
2959 1.06695e-05, 5.78742e-06, 3.02897e-06, 1.62702e-06, 2.12118e-06 };
2962 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2963 if (bin < 20) weight = weightsBins[bin];
2968 if (weight == -1)
return kFALSE;
2969 else return eventAccepted;
2984 AliGenCocktailEventHeader *cHeader = 0x0;
2985 Bool_t headerFound = kFALSE;
3003 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3004 if(cHeader) headerFound = kTRUE;
3013 TList *genHeaders = 0x0;
3014 if(cHeader) genHeaders = cHeader->GetHeaders();
3015 AliGenEventHeader* gh = 0;
3016 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3017 gh = (AliGenEventHeader*)genHeaders->At(i);
3018 TString GeneratorName = gh->GetName();
3019 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3020 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(gh);
3021 NTrials = gPythia->Trials();
3022 XSection = gPythia->GetXsection();
3027 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3029 TString eventHeaderName = eventHeader->ClassName();
3030 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3031 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader);
3032 NTrials = gPythia->Trials();
3033 XSection = gPythia->GetXsection();
3040 if(event->IsA()==AliAODEvent::Class()){
3041 AliAODMCHeader *mch = NULL;
3044 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3046 Int_t nGenerators = mch->GetNCocktailHeaders();
3047 if ( nGenerators > 0 ){
3048 for(
Int_t igen = 0; igen < nGenerators; igen++)
3050 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3051 TString name = eventHeaderGen->GetName();
3052 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3053 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen);
3054 NTrials = gPythia->Trials();
3055 XSection = gPythia->GetXsection();
3075 AliGenCocktailEventHeader *cHeader = 0x0;
3076 Bool_t headerFound = kFALSE;
3091 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3092 if(cHeader) headerFound = kTRUE;
3099 TList *genHeaders = 0x0;
3100 if(cHeader) genHeaders = cHeader->GetHeaders();
3101 AliGenEventHeader* gh = 0;
3102 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3103 gh = (AliGenEventHeader*)genHeaders->At(i);
3104 TString GeneratorName = gh->GetName();
3105 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3106 return dynamic_cast<AliGenPythiaEventHeader*
>(gh)->
GetPtHard();
3110 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3112 TString eventHeaderName = eventHeader->ClassName();
3113 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3114 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
3118 if(event->IsA()==AliAODEvent::Class()){
3119 AliAODMCHeader *mch = NULL;
3122 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3124 Int_t nGenerators = mch->GetNCocktailHeaders();
3125 if ( nGenerators > 0 ){
3126 for(
Int_t igen = 0; igen < nGenerators; igen++)
3128 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3129 TString name = eventHeaderGen->GetName();
3130 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3131 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen)->
GetPtHard();
3150 Int_t runRangesEMCalL0 [52] = { 144871, 145288, 146375, 146382,
3152 150209, 153056, 153911, 153915,
3153 158135, 158136, 158178, 158182, 160683,
3154 160764, 161139, 161256, 161379, 161457,
3155 161525, 161556, 161558, 161609, 161630,
3157 173731, 177144, 177147, 177653, 177724, 178327,
3176 Double_t thresholdEMCalL0[51] = { 2.11, 3.43, 1.71, 2.05,
3178 1.94, 3.39, 4.01, 5.25, 5.5,
3179 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,
3180 2.01, 1.75, 1.52, 2.01, 1.52, 1.85,
3200 Double_t spreadEMCalL0[51] = { 0., 0., 0, 0,
3203 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
3204 0., 0., 0., 0., 0.2, 0.2,
3224 Int_t runRangesEMCalL1[21] = { 179796,
3243 Double_t thresholdEMCalL1[20] = { 9.5,
3262 Double_t spreadEMCalL1[20] = { 1.0,
3282 Int_t runRangesEMCalL1G2[21] = { 195180,
3300 Double_t thresholdEMCalL1G2[19] = { 7.2,
3318 Double_t spreadEMCalL1G2[19] = { 0.3,
3337 Int_t runnumber =
event->GetRunNumber();
3340 if (runnumber < runRangesEMCalL0[0])
return kTRUE;
3342 while (!(runnumber >= runRangesEMCalL0[binRun] && runnumber < runRangesEMCalL0[binRun+1] ) && binRun < 51 ){
3346 if (binRun==51)
return kFALSE;
3348 Double_t threshold = thresholdEMCalL0[binRun];
3350 if (isMC && spreadEMCalL0[binRun] != 0.){
3351 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3352 triggerSmearing->SetParameter(0, 1/(spreadEMCalL0[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3353 triggerSmearing->SetParameter(1, thresholdEMCalL0[binRun]);
3354 triggerSmearing->SetParameter(2, spreadEMCalL0[binRun]);
3355 threshold = triggerSmearing->GetRandom();
3356 delete triggerSmearing;
3361 TClonesArray * arrClustersMimic = NULL;
3363 nclus =
event->GetNumberOfCaloClusters();
3365 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3366 if(!arrClustersMimic)
3367 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3368 nclus = arrClustersMimic->GetEntries();
3371 if(nclus == 0)
return kFALSE;
3374 Bool_t eventIsAccepted = kFALSE;
3375 for(
Int_t i = 0; i < nclus; i++){
3376 if (eventIsAccepted)
continue;
3377 AliVCluster* clus = NULL;
3378 if(event->IsA()==AliESDEvent::Class()){
3379 if(arrClustersMimic)
3380 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3382 clus =
event->GetCaloCluster(i);
3383 }
else if(event->IsA()==AliAODEvent::Class()){
3384 if(arrClustersMimic)
3385 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3387 clus =
event->GetCaloCluster(i);
3391 if(arrClustersMimic)
delete clus;
3394 if (!clus->IsEMCAL()) {
3395 if(arrClustersMimic)
delete clus;
3398 if (clus->GetM02()<0.1) {
3399 if(arrClustersMimic)
delete clus;
3402 if (clus->GetNCells()<2) {
3403 if(arrClustersMimic)
delete clus;
3406 if (clus->E() > threshold ){
3408 eventIsAccepted = kTRUE;
3410 if(arrClustersMimic)
3413 return eventIsAccepted;
3420 if (runnumber < runRangesEMCalL1[0])
return kTRUE;
3422 while (!(runnumber >= runRangesEMCalL1[binRun] && runnumber < runRangesEMCalL1[binRun+1] ) && binRun < 20 ){
3426 if (binRun==20)
return kFALSE;
3427 Double_t threshold = thresholdEMCalL1[binRun];
3429 if (isMC && spreadEMCalL1[binRun] != 0.){
3430 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3431 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3432 triggerSmearing->SetParameter(1, thresholdEMCalL1[binRun]);
3433 triggerSmearing->SetParameter(2, spreadEMCalL1[binRun]);
3434 threshold = triggerSmearing->GetRandom();
3435 delete triggerSmearing;
3440 TClonesArray * arrClustersMimic = NULL;
3443 nclus =
event->GetNumberOfCaloClusters();
3445 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3446 if(!arrClustersMimic)
3447 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3448 nclus = arrClustersMimic->GetEntries();
3451 if(nclus == 0)
return kFALSE;
3454 Bool_t eventIsAccepted = kFALSE;
3455 for(
Int_t i = 0; i < nclus; i++){
3456 if (eventIsAccepted)
continue;
3457 AliVCluster* clus = NULL;
3458 if(event->IsA()==AliESDEvent::Class()){
3459 if(arrClustersMimic)
3460 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3462 clus =
event->GetCaloCluster(i);
3463 }
else if(event->IsA()==AliAODEvent::Class()){
3464 if(arrClustersMimic)
3465 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3467 clus =
event->GetCaloCluster(i);
3470 if(arrClustersMimic)
delete clus;
3473 if (!clus->IsEMCAL()) {
3474 if(arrClustersMimic)
delete clus;
3477 if (clus->GetM02()<0.1) {
3478 if(arrClustersMimic)
delete clus;
3481 if (clus->GetNCells()<2) {
3482 if(arrClustersMimic)
delete clus;
3485 if (clus->E() > threshold ){
3487 eventIsAccepted = kTRUE;
3489 if(arrClustersMimic)
3492 return eventIsAccepted;
3494 if (runnumber < runRangesEMCalL1G2[0])
return kTRUE;
3496 while (!(runnumber >= runRangesEMCalL1G2[binRun] && runnumber < runRangesEMCalL1G2[binRun+1] ) && binRun < 19 ){
3501 if (binRun==19)
return kFALSE;
3502 Double_t threshold = thresholdEMCalL1G2[binRun];
3503 if (isMC && spreadEMCalL1G2[binRun] != 0.){
3504 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3505 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1G2[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3506 triggerSmearing->SetParameter(1, thresholdEMCalL1G2[binRun]);
3507 triggerSmearing->SetParameter(2, spreadEMCalL1G2[binRun]);
3508 threshold = triggerSmearing->GetRandom();
3509 delete triggerSmearing;
3514 TClonesArray * arrClustersMimic = NULL;
3516 nclus =
event->GetNumberOfCaloClusters();
3518 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3519 if(!arrClustersMimic)
3520 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3521 nclus = arrClustersMimic->GetEntries();
3524 if(nclus == 0)
return kFALSE;
3527 Bool_t eventIsAccepted = kFALSE;
3528 for(
Int_t i = 0; i < nclus; i++){
3529 if (eventIsAccepted)
continue;
3530 AliVCluster* clus = NULL;
3531 if(event->IsA()==AliESDEvent::Class()){
3532 if(arrClustersMimic)
3533 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3535 clus =
event->GetCaloCluster(i);
3536 }
else if(event->IsA()==AliAODEvent::Class()){
3537 if(arrClustersMimic)
3538 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3540 clus =
event->GetCaloCluster(i);
3543 if(arrClustersMimic)
delete clus;
3546 if (!clus->IsEMCAL()) {
3547 if(arrClustersMimic)
delete clus;
3550 if (clus->GetM02()<0.1) {
3551 if(arrClustersMimic)
delete clus;
3554 if (clus->GetNCells()<2) {
3555 if(arrClustersMimic)
delete clus;
3558 if (clus->E() > threshold ){
3560 eventIsAccepted = kTRUE;
3562 if(arrClustersMimic)
3565 return eventIsAccepted;
3582 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3585 UInt_t isSelected = AliVEvent::kAny;
3587 if (fInputHandler==NULL)
return kFALSE;
3588 if( fInputHandler->GetEventSelection() ||
event->IsA()==AliAODEvent::Class()) {
3590 TString firedTrigClass =
event->GetFiredTriggerClasses();
3631 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3633 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3635 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3639 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3640 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3642 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3643 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3650 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3652 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3654 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
3657 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3658 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3659 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
3662 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3664 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3667 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3668 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3673 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3674 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3675 if (firedTrigClass.Contains(
"7EG1")) isSelected = 0;
3677 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3678 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3679 if (firedTrigClass.Contains(
"8EG1")) isSelected = 0;
3681 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3682 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3684 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3685 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3689 if (isSelected != 0 ){
3721 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3722 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3723 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3727 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3728 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3729 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3733 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3734 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3735 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3740 for (
Int_t i=0; i<ClassesList->GetEntriesFast(); i++){
3741 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3742 if (firedTrigClass.Contains(NameClass->GetString())) CheckClass+=
"1";
3743 else CheckClass+=
"0";
3745 if(CheckClass.Contains(
"0")) isSelected = 0;
3752 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3754 Bool_t mimickedTrigger = kTRUE;
3761 if (mimickedTrigger){
3762 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)
hTriggerClass->Fill(0);
3763 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)
hTriggerClass->Fill(1);
3764 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)
hTriggerClass->Fill(2);
3765 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)
hTriggerClass->Fill(3);
3766 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)
hTriggerClass->Fill(4);
3767 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)
hTriggerClass->Fill(5);
3768 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)
hTriggerClass->Fill(6);
3770 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)
hTriggerClass->Fill(7);
3772 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)
hTriggerClass->Fill(8);
3774 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)
hTriggerClass->Fill(9);
3776 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)
hTriggerClass->Fill(10);
3778 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)
hTriggerClass->Fill(11);
3779 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)
hTriggerClass->Fill(12);
3780 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)
hTriggerClass->Fill(13);
3783 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)
hTriggerClass->Fill(14);
3784 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)
hTriggerClass->Fill(15);
3785 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)
hTriggerClass->Fill(16);
3786 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)
hTriggerClass->Fill(17);
3787 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)
hTriggerClass->Fill(18);
3788 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)
hTriggerClass->Fill(19);
3789 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)
hTriggerClass->Fill(20);
3791 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)
hTriggerClass->Fill(21);
3792 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClass->Fill(22);
3793 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClass->Fill(23);
3794 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)
hTriggerClass->Fill(24);
3795 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClass->Fill(25);
3796 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClass->Fill(26);
3797 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)
hTriggerClass->Fill(27);
3798 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)
hTriggerClass->Fill(28);
3799 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)
hTriggerClass->Fill(29);
3800 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)
hTriggerClass->Fill(30);
3801 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)
hTriggerClass->Fill(31);
3802 if (!fInputHandler->IsEventSelected())
hTriggerClass->Fill(34);
3808 if (mimickedTrigger){
3840 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClassSelected->Fill(22);
3841 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClassSelected->Fill(23);
3843 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClassSelected->Fill(25);
3844 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClassSelected->Fill(26);
3854 if(!isSelected)
return kFALSE;
3856 if (!mimickedTrigger )
return kFALSE;
3883 if(rejection == 0)
return;
3885 AliGenCocktailEventHeader *cHeader = 0x0;
3886 AliAODMCHeader *cHeaderAOD = 0x0;
3887 Bool_t headerFound = kFALSE;
3888 AliMCEvent *fMCEvent = 0x0;
3889 TClonesArray *fMCEventAOD = 0x0;
3890 if(event->IsA()==AliMCEvent::Class()){
3891 if(dynamic_cast<AliMCEvent*>(event)){
3892 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(
dynamic_cast<AliMCEvent*
>(event)->GenEventHeader());
3893 fMCEvent =
dynamic_cast<AliMCEvent*
>(event);
3894 if(cHeader) headerFound = kTRUE;
3897 if(event->IsA()==AliAODEvent::Class()){
3898 cHeaderAOD =
dynamic_cast<AliAODMCHeader*
>(
event->FindListObject(AliAODMCHeader::StdBranchName()));
3899 fMCEventAOD =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
3900 if(cHeaderAOD) headerFound = kTRUE;
3903 if (
fDebugLevel > 0 ) cout <<
"event starts here" << endl;
3905 TList *genHeaders = 0x0;
3906 if(cHeader) genHeaders = cHeader->GetHeaders();
3908 genHeaders = cHeaderAOD->GetCocktailHeaders();
3909 if(genHeaders->GetEntries()==1){
3914 AliGenEventHeader* gh = 0;
3916 Int_t firstindexA = 0;
3917 Int_t lastindexA = -1;
3918 if(rejection == 1 || rejection == 3)
fnHeaders = 1;
3920 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3921 gh = (AliGenEventHeader*)genHeaders->At(i);
3922 TString GeneratorName = gh->GetName();
3923 lastindexA = lastindexA + gh->NProduced();
3924 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3925 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3926 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3927 if (
fDebugLevel > 0 ) cout << GeneratorInList.Data() << endl;
3928 if(GeneratorInList.Contains(GeneratorName) ){
3930 if (GeneratorInList.BeginsWith(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
3933 if (
fDebugLevel > 2 )cout <<
"number of produced particle: " << gh->NProduced() << endl;
3934 if (
fDebugLevel > 2 )cout <<
"pdg-code of first particle: " << fMCEvent->Particle(firstindexA)->GetPdgCode() << endl;
3936 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindexA+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
3940 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3941 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3945 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3946 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3961 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA));
3964 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0){
3965 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA+10));
3971 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3972 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3976 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3977 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3993 if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4000 firstindexA = firstindexA + gh->NProduced();
4009 if(rejection == 1 || rejection == 3){
4011 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
4012 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
4017 Int_t firstindex = 0;
4018 Int_t lastindex = -1;
4021 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
4022 gh = (AliGenEventHeader*)genHeaders->At(i);
4023 TString GeneratorName = gh->GetName();
4024 lastindex = lastindex + gh->NProduced();
4025 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
4026 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
4027 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
4028 if(GeneratorInList.Contains(GeneratorName) ){
4029 if (GeneratorInList.Contains(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
4033 if (
fDebugLevel > 0 ) cout <<
"produced " << gh->NProduced() <<
" with box generator" << endl;
4034 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindex+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
4035 if (
fDebugLevel > 0 ) cout <<
"one of them was a pi0 or eta" << endl;
4040 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4042 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4047 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4049 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4054 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4068 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex));
4071 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0) {
4072 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex+10));
4080 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4085 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4087 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4092 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4106 }
else if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4110 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4117 firstindex = firstindex + gh->NProduced();
4120 for (
Int_t i = 0; i < number; i++){
4130 fNotRejectedEnd[0] =
static_cast<AliMCEvent*
>(event)->GetNumberOfPrimaries()-1;
4147 if(index < 0)
return 0;
4150 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
4151 if(!mcEvent)
return 0;
4152 if(index >= mcEvent->GetNumberOfPrimaries()){
4153 if( ((TParticle*)mcEvent->Particle(index))->GetMother(0) < 0)
return 0;
4161 if(i == 0) accepted = 2;
4164 if (debug > 1 && !accepted) cout <<
"rejected:" << index << endl;
4166 else if(InputEvent->IsA()==AliAODEvent::Class()){
4167 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
4168 if (AODMCTrackArray){
4169 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4170 if(!aodMCParticle)
return 0;
4171 if(!aodMCParticle->IsPrimary()){
4172 if( aodMCParticle->GetMother() < 0)
return 0;
4175 index = TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
4179 if(i == 0) accepted = 2;
4192 if (mcEvent){isMC = kTRUE;}
4220 Int_t runnumber =
event->GetRunNumber();
4221 if ((runnumber>=144871) && (runnumber<=146860)) {
4223 AliVCaloCells *cells =
event->GetEMCALCells();
4224 const Short_t nCells = cells->GetNumberOfCells();
4226 if (event->IsA()==AliESDEvent::Class()) AliAnalysisManager::GetAnalysisManager()->LoadBranch(
"EMCALCells.");
4228 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
4229 if (!fInputHandler)
return 3;
4232 Int_t nCellCount[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
4233 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
4234 Short_t cellId = cells->GetCellNumber(iCell);
4235 Double_t cellE = cells->GetCellAmplitude(cellId);
4236 Int_t sm = cellId / (24*48);
4237 if (cellE>0.1) ++nCellCount[sm];
4240 Bool_t fIsLedEvent = kFALSE;
4241 if (nCellCount[4] > 100) {
4242 fIsLedEvent = kTRUE;
4244 if ((runnumber>=146858) && (runnumber<=146860)) {
4245 if ((fInputHandler->IsEventSelected() & AliVEvent::kMB) && (nCellCount[3]>=21))
4246 fIsLedEvent = kTRUE;
4247 else if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC1) && (nCellCount[3]>=35))
4248 fIsLedEvent = kTRUE;
4258 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
4259 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
4260 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
4265 if(event->IsA()==AliESDEvent::Class()){
4269 for(
Int_t i=0; i<nPileVert;i++){
4270 const AliESDVertex* pv= ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
4271 Int_t nc2 = pv->GetNContributors();
4276 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
4290 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
4294 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4300 if(
fUtils->IsPileUpEvent(event) ){
4304 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4325 AliEventplane *EventPlane =
event->GetEventplane();
4338 AliInfo(
"Inside the GetWeightForCentralityFlattening function");
4341 if(!event || event->IsA()==AliESDEvent::Class()){
4344 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
4346 centrality = fESDCentrality->GetCentralityPercentile(
"V0M");
4349 }
else if(event->IsA()==AliAODEvent::Class()){
4352 if(aodEvent->GetHeader()){
4353 centrality = ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();
4359 Float_t GetValueForWeight = 1.;
4362 Bool_t CorrCentrLoop = kFALSE;
4368 CorrCentrLoop = kTRUE;
4372 CorrCentrLoop = kTRUE;
4374 CorrCentrLoop = kFALSE;
4377 if (CorrCentrLoop && GetValueForWeight != 0. && maximum !=0. && isfinite(GetValueForWeight) && isfinite(maximum) ){
4378 weightCentrality = maximum/GetValueForWeight;
4379 if (!isfinite(GetValueForWeight)) weightCentrality = 1.;
4380 if (!isfinite(weightCentrality)) weightCentrality = 1.;
4383 return weightCentrality;
4402 if (relativeErrorData < 0.2 && relativeErrorMC < 0.2 ){
4403 if (isfinite(valueMultData) && isfinite(valueMultMC) ){
4404 weightMult = valueMultData/valueMultMC;
4423 if(index < 0)
return 0;
4431 if (kCaseGen == 0)
return 1;
4436 if(!event || event->IsA()==AliESDEvent::Class()){
4437 mesonPt = ((TParticle*)mcEvent->Particle(index))->Pt();
4439 PDGCode = ((TParticle*)mcEvent->Particle(index))->GetPdgCode();
4440 }
else if(event->IsA()==AliAODEvent::Class()){
4441 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4442 if (AODMCTrackArray){
4443 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4444 mesonPt = aodMCParticle->Pt();
4446 PDGCode = aodMCParticle->GetPdgCode();
4452 Float_t functionResultMC = 1.;
4463 Float_t functionResultData = 1;
4475 if (PDGCode == 111 || PDGCode == 221){
4476 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
4477 weight = functionResultData/functionResultMC;
4478 if ( kCaseGen == 3){
4479 if (PDGCode == 111){
4484 if (PDGCode == 221){
4490 if (!isfinite(functionResultData)) weight = 1.;
4491 if (!isfinite(weight)) weight = 1.;
4493 }
else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
4494 weight = functionResultMC;
4510 printf(
" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),-0.465);
4513 printf(
" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),0.465);
4516 else printf(
" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(
GetCutNumber()).
Data());
4528 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
4536 AliEMCALTriggerPatchInfo *patch;
4537 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4539 if (patch->IsMainTrigger()) {
4556 if (event->IsA()==AliESDEvent::Class()){
4566 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
4572 if (event->IsA()==AliESDEvent::Class()){
4604 AliEMCALTriggerPatchInfo *patch;
4606 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4611 if (patch->IsGammaHigh()){
4615 if (patch->IsGammaLow()){
4619 if (patch->IsJetHigh()){
4623 if (patch->IsJetLow()){
4627 if (patch->IsLevel0()){
4638 AliDebug(2,
"Patch summary: ");
4639 AliDebug(2, Form(
"Number of patches: %d", nPatch));
4640 AliDebug(2, Form(
"Level0: [%d]" ,nL0));
4641 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
4642 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
4654 SETBIT(triggers,
kG1);
4656 SETBIT(triggers,
kG2);
4658 SETBIT(triggers,
kJ1);
4660 SETBIT(triggers,
kJ2);
4662 SETBIT(triggers,
kL0);
4681 TClonesArray *arr = 0;
4683 if (!sname.IsNull()) {
4684 arr =
dynamic_cast<TClonesArray*
>(
event->FindListObject(sname));
4686 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
4696 TString objname(arr->GetClass()->GetName());
4697 TClass cls(objname);
4698 if (!cls.InheritsFrom(clname)) {
4699 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
4700 GetName(), cls.GetName(), name, clname));
4709 if (eventpos < 0)
return kFALSE;
4710 TParticle* particle = (TParticle *)mcEvent->Particle(eventpos);
4711 if (!particle)
return kFALSE;
4712 if (TMath::Abs(particle->GetPdgCode()) == 11 ){
4713 if (particle->GetMother(0) != -1){
4714 TParticle* particleMother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4715 if (particleMother){
4716 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4717 particle = particleMother;
4721 if (particle->GetMother(0) != -1){
4722 Double_t deltaX = particle->Vx() - prodVtxX;
4723 Double_t deltaY = particle->Vy() - prodVtxY;
4724 Double_t deltaZ = particle->Vz() - prodVtxZ;
4727 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4730 Bool_t dalitzCand = kFALSE;
4732 TParticle* firstmother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4733 if (!firstmother)
return kFALSE;
4734 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4735 Bool_t intDecay = kFALSE;
4736 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4737 if ( intDecay && TMath::Abs(particle->GetPdgCode()) == 11 ){
4742 Long_t source = particle->GetMother(0);
4743 Bool_t foundExcludedPart = kFALSE;
4744 Bool_t foundShower = kFALSE;
4745 Int_t pdgCodeMotherPrev = 0;
4746 Int_t pdgCodeMotherPPrevMother = 0;
4754 TParticle* mother = (TParticle *)mcEvent->Particle(source);
4755 source = mother->GetMother(0);
4757 Int_t pdgCodeMother = mother->GetPdgCode();
4759 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4760 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4761 foundShower = kTRUE;
4764 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4765 foundShower = kTRUE;
4777 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4778 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4779 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312
4781 foundExcludedPart = kTRUE;
4784 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4785 pdgCodeMotherPrev = pdgCodeMother;
4786 if (source == -1) depth = 20;
4792 if (foundExcludedPart){
4798 }
else if (foundShower){
4813 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4814 if (AODMCTrackArray == NULL)
return kFALSE;
4815 AliAODMCParticle* currentParticle = AODMCParticle;
4816 if (TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4817 if (currentParticle->GetMother() != -1){
4818 AliAODMCParticle* particleMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4819 if (particleMother){
4820 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4821 currentParticle = particleMother;
4825 if (currentParticle->GetMother() > -1){
4826 Double_t deltaX = currentParticle->Xv() - prodVtxX;
4827 Double_t deltaY = currentParticle->Yv() - prodVtxY;
4828 Double_t deltaZ = currentParticle->Zv() - prodVtxZ;
4831 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4833 Bool_t dalitzCand = kFALSE;
4835 AliAODMCParticle* firstmother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4836 if (!firstmother)
return kFALSE;
4837 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4838 Bool_t intDecay = kFALSE;
4839 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4840 if ( intDecay && TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4845 Long_t source = currentParticle->GetMother();
4846 Bool_t foundExcludedPart = kFALSE;
4847 Bool_t foundShower = kFALSE;
4848 Int_t pdgCodeMotherPrev = 0;
4849 Int_t pdgCodeMotherPPrevMother = 0;
4857 AliAODMCParticle* mother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(source));
4858 source = mother->GetMother();
4860 Int_t pdgCodeMother = mother->GetPdgCode();
4862 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4863 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4864 foundShower = kTRUE;
4867 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4868 foundShower = kTRUE;
4880 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4881 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4882 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312)
4884 foundExcludedPart = kTRUE;
4887 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4888 pdgCodeMotherPrev = pdgCodeMother;
4889 if (source == -1) depth = 20;
4895 if (foundExcludedPart){
4901 }
else if (foundShower){
4916 if (particle != NULL && mcEvent != NULL){
4917 Int_t pdgSecondary = 0;
4921 Long_t motherID = particle->GetMother(0);
4922 Long_t grandMotherID = -1;
4926 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4928 if (grandMotherID > -1){
4930 pdgSecondary = mcEvent->Particle(grandMotherID)->GetPdgCode();
4937 Long_t motherID = particle->GetMother(0);
4938 Long_t grandMotherID = -1;
4939 Long_t greatGrandMotherID = -1;
4943 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4945 if (grandMotherID > -1){
4947 greatGrandMotherID = mcEvent->Particle(grandMotherID)->GetMother(0);
4949 if (greatGrandMotherID > -1){
4951 pdgSecondary = mcEvent->Particle(greatGrandMotherID)->GetPdgCode();
4957 if (TMath::Abs(pdgSecondary) == 3122 )
4960 else if ( TMath::Abs(pdgSecondary) == 310 )
4963 else if ( TMath::Abs(pdgSecondary) == 130 )
4966 else if ( TMath::Abs(pdgSecondary) == 221 )
4969 else if ( TMath::Abs(pdgSecondary) != 0 )
4979 if (particle != NULL && aodmcArray != NULL){
4980 Int_t pdgSecondary = 0;
4984 Long_t motherID = particle->GetMother();
4985 Long_t grandMotherID = -1;
4989 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4991 if (grandMotherID > -1){
4993 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetPdgCode();
5000 Long_t motherID = particle->GetMother();
5001 Long_t grandMotherID = -1;
5002 Long_t greatGrandMotherID = -1;
5006 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
5008 if (grandMotherID > -1){
5010 greatGrandMotherID = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetMother();
5012 if (greatGrandMotherID > -1){
5014 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(greatGrandMotherID))->GetPdgCode();
5020 if (TMath::Abs(pdgSecondary) == 3122 )
5023 else if ( TMath::Abs(pdgSecondary) == 310 )
5026 else if ( TMath::Abs(pdgSecondary) == 130 )
5029 else if ( TMath::Abs(pdgSecondary) == 221 )
5032 else if ( TMath::Abs(pdgSecondary) != 0 )
5042 if (periodName.CompareTo(
"") == 0){
5045 if (periodName.CompareTo(
"") == 0) {
5048 AliError(
"No correct period could be set, periodName string empty");
5053 if (periodName.CompareTo(
"LHC10b") == 0 || periodName.CompareTo(
"LHC10c") == 0 || periodName.CompareTo(
"LHC10d") == 0 || periodName.CompareTo(
"LHC10e") == 0 ||
5054 periodName.CompareTo(
"LHC10f") == 0 || periodName.CompareTo(
"LHC10g") == 0 || periodName.CompareTo(
"LHC10bg") == 0
5058 }
else if (periodName.CompareTo(
"LHC10h") == 0) {
5061 }
else if (periodName.CompareTo(
"LHC11a") == 0) {
5064 }
else if (periodName.CompareTo(
"LHC11b") == 0) {