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");
1009 printf(
"\t only events triggered by kMB, kCentral, kSemiCentral will be analysed \n");
1017 printf(
"Running in pPb mode \n");
1019 printf(
"\t centrality selection based on V0A \n");
1021 printf(
"\t centrality selection based on Cl1 \n");
1030 printf(
"\t only events triggered by kINT7 will be analysed \n");
1037 else printf(
"\t No vertex cut \n");
1040 printf(
"\t Doing pile up removal \n");
1042 printf(
"\t Doing extra pile up removal V0M vs TPCout \n");
1046 printf(
"MC event cuts: \n");
1050 printf(
"\t maximum factor between jet and pt hard = %2.2f \n",
fMaxFacPtHard);
1129 AliError(Form(
"SetHeavyIon not defined %d",isHeavyIon));
1139 if(minCentrality<0||minCentrality>20){
1140 AliError(Form(
"minCentrality not defined %d",minCentrality));
1152 if(maxCentrality<0||maxCentrality>20){
1153 AliError(Form(
"maxCentrality not defined %d",maxCentrality));
1164 switch(selectSpecialTrigger){
1194 fOfflineTriggerMask=AliVEvent::kPHI7 | AliVEvent::kPHI1 | AliVEvent::kPHI8 | AliVEvent::kPHOSPb;
1221 AliError(
"Warning: Special Trigger Not known");
1232 switch(selectSpecialSubTriggerClass){
1243 AliError(
"Warning: Special Subtrigger Class Not known");
1247 switch(selectSpecialSubTriggerClass){
1272 AliError(
"Warning: Special Subtrigger Class Not known");
1276 switch(selectSpecialSubTriggerClass){
1337 AliError(
"Warning: Special Subtrigger Class Not known");
1341 switch(selectSpecialSubTriggerClass){
1388 AliError(
"Warning: Special Subtrigger Class Not known");
1392 switch(selectSpecialSubTriggerClass){
1441 AliError(
"Warning: Special Subtrigger Class Not known");
1445 switch(selectSpecialSubTriggerClass){
1473 AliError(
"Warning: Special Subtrigger Class Not known");
1477 switch(selectSpecialSubTriggerClass){
1521 AliError(
"Warning: Special Subtrigger Class Not known");
1525 switch(selectSpecialSubTriggerClass){
1617 AliError(
"Warning: Special Subtrigger Class Not known");
1621 switch(selectSpecialSubTriggerClass){
1699 AliError(
"Warning: Special Subtrigger Class Not known");
1723 switch(removePileUp){
1857 AliError(
"RemovePileUpCut not defined");
1866 switch(extraSignal){
1880 AliError(Form(
"Extra Signal Rejection not defined %d",extraSignal));
1915 AliError(Form(
"Vertex Cut not defined %d",vertexCut));
1961 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
1963 AliWarning (
"AliMultSelection object not found !");
1967 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
1968 else return MultSelection->GetMultiplicityPercentile(
"V0M");
1969 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
1972 AliCentrality *fESDCentrality = (AliCentrality*)esdEvent->GetCentrality();
1974 if(
fIsHeavyIon==2)
return fESDCentrality->GetCentralityPercentile(
"V0A");
1975 else return fESDCentrality->GetCentralityPercentile(
"V0M");
1983 AliMultSelection *MultSelection = (AliMultSelection*)aodEvent->FindListObject(
"MultSelection");
1985 AliWarning (
"AliMultSelection object not found !");
1989 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
1990 else return MultSelection->GetMultiplicityPercentile(
"V0M",kTRUE);
1991 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
1994 if(aodEvent->GetHeader()){
return ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();}
2009 Int_t primaryTracksPP[9] = { 0, 2, 5, 10, 15,
2024 if(centrality<0 && !mcEvent)
return kFALSE;
2026 Int_t centralityC=0;
2028 centralityC=
Int_t(centrality/10);
2034 centralityC=
Int_t(centrality);
2037 }
else return kFALSE;
2041 Int_t PrimaryTracks10[11][2] =
2055 Int_t PrimaryTracksLHC11h10[11][2] =
2069 Int_t PrimaryTracksLHC15o10[11][2] =
2083 Int_t PrimaryTracksLHC10h5[21][2] =
2107 Int_t PrimaryTracksLHC11h5[21][2] =
2131 Int_t PrimaryTracksLHC15o5[21][2] =
2155 Int_t PrimaryTracksLHC17n10[11][2] =
2171 if(event->IsA()==AliESDEvent::Class()) column = 0;
2172 if(event->IsA()==AliAODEvent::Class()) column = 1;
2188 centralityC=
Int_t(centrality/10);
2190 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o10[0][column])
return kFALSE;
2192 }
else return kFALSE;
2201 centralityC=
Int_t(centrality/10);
2216 centralityC =
Int_t(centrality);
2218 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o5[0][column])
return kFALSE;
2220 }
else return kFALSE;
2229 centralityC=
Int_t(centrality);
2232 }
else return kFALSE;
2236 Int_t PrimaryTracksLHC11h10AltMin[11][2] =
2250 Int_t PrimaryTracksLHC11h10AltMax[11][2] =
2264 Int_t PrimaryTracksLHC11h5AltMin[21][2] =
2288 Int_t PrimaryTracksLHC11h5AltMax[21][2] =
2317 if(nprimaryTracks > PrimaryTracksLHC11h10AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h10AltMax[
fCentralityMin][column])
2325 centralityC=
Int_t(centrality/10);
2335 if(nprimaryTracks > PrimaryTracksLHC11h5AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h5AltMax[
fCentralityMin][column])
2342 centralityC=
Int_t(centrality);
2345 }
else return kFALSE;
2355 Double_t fVertexZ=
event->GetPrimaryVertex()->GetZ();
2359 fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ();
2363 fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ();
2366 if(TMath::Abs(fVertexZ)>
fMaxVertexZ)
return kFALSE;
2370 if (TMath::Abs(fVertexZ-fVertexZSPD) > 0.1)
return kFALSE;
2373 if(!
fUtils->IsVertexSelected2013pA(event))
return kFALSE;
2384 TBits fIR1 =
event->GetHeader()->GetIRInt1InteractionMap();
2385 TBits fIR2 =
event->GetHeader()->GetIRInt2InteractionMap();
2386 UShort_t bunchCrossings =
event->GetBunchCrossNumber();
2388 for(
Int_t i = 0; i<180;i++){
2389 if(fIR1.TestBitNumber(i))
2394 Bool_t isOutOfBunchPileup = 0;
2397 if(pf1 < -89) pf1 = -89;
2398 if(pf2 > 89) pf2 = 89;
2399 Int_t pf2maxForT0 = pf2;
2401 for (
Int_t i=pf1;i<=pf2;i++) {
2403 if (i<=pf2maxForT0) isOutOfBunchPileup|=fIR2.TestBitNumber(90+i);
2404 if (i>0 && i<=ir1skip)
continue;
2405 isOutOfBunchPileup|=fIR1.TestBitNumber(90+i);
2407 return isOutOfBunchPileup;
2413 Bool_t isPileUpV0MTPCout=0;
2418 multV0M =
event->GetVZEROData()->GetMTotV0A();
2420 multV0M =
event->GetVZEROData()->GetMTotV0A() +
event->GetVZEROData()->GetMTotV0C() ;
2425 if (multV0M < valFunc ) isPileUpV0MTPCout=1;
2428 return isPileUpV0MTPCout;
2437 if (fESDEvent->GetPrimaryVertex() != NULL){
2438 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
2440 return fESDEvent->GetPrimaryVertex()->GetNContributors();
2444 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
2445 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2447 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
2449 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
2458 if (fAODEvent->GetPrimaryVertex() != NULL){
2459 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
2460 return fAODEvent->GetPrimaryVertex()->GetNContributors();
2463 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
2464 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2465 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
2467 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
2480 AliGenCocktailEventHeader *cHeader = 0x0;
2481 Bool_t headerFound = kFALSE;
2501 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2502 if(cHeader) headerFound = kTRUE;
2510 TList *genHeaders = 0x0;
2511 if(cHeader) genHeaders = cHeader->GetHeaders();
2512 AliGenEventHeader* gh = 0;
2513 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2514 gh = (AliGenEventHeader*)genHeaders->At(i);
2515 TString GeneratorName = gh->GetName();
2516 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2517 Bool_t eventAccepted = kTRUE;
2518 TParticle * jet = 0;
2519 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(gh)->NTriggerJets();
2522 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2523 dynamic_cast<AliGenPythiaEventHeader*
>(gh)->TriggerJet(ijet, tmpjet);
2524 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2527 eventAccepted= kFALSE;
2531 if (jet)
delete jet;
2533 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2534 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2535 if (!particle)
continue;
2536 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2538 eventAccepted= kFALSE;
2546 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2548 70, 85, 99, 115, 132,
2549 150, 169, 190, 212, 235,
2551 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2552 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2553 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2554 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2556 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2557 if (bin < 20) weight = weightsBins[bin];
2560 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2562 70, 85, 99, 115, 132,
2563 150, 169, 190, 212, 235,
2565 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2566 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2567 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2568 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2571 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2572 if (bin < 20) weight = weightsBins[bin];
2575 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2577 70, 85, 99, 115, 132,
2578 150, 169, 190, 212, 235,
2580 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2581 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2582 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2583 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2585 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2586 if (bin < 20) weight = weightsBins[bin];
2590 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2593 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2594 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2595 1.933238e-05, 1.562895e-05};
2597 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2598 if (bin < 12) weight = weightsBins[bin];
2601 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2602 84, 117, 152, 191, 1000000,
2604 21, 28, 36, 45, 57 };
2605 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2606 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2607 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2608 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2612 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2613 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2614 if (bin < 19) weight = weightsBins[bin];
2617 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2618 84, 117, 152, 191, 1000000,
2620 21, 28, 36, 45, 57 };
2622 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2623 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2624 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2625 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2628 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2629 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2630 if (bin < 19) weight = weightsBins[bin];
2633 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2635 70, 85, 99, 115, 132,
2636 150, 169, 190, 212, 235,
2638 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2639 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2640 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2641 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2643 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2644 if (bin < 20) weight = weightsBins[bin];
2647 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2648 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2650 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2651 if (bin < 5) weight = weightsBins[bin];
2654 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2655 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2657 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2658 if (bin < 6) weight = weightsBins[bin];
2661 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2662 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2664 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2665 if (bin < 7) weight = weightsBins[bin];
2668 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2669 84, 117, 152, 191, 234,
2671 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2672 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2674 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2675 if (bin < 10) weight = weightsBins[bin];
2678 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};
2679 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};
2681 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2682 if (bin < 20) weight = weightsBins[bin];
2684 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};
2685 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};
2687 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2688 if (bin < 20) weight = weightsBins[bin];
2690 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};
2691 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};
2693 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2694 if (bin < 20) weight = weightsBins[bin];
2700 if (weight == -1)
return kFALSE;
2701 else return eventAccepted;
2706 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2707 TString eventHeaderName = eventHeader->ClassName();
2708 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2709 Bool_t eventAccepted = kTRUE;
2710 TParticle * jet = 0;
2711 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->NTriggerJets();
2712 Float_t ptHard =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
2714 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2715 dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->TriggerJet(ijet, tmpjet);
2716 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2719 eventAccepted= kFALSE;
2724 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2725 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2726 if (!particle)
continue;
2727 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2729 eventAccepted= kFALSE;
2737 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2739 70, 85, 99, 115, 132,
2740 150, 169, 190, 212, 235,
2742 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2743 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2744 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2745 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2747 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2748 if (bin < 20) weight = weightsBins[bin];
2751 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2753 70, 85, 99, 115, 132,
2754 150, 169, 190, 212, 235,
2756 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2757 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2758 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2759 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2762 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2763 if (bin < 20) weight = weightsBins[bin];
2766 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2768 70, 85, 99, 115, 132,
2769 150, 169, 190, 212, 235,
2771 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2772 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2773 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2774 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2776 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2777 if (bin < 20) weight = weightsBins[bin];
2781 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2784 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2785 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2786 1.933238e-05, 1.562895e-05};
2788 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2789 if (bin < 12) weight = weightsBins[bin];
2792 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2793 84, 117, 152, 191, 1000000,
2795 21, 28, 36, 45, 57 };
2796 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2797 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2798 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2799 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2803 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2804 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2805 if (bin < 19) weight = weightsBins[bin];
2808 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2809 84, 117, 152, 191, 1000000,
2811 21, 28, 36, 45, 57 };
2813 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2814 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2815 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2816 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2819 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2820 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2821 if (bin < 19) weight = weightsBins[bin];
2824 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2826 70, 85, 99, 115, 132,
2827 150, 169, 190, 212, 235,
2829 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2830 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2831 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2832 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2834 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2835 if (bin < 20) weight = weightsBins[bin];
2838 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2839 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2841 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2842 if (bin < 5) weight = weightsBins[bin];
2845 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2846 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2848 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2849 if (bin < 6) weight = weightsBins[bin];
2852 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2853 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2855 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2856 if (bin < 7) weight = weightsBins[bin];
2859 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2860 84, 117, 152, 191, 234,
2862 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2863 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2865 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2866 if (bin < 10) weight = weightsBins[bin];
2871 if (weight == -1)
return kFALSE;
2872 else return eventAccepted;
2887 AliGenCocktailEventHeader *cHeader = 0x0;
2888 Bool_t headerFound = kFALSE;
2906 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2907 if(cHeader) headerFound = kTRUE;
2916 TList *genHeaders = 0x0;
2917 if(cHeader) genHeaders = cHeader->GetHeaders();
2918 AliGenEventHeader* gh = 0;
2919 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2920 gh = (AliGenEventHeader*)genHeaders->At(i);
2921 TString GeneratorName = gh->GetName();
2922 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2923 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(gh);
2924 NTrials = gPythia->Trials();
2925 XSection = gPythia->GetXsection();
2930 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2932 TString eventHeaderName = eventHeader->ClassName();
2933 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2934 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader);
2935 NTrials = gPythia->Trials();
2936 XSection = gPythia->GetXsection();
2952 AliGenCocktailEventHeader *cHeader = 0x0;
2953 Bool_t headerFound = kFALSE;
2967 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2968 if(cHeader) headerFound = kTRUE;
2975 TList *genHeaders = 0x0;
2976 if(cHeader) genHeaders = cHeader->GetHeaders();
2977 AliGenEventHeader* gh = 0;
2978 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2979 gh = (AliGenEventHeader*)genHeaders->At(i);
2980 TString GeneratorName = gh->GetName();
2981 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2982 return dynamic_cast<AliGenPythiaEventHeader*
>(gh)->
GetPtHard();
2986 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2988 TString eventHeaderName = eventHeader->ClassName();
2989 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2990 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
3005 Int_t runRangesEMCalL0 [35] = { 144871, 145288, 146375, 146382,
3007 150209, 153056, 153911, 153915,
3008 158135, 158136, 158178, 158182, 160683,
3009 160764, 161139, 161256, 161379, 161457,
3010 161525, 161556, 161558, 161609, 161630,
3012 173731, 177144, 177147, 177653, 177724, 178327,
3017 Double_t thresholdEMCalL0[34] = { 2.11, 3.43, 1.71, 2.05,
3019 1.94, 3.39, 4.01, 5.25, 5.5,
3020 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,
3021 2.01, 1.75, 1.52, 2.01, 1.52, 1.85,
3025 Double_t spreadEMCalL0[34] = { 0., 0., 0, 0,
3028 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
3029 0., 0., 0., 0., 0.2, 0.2,
3034 Int_t runRangesEMCalL1[4] = { 179796,
3039 Double_t thresholdEMCalL1[3] = { 9.5, 11.5, 5.5};
3040 Double_t spreadEMCalL1[3] = { 1.0, 0.5, 0.6};
3042 Int_t runRangesEMCalL1G2[3] = { 195180,
3046 Double_t thresholdEMCalL1G2[2] = { 7.2, 3.75};
3047 Double_t spreadEMCalL1G2[2] = { 0.3, 0.25};
3049 Int_t runnumber =
event->GetRunNumber();
3052 if (runnumber < runRangesEMCalL0[0])
return kTRUE;
3054 while (!(runnumber >= runRangesEMCalL0[binRun] && runnumber < runRangesEMCalL0[binRun+1] ) && binRun < 34 ){
3058 if (binRun==34)
return kFALSE;
3059 Double_t threshold = thresholdEMCalL0[binRun];
3061 if (isMC && spreadEMCalL0[binRun] != 0.){
3062 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3063 triggerSmearing->SetParameter(0, 1/(spreadEMCalL0[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3064 triggerSmearing->SetParameter(1, thresholdEMCalL0[binRun]);
3065 triggerSmearing->SetParameter(2, spreadEMCalL0[binRun]);
3066 threshold = triggerSmearing->GetRandom();
3067 delete triggerSmearing;
3072 TClonesArray * arrClustersMimic = NULL;
3074 nclus =
event->GetNumberOfCaloClusters();
3076 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3077 if(!arrClustersMimic)
3078 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3079 nclus = arrClustersMimic->GetEntries();
3082 if(nclus == 0)
return kFALSE;
3085 Bool_t eventIsAccepted = kFALSE;
3086 for(
Int_t i = 0; i < nclus; i++){
3087 AliVCluster* clus = NULL;
3088 if(event->IsA()==AliESDEvent::Class()){
3089 if(arrClustersMimic)
3090 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3092 clus =
event->GetCaloCluster(i);
3093 }
else if(event->IsA()==AliAODEvent::Class()){
3094 if(arrClustersMimic)
3095 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3097 clus =
event->GetCaloCluster(i);
3100 if (!clus)
continue;
3101 if (!clus->IsEMCAL())
continue;
3102 if (clus->GetM02()<0.1)
continue;
3103 if (clus->GetNCells()<2)
continue;
3104 if (clus->E() > threshold ){
3106 eventIsAccepted = kTRUE;
3109 return eventIsAccepted;
3116 if (runnumber < runRangesEMCalL1[0])
return kTRUE;
3118 while (!(runnumber >= runRangesEMCalL1[binRun] && runnumber < runRangesEMCalL1[binRun+1] ) && binRun < 3 ){
3122 if (binRun==3)
return kFALSE;
3123 Double_t threshold = thresholdEMCalL1[binRun];
3125 if (isMC && spreadEMCalL1[binRun] != 0.){
3126 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3127 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3128 triggerSmearing->SetParameter(1, thresholdEMCalL1[binRun]);
3129 triggerSmearing->SetParameter(2, spreadEMCalL1[binRun]);
3130 threshold = triggerSmearing->GetRandom();
3131 delete triggerSmearing;
3136 TClonesArray * arrClustersMimic = NULL;
3139 nclus =
event->GetNumberOfCaloClusters();
3141 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3142 if(!arrClustersMimic)
3143 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3144 nclus = arrClustersMimic->GetEntries();
3147 if(nclus == 0)
return kFALSE;
3150 Bool_t eventIsAccepted = kFALSE;
3151 for(
Int_t i = 0; i < nclus; i++){
3152 AliVCluster* clus = NULL;
3153 if(event->IsA()==AliESDEvent::Class()){
3154 if(arrClustersMimic)
3155 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3157 clus =
event->GetCaloCluster(i);
3158 }
else if(event->IsA()==AliAODEvent::Class()){
3159 if(arrClustersMimic)
3160 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3162 clus =
event->GetCaloCluster(i);
3164 if (!clus)
continue;
3165 if (!clus->IsEMCAL())
continue;
3166 if (clus->GetM02()<0.1)
continue;
3167 if (clus->GetNCells()<2)
continue;
3168 if (clus->E() > threshold ){
3170 eventIsAccepted = kTRUE;
3173 return eventIsAccepted;
3175 if (runnumber < runRangesEMCalL1G2[0])
return kTRUE;
3177 while (!(runnumber >= runRangesEMCalL1G2[binRun] && runnumber < runRangesEMCalL1G2[binRun+1] ) && binRun < 2 ){
3181 if (binRun==2)
return kFALSE;
3182 Double_t threshold = thresholdEMCalL1G2[binRun];
3183 if (isMC && spreadEMCalL1G2[binRun] != 0.){
3184 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3185 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1G2[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3186 triggerSmearing->SetParameter(1, thresholdEMCalL1G2[binRun]);
3187 triggerSmearing->SetParameter(2, spreadEMCalL1G2[binRun]);
3188 threshold = triggerSmearing->GetRandom();
3189 delete triggerSmearing;
3194 TClonesArray * arrClustersMimic = NULL;
3196 nclus =
event->GetNumberOfCaloClusters();
3198 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3199 if(!arrClustersMimic)
3200 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3201 nclus = arrClustersMimic->GetEntries();
3204 if(nclus == 0)
return kFALSE;
3207 Bool_t eventIsAccepted = kFALSE;
3208 for(
Int_t i = 0; i < nclus; i++){
3209 AliVCluster* clus = NULL;
3210 if(event->IsA()==AliESDEvent::Class()){
3211 if(arrClustersMimic)
3212 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3214 clus =
event->GetCaloCluster(i);
3215 }
else if(event->IsA()==AliAODEvent::Class()){
3216 if(arrClustersMimic)
3217 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3219 clus =
event->GetCaloCluster(i);
3221 if (!clus)
continue;
3222 if (!clus->IsEMCAL())
continue;
3223 if (clus->GetM02()<0.1)
continue;
3224 if (clus->GetNCells()<2)
continue;
3225 if (clus->E() > threshold ){
3227 eventIsAccepted = kTRUE;
3230 return eventIsAccepted;
3247 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3250 UInt_t isSelected = AliVEvent::kAny;
3252 if (fInputHandler==NULL)
return kFALSE;
3253 if( fInputHandler->GetEventSelection() ||
event->IsA()==AliAODEvent::Class()) {
3255 TString firedTrigClass =
event->GetFiredTriggerClasses();
3296 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3298 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3300 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3304 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3305 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3307 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3308 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3315 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3317 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3319 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
3322 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3323 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3324 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
3327 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3329 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3332 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3333 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3338 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3339 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3340 if (firedTrigClass.Contains(
"7EG1")) isSelected = 0;
3342 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3343 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3344 if (firedTrigClass.Contains(
"8EG1")) isSelected = 0;
3346 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3347 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3349 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3350 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3354 if (isSelected != 0 ){
3386 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3387 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3388 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3392 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3393 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3394 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3398 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3399 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3400 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3405 for (
Int_t i=0; i<ClassesList->GetEntriesFast(); i++){
3406 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3407 if (firedTrigClass.Contains(NameClass->GetString())) CheckClass+=
"1";
3408 else CheckClass+=
"0";
3410 if(CheckClass.Contains(
"0")) isSelected = 0;
3417 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3419 Bool_t mimickedTrigger = kTRUE;
3426 if (mimickedTrigger){
3427 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)
hTriggerClass->Fill(0);
3428 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)
hTriggerClass->Fill(1);
3429 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)
hTriggerClass->Fill(2);
3430 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)
hTriggerClass->Fill(3);
3431 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)
hTriggerClass->Fill(4);
3432 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)
hTriggerClass->Fill(5);
3433 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)
hTriggerClass->Fill(6);
3435 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)
hTriggerClass->Fill(7);
3437 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)
hTriggerClass->Fill(8);
3439 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)
hTriggerClass->Fill(9);
3441 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)
hTriggerClass->Fill(10);
3443 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)
hTriggerClass->Fill(11);
3444 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)
hTriggerClass->Fill(12);
3445 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)
hTriggerClass->Fill(13);
3448 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)
hTriggerClass->Fill(14);
3449 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)
hTriggerClass->Fill(15);
3450 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)
hTriggerClass->Fill(16);
3451 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)
hTriggerClass->Fill(17);
3452 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)
hTriggerClass->Fill(18);
3453 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)
hTriggerClass->Fill(19);
3454 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)
hTriggerClass->Fill(20);
3456 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)
hTriggerClass->Fill(21);
3457 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClass->Fill(22);
3458 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClass->Fill(23);
3459 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)
hTriggerClass->Fill(24);
3460 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClass->Fill(25);
3461 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClass->Fill(26);
3462 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)
hTriggerClass->Fill(27);
3463 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)
hTriggerClass->Fill(28);
3464 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)
hTriggerClass->Fill(29);
3465 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)
hTriggerClass->Fill(30);
3466 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)
hTriggerClass->Fill(31);
3467 if (!fInputHandler->IsEventSelected())
hTriggerClass->Fill(34);
3473 if (mimickedTrigger){
3505 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClassSelected->Fill(22);
3506 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClassSelected->Fill(23);
3508 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClassSelected->Fill(25);
3509 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClassSelected->Fill(26);
3519 if(!isSelected)
return kFALSE;
3521 if (!mimickedTrigger )
return kFALSE;
3548 if(rejection == 0)
return;
3550 AliGenCocktailEventHeader *cHeader = 0x0;
3551 AliAODMCHeader *cHeaderAOD = 0x0;
3552 Bool_t headerFound = kFALSE;
3553 AliMCEvent *fMCEvent = 0x0;
3554 TClonesArray *fMCEventAOD = 0x0;
3555 if(event->IsA()==AliMCEvent::Class()){
3556 if(dynamic_cast<AliMCEvent*>(event)){
3557 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(
dynamic_cast<AliMCEvent*
>(event)->GenEventHeader());
3558 fMCEvent =
dynamic_cast<AliMCEvent*
>(event);
3559 if(cHeader) headerFound = kTRUE;
3562 if(event->IsA()==AliAODEvent::Class()){
3563 cHeaderAOD =
dynamic_cast<AliAODMCHeader*
>(
event->FindListObject(AliAODMCHeader::StdBranchName()));
3564 fMCEventAOD =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
3565 if(cHeaderAOD) headerFound = kTRUE;
3568 if (
fDebugLevel > 0 ) cout <<
"event starts here" << endl;
3570 TList *genHeaders = 0x0;
3571 if(cHeader) genHeaders = cHeader->GetHeaders();
3573 genHeaders = cHeaderAOD->GetCocktailHeaders();
3574 if(genHeaders->GetEntries()==1){
3579 AliGenEventHeader* gh = 0;
3581 Int_t firstindexA = 0;
3582 Int_t lastindexA = -1;
3583 if(rejection == 1 || rejection == 3)
fnHeaders = 1;
3585 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3586 gh = (AliGenEventHeader*)genHeaders->At(i);
3587 TString GeneratorName = gh->GetName();
3588 lastindexA = lastindexA + gh->NProduced();
3589 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3590 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3591 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3592 if (
fDebugLevel > 0 ) cout << GeneratorInList.Data() << endl;
3593 if(GeneratorInList.Contains(GeneratorName) ){
3595 if (GeneratorInList.BeginsWith(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
3598 if (
fDebugLevel > 2 )cout <<
"number of produced particle: " << gh->NProduced() << endl;
3599 if (
fDebugLevel > 2 )cout <<
"pdg-code of first particle: " << fMCEvent->Particle(firstindexA)->GetPdgCode() << endl;
3601 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindexA+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
3605 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3606 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3610 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3611 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3626 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA));
3629 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0){
3630 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA+10));
3636 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3637 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3641 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3642 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3658 if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
3665 firstindexA = firstindexA + gh->NProduced();
3674 if(rejection == 1 || rejection == 3){
3676 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
3677 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
3682 Int_t firstindex = 0;
3683 Int_t lastindex = -1;
3686 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3687 gh = (AliGenEventHeader*)genHeaders->At(i);
3688 TString GeneratorName = gh->GetName();
3689 lastindex = lastindex + gh->NProduced();
3690 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3691 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3692 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3693 if(GeneratorInList.Contains(GeneratorName) ){
3694 if (GeneratorInList.Contains(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
3698 if (
fDebugLevel > 0 ) cout <<
"produced " << gh->NProduced() <<
" with box generator" << endl;
3699 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindex+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
3700 if (
fDebugLevel > 0 ) cout <<
"one of them was a pi0 or eta" << endl;
3705 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
3707 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3712 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
3714 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3719 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
3733 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex));
3736 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0) {
3737 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex+10));
3745 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3750 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
3752 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3757 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
3771 }
else if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
3775 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
3782 firstindex = firstindex + gh->NProduced();
3785 for (
Int_t i = 0; i < number; i++){
3795 fNotRejectedEnd[0] =
static_cast<AliMCEvent*
>(event)->GetNumberOfPrimaries()-1;
3812 if(index < 0)
return 0;
3815 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
3816 if(!mcEvent)
return 0;
3817 if(index >= mcEvent->GetNumberOfPrimaries()){
3818 if( ((TParticle*)mcEvent->Particle(index))->GetMother(0) < 0)
return 0;
3826 if(i == 0) accepted = 2;
3829 if (debug > 1 && !accepted) cout <<
"rejected:" << index << endl;
3831 else if(InputEvent->IsA()==AliAODEvent::Class()){
3832 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3833 if (AODMCTrackArray){
3834 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
3835 if(!aodMCParticle)
return 0;
3836 if(!aodMCParticle->IsPrimary()){
3837 if( aodMCParticle->GetMother() < 0)
return 0;
3840 index = TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
3844 if(i == 0) accepted = 2;
3857 if (mcEvent){isMC = kTRUE;}
3885 Int_t runnumber =
event->GetRunNumber();
3886 if ((runnumber>=144871) && (runnumber<=146860)) {
3888 AliVCaloCells *cells =
event->GetEMCALCells();
3889 const Short_t nCells = cells->GetNumberOfCells();
3891 if (event->IsA()==AliESDEvent::Class()) AliAnalysisManager::GetAnalysisManager()->LoadBranch(
"EMCALCells.");
3893 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3894 if (!fInputHandler)
return 3;
3897 Int_t nCellCount[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
3898 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
3899 Short_t cellId = cells->GetCellNumber(iCell);
3900 Double_t cellE = cells->GetCellAmplitude(cellId);
3901 Int_t sm = cellId / (24*48);
3902 if (cellE>0.1) ++nCellCount[sm];
3905 Bool_t fIsLedEvent = kFALSE;
3906 if (nCellCount[4] > 100) {
3907 fIsLedEvent = kTRUE;
3909 if ((runnumber>=146858) && (runnumber<=146860)) {
3910 if ((fInputHandler->IsEventSelected() & AliVEvent::kMB) && (nCellCount[3]>=21))
3911 fIsLedEvent = kTRUE;
3912 else if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC1) && (nCellCount[3]>=35))
3913 fIsLedEvent = kTRUE;
3923 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
3924 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
3925 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
3930 if(event->IsA()==AliESDEvent::Class()){
3934 for(
Int_t i=0; i<nPileVert;i++){
3935 const AliESDVertex* pv= ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
3936 Int_t nc2 = pv->GetNContributors();
3941 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
3955 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
3959 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
3965 if(
fUtils->IsPileUpEvent(event) ){
3969 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
3990 AliEventplane *EventPlane =
event->GetEventplane();
4003 AliInfo(
"Inside the GetWeightForCentralityFlattening function");
4006 if(!event || event->IsA()==AliESDEvent::Class()){
4009 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
4011 centrality = fESDCentrality->GetCentralityPercentile(
"V0M");
4014 }
else if(event->IsA()==AliAODEvent::Class()){
4017 if(aodEvent->GetHeader()){
4018 centrality = ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();
4024 Float_t GetValueForWeight = 1.;
4027 Bool_t CorrCentrLoop = kFALSE;
4033 CorrCentrLoop = kTRUE;
4037 CorrCentrLoop = kTRUE;
4039 CorrCentrLoop = kFALSE;
4042 if (CorrCentrLoop && GetValueForWeight != 0. && maximum !=0. && isfinite(GetValueForWeight) && isfinite(maximum) ){
4043 weightCentrality = maximum/GetValueForWeight;
4044 if (!isfinite(GetValueForWeight)) weightCentrality = 1.;
4045 if (!isfinite(weightCentrality)) weightCentrality = 1.;
4048 return weightCentrality;
4067 if (relativeErrorData < 0.2 && relativeErrorMC < 0.2 ){
4068 if (isfinite(valueMultData) && isfinite(valueMultMC) ){
4069 weightMult = valueMultData/valueMultMC;
4088 if(index < 0)
return 0;
4096 if (kCaseGen == 0)
return 1;
4101 if(!event || event->IsA()==AliESDEvent::Class()){
4102 mesonPt = ((TParticle*)mcEvent->Particle(index))->Pt();
4104 PDGCode = ((TParticle*)mcEvent->Particle(index))->GetPdgCode();
4105 }
else if(event->IsA()==AliAODEvent::Class()){
4106 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4107 if (AODMCTrackArray){
4108 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4109 mesonPt = aodMCParticle->Pt();
4111 PDGCode = aodMCParticle->GetPdgCode();
4117 Float_t functionResultMC = 1.;
4128 Float_t functionResultData = 1;
4140 if (PDGCode == 111 || PDGCode == 221){
4141 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
4142 weight = functionResultData/functionResultMC;
4143 if ( kCaseGen == 3){
4144 if (PDGCode == 111){
4149 if (PDGCode == 221){
4155 if (!isfinite(functionResultData)) weight = 1.;
4156 if (!isfinite(weight)) weight = 1.;
4158 }
else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
4159 weight = functionResultMC;
4175 printf(
" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),-0.465);
4178 printf(
" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),0.465);
4181 else printf(
" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(
GetCutNumber()).
Data());
4193 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
4201 AliEMCALTriggerPatchInfo *patch;
4202 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4204 if (patch->IsMainTrigger()) {
4221 if (event->IsA()==AliESDEvent::Class()){
4231 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
4237 if (event->IsA()==AliESDEvent::Class()){
4269 AliEMCALTriggerPatchInfo *patch;
4271 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4276 if (patch->IsGammaHigh()){
4280 if (patch->IsGammaLow()){
4284 if (patch->IsJetHigh()){
4288 if (patch->IsJetLow()){
4292 if (patch->IsLevel0()){
4303 AliDebug(2,
"Patch summary: ");
4304 AliDebug(2, Form(
"Number of patches: %d", nPatch));
4305 AliDebug(2, Form(
"Level0: [%d]" ,nL0));
4306 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
4307 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
4319 SETBIT(triggers,
kG1);
4321 SETBIT(triggers,
kG2);
4323 SETBIT(triggers,
kJ1);
4325 SETBIT(triggers,
kJ2);
4327 SETBIT(triggers,
kL0);
4346 TClonesArray *arr = 0;
4348 if (!sname.IsNull()) {
4349 arr =
dynamic_cast<TClonesArray*
>(
event->FindListObject(sname));
4351 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
4361 TString objname(arr->GetClass()->GetName());
4362 TClass cls(objname);
4363 if (!cls.InheritsFrom(clname)) {
4364 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
4365 GetName(), cls.GetName(), name, clname));
4374 if (eventpos < 0)
return kFALSE;
4375 TParticle* particle = (TParticle *)mcEvent->Particle(eventpos);
4376 if (!particle)
return kFALSE;
4377 if (TMath::Abs(particle->GetPdgCode()) == 11 ){
4378 if (particle->GetMother(0) != -1){
4379 TParticle* particleMother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4380 if (particleMother){
4381 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4382 particle = particleMother;
4386 if (particle->GetMother(0) != -1){
4387 Double_t deltaX = particle->Vx() - prodVtxX;
4388 Double_t deltaY = particle->Vy() - prodVtxY;
4389 Double_t deltaZ = particle->Vz() - prodVtxZ;
4392 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4395 Bool_t dalitzCand = kFALSE;
4397 TParticle* firstmother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4398 if (!firstmother)
return kFALSE;
4399 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4400 Bool_t intDecay = kFALSE;
4401 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4402 if ( intDecay && TMath::Abs(particle->GetPdgCode()) == 11 ){
4407 Long_t source = particle->GetMother(0);
4408 Bool_t foundExcludedPart = kFALSE;
4409 Bool_t foundShower = kFALSE;
4410 Int_t pdgCodeMotherPrev = 0;
4411 Int_t pdgCodeMotherPPrevMother = 0;
4419 TParticle* mother = (TParticle *)mcEvent->Particle(source);
4420 source = mother->GetMother(0);
4422 Int_t pdgCodeMother = mother->GetPdgCode();
4424 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4425 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4426 foundShower = kTRUE;
4429 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4430 foundShower = kTRUE;
4442 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4443 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4444 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312
4446 foundExcludedPart = kTRUE;
4449 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4450 pdgCodeMotherPrev = pdgCodeMother;
4451 if (source == -1) depth = 20;
4457 if (foundExcludedPart){
4463 }
else if (foundShower){
4478 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4479 if (AODMCTrackArray == NULL)
return kFALSE;
4480 AliAODMCParticle* currentParticle = AODMCParticle;
4481 if (TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4482 if (currentParticle->GetMother() != -1){
4483 AliAODMCParticle* particleMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4484 if (particleMother){
4485 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4486 currentParticle = particleMother;
4490 if (currentParticle->GetMother() > -1){
4491 Double_t deltaX = currentParticle->Xv() - prodVtxX;
4492 Double_t deltaY = currentParticle->Yv() - prodVtxY;
4493 Double_t deltaZ = currentParticle->Zv() - prodVtxZ;
4496 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4498 Bool_t dalitzCand = kFALSE;
4500 AliAODMCParticle* firstmother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4501 if (!firstmother)
return kFALSE;
4502 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4503 Bool_t intDecay = kFALSE;
4504 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4505 if ( intDecay && TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4510 Long_t source = currentParticle->GetMother();
4511 Bool_t foundExcludedPart = kFALSE;
4512 Bool_t foundShower = kFALSE;
4513 Int_t pdgCodeMotherPrev = 0;
4514 Int_t pdgCodeMotherPPrevMother = 0;
4522 AliAODMCParticle* mother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(source));
4523 source = mother->GetMother();
4525 Int_t pdgCodeMother = mother->GetPdgCode();
4527 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4528 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4529 foundShower = kTRUE;
4532 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4533 foundShower = kTRUE;
4545 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4546 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4547 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312)
4549 foundExcludedPart = kTRUE;
4552 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4553 pdgCodeMotherPrev = pdgCodeMother;
4554 if (source == -1) depth = 20;
4560 if (foundExcludedPart){
4566 }
else if (foundShower){
4581 if (particle != NULL && mcEvent != NULL){
4582 Int_t pdgSecondary = 0;
4586 Long_t motherID = particle->GetMother(0);
4587 Long_t grandMotherID = -1;
4591 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4593 if (grandMotherID > -1){
4595 pdgSecondary = mcEvent->Particle(grandMotherID)->GetPdgCode();
4602 Long_t motherID = particle->GetMother(0);
4603 Long_t grandMotherID = -1;
4604 Long_t greatGrandMotherID = -1;
4608 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4610 if (grandMotherID > -1){
4612 greatGrandMotherID = mcEvent->Particle(grandMotherID)->GetMother(0);
4614 if (greatGrandMotherID > -1){
4616 pdgSecondary = mcEvent->Particle(greatGrandMotherID)->GetPdgCode();
4622 if (TMath::Abs(pdgSecondary) == 3122 )
4625 else if ( TMath::Abs(pdgSecondary) == 310 )
4628 else if ( TMath::Abs(pdgSecondary) == 130 )
4631 else if ( TMath::Abs(pdgSecondary) == 221 )
4634 else if ( TMath::Abs(pdgSecondary) != 0 )
4644 if (particle != NULL && aodmcArray != NULL){
4645 Int_t pdgSecondary = 0;
4649 Long_t motherID = particle->GetMother();
4650 Long_t grandMotherID = -1;
4654 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4656 if (grandMotherID > -1){
4658 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetPdgCode();
4665 Long_t motherID = particle->GetMother();
4666 Long_t grandMotherID = -1;
4667 Long_t greatGrandMotherID = -1;
4671 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4673 if (grandMotherID > -1){
4675 greatGrandMotherID = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetMother();
4677 if (greatGrandMotherID > -1){
4679 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(greatGrandMotherID))->GetPdgCode();
4685 if (TMath::Abs(pdgSecondary) == 3122 )
4688 else if ( TMath::Abs(pdgSecondary) == 310 )
4691 else if ( TMath::Abs(pdgSecondary) == 130 )
4694 else if ( TMath::Abs(pdgSecondary) == 221 )
4697 else if ( TMath::Abs(pdgSecondary) != 0 )
4707 if (periodName.CompareTo(
"") == 0){
4710 if (periodName.CompareTo(
"") == 0) {
4713 AliError(
"No correct period could be set, periodName string empty");
4718 if (periodName.CompareTo(
"LHC10b") == 0 || periodName.CompareTo(
"LHC10c") == 0 || periodName.CompareTo(
"LHC10d") == 0 || periodName.CompareTo(
"LHC10e") == 0 ||
4719 periodName.CompareTo(
"LHC10f") == 0 || periodName.CompareTo(
"LHC10g") == 0 || periodName.CompareTo(
"LHC10bg") == 0
4723 }
else if (periodName.CompareTo(
"LHC10h") == 0) {
4726 }
else if (periodName.CompareTo(
"LHC11a") == 0) {
4729 }
else if (periodName.CompareTo(
"LHC11b") == 0) {
4732 }
else if (periodName.CompareTo(
"LHC11c") == 0 || periodName.CompareTo(
"LHC11d") == 0 || periodName.CompareTo(
"LHC11e") == 0 || periodName.CompareTo(
"LHC11f") == 0 ||
4733 periodName.CompareTo(
"LHC11g") == 0
4737 }
else if (periodName.CompareTo(
"LHC11h") == 0) {
4740 }
else if (periodName.CompareTo(
"LHC12a") == 0 || periodName.CompareTo(
"LHC12b") == 0 || periodName.CompareTo(
"LHC12c") == 0 || periodName.CompareTo(
"LHC12d") == 0 ||
4741 periodName.CompareTo(
"LHC12e") == 0 || periodName.CompareTo(
"LHC12f") == 0 || periodName.CompareTo(
"LHC12g") == 0 || periodName.CompareTo(
"LHC12h") == 0 ||
4742 periodName.CompareTo(
"LHC12i") == 0 || periodName.CompareTo(
"LHC12ai") == 0
4746 }
else if (periodName.CompareTo(
"LHC13b") == 0 || periodName.CompareTo(
"LHC13c") == 0 || periodName.CompareTo(
"LHC13bc") == 0){
4749 }
else if (periodName.CompareTo(
"LHC13d") == 0 || periodName.CompareTo(
"LHC13e") == 0 || periodName.CompareTo(
"LHC13de") == 0){
4752 }
else if (periodName.CompareTo(
"LHC13f") == 0 ){
4755 }
else if (periodName.CompareTo(
"LHC13g") == 0 ){
4758 }
else if ( periodName.CompareTo(
"LHC15f") == 0 || periodName.CompareTo(
"LHC15g") == 0 || periodName.CompareTo(
"LHC15h") == 0 || periodName.CompareTo(
"LHC15i") == 0 ||
4759 periodName.CompareTo(
"LHC15j") == 0 || periodName.CompareTo(
"LHC15k") == 0 || periodName.CompareTo(
"LHC15l") == 0 || periodName.CompareTo(
"LHC15m") == 0 ||
4760 periodName.CompareTo(
"LHC15fm") == 0
4764 }
else if (periodName.CompareTo(
"LHC15n") == 0 ){
4767 }
else if (periodName.CompareTo(
"LHC15o") == 0 ){
4770 }
else if ( periodName.CompareTo(
"LHC16dp") == 0 || periodName.CompareTo(
"LHC16d") == 0 || periodName.CompareTo(
"LHC16e") == 0 || periodName.CompareTo(
"LHC16g") == 0 ||
4771 periodName.CompareTo(
"LHC16h") == 0 || periodName.CompareTo(
"LHC16i") == 0 || periodName.CompareTo(
"LHC16j") == 0 || periodName.CompareTo(
"LHC16k") == 0 || periodName.CompareTo(
"LHC16l") == 0 || periodName.CompareTo(
"LHC16m") == 0 || periodName.CompareTo(
"LHC16n") == 0 || periodName.CompareTo(
"LHC16o") == 0 ||
4772 periodName.CompareTo(
"LHC16p") == 0){
4775 }
else if (periodName.CompareTo(
"LHC16f") == 0 ){
4778 }
else if (periodName.CompareTo(
"LHC16qt") == 0 || periodName.CompareTo(
"LHC16q") == 0 || periodName.CompareTo(
"LHC16t") == 0 ){
4781 }
else if (periodName.CompareTo(
"LHC16r") == 0 ){
4784 }
else if (periodName.CompareTo(
"LHC16s") == 0 ){
4787 }
else if (periodName.CompareTo(
"LHC17cr") == 0 || periodName.CompareTo(
"LHC17c") == 0 || periodName.CompareTo(
"LHC17d") == 0 || periodName.CompareTo(
"LHC17e") == 0 ||
4788 periodName.CompareTo(
"LHC17f") == 0 || periodName.CompareTo(
"LHC17h") == 0 || periodName.CompareTo(
"LHC17i") == 0 || periodName.CompareTo(
"LHC17j") == 0 ||
4789 periodName.CompareTo(
"LHC17k") == 0 || periodName.CompareTo(
"LHC17l") == 0 || periodName.CompareTo(
"LHC17m") == 0 || periodName.CompareTo(
"LHC17o") == 0 ||
4790 periodName.CompareTo(
"LHC17r") == 0 ){
4793 }
else if ( periodName.CompareTo(
"LHC17g") == 0 ){
4796 }
else if ( periodName.CompareTo(
"LHC17n") == 0 ){
4799 }
else if ( periodName.CompareTo(
"LHC17pq") == 0 || periodName.CompareTo(
"LHC17p") == 0 || periodName.CompareTo(
"LHC17q") == 0 ){
4804 }
else if (periodName.CompareTo(
"LHC10d1") == 0){
4807 }
else if (periodName.CompareTo(
"LHC10d2") == 0){
4810 }
else if (periodName.CompareTo(
"LHC10d4a") == 0){
4813 }
else if (periodName.CompareTo(
"LHC10d4") == 0){
4816 }
else if (periodName.CompareTo(
"LHC10e12") == 0){
4819 }
else if (periodName.CompareTo(
"LHC10e13") == 0){
4822 }
else if (periodName.CompareTo(
"LHC10e20") == 0){
4825 }
else if (periodName.CompareTo(
"LHC10e21") == 0){
4828 }
else if (periodName.CompareTo(
"LHC10f6a") == 0){
4831 }
else if (periodName.CompareTo(
"LHC10f6") == 0){
4834 }
else if (periodName.Contains(
"LHC14j4")){
4837 }
else if (periodName.CompareTo(
"LHC13d2") == 0){
4840 }
else if (periodName.CompareTo(
"LHC13d2b") == 0){
4843 }
else if (periodName.CompareTo(
"LHC12a11a") == 0){
4846 }
else if (periodName.CompareTo(
"LHC12a11b") == 0){
4849 }
else if (periodName.CompareTo(
"LHC12a11c") == 0){
4852 }
else if (periodName.CompareTo(
"LHC12a11d") == 0){
4855 }
else if (periodName.CompareTo(
"LHC12a11e") == 0){
4858 }
else if (periodName.CompareTo(
"LHC12a11f") == 0){
4862 }
else if (periodName.CompareTo(
"LHC12a15c") == 0){
4865 }
else if (periodName.Contains(
"LHC12f1a") ){
4868 }
else if (periodName.Contains(
"LHC12f1b") ){
4871 }
else if (periodName.Contains(
"LHC12i3") ){
4874 }
else if (periodName.CompareTo(
"LHC15g1a") == 0){
4877 }
else if (periodName.CompareTo(
"LHC15g1b") == 0){
4880 }
else if (periodName.CompareTo(
"LHC13e4") == 0){
4883 }
else if (periodName.CompareTo(
"LHC13e5") == 0){
4886 }
else if (periodName.CompareTo(
"LHC14k1a") == 0){
4889 }
else if (periodName.CompareTo(
"LHC14k1b") == 0){
4892 }
else if (periodName.CompareTo(
"LHC12a15f") == 0){
4895 }
else if (periodName.CompareTo(
"LHC12a15g") == 0){
4898 }
else if (periodName.CompareTo(
"LHC12f2a") == 0){
4901 }
else if (periodName.CompareTo(
"LHC14a1a") == 0){
4904 }
else if (periodName.CompareTo(
"LHC14a1b") == 0){
4907 }
else if (periodName.CompareTo(
"LHC14a1c") == 0){
4911 }
else if (periodName.CompareTo(
"LHC14e2a") == 0){
4914 }
else if (periodName.CompareTo(
"LHC14e2b") == 0){
4917 }
else if (periodName.CompareTo(
"LHC14e2c") == 0){
4920 }
else if (periodName.Contains(
"LHC15h1")){
4923 }
else if (periodName.Contains(
"LHC15h2")){
4926 }
else if (periodName.CompareTo(
"LHC16c2") == 0){
4929 }
else if (periodName.CompareTo(
"LHC16c2_plus") == 0){
4933 }
else if (periodName.Contains(
"LHC13b2_efix")){
4936 }
else if (periodName.CompareTo(
"LHC13e7") == 0){