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){
1389 AliError(
"Warning: Special Subtrigger Class Not known");
1393 switch(selectSpecialSubTriggerClass){
1440 AliError(
"Warning: Special Subtrigger Class Not known");
1444 switch(selectSpecialSubTriggerClass){
1493 AliError(
"Warning: Special Subtrigger Class Not known");
1497 switch(selectSpecialSubTriggerClass){
1525 AliError(
"Warning: Special Subtrigger Class Not known");
1529 switch(selectSpecialSubTriggerClass){
1573 AliError(
"Warning: Special Subtrigger Class Not known");
1577 switch(selectSpecialSubTriggerClass){
1669 AliError(
"Warning: Special Subtrigger Class Not known");
1673 switch(selectSpecialSubTriggerClass){
1751 AliError(
"Warning: Special Subtrigger Class Not known");
1775 switch(removePileUp){
1909 AliError(
"RemovePileUpCut not defined");
1918 switch(extraSignal){
1932 AliError(Form(
"Extra Signal Rejection not defined %d",extraSignal));
1967 AliError(Form(
"Vertex Cut not defined %d",vertexCut));
2014 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
2016 AliWarning (
"AliMultSelection object not found !");
2020 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
2021 else return MultSelection->GetMultiplicityPercentile(
"V0M");
2022 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2025 AliCentrality *fESDCentrality = (AliCentrality*)esdEvent->GetCentrality();
2027 if(
fIsHeavyIon==2)
return fESDCentrality->GetCentralityPercentile(
"V0A");
2028 else return fESDCentrality->GetCentralityPercentile(
"V0M");
2036 AliMultSelection *MultSelection = (AliMultSelection*)aodEvent->FindListObject(
"MultSelection");
2038 AliWarning (
"AliMultSelection object not found !");
2042 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
2043 else return MultSelection->GetMultiplicityPercentile(
"V0M",kTRUE);
2044 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2047 if(aodEvent->GetHeader()){
return ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();}
2062 Int_t primaryTracksPP[9] = { 0, 2, 5, 10, 15,
2077 if(centrality<0 && !mcEvent)
return kFALSE;
2079 Int_t centralityC=0;
2081 centralityC=
Int_t(centrality/10);
2087 centralityC=
Int_t(centrality);
2090 }
else return kFALSE;
2093 centralityC=
Int_t(centrality);
2096 }
else return kFALSE;
2099 Int_t PrimaryTracks10[11][2] =
2113 Int_t PrimaryTracksLHC11h10[11][2] =
2127 Int_t PrimaryTracksLHC15o10[11][2] =
2141 Int_t PrimaryTracksLHC10h5[21][2] =
2165 Int_t PrimaryTracksLHC11h5[21][2] =
2189 Int_t PrimaryTracksLHC15o5[21][2] =
2213 Int_t PrimaryTracksLHC17n10[11][2] =
2229 if(event->IsA()==AliESDEvent::Class()) column = 0;
2230 if(event->IsA()==AliAODEvent::Class()) column = 1;
2246 centralityC=
Int_t(centrality/10);
2248 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o10[0][column])
return kFALSE;
2250 }
else return kFALSE;
2259 centralityC=
Int_t(centrality/10);
2274 centralityC =
Int_t(centrality);
2276 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o5[0][column])
return kFALSE;
2278 }
else return kFALSE;
2287 centralityC=
Int_t(centrality);
2290 }
else return kFALSE;
2294 Int_t PrimaryTracksLHC11h10AltMin[11][2] =
2308 Int_t PrimaryTracksLHC11h10AltMax[11][2] =
2322 Int_t PrimaryTracksLHC11h5AltMin[21][2] =
2346 Int_t PrimaryTracksLHC11h5AltMax[21][2] =
2375 if(nprimaryTracks > PrimaryTracksLHC11h10AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h10AltMax[
fCentralityMin][column])
2383 centralityC=
Int_t(centrality/10);
2393 if(nprimaryTracks > PrimaryTracksLHC11h5AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h5AltMax[
fCentralityMin][column])
2400 centralityC=
Int_t(centrality);
2403 }
else return kFALSE;
2413 Double_t fVertexZ=
event->GetPrimaryVertex()->GetZ();
2417 fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ();
2421 fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ();
2424 if(TMath::Abs(fVertexZ)>
fMaxVertexZ)
return kFALSE;
2428 if (TMath::Abs(fVertexZ-fVertexZSPD) > 0.1)
return kFALSE;
2431 if(!
fUtils->IsVertexSelected2013pA(event))
return kFALSE;
2442 TBits fIR1 =
event->GetHeader()->GetIRInt1InteractionMap();
2443 TBits fIR2 =
event->GetHeader()->GetIRInt2InteractionMap();
2444 UShort_t bunchCrossings =
event->GetBunchCrossNumber();
2446 for(
Int_t i = 0; i<180;i++){
2447 if(fIR1.TestBitNumber(i))
2452 Bool_t isOutOfBunchPileup = 0;
2455 if(pf1 < -89) pf1 = -89;
2456 if(pf2 > 89) pf2 = 89;
2457 Int_t pf2maxForT0 = pf2;
2459 for (
Int_t i=pf1;i<=pf2;i++) {
2461 if (i<=pf2maxForT0) isOutOfBunchPileup|=fIR2.TestBitNumber(90+i);
2462 if (i>0 && i<=ir1skip)
continue;
2463 isOutOfBunchPileup|=fIR1.TestBitNumber(90+i);
2465 return isOutOfBunchPileup;
2471 Bool_t isPileUpV0MTPCout=0;
2476 multV0M =
event->GetVZEROData()->GetMTotV0A();
2478 multV0M =
event->GetVZEROData()->GetMTotV0A() +
event->GetVZEROData()->GetMTotV0C() ;
2483 if (multV0M < valFunc ) isPileUpV0MTPCout=1;
2486 return isPileUpV0MTPCout;
2495 if (fESDEvent->GetPrimaryVertex() != NULL){
2496 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
2498 return fESDEvent->GetPrimaryVertex()->GetNContributors();
2502 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
2503 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2505 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
2507 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
2516 if (fAODEvent->GetPrimaryVertex() != NULL){
2517 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
2518 return fAODEvent->GetPrimaryVertex()->GetNContributors();
2521 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
2522 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2523 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
2525 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
2538 AliGenCocktailEventHeader *cHeader = 0x0;
2539 Bool_t headerFound = kFALSE;
2560 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2561 if(cHeader) headerFound = kTRUE;
2569 TList *genHeaders = 0x0;
2570 if(cHeader) genHeaders = cHeader->GetHeaders();
2571 AliGenEventHeader* gh = 0;
2572 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2573 gh = (AliGenEventHeader*)genHeaders->At(i);
2574 TString GeneratorName = gh->GetName();
2575 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2576 Bool_t eventAccepted = kTRUE;
2577 TParticle * jet = 0;
2578 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(gh)->NTriggerJets();
2581 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2582 dynamic_cast<AliGenPythiaEventHeader*
>(gh)->TriggerJet(ijet, tmpjet);
2583 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2586 eventAccepted= kFALSE;
2590 if (jet)
delete jet;
2592 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2593 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2594 if (!particle)
continue;
2595 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2597 eventAccepted= kFALSE;
2605 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2607 70, 85, 99, 115, 132,
2608 150, 169, 190, 212, 235,
2610 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2611 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2612 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2613 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2615 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2616 if (bin < 20) weight = weightsBins[bin];
2619 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2621 70, 85, 99, 115, 132,
2622 150, 169, 190, 212, 235,
2624 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2625 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2626 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2627 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2630 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2631 if (bin < 20) weight = weightsBins[bin];
2634 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2636 70, 85, 99, 115, 132,
2637 150, 169, 190, 212, 235,
2639 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2640 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2641 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2642 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2644 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2645 if (bin < 20) weight = weightsBins[bin];
2649 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2652 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2653 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2654 1.933238e-05, 1.562895e-05};
2656 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2657 if (bin < 12) weight = weightsBins[bin];
2660 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2661 84, 117, 152, 191, 1000000,
2663 21, 28, 36, 45, 57 };
2664 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2665 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2666 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2667 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2671 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2672 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2673 if (bin < 19) weight = weightsBins[bin];
2676 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2677 84, 117, 152, 191, 1000000,
2679 21, 28, 36, 45, 57 };
2681 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2682 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2683 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2684 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2687 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2688 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2689 if (bin < 19) weight = weightsBins[bin];
2692 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2694 70, 85, 99, 115, 132,
2695 150, 169, 190, 212, 235,
2697 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2698 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2699 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2700 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2702 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2703 if (bin < 20) weight = weightsBins[bin];
2706 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2707 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2709 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2710 if (bin < 5) weight = weightsBins[bin];
2713 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2714 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2716 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2717 if (bin < 6) weight = weightsBins[bin];
2720 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2721 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2723 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2724 if (bin < 7) weight = weightsBins[bin];
2727 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2728 84, 117, 152, 191, 234,
2730 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2731 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2733 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2734 if (bin < 10) weight = weightsBins[bin];
2736 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};
2737 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};
2739 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2740 if (bin < 20) weight = weightsBins[bin];
2742 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};
2743 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};
2745 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2746 if (bin < 20) weight = weightsBins[bin];
2748 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};
2749 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};
2751 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2752 if (bin < 20) weight = weightsBins[bin];
2757 if (weight == -1)
return kFALSE;
2758 else return eventAccepted;
2763 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2764 TString eventHeaderName = eventHeader->ClassName();
2765 Bool_t eventAccepted = kFALSE;
2766 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2767 eventAccepted = kTRUE;
2769 if(event->IsA()==AliAODEvent::Class()){
2770 AliAODMCHeader *mch = NULL;
2773 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
2775 Int_t nGenerators = mch->GetNCocktailHeaders();
2776 if ( nGenerators > 0 ){
2777 for(
Int_t igen = 0; igen < nGenerators; igen++)
2779 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
2780 TString name = eventHeaderGen->GetName();
2781 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
2782 eventAccepted = kTRUE;
2783 eventHeader = eventHeaderGen;
2792 TParticle * jet = 0;
2793 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->NTriggerJets();
2794 Float_t ptHard =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
2796 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2797 dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->TriggerJet(ijet, tmpjet);
2798 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2801 eventAccepted= kFALSE;
2806 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2807 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2808 if (!particle)
continue;
2809 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2811 eventAccepted= kFALSE;
2819 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2821 70, 85, 99, 115, 132,
2822 150, 169, 190, 212, 235,
2824 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2825 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2826 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2827 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2829 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2830 if (bin < 20) weight = weightsBins[bin];
2833 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2835 70, 85, 99, 115, 132,
2836 150, 169, 190, 212, 235,
2838 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2839 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2840 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2841 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2844 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2845 if (bin < 20) weight = weightsBins[bin];
2848 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2850 70, 85, 99, 115, 132,
2851 150, 169, 190, 212, 235,
2853 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2854 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2855 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2856 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2858 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2859 if (bin < 20) weight = weightsBins[bin];
2863 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2866 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2867 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2868 1.933238e-05, 1.562895e-05};
2870 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2871 if (bin < 12) weight = weightsBins[bin];
2874 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2875 84, 117, 152, 191, 1000000,
2877 21, 28, 36, 45, 57 };
2878 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2879 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2880 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2881 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2885 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2886 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2887 if (bin < 19) weight = weightsBins[bin];
2890 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2891 84, 117, 152, 191, 1000000,
2893 21, 28, 36, 45, 57 };
2895 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2896 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2897 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2898 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2901 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2902 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2903 if (bin < 19) weight = weightsBins[bin];
2906 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2908 70, 85, 99, 115, 132,
2909 150, 169, 190, 212, 235,
2911 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2912 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2913 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2914 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2916 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2917 if (bin < 20) weight = weightsBins[bin];
2920 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2921 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2923 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2924 if (bin < 5) weight = weightsBins[bin];
2927 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2928 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2930 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2931 if (bin < 6) weight = weightsBins[bin];
2934 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2935 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2937 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2938 if (bin < 7) weight = weightsBins[bin];
2941 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2942 84, 117, 152, 191, 234,
2944 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2945 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2947 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2948 if (bin < 10) weight = weightsBins[bin];
2950 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};
2951 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};
2953 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2954 if (bin < 20) weight = weightsBins[bin];
2956 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};
2957 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};
2959 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2960 if (bin < 20) weight = weightsBins[bin];
2962 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};
2963 Double_t weightsBins[20] = { 16.1083, 4.60917, 2.15196, 0.782021, 0.26541,
2964 0.0978374, 0.0294286, 0.00989457, 0.0040615, 0.00135787,
2965 0.000531766, 0.000188772, 9.23331e-05, 4.30245e-05, 2.10196e-05,
2966 1.06695e-05, 5.78742e-06, 3.02897e-06, 1.62702e-06, 2.12118e-06 };
2969 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2970 if (bin < 20) weight = weightsBins[bin];
2975 if (weight == -1)
return kFALSE;
2976 else return eventAccepted;
2991 AliGenCocktailEventHeader *cHeader = 0x0;
2992 Bool_t headerFound = kFALSE;
3010 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3011 if(cHeader) headerFound = kTRUE;
3020 TList *genHeaders = 0x0;
3021 if(cHeader) genHeaders = cHeader->GetHeaders();
3022 AliGenEventHeader* gh = 0;
3023 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3024 gh = (AliGenEventHeader*)genHeaders->At(i);
3025 TString GeneratorName = gh->GetName();
3026 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3027 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(gh);
3028 NTrials = gPythia->Trials();
3029 XSection = gPythia->GetXsection();
3034 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3036 TString eventHeaderName = eventHeader->ClassName();
3037 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3038 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader);
3039 NTrials = gPythia->Trials();
3040 XSection = gPythia->GetXsection();
3047 if(event->IsA()==AliAODEvent::Class()){
3048 AliAODMCHeader *mch = NULL;
3051 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3053 Int_t nGenerators = mch->GetNCocktailHeaders();
3054 if ( nGenerators > 0 ){
3055 for(
Int_t igen = 0; igen < nGenerators; igen++)
3057 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3058 TString name = eventHeaderGen->GetName();
3059 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3060 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen);
3061 NTrials = gPythia->Trials();
3062 XSection = gPythia->GetXsection();
3082 AliGenCocktailEventHeader *cHeader = 0x0;
3083 Bool_t headerFound = kFALSE;
3098 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3099 if(cHeader) headerFound = kTRUE;
3106 TList *genHeaders = 0x0;
3107 if(cHeader) genHeaders = cHeader->GetHeaders();
3108 AliGenEventHeader* gh = 0;
3109 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3110 gh = (AliGenEventHeader*)genHeaders->At(i);
3111 TString GeneratorName = gh->GetName();
3112 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3113 return dynamic_cast<AliGenPythiaEventHeader*
>(gh)->
GetPtHard();
3117 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3119 TString eventHeaderName = eventHeader->ClassName();
3120 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3121 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
3125 if(event->IsA()==AliAODEvent::Class()){
3126 AliAODMCHeader *mch = NULL;
3129 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3131 Int_t nGenerators = mch->GetNCocktailHeaders();
3132 if ( nGenerators > 0 ){
3133 for(
Int_t igen = 0; igen < nGenerators; igen++)
3135 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3136 TString name = eventHeaderGen->GetName();
3137 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3138 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen)->
GetPtHard();
3157 Int_t runRangesEMCalL0 [52] = { 144871, 145288, 146375, 146382,
3159 150209, 153056, 153911, 153915,
3160 158135, 158136, 158178, 158182, 160683,
3161 160764, 161139, 161256, 161379, 161457,
3162 161525, 161556, 161558, 161609, 161630,
3164 173731, 177144, 177147, 177653, 177724, 178327,
3183 Double_t thresholdEMCalL0[51] = { 2.11, 3.43, 1.71, 2.05,
3185 1.94, 3.39, 4.01, 5.25, 5.5,
3186 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,
3187 2.01, 1.75, 1.52, 2.01, 1.52, 1.85,
3207 Double_t spreadEMCalL0[51] = { 0., 0., 0, 0,
3210 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
3211 0., 0., 0., 0., 0.2, 0.2,
3231 Int_t runRangesEMCalL1[21] = { 179796,
3250 Double_t thresholdEMCalL1[20] = { 9.5,
3269 Double_t spreadEMCalL1[20] = { 1.0,
3289 Int_t runRangesEMCalL1G2[21] = { 195180,
3307 Double_t thresholdEMCalL1G2[19] = { 7.2,
3325 Double_t spreadEMCalL1G2[19] = { 0.3,
3344 Int_t runnumber =
event->GetRunNumber();
3347 if (runnumber < runRangesEMCalL0[0])
return kTRUE;
3349 while (!(runnumber >= runRangesEMCalL0[binRun] && runnumber < runRangesEMCalL0[binRun+1] ) && binRun < 51 ){
3353 if (binRun==51)
return kFALSE;
3355 Double_t threshold = thresholdEMCalL0[binRun];
3357 if (isMC && spreadEMCalL0[binRun] != 0.){
3358 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3359 triggerSmearing->SetParameter(0, 1/(spreadEMCalL0[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3360 triggerSmearing->SetParameter(1, thresholdEMCalL0[binRun]);
3361 triggerSmearing->SetParameter(2, spreadEMCalL0[binRun]);
3362 threshold = triggerSmearing->GetRandom();
3363 delete triggerSmearing;
3368 TClonesArray * arrClustersMimic = NULL;
3370 nclus =
event->GetNumberOfCaloClusters();
3372 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3373 if(!arrClustersMimic)
3374 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3375 nclus = arrClustersMimic->GetEntries();
3378 if(nclus == 0)
return kFALSE;
3381 Bool_t eventIsAccepted = kFALSE;
3382 for(
Int_t i = 0; i < nclus; i++){
3383 if (eventIsAccepted)
continue;
3384 AliVCluster* clus = NULL;
3385 if(event->IsA()==AliESDEvent::Class()){
3386 if(arrClustersMimic)
3387 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3389 clus =
event->GetCaloCluster(i);
3390 }
else if(event->IsA()==AliAODEvent::Class()){
3391 if(arrClustersMimic)
3392 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3394 clus =
event->GetCaloCluster(i);
3398 if(arrClustersMimic)
delete clus;
3401 if (!clus->IsEMCAL()) {
3402 if(arrClustersMimic)
delete clus;
3405 if (clus->GetM02()<0.1) {
3406 if(arrClustersMimic)
delete clus;
3409 if (clus->GetNCells()<2) {
3410 if(arrClustersMimic)
delete clus;
3413 if (clus->E() > threshold ){
3415 eventIsAccepted = kTRUE;
3417 if(arrClustersMimic)
3420 return eventIsAccepted;
3427 if (runnumber < runRangesEMCalL1[0])
return kTRUE;
3429 while (!(runnumber >= runRangesEMCalL1[binRun] && runnumber < runRangesEMCalL1[binRun+1] ) && binRun < 20 ){
3433 if (binRun==20)
return kFALSE;
3434 Double_t threshold = thresholdEMCalL1[binRun];
3436 if (isMC && spreadEMCalL1[binRun] != 0.){
3437 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3438 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3439 triggerSmearing->SetParameter(1, thresholdEMCalL1[binRun]);
3440 triggerSmearing->SetParameter(2, spreadEMCalL1[binRun]);
3441 threshold = triggerSmearing->GetRandom();
3442 delete triggerSmearing;
3447 TClonesArray * arrClustersMimic = NULL;
3450 nclus =
event->GetNumberOfCaloClusters();
3452 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3453 if(!arrClustersMimic)
3454 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3455 nclus = arrClustersMimic->GetEntries();
3458 if(nclus == 0)
return kFALSE;
3461 Bool_t eventIsAccepted = kFALSE;
3462 for(
Int_t i = 0; i < nclus; i++){
3463 if (eventIsAccepted)
continue;
3464 AliVCluster* clus = NULL;
3465 if(event->IsA()==AliESDEvent::Class()){
3466 if(arrClustersMimic)
3467 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3469 clus =
event->GetCaloCluster(i);
3470 }
else if(event->IsA()==AliAODEvent::Class()){
3471 if(arrClustersMimic)
3472 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3474 clus =
event->GetCaloCluster(i);
3477 if(arrClustersMimic)
delete clus;
3480 if (!clus->IsEMCAL()) {
3481 if(arrClustersMimic)
delete clus;
3484 if (clus->GetM02()<0.1) {
3485 if(arrClustersMimic)
delete clus;
3488 if (clus->GetNCells()<2) {
3489 if(arrClustersMimic)
delete clus;
3492 if (clus->E() > threshold ){
3494 eventIsAccepted = kTRUE;
3496 if(arrClustersMimic)
3499 return eventIsAccepted;
3501 if (runnumber < runRangesEMCalL1G2[0])
return kTRUE;
3503 while (!(runnumber >= runRangesEMCalL1G2[binRun] && runnumber < runRangesEMCalL1G2[binRun+1] ) && binRun < 19 ){
3508 if (binRun==19)
return kFALSE;
3509 Double_t threshold = thresholdEMCalL1G2[binRun];
3510 if (isMC && spreadEMCalL1G2[binRun] != 0.){
3511 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3512 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1G2[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3513 triggerSmearing->SetParameter(1, thresholdEMCalL1G2[binRun]);
3514 triggerSmearing->SetParameter(2, spreadEMCalL1G2[binRun]);
3515 threshold = triggerSmearing->GetRandom();
3516 delete triggerSmearing;
3521 TClonesArray * arrClustersMimic = NULL;
3523 nclus =
event->GetNumberOfCaloClusters();
3525 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3526 if(!arrClustersMimic)
3527 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3528 nclus = arrClustersMimic->GetEntries();
3531 if(nclus == 0)
return kFALSE;
3534 Bool_t eventIsAccepted = kFALSE;
3535 for(
Int_t i = 0; i < nclus; i++){
3536 if (eventIsAccepted)
continue;
3537 AliVCluster* clus = NULL;
3538 if(event->IsA()==AliESDEvent::Class()){
3539 if(arrClustersMimic)
3540 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3542 clus =
event->GetCaloCluster(i);
3543 }
else if(event->IsA()==AliAODEvent::Class()){
3544 if(arrClustersMimic)
3545 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3547 clus =
event->GetCaloCluster(i);
3550 if(arrClustersMimic)
delete clus;
3553 if (!clus->IsEMCAL()) {
3554 if(arrClustersMimic)
delete clus;
3557 if (clus->GetM02()<0.1) {
3558 if(arrClustersMimic)
delete clus;
3561 if (clus->GetNCells()<2) {
3562 if(arrClustersMimic)
delete clus;
3565 if (clus->E() > threshold ){
3567 eventIsAccepted = kTRUE;
3569 if(arrClustersMimic)
3572 return eventIsAccepted;
3589 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3592 UInt_t isSelected = AliVEvent::kAny;
3594 if (fInputHandler==NULL)
return kFALSE;
3595 if( fInputHandler->GetEventSelection() ||
event->IsA()==AliAODEvent::Class()) {
3597 TString firedTrigClass =
event->GetFiredTriggerClasses();
3638 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3640 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3642 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3646 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3647 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3649 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3650 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3657 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3659 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3661 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
3664 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3665 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3666 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
3669 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3671 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3674 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3675 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3680 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3681 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3682 if (firedTrigClass.Contains(
"7EG1")) isSelected = 0;
3684 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3685 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3686 if (firedTrigClass.Contains(
"8EG1")) isSelected = 0;
3688 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3689 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3691 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3692 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3696 if (isSelected != 0 ){
3728 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3729 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3730 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3734 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3735 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3736 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())) isSelected = 1;
3747 for (
Int_t i=0; i<ClassesList->GetEntriesFast(); i++){
3748 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3749 if (firedTrigClass.Contains(NameClass->GetString())) CheckClass+=
"1";
3750 else CheckClass+=
"0";
3752 if(CheckClass.Contains(
"0")) isSelected = 0;
3759 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3761 Bool_t mimickedTrigger = kTRUE;
3768 if (mimickedTrigger){
3769 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)
hTriggerClass->Fill(0);
3770 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)
hTriggerClass->Fill(1);
3771 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)
hTriggerClass->Fill(2);
3772 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)
hTriggerClass->Fill(3);
3773 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)
hTriggerClass->Fill(4);
3774 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)
hTriggerClass->Fill(5);
3775 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)
hTriggerClass->Fill(6);
3777 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)
hTriggerClass->Fill(7);
3779 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)
hTriggerClass->Fill(8);
3781 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)
hTriggerClass->Fill(9);
3783 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)
hTriggerClass->Fill(10);
3785 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)
hTriggerClass->Fill(11);
3786 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)
hTriggerClass->Fill(12);
3787 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)
hTriggerClass->Fill(13);
3790 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)
hTriggerClass->Fill(14);
3791 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)
hTriggerClass->Fill(15);
3792 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)
hTriggerClass->Fill(16);
3793 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)
hTriggerClass->Fill(17);
3794 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)
hTriggerClass->Fill(18);
3795 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)
hTriggerClass->Fill(19);
3796 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)
hTriggerClass->Fill(20);
3798 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)
hTriggerClass->Fill(21);
3799 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClass->Fill(22);
3800 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClass->Fill(23);
3801 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)
hTriggerClass->Fill(24);
3802 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClass->Fill(25);
3803 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClass->Fill(26);
3804 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)
hTriggerClass->Fill(27);
3805 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)
hTriggerClass->Fill(28);
3806 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)
hTriggerClass->Fill(29);
3807 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)
hTriggerClass->Fill(30);
3808 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)
hTriggerClass->Fill(31);
3809 if (!fInputHandler->IsEventSelected())
hTriggerClass->Fill(34);
3815 if (mimickedTrigger){
3847 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClassSelected->Fill(22);
3848 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClassSelected->Fill(23);
3850 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClassSelected->Fill(25);
3851 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClassSelected->Fill(26);
3861 if(!isSelected)
return kFALSE;
3863 if (!mimickedTrigger )
return kFALSE;
3890 if(rejection == 0)
return;
3892 AliGenCocktailEventHeader *cHeader = 0x0;
3893 AliAODMCHeader *cHeaderAOD = 0x0;
3894 Bool_t headerFound = kFALSE;
3895 AliMCEvent *fMCEvent = 0x0;
3896 TClonesArray *fMCEventAOD = 0x0;
3897 if(event->IsA()==AliMCEvent::Class()){
3898 if(dynamic_cast<AliMCEvent*>(event)){
3899 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(
dynamic_cast<AliMCEvent*
>(event)->GenEventHeader());
3900 fMCEvent =
dynamic_cast<AliMCEvent*
>(event);
3901 if(cHeader) headerFound = kTRUE;
3904 if(event->IsA()==AliAODEvent::Class()){
3905 cHeaderAOD =
dynamic_cast<AliAODMCHeader*
>(
event->FindListObject(AliAODMCHeader::StdBranchName()));
3906 fMCEventAOD =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
3907 if(cHeaderAOD) headerFound = kTRUE;
3910 if (
fDebugLevel > 0 ) cout <<
"event starts here" << endl;
3912 TList *genHeaders = 0x0;
3913 if(cHeader) genHeaders = cHeader->GetHeaders();
3915 genHeaders = cHeaderAOD->GetCocktailHeaders();
3916 if(genHeaders->GetEntries()==1){
3921 AliGenEventHeader* gh = 0;
3923 Int_t firstindexA = 0;
3924 Int_t lastindexA = -1;
3925 if(rejection == 1 || rejection == 3)
fnHeaders = 1;
3927 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3928 gh = (AliGenEventHeader*)genHeaders->At(i);
3929 TString GeneratorName = gh->GetName();
3930 lastindexA = lastindexA + gh->NProduced();
3931 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3932 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3933 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3934 if (
fDebugLevel > 0 ) cout << GeneratorInList.Data() << endl;
3935 if(GeneratorInList.Contains(GeneratorName) ){
3937 if (GeneratorInList.BeginsWith(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
3940 if (
fDebugLevel > 2 )cout <<
"number of produced particle: " << gh->NProduced() << endl;
3941 if (
fDebugLevel > 2 )cout <<
"pdg-code of first particle: " << fMCEvent->Particle(firstindexA)->GetPdgCode() << endl;
3943 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindexA+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
3947 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3948 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3952 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3953 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3968 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA));
3971 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0){
3972 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA+10));
3978 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3979 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3983 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3984 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
4000 if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4007 firstindexA = firstindexA + gh->NProduced();
4016 if(rejection == 1 || rejection == 3){
4018 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
4019 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
4024 Int_t firstindex = 0;
4025 Int_t lastindex = -1;
4028 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
4029 gh = (AliGenEventHeader*)genHeaders->At(i);
4030 TString GeneratorName = gh->GetName();
4031 lastindex = lastindex + gh->NProduced();
4032 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
4033 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
4034 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
4035 if(GeneratorInList.Contains(GeneratorName) ){
4036 if (GeneratorInList.Contains(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
4040 if (
fDebugLevel > 0 ) cout <<
"produced " << gh->NProduced() <<
" with box generator" << endl;
4041 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindex+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
4042 if (
fDebugLevel > 0 ) cout <<
"one of them was a pi0 or eta" << endl;
4047 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4049 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4054 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4056 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4061 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4075 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex));
4078 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0) {
4079 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex+10));
4087 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4092 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4094 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4099 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4113 }
else if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4117 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4124 firstindex = firstindex + gh->NProduced();
4127 for (
Int_t i = 0; i < number; i++){
4137 fNotRejectedEnd[0] =
static_cast<AliMCEvent*
>(event)->GetNumberOfPrimaries()-1;
4154 if(index < 0)
return 0;
4157 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
4158 if(!mcEvent)
return 0;
4159 if(index >= mcEvent->GetNumberOfPrimaries()){
4160 if( ((TParticle*)mcEvent->Particle(index))->GetMother(0) < 0)
return 0;
4168 if(i == 0) accepted = 2;
4171 if (debug > 1 && !accepted) cout <<
"rejected:" << index << endl;
4173 else if(InputEvent->IsA()==AliAODEvent::Class()){
4174 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
4175 if (AODMCTrackArray){
4176 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4177 if(!aodMCParticle)
return 0;
4178 if(!aodMCParticle->IsPrimary()){
4179 if( aodMCParticle->GetMother() < 0)
return 0;
4182 index = TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
4186 if(i == 0) accepted = 2;
4199 if (mcEvent){isMC = kTRUE;}
4227 Int_t runnumber =
event->GetRunNumber();
4228 if ((runnumber>=144871) && (runnumber<=146860)) {
4230 AliVCaloCells *cells =
event->GetEMCALCells();
4231 const Short_t nCells = cells->GetNumberOfCells();
4233 if (event->IsA()==AliESDEvent::Class()) AliAnalysisManager::GetAnalysisManager()->LoadBranch(
"EMCALCells.");
4235 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
4236 if (!fInputHandler)
return 3;
4239 Int_t nCellCount[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
4240 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
4241 Short_t cellId = cells->GetCellNumber(iCell);
4242 Double_t cellE = cells->GetCellAmplitude(cellId);
4243 Int_t sm = cellId / (24*48);
4244 if (cellE>0.1) ++nCellCount[sm];
4247 Bool_t fIsLedEvent = kFALSE;
4248 if (nCellCount[4] > 100) {
4249 fIsLedEvent = kTRUE;
4251 if ((runnumber>=146858) && (runnumber<=146860)) {
4252 if ((fInputHandler->IsEventSelected() & AliVEvent::kMB) && (nCellCount[3]>=21))
4253 fIsLedEvent = kTRUE;
4254 else if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC1) && (nCellCount[3]>=35))
4255 fIsLedEvent = kTRUE;
4265 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
4266 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
4267 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
4272 if(event->IsA()==AliESDEvent::Class()){
4276 for(
Int_t i=0; i<nPileVert;i++){
4277 const AliESDVertex* pv= ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
4278 Int_t nc2 = pv->GetNContributors();
4283 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
4297 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
4301 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4307 if(
fUtils->IsPileUpEvent(event) ){
4311 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4332 AliEventplane *EventPlane =
event->GetEventplane();
4345 AliInfo(
"Inside the GetWeightForCentralityFlattening function");
4348 if(!event || event->IsA()==AliESDEvent::Class()){
4351 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
4353 centrality = fESDCentrality->GetCentralityPercentile(
"V0M");
4356 }
else if(event->IsA()==AliAODEvent::Class()){
4359 if(aodEvent->GetHeader()){
4360 centrality = ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();
4366 Float_t GetValueForWeight = 1.;
4369 Bool_t CorrCentrLoop = kFALSE;
4375 CorrCentrLoop = kTRUE;
4379 CorrCentrLoop = kTRUE;
4381 CorrCentrLoop = kFALSE;
4384 if (CorrCentrLoop && GetValueForWeight != 0. && maximum !=0. && isfinite(GetValueForWeight) && isfinite(maximum) ){
4385 weightCentrality = maximum/GetValueForWeight;
4386 if (!isfinite(GetValueForWeight)) weightCentrality = 1.;
4387 if (!isfinite(weightCentrality)) weightCentrality = 1.;
4390 return weightCentrality;
4409 if (relativeErrorData < 0.2 && relativeErrorMC < 0.2 ){
4410 if (isfinite(valueMultData) && isfinite(valueMultMC) ){
4411 weightMult = valueMultData/valueMultMC;
4430 if(index < 0)
return 0;
4438 if (kCaseGen == 0)
return 1;
4443 if(!event || event->IsA()==AliESDEvent::Class()){
4444 mesonPt = ((TParticle*)mcEvent->Particle(index))->Pt();
4446 PDGCode = ((TParticle*)mcEvent->Particle(index))->GetPdgCode();
4447 }
else if(event->IsA()==AliAODEvent::Class()){
4448 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4449 if (AODMCTrackArray){
4450 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4451 mesonPt = aodMCParticle->Pt();
4453 PDGCode = aodMCParticle->GetPdgCode();
4459 Float_t functionResultMC = 1.;
4470 Float_t functionResultData = 1;
4482 if (PDGCode == 111 || PDGCode == 221){
4483 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
4484 weight = functionResultData/functionResultMC;
4485 if ( kCaseGen == 3){
4486 if (PDGCode == 111){
4491 if (PDGCode == 221){
4497 if (!isfinite(functionResultData)) weight = 1.;
4498 if (!isfinite(weight)) weight = 1.;
4500 }
else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
4501 weight = functionResultMC;
4517 printf(
" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),-0.465);
4520 printf(
" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),0.465);
4523 else printf(
" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(
GetCutNumber()).
Data());
4535 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
4543 AliEMCALTriggerPatchInfo *patch;
4544 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4546 if (patch->IsMainTrigger()) {
4563 if (event->IsA()==AliESDEvent::Class()){
4573 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
4579 if (event->IsA()==AliESDEvent::Class()){
4611 AliEMCALTriggerPatchInfo *patch;
4613 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4618 if (patch->IsGammaHigh()){
4622 if (patch->IsGammaLow()){
4626 if (patch->IsJetHigh()){
4630 if (patch->IsJetLow()){
4634 if (patch->IsLevel0()){
4645 AliDebug(2,
"Patch summary: ");
4646 AliDebug(2, Form(
"Number of patches: %d", nPatch));
4647 AliDebug(2, Form(
"Level0: [%d]" ,nL0));
4648 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
4649 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
4661 SETBIT(triggers,
kG1);
4663 SETBIT(triggers,
kG2);
4665 SETBIT(triggers,
kJ1);
4667 SETBIT(triggers,
kJ2);
4669 SETBIT(triggers,
kL0);
4688 TClonesArray *arr = 0;
4690 if (!sname.IsNull()) {
4691 arr =
dynamic_cast<TClonesArray*
>(
event->FindListObject(sname));
4693 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
4703 TString objname(arr->GetClass()->GetName());
4704 TClass cls(objname);
4705 if (!cls.InheritsFrom(clname)) {
4706 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
4707 GetName(), cls.GetName(), name, clname));
4716 if (eventpos < 0)
return kFALSE;
4717 TParticle* particle = (TParticle *)mcEvent->Particle(eventpos);
4718 if (!particle)
return kFALSE;
4719 if (TMath::Abs(particle->GetPdgCode()) == 11 ){
4720 if (particle->GetMother(0) != -1){
4721 TParticle* particleMother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4722 if (particleMother){
4723 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4724 particle = particleMother;
4728 if (particle->GetMother(0) != -1){
4729 Double_t deltaX = particle->Vx() - prodVtxX;
4730 Double_t deltaY = particle->Vy() - prodVtxY;
4731 Double_t deltaZ = particle->Vz() - prodVtxZ;
4734 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4737 Bool_t dalitzCand = kFALSE;
4739 TParticle* firstmother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4740 if (!firstmother)
return kFALSE;
4741 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4742 Bool_t intDecay = kFALSE;
4743 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4744 if ( intDecay && TMath::Abs(particle->GetPdgCode()) == 11 ){
4749 Long_t source = particle->GetMother(0);
4750 Bool_t foundExcludedPart = kFALSE;
4751 Bool_t foundShower = kFALSE;
4752 Int_t pdgCodeMotherPrev = 0;
4753 Int_t pdgCodeMotherPPrevMother = 0;
4761 TParticle* mother = (TParticle *)mcEvent->Particle(source);
4762 source = mother->GetMother(0);
4764 Int_t pdgCodeMother = mother->GetPdgCode();
4766 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4767 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4768 foundShower = kTRUE;
4771 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4772 foundShower = kTRUE;
4784 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4785 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4786 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312
4788 foundExcludedPart = kTRUE;
4791 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4792 pdgCodeMotherPrev = pdgCodeMother;
4793 if (source == -1) depth = 20;
4799 if (foundExcludedPart){
4805 }
else if (foundShower){
4820 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4821 if (AODMCTrackArray == NULL)
return kFALSE;
4822 AliAODMCParticle* currentParticle = AODMCParticle;
4823 if (TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4824 if (currentParticle->GetMother() != -1){
4825 AliAODMCParticle* particleMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4826 if (particleMother){
4827 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4828 currentParticle = particleMother;
4832 if (currentParticle->GetMother() > -1){
4833 Double_t deltaX = currentParticle->Xv() - prodVtxX;
4834 Double_t deltaY = currentParticle->Yv() - prodVtxY;
4835 Double_t deltaZ = currentParticle->Zv() - prodVtxZ;
4838 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4840 Bool_t dalitzCand = kFALSE;
4842 AliAODMCParticle* firstmother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4843 if (!firstmother)
return kFALSE;
4844 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4845 Bool_t intDecay = kFALSE;
4846 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4847 if ( intDecay && TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4852 Long_t source = currentParticle->GetMother();
4853 Bool_t foundExcludedPart = kFALSE;
4854 Bool_t foundShower = kFALSE;
4855 Int_t pdgCodeMotherPrev = 0;
4856 Int_t pdgCodeMotherPPrevMother = 0;
4864 AliAODMCParticle* mother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(source));
4865 source = mother->GetMother();
4867 Int_t pdgCodeMother = mother->GetPdgCode();
4869 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4870 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4871 foundShower = kTRUE;
4874 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4875 foundShower = kTRUE;
4887 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4888 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4889 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312)
4891 foundExcludedPart = kTRUE;
4894 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4895 pdgCodeMotherPrev = pdgCodeMother;
4896 if (source == -1) depth = 20;
4902 if (foundExcludedPart){
4908 }
else if (foundShower){
4923 if (particle != NULL && mcEvent != NULL){
4924 Int_t pdgSecondary = 0;
4928 Long_t motherID = particle->GetMother(0);
4929 Long_t grandMotherID = -1;
4933 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4935 if (grandMotherID > -1){
4937 pdgSecondary = mcEvent->Particle(grandMotherID)->GetPdgCode();
4944 Long_t motherID = particle->GetMother(0);
4945 Long_t grandMotherID = -1;
4946 Long_t greatGrandMotherID = -1;
4950 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4952 if (grandMotherID > -1){
4954 greatGrandMotherID = mcEvent->Particle(grandMotherID)->GetMother(0);
4956 if (greatGrandMotherID > -1){
4958 pdgSecondary = mcEvent->Particle(greatGrandMotherID)->GetPdgCode();
4964 if (TMath::Abs(pdgSecondary) == 3122 )
4967 else if ( TMath::Abs(pdgSecondary) == 310 )
4970 else if ( TMath::Abs(pdgSecondary) == 130 )
4973 else if ( TMath::Abs(pdgSecondary) == 221 )
4976 else if ( TMath::Abs(pdgSecondary) != 0 )
4986 if (particle != NULL && aodmcArray != NULL){
4987 Int_t pdgSecondary = 0;
4991 Long_t motherID = particle->GetMother();
4992 Long_t grandMotherID = -1;
4996 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4998 if (grandMotherID > -1){
5000 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetPdgCode();
5007 Long_t motherID = particle->GetMother();
5008 Long_t grandMotherID = -1;
5009 Long_t greatGrandMotherID = -1;
5013 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
5015 if (grandMotherID > -1){
5017 greatGrandMotherID = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetMother();
5019 if (greatGrandMotherID > -1){
5021 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(greatGrandMotherID))->GetPdgCode();
5027 if (TMath::Abs(pdgSecondary) == 3122 )
5030 else if ( TMath::Abs(pdgSecondary) == 310 )
5033 else if ( TMath::Abs(pdgSecondary) == 130 )
5036 else if ( TMath::Abs(pdgSecondary) == 221 )
5039 else if ( TMath::Abs(pdgSecondary) != 0 )
5049 if (periodName.CompareTo(
"") == 0){
5052 if (periodName.CompareTo(
"") == 0) {
5055 AliError(
"No correct period could be set, periodName string empty");
5060 if (periodName.CompareTo(
"LHC10b") == 0 || periodName.CompareTo(
"LHC10c") == 0 || periodName.CompareTo(
"LHC10d") == 0 || periodName.CompareTo(
"LHC10e") == 0 ||
5061 periodName.CompareTo(
"LHC10f") == 0 || periodName.CompareTo(
"LHC10g") == 0 || periodName.CompareTo(
"LHC10bg") == 0
5065 }
else if (periodName.CompareTo(
"LHC10h") == 0) {