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 fRemovePileUpSPD(kFALSE),
94 fPastFutureRejectionLow(0),
95 fPastFutureRejectionHigh(0),
96 fDoPileUpRejectV0MTPCout(0),
97 fFPileUpRejectV0MTPCout(0),
98 fRejectExtraSignals(0),
99 fOfflineTriggerMask(0),
104 fNotRejectedStart(NULL),
105 fNotRejectedEnd(NULL),
106 fGeneratorNames(NULL),
107 fPeriodEnum(kNoPeriod),
114 fDoCentralityFlat(0),
115 fPathWeightsFlatCent(
""),
116 fNameHistoNotFlatCentrality(
""),
117 fDoReweightHistoMCPi0(kFALSE),
118 fDoReweightHistoMCEta(kFALSE),
119 fDoReweightHistoMCK0s(kFALSE),
120 fPathTrFReweighting(
""),
121 fNameHistoReweightingPi0(
""),
122 fNameHistoReweightingEta(
""),
123 fNameHistoReweightingK0s(
""),
127 fHistoEventCuts(NULL),
128 fHistoPastFutureBits(NULL),
130 hCentralityNotFlat(NULL),
133 hNPileupVertices(NULL),
134 hPileupVertexToPrimZ(NULL),
135 hPileupVertexToPrimZSPDPileup(NULL),
136 hPileupVertexToPrimZTrackletvsHits(NULL),
137 hEventPlaneAngle(NULL),
140 hTriggerClassSelected(NULL),
141 hTriggerClassesCorrelated(NULL),
142 hReweightMCHistPi0(NULL),
143 hReweightMCHistEta(NULL),
144 hReweightMCHistK0s(NULL),
148 fAddedSignalPDGCode(0),
150 fTriggerSelectedManually(kFALSE),
151 fSpecialTriggerName(
""),
152 fSpecialSubTriggerName(
""),
153 fNSpecialSubTriggerOptions(0),
154 hSPDClusterTrackletBackgroundBefore(NULL),
155 hSPDClusterTrackletBackground(NULL),
157 fCorrTaskSetting(
""),
159 fTriggerPatchInfo(NULL),
160 fMainTriggerPatchEMCAL(NULL),
161 fCaloTriggersName(
""),
162 fCaloTriggerPatchInfoName(
""),
164 fTriggersEMCALSelected(-1),
165 fEMCALTrigInitialized(kFALSE),
166 fSecProdBoundary(1.0),
169 fMaxFacPtHardSingleParticle(1.5),
170 fMimicTrigger(kFALSE),
171 fRejectTriggerOverlap(kFALSE),
172 fDoMultiplicityWeighting(kFALSE),
173 fPathReweightingMult(
""),
174 fNameHistoReweightingMultData(
""),
175 fNameHistoReweightingMultMC(
""),
176 hReweightMultData(NULL),
177 hReweightMultMC(NULL),
183 fUtils =
new AliAnalysisUtils();
192 AliAnalysisCuts(ref),
298 fUtils =
new AliAnalysisUtils();
338 TH1::AddDirectory(kFALSE);
437 hTriggerClass->GetXaxis()->SetBinLabel( 9,
"kMUL7/kMuonLikePB");
438 hTriggerClass->GetXaxis()->SetBinLabel(10,
"kMUU7/kMuonUnlikePB");
442 hTriggerClass->GetXaxis()->SetBinLabel(14,
"kPHI7/kPHI8/kPHOSPb");
451 hTriggerClass->GetXaxis()->SetBinLabel(23,
"kMuonSingleLowPt8");
452 hTriggerClass->GetXaxis()->SetBinLabel(24,
"kMuonSingleHighPt8");
453 hTriggerClass->GetXaxis()->SetBinLabel(25,
"kMuonLikeLowPt8");
454 hTriggerClass->GetXaxis()->SetBinLabel(26,
"kMuonUnlikeLowPt8");
455 hTriggerClass->GetXaxis()->SetBinLabel(27,
"kMuonUnlikeLowPt0");
464 hTriggerClass->GetXaxis()->SetBinLabel(36,
"failed Physics Selection");
465 hTriggerClass->GetXaxis()->SetBinLabel(37,
"mimickedTrigger");
530 TH1::AddDirectory(kTRUE);
543 if(mcEvent && event->IsA()==AliESDEvent::Class()){
545 AliMCEventHandler* mcHandler =
dynamic_cast<AliMCEventHandler*
> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
550 if (!mcHandler->InitOk() ){
554 if (!mcHandler->TreeK() ){
578 if(event->IsA()==AliESDEvent::Class()){
579 AliTriggerAnalysis fTriggerAnalysis;
580 fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((
AliESDEvent*)event, AliTriggerAnalysis::kV0AND);
607 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
608 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
609 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
614 if(event->IsA()==AliESDEvent::Class()){
618 for(
Int_t i=0; i<nPileVert;i++){
619 const AliESDVertex* pv = ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
620 Int_t nc2 = pv->GetNContributors();
625 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
637 if(
fUtils->IsPileUpMV(event)){
643 if(
fUtils->IsFirstEventInChunk(event)){
649 if(
fUtils->IsPileUpEvent(event)){
655 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
664 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
670 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
703 AliEventplane *EventPlane =
event->GetEventplane();
728 AliInfo(
"Entering loading of weights for centrality flattening");
751 AliInfo(
"Entering loading of weights for multiplicity weighting");
785 AliInfo(
"Entering loading of histograms for weighting");
794 if(hReweightMCHistPi0temp){
812 if(hReweightMCHistEtatemp){
831 if(hReweightMCHistK0stemp){
857 AliInfo(
"Centrality flattening was enabled");
862 AliInfo(
"Multiplicity weighting was enabled");
866 AliInfo(
"Particle Weighting was enabled");
871 AliInfo(Form(
"Set Event Cut Number: %s",analysisCutSelection.Data()));
872 if(analysisCutSelection.Length()!=
kNCuts) {
873 AliError(Form(
"Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(),
kNCuts));
876 if(!analysisCutSelection.IsAlnum()){
877 AliError(
"Cut selection is not alphanumeric");
884 TString analysisCutSelectionLowerCase = Form(
"%s",analysisCutSelection.Data());
885 analysisCutSelectionLowerCase.ToLower();
886 const char *cutSelection = analysisCutSelectionLowerCase.Data();
887 #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0' 920 }
else return kFALSE;
926 }
else return kFALSE;
932 }
else return kFALSE;
938 }
else return kFALSE;
944 }
else return kFALSE;
950 }
else return kFALSE;
956 }
else return kFALSE;
962 }
else return kFALSE;
965 AliError(
"Cut id out of range");
969 AliError(
"Cut id %d not recognized");
983 printf(
"\nEvent cutnumber \n");
985 printf(
"%d",
fCuts[ic]);
990 printf(
"Running in pp mode \n");
993 printf(
"\t only events triggered by V0OR will be analysed \n");
995 printf(
"\t only events where SDD was present will be analysed \n");
999 printf(
"\t only events triggered by V0AND will be analysed \n");
1001 printf(
"\t only events where SDD was present will be analysed and triggered by VOAND\n");
1012 printf(
"Running in PbPb mode \n");
1014 printf(
"\t centrality selection based on V0M \n");
1016 printf(
"\t centrality selection based on Cl1 \n");
1018 printf(
"\t centrality selection based on ZNA \n");
1036 printf(
"\t only events triggered by kMB, kCentral, kSemiCentral will be analysed \n");
1044 printf(
"Running in pPb mode \n");
1046 printf(
"\t centrality selection based on V0A \n");
1048 printf(
"\t centrality selection based on Cl1 \n");
1050 printf(
"\t centrality selection based on ZNA \n");
1060 printf(
"\t only events triggered by kINT7 will be analysed \n");
1067 else printf(
"\t No vertex cut \n");
1070 printf(
"\t Doing pile up removal \n");
1072 printf(
"\t Doing pile up removal using SPD \n");
1075 printf(
"\t Doing extra pile up removal V0M vs TPCout \n");
1078 printf(
"\t Doing extra past-future pile up removal\n");
1082 printf(
"MC event cuts: \n");
1085 else if (
fRejectExtraSignals == 4) printf(
"\t special handling for Jets embedded in MB events \n");
1087 printf(
"\t maximum factor between jet and pt hard = %2.2f \n",
fMaxFacPtHard);
1199 AliError(Form(
"SetHeavyIon not defined %d",isHeavyIon));
1209 if(minCentrality<0||minCentrality>20){
1210 AliError(Form(
"minCentrality not defined %d",minCentrality));
1222 if(maxCentrality<0||maxCentrality>20){
1223 AliError(Form(
"maxCentrality not defined %d",maxCentrality));
1234 switch(selectSpecialTrigger){
1264 fOfflineTriggerMask=AliVEvent::kPHI7 | AliVEvent::kPHI1 | AliVEvent::kPHI8 | AliVEvent::kPHOSPb;
1298 AliError(
"Warning: Special Trigger Not known");
1309 switch(selectSpecialSubTriggerClass){
1320 AliError(
"Warning: Special Subtrigger Class Not known");
1324 switch(selectSpecialSubTriggerClass){
1349 AliError(
"Warning: Special Subtrigger Class Not known");
1353 switch(selectSpecialSubTriggerClass){
1449 AliError(
"Warning: Special Subtrigger Class Not known");
1453 switch(selectSpecialSubTriggerClass){
1500 AliError(
"Warning: Special Subtrigger Class Not known");
1504 switch(selectSpecialSubTriggerClass){
1553 AliError(
"Warning: Special Subtrigger Class Not known");
1557 switch(selectSpecialSubTriggerClass){
1585 AliError(
"Warning: Special Subtrigger Class Not known");
1589 switch(selectSpecialSubTriggerClass){
1633 AliError(
"Warning: Special Subtrigger Class Not known");
1637 switch(selectSpecialSubTriggerClass){
1729 AliError(
"Warning: Special Subtrigger Class Not known");
1733 switch(selectSpecialSubTriggerClass){
1811 AliError(
"Warning: Special Subtrigger Class Not known");
1815 switch(selectSpecialSubTriggerClass){
1943 AliError(
"Warning: Special Subtrigger Class Not known");
1967 switch(removePileUp){
2112 fUtils->SetASPDCvsTCut(200.);
2113 fUtils->SetBSPDCvsTCut(7.);
2128 AliError(
"RemovePileUpCut not defined");
2137 switch(extraSignal){
2154 AliError(Form(
"Extra Signal Rejection not defined %d",extraSignal));
2189 AliError(Form(
"Vertex Cut not defined %d",vertexCut));
2233 Int_t runnumber =
event->GetRunNumber();
2236 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
2238 AliWarning (
"AliMultSelection object not found !");
2243 if (runnumber > 266329 && runnumber < 267139)
2244 return MultSelection->GetMultiplicityPercentile(
"V0C");
2246 return MultSelection->GetMultiplicityPercentile(
"V0A");
2248 return MultSelection->GetMultiplicityPercentile(
"V0M");
2251 return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2253 if (runnumber > 266329 && runnumber < 267139)
2254 return MultSelection->GetMultiplicityPercentile(
"ZNC",kTRUE);
2256 return MultSelection->GetMultiplicityPercentile(
"ZNA",kTRUE);
2260 AliCentrality *fESDCentrality = (AliCentrality*)esdEvent->GetCentrality();
2263 if (runnumber > 196432 && runnumber < 197389)
2264 return fESDCentrality->GetCentralityPercentile(
"V0C");
2266 return fESDCentrality->GetCentralityPercentile(
"V0A");
2268 return fESDCentrality->GetCentralityPercentile(
"V0M");
2271 return fESDCentrality->GetCentralityPercentile(
"CL1");
2273 if (runnumber > 196432 && runnumber < 197389)
2274 return fESDCentrality->GetCentralityPercentile(
"ZNC");
2276 return fESDCentrality->GetCentralityPercentile(
"ZNA");
2284 AliMultSelection *MultSelection = (AliMultSelection*)aodEvent->FindListObject(
"MultSelection");
2286 AliWarning (
"AliMultSelection object not found !");
2290 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
2291 else return MultSelection->GetMultiplicityPercentile(
"V0M",kTRUE);
2292 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2293 else if(
fDetectorCentrality==2)
return MultSelection->GetMultiplicityPercentile(
"ZNA",kTRUE);
2296 if(aodEvent->GetHeader()){
return ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();}
2311 Int_t primaryTracksPP[9] = { 0, 2, 5, 10, 15,
2326 if(centrality<0 && !mcEvent)
return kFALSE;
2328 Int_t centralityC=0;
2330 centralityC=
Int_t(centrality/10);
2336 centralityC=
Int_t(centrality);
2339 }
else return kFALSE;
2342 centralityC=
Int_t(centrality);
2345 }
else return kFALSE;
2348 Int_t PrimaryTracks10[11][2] =
2362 Int_t PrimaryTracksLHC11h10[11][2] =
2376 Int_t PrimaryTracksLHC15o10[11][2] =
2390 Int_t PrimaryTracksLHC10h5[21][2] =
2414 Int_t PrimaryTracksLHC11h5[21][2] =
2438 Int_t PrimaryTracksLHC15o5[21][2] =
2462 Int_t PrimaryTracksLHC17n10[11][2] =
2478 if(event->IsA()==AliESDEvent::Class()) column = 0;
2479 if(event->IsA()==AliAODEvent::Class()) column = 1;
2495 centralityC=
Int_t(centrality/10);
2497 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o10[0][column])
return kFALSE;
2499 }
else return kFALSE;
2508 centralityC=
Int_t(centrality/10);
2523 centralityC =
Int_t(centrality);
2525 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o5[0][column])
return kFALSE;
2527 }
else return kFALSE;
2536 centralityC=
Int_t(centrality);
2539 }
else return kFALSE;
2543 Int_t PrimaryTracksLHC11h10AltMin[11][2] =
2557 Int_t PrimaryTracksLHC11h10AltMax[11][2] =
2571 Int_t PrimaryTracksLHC11h5AltMin[21][2] =
2595 Int_t PrimaryTracksLHC11h5AltMax[21][2] =
2624 if(nprimaryTracks > PrimaryTracksLHC11h10AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h10AltMax[
fCentralityMin][column])
2632 centralityC=
Int_t(centrality/10);
2642 if(nprimaryTracks > PrimaryTracksLHC11h5AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h5AltMax[
fCentralityMin][column])
2649 centralityC=
Int_t(centrality);
2652 }
else return kFALSE;
2662 Double_t fVertexZ=
event->GetPrimaryVertex()->GetZ();
2666 fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ();
2670 fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ();
2673 if(TMath::Abs(fVertexZ)>
fMaxVertexZ)
return kFALSE;
2677 if (TMath::Abs(fVertexZ-fVertexZSPD) > 0.1)
return kFALSE;
2680 if(!
fUtils->IsVertexSelected2013pA(event))
return kFALSE;
2691 TBits fIR1 =
event->GetHeader()->GetIRInt1InteractionMap();
2692 TBits fIR2 =
event->GetHeader()->GetIRInt2InteractionMap();
2693 UShort_t bunchCrossings =
event->GetBunchCrossNumber();
2695 for(
Int_t i = 0; i<180;i++){
2696 if(fIR1.TestBitNumber(i))
2701 Bool_t isOutOfBunchPileup = 0;
2704 if(pf1 < -89) pf1 = -89;
2705 if(pf2 > 89) pf2 = 89;
2706 Int_t pf2maxForT0 = pf2;
2708 for (
Int_t i=pf1;i<=pf2;i++) {
2710 if (i<=pf2maxForT0) isOutOfBunchPileup|=fIR2.TestBitNumber(90+i);
2711 if (i>0 && i<=ir1skip)
continue;
2712 isOutOfBunchPileup|=fIR1.TestBitNumber(90+i);
2714 return isOutOfBunchPileup;
2720 Bool_t isPileUpV0MTPCout=0;
2725 multV0M =
event->GetVZEROData()->GetMTotV0A();
2727 multV0M =
event->GetVZEROData()->GetMTotV0A() +
event->GetVZEROData()->GetMTotV0C() ;
2732 if (multV0M < valFunc ) isPileUpV0MTPCout=1;
2735 return isPileUpV0MTPCout;
2744 if (fESDEvent->GetPrimaryVertex() != NULL){
2745 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
2747 return fESDEvent->GetPrimaryVertex()->GetNContributors();
2751 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
2752 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2754 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
2756 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
2765 if (fAODEvent->GetPrimaryVertex() != NULL){
2766 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
2767 return fAODEvent->GetPrimaryVertex()->GetNContributors();
2770 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
2771 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2772 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
2774 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
2787 AliGenCocktailEventHeader *cHeader = 0x0;
2788 Bool_t headerFound = kFALSE;
2811 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2812 if(cHeader) headerFound = kTRUE;
2820 TList *genHeaders = 0x0;
2821 if(cHeader) genHeaders = cHeader->GetHeaders();
2822 AliGenEventHeader* gh = 0;
2823 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2824 gh = (AliGenEventHeader*)genHeaders->At(i);
2825 TString GeneratorName = gh->GetName();
2826 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2827 Bool_t eventAccepted = kTRUE;
2828 TParticle * jet = 0;
2829 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(gh)->NTriggerJets();
2832 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2833 dynamic_cast<AliGenPythiaEventHeader*
>(gh)->TriggerJet(ijet, tmpjet);
2834 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2837 eventAccepted= kFALSE;
2841 if (jet)
delete jet;
2843 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2844 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2845 if (!particle)
continue;
2846 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2848 eventAccepted= kFALSE;
2856 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2858 70, 85, 99, 115, 132,
2859 150, 169, 190, 212, 235,
2861 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2862 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2863 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2864 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2866 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2867 if (bin < 20) weight = weightsBins[bin];
2870 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2872 70, 85, 99, 115, 132,
2873 150, 169, 190, 212, 235,
2875 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2876 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2877 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2878 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2881 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2882 if (bin < 20) weight = weightsBins[bin];
2885 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2887 70, 85, 99, 115, 132,
2888 150, 169, 190, 212, 235,
2890 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2891 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2892 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2893 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2895 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2896 if (bin < 20) weight = weightsBins[bin];
2900 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2903 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2904 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2905 1.933238e-05, 1.562895e-05};
2907 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2908 if (bin < 12) weight = weightsBins[bin];
2911 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2912 84, 117, 152, 191, 1000000,
2914 21, 28, 36, 45, 57 };
2915 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2916 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2917 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2918 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2922 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2923 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2924 if (bin < 19) weight = weightsBins[bin];
2927 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2928 84, 117, 152, 191, 1000000,
2930 21, 28, 36, 45, 57 };
2932 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2933 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2934 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2935 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2938 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2939 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2940 if (bin < 19) weight = weightsBins[bin];
2943 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2945 70, 85, 99, 115, 132,
2946 150, 169, 190, 212, 235,
2948 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2949 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2950 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2951 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2953 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2954 if (bin < 20) weight = weightsBins[bin];
2957 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2958 Double_t weightsBins[5] = { 6.731200e-03, 7.995602e-03, 6.778717e-03, 4.643571e-03, 6.014497e-03};
2960 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2961 if (bin < 5) weight = weightsBins[bin];
2964 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2965 Double_t weightsBins[6] = { 6.071458e-03, 3.941701e-03, 2.001984e-03, 9.862765e-04, 3.893911e-04, 1.865924e-04};
2967 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2968 if (bin < 6) weight = weightsBins[bin];
2971 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2972 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2974 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2975 if (bin < 7) weight = weightsBins[bin];
2978 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2979 84, 117, 152, 191, 234,
2981 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2982 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2984 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2985 if (bin < 10) weight = weightsBins[bin];
2987 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};
2988 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};
2990 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2991 if (bin < 20) weight = weightsBins[bin];
2993 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};
2994 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};
2996 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2997 if (bin < 20) weight = weightsBins[bin];
2999 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};
3000 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};
3002 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3003 if (bin < 20) weight = weightsBins[bin];
3005 Double_t ptHardBinRanges[7] = { 5, 11, 21, 36, 57, 84, 10000};
3006 Double_t weightsBins[6] = { 0.0002181, 3.13684e-05, 5.01515e-06, 9.50662e-07, 2.08186e-07, 7.96555e-08};
3008 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3009 if (bin < 6) weight = weightsBins[bin];
3014 if (weight == -1)
return kFALSE;
3015 else return eventAccepted;
3020 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3021 TString eventHeaderName = eventHeader->ClassName();
3022 Bool_t eventAccepted = kFALSE;
3023 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3024 eventAccepted = kTRUE;
3026 if(event->IsA()==AliAODEvent::Class()){
3027 AliAODMCHeader *mch = NULL;
3030 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3032 Int_t nGenerators = mch->GetNCocktailHeaders();
3033 if ( nGenerators > 0 ){
3034 for(
Int_t igen = 0; igen < nGenerators; igen++)
3036 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3037 TString name = eventHeaderGen->GetName();
3038 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3039 eventAccepted = kTRUE;
3040 eventHeader = eventHeaderGen;
3049 TParticle * jet = 0;
3050 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->NTriggerJets();
3051 Float_t ptHard =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
3053 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
3054 dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->TriggerJet(ijet, tmpjet);
3055 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
3058 eventAccepted= kFALSE;
3063 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
3064 TParticle* particle = (TParticle *)mcEvent->Particle(i);
3065 if (!particle)
continue;
3066 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
3068 eventAccepted= kFALSE;
3076 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
3078 70, 85, 99, 115, 132,
3079 150, 169, 190, 212, 235,
3081 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
3082 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
3083 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
3084 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
3086 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3087 if (bin < 20) weight = weightsBins[bin];
3090 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
3092 70, 85, 99, 115, 132,
3093 150, 169, 190, 212, 235,
3095 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
3096 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
3097 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
3098 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
3101 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3102 if (bin < 20) weight = weightsBins[bin];
3105 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
3107 70, 85, 99, 115, 132,
3108 150, 169, 190, 212, 235,
3110 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
3111 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
3112 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
3113 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
3115 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3116 if (bin < 20) weight = weightsBins[bin];
3120 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
3123 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
3124 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
3125 1.933238e-05, 1.562895e-05};
3127 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3128 if (bin < 12) weight = weightsBins[bin];
3131 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
3132 84, 117, 152, 191, 1000000,
3134 21, 28, 36, 45, 57 };
3135 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
3136 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
3137 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
3138 0.0307759, 0.0087083, 0.0027664, 0.00106203};
3142 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
3143 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3144 if (bin < 19) weight = weightsBins[bin];
3147 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
3148 84, 117, 152, 191, 1000000,
3150 21, 28, 36, 45, 57 };
3152 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
3153 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
3154 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
3155 0.0307638, 0.00870635, 0.00276658, 0.00106229};
3158 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
3159 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3160 if (bin < 19) weight = weightsBins[bin];
3163 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
3165 70, 85, 99, 115, 132,
3166 150, 169, 190, 212, 235,
3168 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
3169 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
3170 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
3171 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
3173 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3174 if (bin < 20) weight = weightsBins[bin];
3177 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
3178 Double_t weightsBins[5] = { 6.731200e-03, 7.995602e-03, 6.778717e-03, 4.643571e-03, 6.014497e-03};
3180 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3181 if (bin < 5) weight = weightsBins[bin];
3184 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
3185 Double_t weightsBins[6] = { 6.071458e-03, 3.941701e-03, 2.001984e-03, 9.862765e-04, 3.893911e-04, 1.865924e-04};
3187 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3188 if (bin < 6) weight = weightsBins[bin];
3191 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
3192 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
3194 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3195 if (bin < 7) weight = weightsBins[bin];
3198 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
3199 84, 117, 152, 191, 234,
3201 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
3202 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
3204 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3205 if (bin < 10) weight = weightsBins[bin];
3207 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};
3208 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};
3210 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3211 if (bin < 20) weight = weightsBins[bin];
3213 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};
3214 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};
3216 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3217 if (bin < 20) weight = weightsBins[bin];
3219 Double_t ptHardBinRanges[7] = { 5, 11, 21, 36, 57, 84, 10000};
3220 Double_t weightsBins[6] = { 0.0002181, 3.13684e-05, 5.01515e-06, 9.50662e-07, 2.08186e-07, 7.96555e-08};
3222 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3223 if (bin < 6) weight = weightsBins[bin];
3225 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};
3226 Double_t weightsBins[20] = { 16.1083, 4.60917, 2.15196, 0.782021, 0.26541,
3227 0.0978374, 0.0294286, 0.00989457, 0.0040615, 0.00135787,
3228 0.000531766, 0.000188772, 9.23331e-05, 4.30245e-05, 2.10196e-05,
3229 1.06695e-05, 5.78742e-06, 3.02897e-06, 1.62702e-06, 2.12118e-06 };
3232 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
3233 if (bin < 20) weight = weightsBins[bin];
3238 if (weight == -1)
return kFALSE;
3239 else return eventAccepted;
3254 AliGenCocktailEventHeader *cHeader = 0x0;
3255 Bool_t headerFound = kFALSE;
3275 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3276 if(cHeader) headerFound = kTRUE;
3285 TList *genHeaders = 0x0;
3286 if(cHeader) genHeaders = cHeader->GetHeaders();
3287 AliGenEventHeader* gh = 0;
3288 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3289 gh = (AliGenEventHeader*)genHeaders->At(i);
3290 TString GeneratorName = gh->GetName();
3291 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3292 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(gh);
3293 NTrials = gPythia->Trials();
3294 XSection = gPythia->GetXsection();
3299 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3301 TString eventHeaderName = eventHeader->ClassName();
3302 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3303 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader);
3304 NTrials = gPythia->Trials();
3305 XSection = gPythia->GetXsection();
3312 if(event->IsA()==AliAODEvent::Class()){
3313 AliAODMCHeader *mch = NULL;
3316 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3318 Int_t nGenerators = mch->GetNCocktailHeaders();
3319 if ( nGenerators > 0 ){
3320 for(
Int_t igen = 0; igen < nGenerators; igen++){
3321 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3322 TString name = eventHeaderGen->GetName();
3323 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3324 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen);
3325 NTrials = gPythia->Trials();
3326 XSection = gPythia->GetXsection();
3346 AliGenCocktailEventHeader *cHeader = 0x0;
3347 Bool_t headerFound = kFALSE;
3363 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3364 if(cHeader) headerFound = kTRUE;
3371 TList *genHeaders = 0x0;
3372 if(cHeader) genHeaders = cHeader->GetHeaders();
3373 AliGenEventHeader* gh = 0;
3374 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3375 gh = (AliGenEventHeader*)genHeaders->At(i);
3376 TString GeneratorName = gh->GetName();
3377 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3378 return dynamic_cast<AliGenPythiaEventHeader*
>(gh)->
GetPtHard();
3382 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3384 TString eventHeaderName = eventHeader->ClassName();
3385 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3386 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
3390 if(event->IsA()==AliAODEvent::Class()){
3391 AliAODMCHeader *mch = NULL;
3394 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3396 Int_t nGenerators = mch->GetNCocktailHeaders();
3397 if ( nGenerators > 0 ){
3398 for(
Int_t igen = 0; igen < nGenerators; igen++)
3400 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3401 TString name = eventHeaderGen->GetName();
3402 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3403 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen)->
GetPtHard();
3422 Int_t runRangesEMCalL0 [52] = { 144871, 145288, 146375, 146382,
3424 150209, 153056, 153911, 153915,
3425 158135, 158136, 158178, 158182, 160683,
3426 160764, 161139, 161256, 161379, 161457,
3427 161525, 161556, 161558, 161609, 161630,
3429 173731, 177144, 177147, 177653, 177724, 178327,
3448 Double_t thresholdEMCalL0[51] = { 2.11, 3.43, 1.71, 2.05,
3450 1.94, 3.39, 4.01, 5.25, 5.5,
3451 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,
3452 2.01, 1.75, 1.52, 2.01, 1.52, 1.85,
3472 Double_t spreadEMCalL0[51] = { 0., 0., 0, 0,
3475 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
3476 0., 0., 0., 0., 0.2, 0.2,
3496 Int_t runRangesEMCalL1[21] = { 179796,
3515 Double_t thresholdEMCalL1[20] = { 9.5,
3534 Double_t spreadEMCalL1[20] = { 1.0,
3554 Int_t runRangesEMCalL1G2[21] = { 195180,
3572 Double_t thresholdEMCalL1G2[19] = { 7.2,
3590 Double_t spreadEMCalL1G2[19] = { 0.3,
3609 Int_t runnumber =
event->GetRunNumber();
3612 if (runnumber < runRangesEMCalL0[0])
return kTRUE;
3614 while (!(runnumber >= runRangesEMCalL0[binRun] && runnumber < runRangesEMCalL0[binRun+1] ) && binRun < 51 ){
3618 if (binRun==51)
return kFALSE;
3620 Double_t threshold = thresholdEMCalL0[binRun];
3622 if (isMC && spreadEMCalL0[binRun] != 0.){
3623 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3624 triggerSmearing->SetParameter(0, 1/(spreadEMCalL0[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3625 triggerSmearing->SetParameter(1, thresholdEMCalL0[binRun]);
3626 triggerSmearing->SetParameter(2, spreadEMCalL0[binRun]);
3627 threshold = triggerSmearing->GetRandom();
3628 delete triggerSmearing;
3633 TClonesArray * arrClustersMimic = NULL;
3635 nclus =
event->GetNumberOfCaloClusters();
3637 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3638 if(!arrClustersMimic)
3639 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3640 nclus = arrClustersMimic->GetEntries();
3643 if(nclus == 0)
return kFALSE;
3646 Bool_t eventIsAccepted = kFALSE;
3647 for(
Int_t i = 0; i < nclus; i++){
3648 if (eventIsAccepted)
continue;
3649 AliVCluster* clus = NULL;
3650 if(event->IsA()==AliESDEvent::Class()){
3651 if(arrClustersMimic)
3652 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3654 clus =
event->GetCaloCluster(i);
3655 }
else if(event->IsA()==AliAODEvent::Class()){
3656 if(arrClustersMimic)
3657 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3659 clus =
event->GetCaloCluster(i);
3663 if(arrClustersMimic)
delete clus;
3666 if (!clus->IsEMCAL()) {
3667 if(arrClustersMimic)
delete clus;
3670 if (clus->GetM02()<0.1) {
3671 if(arrClustersMimic)
delete clus;
3674 if (clus->GetNCells()<2) {
3675 if(arrClustersMimic)
delete clus;
3678 if (clus->E() > threshold ){
3680 eventIsAccepted = kTRUE;
3682 if(arrClustersMimic)
3685 return eventIsAccepted;
3692 if (runnumber < runRangesEMCalL1[0])
return kTRUE;
3694 while (!(runnumber >= runRangesEMCalL1[binRun] && runnumber < runRangesEMCalL1[binRun+1] ) && binRun < 20 ){
3698 if (binRun==20)
return kFALSE;
3699 Double_t threshold = thresholdEMCalL1[binRun];
3701 if (isMC && spreadEMCalL1[binRun] != 0.){
3702 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3703 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3704 triggerSmearing->SetParameter(1, thresholdEMCalL1[binRun]);
3705 triggerSmearing->SetParameter(2, spreadEMCalL1[binRun]);
3706 threshold = triggerSmearing->GetRandom();
3707 delete triggerSmearing;
3712 TClonesArray * arrClustersMimic = NULL;
3715 nclus =
event->GetNumberOfCaloClusters();
3717 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3718 if(!arrClustersMimic)
3719 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3720 nclus = arrClustersMimic->GetEntries();
3723 if(nclus == 0)
return kFALSE;
3726 Bool_t eventIsAccepted = kFALSE;
3727 for(
Int_t i = 0; i < nclus; i++){
3728 if (eventIsAccepted)
continue;
3729 AliVCluster* clus = NULL;
3730 if(event->IsA()==AliESDEvent::Class()){
3731 if(arrClustersMimic)
3732 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3734 clus =
event->GetCaloCluster(i);
3735 }
else if(event->IsA()==AliAODEvent::Class()){
3736 if(arrClustersMimic)
3737 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3739 clus =
event->GetCaloCluster(i);
3742 if(arrClustersMimic)
delete clus;
3745 if (!clus->IsEMCAL()) {
3746 if(arrClustersMimic)
delete clus;
3749 if (clus->GetM02()<0.1) {
3750 if(arrClustersMimic)
delete clus;
3753 if (clus->GetNCells()<2) {
3754 if(arrClustersMimic)
delete clus;
3757 if (clus->E() > threshold ){
3759 eventIsAccepted = kTRUE;
3761 if(arrClustersMimic)
3764 return eventIsAccepted;
3766 if (runnumber < runRangesEMCalL1G2[0])
return kTRUE;
3768 while (!(runnumber >= runRangesEMCalL1G2[binRun] && runnumber < runRangesEMCalL1G2[binRun+1] ) && binRun < 19 ){
3773 if (binRun==19)
return kFALSE;
3774 Double_t threshold = thresholdEMCalL1G2[binRun];
3775 if (isMC && spreadEMCalL1G2[binRun] != 0.){
3776 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3777 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1G2[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3778 triggerSmearing->SetParameter(1, thresholdEMCalL1G2[binRun]);
3779 triggerSmearing->SetParameter(2, spreadEMCalL1G2[binRun]);
3780 threshold = triggerSmearing->GetRandom();
3781 delete triggerSmearing;
3786 TClonesArray * arrClustersMimic = NULL;
3788 nclus =
event->GetNumberOfCaloClusters();
3790 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3791 if(!arrClustersMimic)
3792 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3793 nclus = arrClustersMimic->GetEntries();
3796 if(nclus == 0)
return kFALSE;
3799 Bool_t eventIsAccepted = kFALSE;
3800 for(
Int_t i = 0; i < nclus; i++){
3801 if (eventIsAccepted)
continue;
3802 AliVCluster* clus = NULL;
3803 if(event->IsA()==AliESDEvent::Class()){
3804 if(arrClustersMimic)
3805 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3807 clus =
event->GetCaloCluster(i);
3808 }
else if(event->IsA()==AliAODEvent::Class()){
3809 if(arrClustersMimic)
3810 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3812 clus =
event->GetCaloCluster(i);
3815 if(arrClustersMimic)
delete clus;
3818 if (!clus->IsEMCAL()) {
3819 if(arrClustersMimic)
delete clus;
3822 if (clus->GetM02()<0.1) {
3823 if(arrClustersMimic)
delete clus;
3826 if (clus->GetNCells()<2) {
3827 if(arrClustersMimic)
delete clus;
3830 if (clus->E() > threshold ){
3832 eventIsAccepted = kTRUE;
3834 if(arrClustersMimic)
3837 return eventIsAccepted;
3854 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3857 UInt_t isSelected = AliVEvent::kAny;
3859 if (fInputHandler==NULL)
return kFALSE;
3860 if( fInputHandler->GetEventSelection() ||
event->IsA()==AliAODEvent::Class()) {
3862 TString firedTrigClass =
event->GetFiredTriggerClasses();
3903 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3905 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3907 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3909 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3911 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3913 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3917 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3918 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3920 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3921 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3923 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3924 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3926 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3927 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3933 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3935 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3937 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
3940 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3941 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3942 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
3945 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3947 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3950 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3951 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3954 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3956 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3958 if (firedTrigClass.Contains(
"7DG2")) isSelected = 0;
3961 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3962 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3963 if (firedTrigClass.Contains(
"8DG2")) isSelected = 0;
3966 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3968 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3971 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3972 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3974 if (
fSpecialTrigger == 10 && (fInputHandler->IsEventSelected() & AliVEvent::kCaloOnly) ){
3977 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
3979 if (firedTrigClass.Contains(
"INT1-")) isSelected = 0;
3981 if (firedTrigClass.Contains(
"INT8-")) isSelected = 0;
3983 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
3985 if (firedTrigClass.Contains(
"INT1-")) isSelected = 0;
3987 if (firedTrigClass.Contains(
"INT8-")) isSelected = 0;
3991 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
3992 if (firedTrigClass.Contains(
"EMC7-")) isSelected = 0;
3994 if (firedTrigClass.Contains(
"INT8-")) isSelected = 0;
3995 if (firedTrigClass.Contains(
"EMC8-")) isSelected = 0;
3997 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
3998 if (firedTrigClass.Contains(
"EMC7-")) isSelected = 0;
4000 if (firedTrigClass.Contains(
"INT8-")) isSelected = 0;
4001 if (firedTrigClass.Contains(
"EMC8-")) isSelected = 0;
4005 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
4006 if (firedTrigClass.Contains(
"EMC7-")) isSelected = 0;
4007 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
4009 if (firedTrigClass.Contains(
"INT8-")) isSelected = 0;
4010 if (firedTrigClass.Contains(
"EMC8-")) isSelected = 0;
4011 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
4013 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
4014 if (firedTrigClass.Contains(
"EMC7-")) isSelected = 0;
4016 if (firedTrigClass.Contains(
"INT8-")) isSelected = 0;
4017 if (firedTrigClass.Contains(
"EMC8-")) isSelected = 0;
4019 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
4020 if (firedTrigClass.Contains(
"DMC7-")) isSelected = 0;
4021 if (firedTrigClass.Contains(
"7DG2")) isSelected = 0;
4023 if (firedTrigClass.Contains(
"INT8-")) isSelected = 0;
4024 if (firedTrigClass.Contains(
"DMC8-")) isSelected = 0;
4025 if (firedTrigClass.Contains(
"8DG2")) isSelected = 0;
4027 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
4028 if (firedTrigClass.Contains(
"DMC7-")) isSelected = 0;
4030 if (firedTrigClass.Contains(
"INT7-")) isSelected = 0;
4031 if (firedTrigClass.Contains(
"DMC8-")) isSelected = 0;
4035 if (isSelected != 0 ){
4042 if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC7) && firedTrigClass.Contains(
"EMC"))
hTriggerClassesCorrelated->Fill(3);
4049 if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC7) && firedTrigClass.Contains(
"DMC"))
hTriggerClassesCorrelated->Fill(10);
4059 if (fInputHandler->IsEventSelected() & AliVEvent::kCaloOnly){
4096 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
4097 TObjString *NameClass = (TObjString*)ClassesList->At(i);
4098 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
4102 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
4103 TObjString *NameClass = (TObjString*)ClassesList->At(i);
4104 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
4108 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
4109 TObjString *NameClass = (TObjString*)ClassesList->At(i);
4110 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
4115 for (
Int_t i=0; i<ClassesList->GetEntriesFast(); i++){
4116 TObjString *NameClass = (TObjString*)ClassesList->At(i);
4117 if (firedTrigClass.Contains(NameClass->GetString())) CheckClass+=
"1";
4118 else CheckClass+=
"0";
4120 if(CheckClass.Contains(
"0")) isSelected = 0;
4127 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
4129 Bool_t mimickedTrigger = kTRUE;
4136 if (mimickedTrigger){
4137 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)
hTriggerClass->Fill(0);
4138 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)
hTriggerClass->Fill(1);
4139 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)
hTriggerClass->Fill(2);
4140 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)
hTriggerClass->Fill(3);
4141 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)
hTriggerClass->Fill(4);
4142 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)
hTriggerClass->Fill(5);
4143 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)
hTriggerClass->Fill(6);
4145 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)
hTriggerClass->Fill(7);
4147 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)
hTriggerClass->Fill(8);
4149 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)
hTriggerClass->Fill(9);
4151 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)
hTriggerClass->Fill(10);
4153 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)
hTriggerClass->Fill(11);
4154 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)
hTriggerClass->Fill(12);
4155 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)
hTriggerClass->Fill(13);
4158 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)
hTriggerClass->Fill(14);
4159 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)
hTriggerClass->Fill(15);
4160 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)
hTriggerClass->Fill(16);
4161 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)
hTriggerClass->Fill(17);
4162 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)
hTriggerClass->Fill(18);
4163 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)
hTriggerClass->Fill(19);
4164 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)
hTriggerClass->Fill(20);
4166 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)
hTriggerClass->Fill(21);
4167 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClass->Fill(22);
4168 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClass->Fill(23);
4169 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)
hTriggerClass->Fill(24);
4170 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClass->Fill(25);
4171 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClass->Fill(26);
4172 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)
hTriggerClass->Fill(27);
4173 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)
hTriggerClass->Fill(28);
4174 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)
hTriggerClass->Fill(29);
4175 if (fInputHandler->IsEventSelected() & AliVEvent::kCaloOnly)
hTriggerClass->Fill(30);
4176 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)
hTriggerClass->Fill(31);
4177 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)
hTriggerClass->Fill(32);
4178 if (!fInputHandler->IsEventSelected())
hTriggerClass->Fill(35);
4184 if (mimickedTrigger){
4216 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClassSelected->Fill(22);
4217 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClassSelected->Fill(23);
4219 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClassSelected->Fill(25);
4220 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClassSelected->Fill(26);
4230 if(!isSelected)
return kFALSE;
4232 if (!mimickedTrigger )
return kFALSE;
4259 if(rejection == 0)
return;
4261 AliGenCocktailEventHeader *cHeader = 0x0;
4262 AliAODMCHeader *cHeaderAOD = 0x0;
4263 Bool_t headerFound = kFALSE;
4264 AliMCEvent *fMCEvent = 0x0;
4265 TClonesArray *fMCEventAOD = 0x0;
4266 if(event->IsA()==AliMCEvent::Class()){
4267 if(dynamic_cast<AliMCEvent*>(event)){
4268 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(
dynamic_cast<AliMCEvent*
>(event)->GenEventHeader());
4269 fMCEvent =
dynamic_cast<AliMCEvent*
>(event);
4270 if(cHeader) headerFound = kTRUE;
4273 if(event->IsA()==AliAODEvent::Class()){
4274 cHeaderAOD =
dynamic_cast<AliAODMCHeader*
>(
event->FindListObject(AliAODMCHeader::StdBranchName()));
4275 fMCEventAOD =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4276 if(cHeaderAOD) headerFound = kTRUE;
4279 if (
fDebugLevel > 0 ) cout <<
"event starts here" << endl;
4281 TList *genHeaders = 0x0;
4282 if(cHeader) genHeaders = cHeader->GetHeaders();
4284 genHeaders = cHeaderAOD->GetCocktailHeaders();
4285 if(genHeaders->GetEntries()==1){
4290 AliGenEventHeader* gh = 0;
4292 Int_t firstindexA = 0;
4293 Int_t lastindexA = -1;
4294 if(rejection == 1 || rejection == 3)
fnHeaders = 1;
4295 if(rejection == 2 || rejection == 4){
4296 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
4297 gh = (AliGenEventHeader*)genHeaders->At(i);
4298 TString GeneratorName = gh->GetName();
4299 lastindexA = lastindexA + gh->NProduced();
4300 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
4301 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
4302 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
4303 if (
fDebugLevel > 0 ) cout << GeneratorInList.Data() << endl;
4304 if(GeneratorInList.Contains(GeneratorName) ){
4306 if (GeneratorInList.BeginsWith(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
4309 if (
fDebugLevel > 2 )cout <<
"number of produced particle: " << gh->NProduced() << endl;
4310 if (
fDebugLevel > 2 )cout <<
"pdg-code of first particle: " << fMCEvent->Particle(firstindexA)->GetPdgCode() << endl;
4312 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindexA+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
4316 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4317 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
4321 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4322 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
4337 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA));
4340 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0){
4341 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA+10));
4347 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4348 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
4352 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4353 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
4369 if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4376 firstindexA = firstindexA + gh->NProduced();
4385 if(rejection == 1 || rejection == 3){
4387 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
4388 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
4393 Int_t firstindex = 0;
4394 Int_t lastindex = -1;
4397 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
4398 gh = (AliGenEventHeader*)genHeaders->At(i);
4399 TString GeneratorName = gh->GetName();
4400 lastindex = lastindex + gh->NProduced();
4401 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
4402 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
4403 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
4404 if(GeneratorInList.Contains(GeneratorName) ){
4405 if (GeneratorInList.Contains(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
4409 if (
fDebugLevel > 0 ) cout <<
"produced " << gh->NProduced() <<
" with box generator" << endl;
4410 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindex+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
4411 if (
fDebugLevel > 0 ) cout <<
"one of them was a pi0 or eta" << endl;
4416 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4418 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4423 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4425 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4430 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4444 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex));
4447 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0) {
4448 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex+10));
4456 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4461 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4463 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4468 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4482 }
else if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4486 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4493 firstindex = firstindex + gh->NProduced();
4496 for (
Int_t i = 0; i < number; i++){
4506 fNotRejectedEnd[0] =
static_cast<AliMCEvent*
>(event)->GetNumberOfPrimaries()-1;
4523 if(index < 0)
return 0;
4526 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
4527 if(!mcEvent)
return 0;
4528 if(index >= mcEvent->GetNumberOfPrimaries()){
4529 if( ((TParticle*)mcEvent->Particle(index))->GetMother(0) < 0)
return 0;
4530 return IsParticleFromBGEvent(((TParticle*)mcEvent->Particle(index))->GetMother(0),mcEvent,InputEvent, debug);
4537 if(i == 0) accepted = 2;
4540 if (debug > 1 && !accepted) cout <<
"rejected:" << index << endl;
4542 else if(InputEvent->IsA()==AliAODEvent::Class()){
4543 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
4544 if (AODMCTrackArray){
4545 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4546 if(!aodMCParticle)
return 0;
4547 if(!aodMCParticle->IsPrimary()){
4548 if( aodMCParticle->GetMother() < 0)
return 0;
4551 index = TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
4555 if(i == 0) accepted = 2;
4568 if (mcEvent){isMC = kTRUE;}
4596 Int_t runnumber =
event->GetRunNumber();
4597 if ((runnumber>=144871) && (runnumber<=146860)) {
4599 AliVCaloCells *cells =
event->GetEMCALCells();
4600 const Short_t nCells = cells->GetNumberOfCells();
4602 if (event->IsA()==AliESDEvent::Class()) AliAnalysisManager::GetAnalysisManager()->LoadBranch(
"EMCALCells.");
4604 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
4605 if (!fInputHandler)
return 3;
4608 Int_t nCellCount[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
4609 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
4610 Short_t cellId = cells->GetCellNumber(iCell);
4611 Double_t cellE = cells->GetCellAmplitude(cellId);
4612 Int_t sm = cellId / (24*48);
4613 if (cellE>0.1) ++nCellCount[sm];
4616 Bool_t fIsLedEvent = kFALSE;
4617 if (nCellCount[4] > 100) {
4618 fIsLedEvent = kTRUE;
4620 if ((runnumber>=146858) && (runnumber<=146860)) {
4621 if ((fInputHandler->IsEventSelected() & AliVEvent::kMB) && (nCellCount[3]>=21))
4622 fIsLedEvent = kTRUE;
4623 else if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC1) && (nCellCount[3]>=35))
4624 fIsLedEvent = kTRUE;
4634 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
4635 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
4636 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
4641 if(event->IsA()==AliESDEvent::Class()){
4645 for(
Int_t i=0; i<nPileVert;i++){
4646 const AliESDVertex* pv= ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
4647 Int_t nc2 = pv->GetNContributors();
4652 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
4666 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
4670 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4676 if(
fUtils->IsPileUpEvent(event) ){
4680 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4701 AliEventplane *EventPlane =
event->GetEventplane();
4714 AliInfo(
"Inside the GetWeightForCentralityFlattening function");
4717 if(!event || event->IsA()==AliESDEvent::Class()){
4720 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
4722 centrality = fESDCentrality->GetCentralityPercentile(
"V0M");
4725 }
else if(event->IsA()==AliAODEvent::Class()){
4728 if(aodEvent->GetHeader()){
4729 centrality = ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();
4735 Float_t GetValueForWeight = 1.;
4738 Bool_t CorrCentrLoop = kFALSE;
4744 CorrCentrLoop = kTRUE;
4748 CorrCentrLoop = kTRUE;
4750 CorrCentrLoop = kFALSE;
4753 if (CorrCentrLoop && GetValueForWeight != 0. && maximum !=0. && isfinite(GetValueForWeight) && isfinite(maximum) ){
4754 weightCentrality = maximum/GetValueForWeight;
4755 if (!isfinite(GetValueForWeight)) weightCentrality = 1.;
4756 if (!isfinite(weightCentrality)) weightCentrality = 1.;
4759 return weightCentrality;
4778 if (relativeErrorData < 0.2 && relativeErrorMC < 0.2 ){
4779 if (isfinite(valueMultData) && isfinite(valueMultMC) ){
4780 weightMult = valueMultData/valueMultMC;
4792 if(index < 0)
return 0;
4805 if (kCaseGen == 0)
return 1.;
4812 if(!event || event->IsA()==AliESDEvent::Class()){
4813 mesonPt = ((TParticle*)mcEvent->Particle(index))->Pt();
4815 PDGCode = ((TParticle*)mcEvent->Particle(index))->GetPdgCode();
4816 }
else if(event->IsA()==AliAODEvent::Class()){
4817 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4818 if (AODMCTrackArray){
4819 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4820 mesonPt = aodMCParticle->Pt();
4822 PDGCode = aodMCParticle->GetPdgCode();
4829 Float_t functionResultMC = 1.;
4841 Float_t functionResultData = 1;
4854 if (PDGCode == 111 || PDGCode == 221){
4855 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
4856 weight = functionResultData/functionResultMC;
4857 if ( kCaseGen == 3){
4858 if (PDGCode == 111){
4863 if (PDGCode == 221){
4869 if (!isfinite(functionResultData)) weight = 1.;
4870 if (!isfinite(weight)) weight = 1.;
4872 }
else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
4873 weight = functionResultMC;
4889 printf(
" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),-0.465);
4892 printf(
" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),0.465);
4895 else printf(
" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(
GetCutNumber()).
Data());