25 #include "AliAODTrack.h" 26 #include "AliESDtrack.h" 27 #include "AliAnalysisManager.h" 28 #include "AliInputEventHandler.h" 29 #include "AliMCEventHandler.h" 30 #include "AliAODHandler.h" 34 #include "TObjString.h" 35 #include "AliMCEvent.h" 36 #include "AliAODEvent.h" 37 #include "AliESDEvent.h" 38 #include "AliCentrality.h" 39 #include "AliMultSelection.h" 43 #include "AliGenCocktailEventHeader.h" 44 #include "AliGenDPMjetEventHeader.h" 45 #include "AliGenPythiaEventHeader.h" 46 #include "AliGenHijingEventHeader.h" 47 #include "AliTriggerAnalysis.h" 49 #include "AliVCaloCells.h" 50 #include "AliAODMCParticle.h" 51 #include "AliAODMCHeader.h" 52 #include "AliEMCALTriggerPatchInfo.h" 67 "SelectSpecialTrigger",
68 "SelectSpecialSubTriggerClass",
77 AliAnalysisCuts(name,title),
80 fDoLightOutput(kFALSE),
83 fDetectorCentrality(0),
84 fModCentralityClass(0),
85 fEnableVertexCut(kTRUE),
89 fMultiplicityMethod(0),
91 fSpecialSubTrigger(0),
92 fRemovePileUp(kFALSE),
93 fPastFutureRejectionLow(0),
94 fPastFutureRejectionHigh(0),
95 fDoPileUpRejectV0MTPCout(0),
96 fFPileUpRejectV0MTPCout(0),
97 fRejectExtraSignals(0),
98 fOfflineTriggerMask(0),
103 fNotRejectedStart(NULL),
104 fNotRejectedEnd(NULL),
105 fGeneratorNames(NULL),
106 fPeriodEnum(kNoPeriod),
113 fDoCentralityFlat(0),
114 fPathWeightsFlatCent(
""),
115 fNameHistoNotFlatCentrality(
""),
116 fDoReweightHistoMCPi0(kFALSE),
117 fDoReweightHistoMCEta(kFALSE),
118 fDoReweightHistoMCK0s(kFALSE),
119 fPathTrFReweighting(
""),
120 fNameHistoReweightingPi0(
""),
121 fNameHistoReweightingEta(
""),
122 fNameHistoReweightingK0s(
""),
126 fHistoEventCuts(NULL),
127 fHistoPastFutureBits(NULL),
129 hCentralityNotFlat(NULL),
132 hNPileupVertices(NULL),
133 hPileupVertexToPrimZ(NULL),
134 hPileupVertexToPrimZSPDPileup(NULL),
135 hPileupVertexToPrimZTrackletvsHits(NULL),
136 hEventPlaneAngle(NULL),
139 hTriggerClassSelected(NULL),
140 hTriggerClassesCorrelated(NULL),
141 hReweightMCHistPi0(NULL),
142 hReweightMCHistEta(NULL),
143 hReweightMCHistK0s(NULL),
147 fAddedSignalPDGCode(0),
149 fTriggerSelectedManually(kFALSE),
150 fSpecialTriggerName(
""),
151 fSpecialSubTriggerName(
""),
152 fNSpecialSubTriggerOptions(0),
153 hSPDClusterTrackletBackgroundBefore(NULL),
154 hSPDClusterTrackletBackground(NULL),
156 fCorrTaskSetting(
""),
158 fTriggerPatchInfo(NULL),
159 fMainTriggerPatchEMCAL(NULL),
160 fCaloTriggersName(
""),
161 fCaloTriggerPatchInfoName(
""),
163 fTriggersEMCALSelected(-1),
164 fEMCALTrigInitialized(kFALSE),
165 fSecProdBoundary(1.0),
168 fMaxFacPtHardSingleParticle(1.5),
169 fMimicTrigger(kFALSE),
170 fRejectTriggerOverlap(kFALSE),
171 fDoMultiplicityWeighting(kFALSE),
172 fPathReweightingMult(
""),
173 fNameHistoReweightingMultData(
""),
174 fNameHistoReweightingMultMC(
""),
175 hReweightMultData(NULL),
176 hReweightMultMC(NULL),
182 fUtils =
new AliAnalysisUtils();
191 AliAnalysisCuts(ref),
296 fUtils =
new AliAnalysisUtils();
336 TH1::AddDirectory(kFALSE);
429 hTriggerClass->GetXaxis()->SetBinLabel( 9,
"kMUL7/kMuonLikePB");
430 hTriggerClass->GetXaxis()->SetBinLabel(10,
"kMUU7/kMuonUnlikePB");
434 hTriggerClass->GetXaxis()->SetBinLabel(14,
"kPHI7/kPHI8/kPHOSPb");
443 hTriggerClass->GetXaxis()->SetBinLabel(23,
"kMuonSingleLowPt8");
444 hTriggerClass->GetXaxis()->SetBinLabel(24,
"kMuonSingleHighPt8");
445 hTriggerClass->GetXaxis()->SetBinLabel(25,
"kMuonLikeLowPt8");
446 hTriggerClass->GetXaxis()->SetBinLabel(26,
"kMuonUnlikeLowPt8");
447 hTriggerClass->GetXaxis()->SetBinLabel(27,
"kMuonUnlikeLowPt0");
455 hTriggerClass->GetXaxis()->SetBinLabel(35,
"failed Physics Selection");
456 hTriggerClass->GetXaxis()->SetBinLabel(36,
"mimickedTrigger");
514 TH1::AddDirectory(kTRUE);
527 if(mcEvent && event->IsA()==AliESDEvent::Class()){
529 AliMCEventHandler* mcHandler =
dynamic_cast<AliMCEventHandler*
> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
534 if (!mcHandler->InitOk() ){
538 if (!mcHandler->TreeK() ){
562 if(event->IsA()==AliESDEvent::Class()){
563 AliTriggerAnalysis fTriggerAnalysis;
564 fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((
AliESDEvent*)event, AliTriggerAnalysis::kV0AND);
591 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
592 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
593 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
598 if(event->IsA()==AliESDEvent::Class()){
602 for(
Int_t i=0; i<nPileVert;i++){
603 const AliESDVertex* pv = ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
604 Int_t nc2 = pv->GetNContributors();
609 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
621 if(
fUtils->IsPileUpMV(event)){
627 if(
fUtils->IsFirstEventInChunk(event)){
633 if(
fUtils->IsPileUpEvent(event)){
639 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
648 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
654 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
687 AliEventplane *EventPlane =
event->GetEventplane();
712 AliInfo(
"Entering loading of weights for centrality flattening");
735 AliInfo(
"Entering loading of weights for multiplicity weighting");
769 AliInfo(
"Entering loading of histograms for weighting");
835 AliInfo(
"Centrality flattening was enabled");
840 AliInfo(
"Multiplicity weighting was enabled");
844 AliInfo(
"Particle Weighting was enabled");
849 AliInfo(Form(
"Set Event Cut Number: %s",analysisCutSelection.Data()));
850 if(analysisCutSelection.Length()!=
kNCuts) {
851 AliError(Form(
"Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(),
kNCuts));
854 if(!analysisCutSelection.IsAlnum()){
855 AliError(
"Cut selection is not alphanumeric");
862 TString analysisCutSelectionLowerCase = Form(
"%s",analysisCutSelection.Data());
863 analysisCutSelectionLowerCase.ToLower();
864 const char *cutSelection = analysisCutSelectionLowerCase.Data();
865 #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0' 898 }
else return kFALSE;
904 }
else return kFALSE;
910 }
else return kFALSE;
916 }
else return kFALSE;
922 }
else return kFALSE;
928 }
else return kFALSE;
934 }
else return kFALSE;
940 }
else return kFALSE;
943 AliError(
"Cut id out of range");
947 AliError(
"Cut id %d not recognized");
961 printf(
"\nEvent cutnumber \n");
963 printf(
"%d",
fCuts[ic]);
967 printf(
"Running in pp mode \n");
970 printf(
"\t only events triggered by V0OR will be analysed \n");
972 printf(
"\t only events where SDD was present will be analysed \n");
976 printf(
"\t only events triggered by V0AND will be analysed \n");
978 printf(
"\t only events where SDD was present will be analysed and triggered by VOAND\n");
989 printf(
"Running in PbPb mode \n");
991 printf(
"\t centrality selection based on V0M \n");
993 printf(
"\t centrality selection based on Cl1 \n");
1011 printf(
"\t only events triggered by kMB, kCentral, kSemiCentral will be analysed \n");
1019 printf(
"Running in pPb mode \n");
1021 printf(
"\t centrality selection based on V0A \n");
1023 printf(
"\t centrality selection based on Cl1 \n");
1033 printf(
"\t only events triggered by kINT7 will be analysed \n");
1040 else printf(
"\t No vertex cut \n");
1043 printf(
"\t Doing pile up removal \n");
1045 printf(
"\t Doing extra pile up removal V0M vs TPCout \n");
1049 printf(
"MC event cuts: \n");
1053 printf(
"\t maximum factor between jet and pt hard = %2.2f \n",
fMaxFacPtHard);
1146 AliError(Form(
"SetHeavyIon not defined %d",isHeavyIon));
1156 if(minCentrality<0||minCentrality>20){
1157 AliError(Form(
"minCentrality not defined %d",minCentrality));
1169 if(maxCentrality<0||maxCentrality>20){
1170 AliError(Form(
"maxCentrality not defined %d",maxCentrality));
1181 switch(selectSpecialTrigger){
1211 fOfflineTriggerMask=AliVEvent::kPHI7 | AliVEvent::kPHI1 | AliVEvent::kPHI8 | AliVEvent::kPHOSPb;
1238 AliError(
"Warning: Special Trigger Not known");
1249 switch(selectSpecialSubTriggerClass){
1260 AliError(
"Warning: Special Subtrigger Class Not known");
1264 switch(selectSpecialSubTriggerClass){
1289 AliError(
"Warning: Special Subtrigger Class Not known");
1293 switch(selectSpecialSubTriggerClass){
1354 AliError(
"Warning: Special Subtrigger Class Not known");
1358 switch(selectSpecialSubTriggerClass){
1405 AliError(
"Warning: Special Subtrigger Class Not known");
1409 switch(selectSpecialSubTriggerClass){
1458 AliError(
"Warning: Special Subtrigger Class Not known");
1462 switch(selectSpecialSubTriggerClass){
1490 AliError(
"Warning: Special Subtrigger Class Not known");
1494 switch(selectSpecialSubTriggerClass){
1538 AliError(
"Warning: Special Subtrigger Class Not known");
1542 switch(selectSpecialSubTriggerClass){
1634 AliError(
"Warning: Special Subtrigger Class Not known");
1638 switch(selectSpecialSubTriggerClass){
1716 AliError(
"Warning: Special Subtrigger Class Not known");
1740 switch(removePileUp){
1874 AliError(
"RemovePileUpCut not defined");
1883 switch(extraSignal){
1897 AliError(Form(
"Extra Signal Rejection not defined %d",extraSignal));
1932 AliError(Form(
"Vertex Cut not defined %d",vertexCut));
1979 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
1981 AliWarning (
"AliMultSelection object not found !");
1985 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
1986 else return MultSelection->GetMultiplicityPercentile(
"V0M");
1987 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
1990 AliCentrality *fESDCentrality = (AliCentrality*)esdEvent->GetCentrality();
1992 if(
fIsHeavyIon==2)
return fESDCentrality->GetCentralityPercentile(
"V0A");
1993 else return fESDCentrality->GetCentralityPercentile(
"V0M");
2001 AliMultSelection *MultSelection = (AliMultSelection*)aodEvent->FindListObject(
"MultSelection");
2003 AliWarning (
"AliMultSelection object not found !");
2007 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
2008 else return MultSelection->GetMultiplicityPercentile(
"V0M",kTRUE);
2009 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
2012 if(aodEvent->GetHeader()){
return ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();}
2027 Int_t primaryTracksPP[9] = { 0, 2, 5, 10, 15,
2042 if(centrality<0 && !mcEvent)
return kFALSE;
2044 Int_t centralityC=0;
2046 centralityC=
Int_t(centrality/10);
2052 centralityC=
Int_t(centrality);
2055 }
else return kFALSE;
2058 centralityC=
Int_t(centrality);
2061 }
else return kFALSE;
2064 Int_t PrimaryTracks10[11][2] =
2078 Int_t PrimaryTracksLHC11h10[11][2] =
2092 Int_t PrimaryTracksLHC15o10[11][2] =
2106 Int_t PrimaryTracksLHC10h5[21][2] =
2130 Int_t PrimaryTracksLHC11h5[21][2] =
2154 Int_t PrimaryTracksLHC15o5[21][2] =
2178 Int_t PrimaryTracksLHC17n10[11][2] =
2194 if(event->IsA()==AliESDEvent::Class()) column = 0;
2195 if(event->IsA()==AliAODEvent::Class()) column = 1;
2211 centralityC=
Int_t(centrality/10);
2213 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o10[0][column])
return kFALSE;
2215 }
else return kFALSE;
2224 centralityC=
Int_t(centrality/10);
2239 centralityC =
Int_t(centrality);
2241 if(
fCentralityMin==0 && nprimaryTracks >= PrimaryTracksLHC15o5[0][column])
return kFALSE;
2243 }
else return kFALSE;
2252 centralityC=
Int_t(centrality);
2255 }
else return kFALSE;
2259 Int_t PrimaryTracksLHC11h10AltMin[11][2] =
2273 Int_t PrimaryTracksLHC11h10AltMax[11][2] =
2287 Int_t PrimaryTracksLHC11h5AltMin[21][2] =
2311 Int_t PrimaryTracksLHC11h5AltMax[21][2] =
2340 if(nprimaryTracks > PrimaryTracksLHC11h10AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h10AltMax[
fCentralityMin][column])
2348 centralityC=
Int_t(centrality/10);
2358 if(nprimaryTracks > PrimaryTracksLHC11h5AltMin[
fCentralityMax][column] && nprimaryTracks <= PrimaryTracksLHC11h5AltMax[
fCentralityMin][column])
2365 centralityC=
Int_t(centrality);
2368 }
else return kFALSE;
2378 Double_t fVertexZ=
event->GetPrimaryVertex()->GetZ();
2382 fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ();
2386 fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ();
2389 if(TMath::Abs(fVertexZ)>
fMaxVertexZ)
return kFALSE;
2393 if (TMath::Abs(fVertexZ-fVertexZSPD) > 0.1)
return kFALSE;
2396 if(!
fUtils->IsVertexSelected2013pA(event))
return kFALSE;
2407 TBits fIR1 =
event->GetHeader()->GetIRInt1InteractionMap();
2408 TBits fIR2 =
event->GetHeader()->GetIRInt2InteractionMap();
2409 UShort_t bunchCrossings =
event->GetBunchCrossNumber();
2411 for(
Int_t i = 0; i<180;i++){
2412 if(fIR1.TestBitNumber(i))
2417 Bool_t isOutOfBunchPileup = 0;
2420 if(pf1 < -89) pf1 = -89;
2421 if(pf2 > 89) pf2 = 89;
2422 Int_t pf2maxForT0 = pf2;
2424 for (
Int_t i=pf1;i<=pf2;i++) {
2426 if (i<=pf2maxForT0) isOutOfBunchPileup|=fIR2.TestBitNumber(90+i);
2427 if (i>0 && i<=ir1skip)
continue;
2428 isOutOfBunchPileup|=fIR1.TestBitNumber(90+i);
2430 return isOutOfBunchPileup;
2436 Bool_t isPileUpV0MTPCout=0;
2441 multV0M =
event->GetVZEROData()->GetMTotV0A();
2443 multV0M =
event->GetVZEROData()->GetMTotV0A() +
event->GetVZEROData()->GetMTotV0C() ;
2448 if (multV0M < valFunc ) isPileUpV0MTPCout=1;
2451 return isPileUpV0MTPCout;
2460 if (fESDEvent->GetPrimaryVertex() != NULL){
2461 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
2463 return fESDEvent->GetPrimaryVertex()->GetNContributors();
2467 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
2468 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2470 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
2472 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
2481 if (fAODEvent->GetPrimaryVertex() != NULL){
2482 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
2483 return fAODEvent->GetPrimaryVertex()->GetNContributors();
2486 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
2487 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2488 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
2490 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
2503 AliGenCocktailEventHeader *cHeader = 0x0;
2504 Bool_t headerFound = kFALSE;
2525 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2526 if(cHeader) headerFound = kTRUE;
2534 TList *genHeaders = 0x0;
2535 if(cHeader) genHeaders = cHeader->GetHeaders();
2536 AliGenEventHeader* gh = 0;
2537 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2538 gh = (AliGenEventHeader*)genHeaders->At(i);
2539 TString GeneratorName = gh->GetName();
2540 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2541 Bool_t eventAccepted = kTRUE;
2542 TParticle * jet = 0;
2543 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(gh)->NTriggerJets();
2546 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2547 dynamic_cast<AliGenPythiaEventHeader*
>(gh)->TriggerJet(ijet, tmpjet);
2548 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2551 eventAccepted= kFALSE;
2555 if (jet)
delete jet;
2557 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2558 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2559 if (!particle)
continue;
2560 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2562 eventAccepted= kFALSE;
2570 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2572 70, 85, 99, 115, 132,
2573 150, 169, 190, 212, 235,
2575 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2576 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2577 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2578 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2580 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2581 if (bin < 20) weight = weightsBins[bin];
2584 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2586 70, 85, 99, 115, 132,
2587 150, 169, 190, 212, 235,
2589 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2590 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2591 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2592 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2595 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2596 if (bin < 20) weight = weightsBins[bin];
2599 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2601 70, 85, 99, 115, 132,
2602 150, 169, 190, 212, 235,
2604 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2605 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2606 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2607 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2609 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2610 if (bin < 20) weight = weightsBins[bin];
2614 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2617 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2618 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2619 1.933238e-05, 1.562895e-05};
2621 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2622 if (bin < 12) weight = weightsBins[bin];
2625 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2626 84, 117, 152, 191, 1000000,
2628 21, 28, 36, 45, 57 };
2629 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2630 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2631 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2632 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2636 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2637 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2638 if (bin < 19) weight = weightsBins[bin];
2641 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2642 84, 117, 152, 191, 1000000,
2644 21, 28, 36, 45, 57 };
2646 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2647 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2648 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2649 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2652 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2653 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2654 if (bin < 19) weight = weightsBins[bin];
2657 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2659 70, 85, 99, 115, 132,
2660 150, 169, 190, 212, 235,
2662 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2663 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2664 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2665 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2667 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2668 if (bin < 20) weight = weightsBins[bin];
2671 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2672 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2674 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2675 if (bin < 5) weight = weightsBins[bin];
2678 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2679 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2681 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2682 if (bin < 6) weight = weightsBins[bin];
2685 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2686 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2688 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2689 if (bin < 7) weight = weightsBins[bin];
2692 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2693 84, 117, 152, 191, 234,
2695 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2696 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2698 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2699 if (bin < 10) weight = weightsBins[bin];
2701 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2702 Double_t weightsBins[20] = {1.565930E+01, 4.598350E+00, 2.081240E+00, 7.744650E-01, 2.644240E-01, 1.002330E-01, 2.979190E-02, 9.696490E-03, 3.950930E-03, 1.333040E-03, 5.210630E-04, 1.927180E-04, 9.235930E-05, 4.346820E-05, 2.120660E-05, 1.073260E-05, 5.701210E-06, 3.047490E-06, 1.664780E-06, 2.123400E-06};
2704 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2705 if (bin < 20) weight = weightsBins[bin];
2707 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2708 Double_t weightsBins[20] = {2.723740E+01, 8.127540E+00, 3.934400E+00, 1.492720E+00, 5.268010E-01, 2.033790E-01, 6.361520E-02, 2.256080E-02, 9.638840E-03, 3.372890E-03, 1.381980E-03, 5.121390E-04, 2.613120E-04, 1.260940E-04, 6.393150E-05, 3.386080E-05, 1.926040E-05, 1.046950E-05, 5.895950E-06, 8.658420E-06};
2710 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2711 if (bin < 20) weight = weightsBins[bin];
2713 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2714 Double_t weightsBins[20] = {2.716550E+01, 8.121430E+00, 3.932100E+00, 1.492830E+00, 5.272190E-01, 2.023090E-01, 6.371860E-02, 2.245360E-02, 9.590340E-03, 3.369300E-03, 1.384470E-03, 5.119390E-04, 2.606910E-04, 1.259110E-04, 6.408650E-05, 3.396290E-05, 1.917340E-05, 1.044610E-05, 5.882680E-06, 8.672390E-06};
2716 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2717 if (bin < 20) weight = weightsBins[bin];
2722 if (weight == -1)
return kFALSE;
2723 else return eventAccepted;
2728 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2729 TString eventHeaderName = eventHeader->ClassName();
2730 Bool_t eventAccepted = kFALSE;
2731 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2732 eventAccepted = kTRUE;
2734 if(event->IsA()==AliAODEvent::Class()){
2735 AliAODMCHeader *mch = NULL;
2738 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
2740 Int_t nGenerators = mch->GetNCocktailHeaders();
2741 if ( nGenerators > 0 ){
2742 for(
Int_t igen = 0; igen < nGenerators; igen++)
2744 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
2745 TString name = eventHeaderGen->GetName();
2746 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
2747 eventAccepted = kTRUE;
2748 eventHeader = eventHeaderGen;
2757 TParticle * jet = 0;
2758 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->NTriggerJets();
2759 Float_t ptHard =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
2761 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2762 dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->TriggerJet(ijet, tmpjet);
2763 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2766 eventAccepted= kFALSE;
2771 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2772 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2773 if (!particle)
continue;
2774 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2776 eventAccepted= kFALSE;
2784 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2786 70, 85, 99, 115, 132,
2787 150, 169, 190, 212, 235,
2789 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2790 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2791 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2792 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2794 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2795 if (bin < 20) weight = weightsBins[bin];
2798 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2800 70, 85, 99, 115, 132,
2801 150, 169, 190, 212, 235,
2803 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2804 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2805 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2806 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2809 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2810 if (bin < 20) weight = weightsBins[bin];
2813 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2815 70, 85, 99, 115, 132,
2816 150, 169, 190, 212, 235,
2818 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2819 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2820 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2821 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2823 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2824 if (bin < 20) weight = weightsBins[bin];
2828 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2831 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2832 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2833 1.933238e-05, 1.562895e-05};
2835 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2836 if (bin < 12) weight = weightsBins[bin];
2839 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2840 84, 117, 152, 191, 1000000,
2842 21, 28, 36, 45, 57 };
2843 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2844 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2845 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2846 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2850 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2851 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2852 if (bin < 19) weight = weightsBins[bin];
2855 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2856 84, 117, 152, 191, 1000000,
2858 21, 28, 36, 45, 57 };
2860 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2861 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2862 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2863 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2866 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2867 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2868 if (bin < 19) weight = weightsBins[bin];
2871 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2873 70, 85, 99, 115, 132,
2874 150, 169, 190, 212, 235,
2876 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2877 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2878 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2879 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2881 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2882 if (bin < 20) weight = weightsBins[bin];
2885 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2886 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2888 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2889 if (bin < 5) weight = weightsBins[bin];
2892 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2893 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2895 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2896 if (bin < 6) weight = weightsBins[bin];
2899 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2900 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2902 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2903 if (bin < 7) weight = weightsBins[bin];
2906 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2907 84, 117, 152, 191, 234,
2909 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2910 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2912 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2913 if (bin < 10) weight = weightsBins[bin];
2915 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2916 Double_t weightsBins[20] = {2.723740E+01, 8.127540E+00, 3.934400E+00, 1.492720E+00, 5.268010E-01, 2.033790E-01, 6.361520E-02, 2.256080E-02, 9.638840E-03, 3.372890E-03, 1.381980E-03, 5.121390E-04, 2.613120E-04, 1.260940E-04, 6.393150E-05, 3.386080E-05, 1.926040E-05, 1.046950E-05, 5.895950E-06, 8.658420E-06};
2918 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2919 if (bin < 20) weight = weightsBins[bin];
2921 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2922 Double_t weightsBins[20] = {2.716550E+01, 8.121430E+00, 3.932100E+00, 1.492830E+00, 5.272190E-01, 2.023090E-01, 6.371860E-02, 2.245360E-02, 9.590340E-03, 3.369300E-03, 1.384470E-03, 5.119390E-04, 2.606910E-04, 1.259110E-04, 6.408650E-05, 3.396290E-05, 1.917340E-05, 1.044610E-05, 5.882680E-06, 8.672390E-06};
2924 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2925 if (bin < 20) weight = weightsBins[bin];
2927 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16, 21, 28, 36, 45, 57, 70, 85, 99, 115, 132, 150, 169, 190, 212, 235, 10000};
2928 Double_t weightsBins[20] = { 16.1083, 4.60917, 2.15196, 0.782021, 0.26541,
2929 0.0978374, 0.0294286, 0.00989457, 0.0040615, 0.00135787,
2930 0.000531766, 0.000188772, 9.23331e-05, 4.30245e-05, 2.10196e-05,
2931 1.06695e-05, 5.78742e-06, 3.02897e-06, 1.62702e-06, 2.12118e-06 };
2934 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2935 if (bin < 20) weight = weightsBins[bin];
2940 if (weight == -1)
return kFALSE;
2941 else return eventAccepted;
2956 AliGenCocktailEventHeader *cHeader = 0x0;
2957 Bool_t headerFound = kFALSE;
2975 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2976 if(cHeader) headerFound = kTRUE;
2985 TList *genHeaders = 0x0;
2986 if(cHeader) genHeaders = cHeader->GetHeaders();
2987 AliGenEventHeader* gh = 0;
2988 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2989 gh = (AliGenEventHeader*)genHeaders->At(i);
2990 TString GeneratorName = gh->GetName();
2991 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2992 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(gh);
2993 NTrials = gPythia->Trials();
2994 XSection = gPythia->GetXsection();
2999 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3001 TString eventHeaderName = eventHeader->ClassName();
3002 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3003 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader);
3004 NTrials = gPythia->Trials();
3005 XSection = gPythia->GetXsection();
3012 if(event->IsA()==AliAODEvent::Class()){
3013 AliAODMCHeader *mch = NULL;
3016 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3018 Int_t nGenerators = mch->GetNCocktailHeaders();
3019 if ( nGenerators > 0 ){
3020 for(
Int_t igen = 0; igen < nGenerators; igen++)
3022 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3023 TString name = eventHeaderGen->GetName();
3024 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3025 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen);
3026 NTrials = gPythia->Trials();
3027 XSection = gPythia->GetXsection();
3047 AliGenCocktailEventHeader *cHeader = 0x0;
3048 Bool_t headerFound = kFALSE;
3063 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
3064 if(cHeader) headerFound = kTRUE;
3071 TList *genHeaders = 0x0;
3072 if(cHeader) genHeaders = cHeader->GetHeaders();
3073 AliGenEventHeader* gh = 0;
3074 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3075 gh = (AliGenEventHeader*)genHeaders->At(i);
3076 TString GeneratorName = gh->GetName();
3077 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
3078 return dynamic_cast<AliGenPythiaEventHeader*
>(gh)->
GetPtHard();
3082 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
3084 TString eventHeaderName = eventHeader->ClassName();
3085 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
3086 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
3090 if(event->IsA()==AliAODEvent::Class()){
3091 AliAODMCHeader *mch = NULL;
3094 mch =
dynamic_cast<AliAODMCHeader*
>(aod->FindListObject(
"mcHeader"));
3096 Int_t nGenerators = mch->GetNCocktailHeaders();
3097 if ( nGenerators > 0 ){
3098 for(
Int_t igen = 0; igen < nGenerators; igen++)
3100 AliGenEventHeader * eventHeaderGen = mch->GetCocktailHeader(igen) ;
3101 TString name = eventHeaderGen->GetName();
3102 if (name.CompareTo(
"AliGenPythiaEventHeader") == 0 || name.Contains(
"Pythia8Jets")){
3103 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeaderGen)->
GetPtHard();
3122 Int_t runRangesEMCalL0 [52] = { 144871, 145288, 146375, 146382,
3124 150209, 153056, 153911, 153915,
3125 158135, 158136, 158178, 158182, 160683,
3126 160764, 161139, 161256, 161379, 161457,
3127 161525, 161556, 161558, 161609, 161630,
3129 173731, 177144, 177147, 177653, 177724, 178327,
3148 Double_t thresholdEMCalL0[51] = { 2.11, 3.43, 1.71, 2.05,
3150 1.94, 3.39, 4.01, 5.25, 5.5,
3151 2.05, 5.50, 2.05, 5.50, 2.05, 1.71, 5.50, 1.71, 5.50, 1.71, 5.50, 1.71, 5.50, 1.71, 5.50, 1.71,
3152 2.01, 1.75, 1.52, 2.01, 1.52, 1.85,
3172 Double_t spreadEMCalL0[51] = { 0., 0., 0, 0,
3175 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
3176 0., 0., 0., 0., 0.2, 0.2,
3196 Int_t runRangesEMCalL1[21] = { 179796,
3215 Double_t thresholdEMCalL1[20] = { 9.5,
3234 Double_t spreadEMCalL1[20] = { 1.0,
3254 Int_t runRangesEMCalL1G2[21] = { 195180,
3272 Double_t thresholdEMCalL1G2[19] = { 7.2,
3290 Double_t spreadEMCalL1G2[19] = { 0.3,
3309 Int_t runnumber =
event->GetRunNumber();
3312 if (runnumber < runRangesEMCalL0[0])
return kTRUE;
3314 while (!(runnumber >= runRangesEMCalL0[binRun] && runnumber < runRangesEMCalL0[binRun+1] ) && binRun < 51 ){
3318 if (binRun==51)
return kFALSE;
3320 Double_t threshold = thresholdEMCalL0[binRun];
3322 if (isMC && spreadEMCalL0[binRun] != 0.){
3323 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3324 triggerSmearing->SetParameter(0, 1/(spreadEMCalL0[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3325 triggerSmearing->SetParameter(1, thresholdEMCalL0[binRun]);
3326 triggerSmearing->SetParameter(2, spreadEMCalL0[binRun]);
3327 threshold = triggerSmearing->GetRandom();
3328 delete triggerSmearing;
3333 TClonesArray * arrClustersMimic = NULL;
3335 nclus =
event->GetNumberOfCaloClusters();
3337 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3338 if(!arrClustersMimic)
3339 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3340 nclus = arrClustersMimic->GetEntries();
3343 if(nclus == 0)
return kFALSE;
3346 Bool_t eventIsAccepted = kFALSE;
3347 for(
Int_t i = 0; i < nclus; i++){
3348 if (eventIsAccepted)
continue;
3349 AliVCluster* clus = NULL;
3350 if(event->IsA()==AliESDEvent::Class()){
3351 if(arrClustersMimic)
3352 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3354 clus =
event->GetCaloCluster(i);
3355 }
else if(event->IsA()==AliAODEvent::Class()){
3356 if(arrClustersMimic)
3357 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3359 clus =
event->GetCaloCluster(i);
3363 if(arrClustersMimic)
delete clus;
3366 if (!clus->IsEMCAL()) {
3367 if(arrClustersMimic)
delete clus;
3370 if (clus->GetM02()<0.1) {
3371 if(arrClustersMimic)
delete clus;
3374 if (clus->GetNCells()<2) {
3375 if(arrClustersMimic)
delete clus;
3378 if (clus->E() > threshold ){
3380 eventIsAccepted = kTRUE;
3382 if(arrClustersMimic)
3385 return eventIsAccepted;
3392 if (runnumber < runRangesEMCalL1[0])
return kTRUE;
3394 while (!(runnumber >= runRangesEMCalL1[binRun] && runnumber < runRangesEMCalL1[binRun+1] ) && binRun < 20 ){
3398 if (binRun==20)
return kFALSE;
3399 Double_t threshold = thresholdEMCalL1[binRun];
3401 if (isMC && spreadEMCalL1[binRun] != 0.){
3402 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3403 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3404 triggerSmearing->SetParameter(1, thresholdEMCalL1[binRun]);
3405 triggerSmearing->SetParameter(2, spreadEMCalL1[binRun]);
3406 threshold = triggerSmearing->GetRandom();
3407 delete triggerSmearing;
3412 TClonesArray * arrClustersMimic = NULL;
3415 nclus =
event->GetNumberOfCaloClusters();
3417 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3418 if(!arrClustersMimic)
3419 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3420 nclus = arrClustersMimic->GetEntries();
3423 if(nclus == 0)
return kFALSE;
3426 Bool_t eventIsAccepted = kFALSE;
3427 for(
Int_t i = 0; i < nclus; i++){
3428 if (eventIsAccepted)
continue;
3429 AliVCluster* clus = NULL;
3430 if(event->IsA()==AliESDEvent::Class()){
3431 if(arrClustersMimic)
3432 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3434 clus =
event->GetCaloCluster(i);
3435 }
else if(event->IsA()==AliAODEvent::Class()){
3436 if(arrClustersMimic)
3437 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3439 clus =
event->GetCaloCluster(i);
3442 if(arrClustersMimic)
delete clus;
3445 if (!clus->IsEMCAL()) {
3446 if(arrClustersMimic)
delete clus;
3449 if (clus->GetM02()<0.1) {
3450 if(arrClustersMimic)
delete clus;
3453 if (clus->GetNCells()<2) {
3454 if(arrClustersMimic)
delete clus;
3457 if (clus->E() > threshold ){
3459 eventIsAccepted = kTRUE;
3461 if(arrClustersMimic)
3464 return eventIsAccepted;
3466 if (runnumber < runRangesEMCalL1G2[0])
return kTRUE;
3468 while (!(runnumber >= runRangesEMCalL1G2[binRun] && runnumber < runRangesEMCalL1G2[binRun+1] ) && binRun < 19 ){
3473 if (binRun==19)
return kFALSE;
3474 Double_t threshold = thresholdEMCalL1G2[binRun];
3475 if (isMC && spreadEMCalL1G2[binRun] != 0.){
3476 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3477 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1G2[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3478 triggerSmearing->SetParameter(1, thresholdEMCalL1G2[binRun]);
3479 triggerSmearing->SetParameter(2, spreadEMCalL1G2[binRun]);
3480 threshold = triggerSmearing->GetRandom();
3481 delete triggerSmearing;
3486 TClonesArray * arrClustersMimic = NULL;
3488 nclus =
event->GetNumberOfCaloClusters();
3490 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3491 if(!arrClustersMimic)
3492 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3493 nclus = arrClustersMimic->GetEntries();
3496 if(nclus == 0)
return kFALSE;
3499 Bool_t eventIsAccepted = kFALSE;
3500 for(
Int_t i = 0; i < nclus; i++){
3501 if (eventIsAccepted)
continue;
3502 AliVCluster* clus = NULL;
3503 if(event->IsA()==AliESDEvent::Class()){
3504 if(arrClustersMimic)
3505 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3507 clus =
event->GetCaloCluster(i);
3508 }
else if(event->IsA()==AliAODEvent::Class()){
3509 if(arrClustersMimic)
3510 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3512 clus =
event->GetCaloCluster(i);
3515 if(arrClustersMimic)
delete clus;
3518 if (!clus->IsEMCAL()) {
3519 if(arrClustersMimic)
delete clus;
3522 if (clus->GetM02()<0.1) {
3523 if(arrClustersMimic)
delete clus;
3526 if (clus->GetNCells()<2) {
3527 if(arrClustersMimic)
delete clus;
3530 if (clus->E() > threshold ){
3532 eventIsAccepted = kTRUE;
3534 if(arrClustersMimic)
3537 return eventIsAccepted;
3554 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3557 UInt_t isSelected = AliVEvent::kAny;
3559 if (fInputHandler==NULL)
return kFALSE;
3560 if( fInputHandler->GetEventSelection() ||
event->IsA()==AliAODEvent::Class()) {
3562 TString firedTrigClass =
event->GetFiredTriggerClasses();
3603 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3605 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3607 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3611 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3612 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3614 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3615 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3622 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3624 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3626 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
3629 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3630 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3631 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
3634 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3636 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3639 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3640 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3645 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3646 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3647 if (firedTrigClass.Contains(
"7EG1")) isSelected = 0;
3649 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3650 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3651 if (firedTrigClass.Contains(
"8EG1")) isSelected = 0;
3653 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3654 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3656 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3657 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3661 if (isSelected != 0 ){
3693 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3694 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3695 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3699 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3700 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3701 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3705 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3706 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3707 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3712 for (
Int_t i=0; i<ClassesList->GetEntriesFast(); i++){
3713 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3714 if (firedTrigClass.Contains(NameClass->GetString())) CheckClass+=
"1";
3715 else CheckClass+=
"0";
3717 if(CheckClass.Contains(
"0")) isSelected = 0;
3724 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3726 Bool_t mimickedTrigger = kTRUE;
3733 if (mimickedTrigger){
3734 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)
hTriggerClass->Fill(0);
3735 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)
hTriggerClass->Fill(1);
3736 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)
hTriggerClass->Fill(2);
3737 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)
hTriggerClass->Fill(3);
3738 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)
hTriggerClass->Fill(4);
3739 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)
hTriggerClass->Fill(5);
3740 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)
hTriggerClass->Fill(6);
3742 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)
hTriggerClass->Fill(7);
3744 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)
hTriggerClass->Fill(8);
3746 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)
hTriggerClass->Fill(9);
3748 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)
hTriggerClass->Fill(10);
3750 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)
hTriggerClass->Fill(11);
3751 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)
hTriggerClass->Fill(12);
3752 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)
hTriggerClass->Fill(13);
3755 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)
hTriggerClass->Fill(14);
3756 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)
hTriggerClass->Fill(15);
3757 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)
hTriggerClass->Fill(16);
3758 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)
hTriggerClass->Fill(17);
3759 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)
hTriggerClass->Fill(18);
3760 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)
hTriggerClass->Fill(19);
3761 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)
hTriggerClass->Fill(20);
3763 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)
hTriggerClass->Fill(21);
3764 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClass->Fill(22);
3765 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClass->Fill(23);
3766 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)
hTriggerClass->Fill(24);
3767 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClass->Fill(25);
3768 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClass->Fill(26);
3769 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)
hTriggerClass->Fill(27);
3770 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)
hTriggerClass->Fill(28);
3771 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)
hTriggerClass->Fill(29);
3772 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)
hTriggerClass->Fill(30);
3773 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)
hTriggerClass->Fill(31);
3774 if (!fInputHandler->IsEventSelected())
hTriggerClass->Fill(34);
3780 if (mimickedTrigger){
3812 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClassSelected->Fill(22);
3813 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClassSelected->Fill(23);
3815 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClassSelected->Fill(25);
3816 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClassSelected->Fill(26);
3826 if(!isSelected)
return kFALSE;
3828 if (!mimickedTrigger )
return kFALSE;
3855 if(rejection == 0)
return;
3857 AliGenCocktailEventHeader *cHeader = 0x0;
3858 AliAODMCHeader *cHeaderAOD = 0x0;
3859 Bool_t headerFound = kFALSE;
3860 AliMCEvent *fMCEvent = 0x0;
3861 TClonesArray *fMCEventAOD = 0x0;
3862 if(event->IsA()==AliMCEvent::Class()){
3863 if(dynamic_cast<AliMCEvent*>(event)){
3864 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(
dynamic_cast<AliMCEvent*
>(event)->GenEventHeader());
3865 fMCEvent =
dynamic_cast<AliMCEvent*
>(event);
3866 if(cHeader) headerFound = kTRUE;
3869 if(event->IsA()==AliAODEvent::Class()){
3870 cHeaderAOD =
dynamic_cast<AliAODMCHeader*
>(
event->FindListObject(AliAODMCHeader::StdBranchName()));
3871 fMCEventAOD =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
3872 if(cHeaderAOD) headerFound = kTRUE;
3875 if (
fDebugLevel > 0 ) cout <<
"event starts here" << endl;
3877 TList *genHeaders = 0x0;
3878 if(cHeader) genHeaders = cHeader->GetHeaders();
3880 genHeaders = cHeaderAOD->GetCocktailHeaders();
3881 if(genHeaders->GetEntries()==1){
3886 AliGenEventHeader* gh = 0;
3888 Int_t firstindexA = 0;
3889 Int_t lastindexA = -1;
3890 if(rejection == 1 || rejection == 3)
fnHeaders = 1;
3892 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3893 gh = (AliGenEventHeader*)genHeaders->At(i);
3894 TString GeneratorName = gh->GetName();
3895 lastindexA = lastindexA + gh->NProduced();
3896 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3897 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3898 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3899 if (
fDebugLevel > 0 ) cout << GeneratorInList.Data() << endl;
3900 if(GeneratorInList.Contains(GeneratorName) ){
3902 if (GeneratorInList.BeginsWith(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
3905 if (
fDebugLevel > 2 )cout <<
"number of produced particle: " << gh->NProduced() << endl;
3906 if (
fDebugLevel > 2 )cout <<
"pdg-code of first particle: " << fMCEvent->Particle(firstindexA)->GetPdgCode() << endl;
3908 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindexA+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
3912 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3913 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3917 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3918 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3933 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA));
3936 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0){
3937 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA+10));
3943 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
3944 if (
fDebugLevel > 2 ) cout <<
"accepted EMC header "<< endl;
3948 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
3949 if (
fDebugLevel > 2 ) cout <<
"accepted PHOS header "<< endl;
3965 if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
3972 firstindexA = firstindexA + gh->NProduced();
3981 if(rejection == 1 || rejection == 3){
3983 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
3984 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
3989 Int_t firstindex = 0;
3990 Int_t lastindex = -1;
3993 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3994 gh = (AliGenEventHeader*)genHeaders->At(i);
3995 TString GeneratorName = gh->GetName();
3996 lastindex = lastindex + gh->NProduced();
3997 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3998 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3999 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
4000 if(GeneratorInList.Contains(GeneratorName) ){
4001 if (GeneratorInList.Contains(
"PARAM") || GeneratorInList.CompareTo(
"BOX") == 0 ){
4005 if (
fDebugLevel > 0 ) cout <<
"produced " << gh->NProduced() <<
" with box generator" << endl;
4006 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindex+10)->GetPdgCode() ==
fAddedSignalPDGCode && GeneratorInList.CompareTo(
"BOX") == 0){
4007 if (
fDebugLevel > 0 ) cout <<
"one of them was a pi0 or eta" << endl;
4012 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4014 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4019 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4021 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4026 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4040 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex));
4043 if (gh->NProduced() > 10 && GeneratorInList.CompareTo(
"BOX") == 0) {
4044 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex+10));
4052 }
else if (gh->NProduced() == 3 && GeneratorInList.Contains(
"PARAM_EMC") && (i == 3 || i == 5) ){
4057 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4059 }
else if (gh->NProduced() > 2 && GeneratorInList.Contains(
"PARAM_PHOS") && (i == 4 || i == 6) ){
4064 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4078 }
else if(GeneratorName.CompareTo(GeneratorInList) == 0 ){
4082 if (
fDebugLevel > 0 ) cout <<
"Number of particles produced for: " << i <<
"\t" << GeneratorName.Data() <<
"\t" << lastindex-firstindex+1 << endl;
4089 firstindex = firstindex + gh->NProduced();
4092 for (
Int_t i = 0; i < number; i++){
4102 fNotRejectedEnd[0] =
static_cast<AliMCEvent*
>(event)->GetNumberOfPrimaries()-1;
4119 if(index < 0)
return 0;
4122 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
4123 if(!mcEvent)
return 0;
4124 if(index >= mcEvent->GetNumberOfPrimaries()){
4125 if( ((TParticle*)mcEvent->Particle(index))->GetMother(0) < 0)
return 0;
4133 if(i == 0) accepted = 2;
4136 if (debug > 1 && !accepted) cout <<
"rejected:" << index << endl;
4138 else if(InputEvent->IsA()==AliAODEvent::Class()){
4139 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
4140 if (AODMCTrackArray){
4141 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4142 if(!aodMCParticle)
return 0;
4143 if(!aodMCParticle->IsPrimary()){
4144 if( aodMCParticle->GetMother() < 0)
return 0;
4147 index = TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
4151 if(i == 0) accepted = 2;
4164 if (mcEvent){isMC = kTRUE;}
4192 Int_t runnumber =
event->GetRunNumber();
4193 if ((runnumber>=144871) && (runnumber<=146860)) {
4195 AliVCaloCells *cells =
event->GetEMCALCells();
4196 const Short_t nCells = cells->GetNumberOfCells();
4198 if (event->IsA()==AliESDEvent::Class()) AliAnalysisManager::GetAnalysisManager()->LoadBranch(
"EMCALCells.");
4200 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
4201 if (!fInputHandler)
return 3;
4204 Int_t nCellCount[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
4205 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
4206 Short_t cellId = cells->GetCellNumber(iCell);
4207 Double_t cellE = cells->GetCellAmplitude(cellId);
4208 Int_t sm = cellId / (24*48);
4209 if (cellE>0.1) ++nCellCount[sm];
4212 Bool_t fIsLedEvent = kFALSE;
4213 if (nCellCount[4] > 100) {
4214 fIsLedEvent = kTRUE;
4216 if ((runnumber>=146858) && (runnumber<=146860)) {
4217 if ((fInputHandler->IsEventSelected() & AliVEvent::kMB) && (nCellCount[3]>=21))
4218 fIsLedEvent = kTRUE;
4219 else if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC1) && (nCellCount[3]>=35))
4220 fIsLedEvent = kTRUE;
4230 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
4231 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
4232 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
4237 if(event->IsA()==AliESDEvent::Class()){
4241 for(
Int_t i=0; i<nPileVert;i++){
4242 const AliESDVertex* pv= ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
4243 Int_t nc2 = pv->GetNContributors();
4248 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
4262 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
4266 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4272 if(
fUtils->IsPileUpEvent(event) ){
4276 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
4297 AliEventplane *EventPlane =
event->GetEventplane();
4310 AliInfo(
"Inside the GetWeightForCentralityFlattening function");
4313 if(!event || event->IsA()==AliESDEvent::Class()){
4316 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
4318 centrality = fESDCentrality->GetCentralityPercentile(
"V0M");
4321 }
else if(event->IsA()==AliAODEvent::Class()){
4324 if(aodEvent->GetHeader()){
4325 centrality = ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();
4331 Float_t GetValueForWeight = 1.;
4334 Bool_t CorrCentrLoop = kFALSE;
4340 CorrCentrLoop = kTRUE;
4344 CorrCentrLoop = kTRUE;
4346 CorrCentrLoop = kFALSE;
4349 if (CorrCentrLoop && GetValueForWeight != 0. && maximum !=0. && isfinite(GetValueForWeight) && isfinite(maximum) ){
4350 weightCentrality = maximum/GetValueForWeight;
4351 if (!isfinite(GetValueForWeight)) weightCentrality = 1.;
4352 if (!isfinite(weightCentrality)) weightCentrality = 1.;
4355 return weightCentrality;
4374 if (relativeErrorData < 0.2 && relativeErrorMC < 0.2 ){
4375 if (isfinite(valueMultData) && isfinite(valueMultMC) ){
4376 weightMult = valueMultData/valueMultMC;
4395 if(index < 0)
return 0;
4403 if (kCaseGen == 0)
return 1;
4408 if(!event || event->IsA()==AliESDEvent::Class()){
4409 mesonPt = ((TParticle*)mcEvent->Particle(index))->Pt();
4411 PDGCode = ((TParticle*)mcEvent->Particle(index))->GetPdgCode();
4412 }
else if(event->IsA()==AliAODEvent::Class()){
4413 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4414 if (AODMCTrackArray){
4415 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
4416 mesonPt = aodMCParticle->Pt();
4418 PDGCode = aodMCParticle->GetPdgCode();
4424 Float_t functionResultMC = 1.;
4435 Float_t functionResultData = 1;
4447 if (PDGCode == 111 || PDGCode == 221){
4448 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
4449 weight = functionResultData/functionResultMC;
4450 if ( kCaseGen == 3){
4451 if (PDGCode == 111){
4456 if (PDGCode == 221){
4462 if (!isfinite(functionResultData)) weight = 1.;
4463 if (!isfinite(weight)) weight = 1.;
4465 }
else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
4466 weight = functionResultMC;
4482 printf(
" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),-0.465);
4485 printf(
" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),0.465);
4488 else printf(
" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(
GetCutNumber()).
Data());
4500 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
4508 AliEMCALTriggerPatchInfo *patch;
4509 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4511 if (patch->IsMainTrigger()) {
4528 if (event->IsA()==AliESDEvent::Class()){
4538 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
4544 if (event->IsA()==AliESDEvent::Class()){
4576 AliEMCALTriggerPatchInfo *patch;
4578 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4583 if (patch->IsGammaHigh()){
4587 if (patch->IsGammaLow()){
4591 if (patch->IsJetHigh()){
4595 if (patch->IsJetLow()){
4599 if (patch->IsLevel0()){
4610 AliDebug(2,
"Patch summary: ");
4611 AliDebug(2, Form(
"Number of patches: %d", nPatch));
4612 AliDebug(2, Form(
"Level0: [%d]" ,nL0));
4613 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
4614 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
4626 SETBIT(triggers,
kG1);
4628 SETBIT(triggers,
kG2);
4630 SETBIT(triggers,
kJ1);
4632 SETBIT(triggers,
kJ2);
4634 SETBIT(triggers,
kL0);
4653 TClonesArray *arr = 0;
4655 if (!sname.IsNull()) {
4656 arr =
dynamic_cast<TClonesArray*
>(
event->FindListObject(sname));
4658 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
4668 TString objname(arr->GetClass()->GetName());
4669 TClass cls(objname);
4670 if (!cls.InheritsFrom(clname)) {
4671 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
4672 GetName(), cls.GetName(), name, clname));
4681 if (eventpos < 0)
return kFALSE;
4682 TParticle* particle = (TParticle *)mcEvent->Particle(eventpos);
4683 if (!particle)
return kFALSE;
4684 if (TMath::Abs(particle->GetPdgCode()) == 11 ){
4685 if (particle->GetMother(0) != -1){
4686 TParticle* particleMother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4687 if (particleMother){
4688 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4689 particle = particleMother;
4693 if (particle->GetMother(0) != -1){
4694 Double_t deltaX = particle->Vx() - prodVtxX;
4695 Double_t deltaY = particle->Vy() - prodVtxY;
4696 Double_t deltaZ = particle->Vz() - prodVtxZ;
4699 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4702 Bool_t dalitzCand = kFALSE;
4704 TParticle* firstmother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4705 if (!firstmother)
return kFALSE;
4706 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4707 Bool_t intDecay = kFALSE;
4708 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4709 if ( intDecay && TMath::Abs(particle->GetPdgCode()) == 11 ){
4714 Long_t source = particle->GetMother(0);
4715 Bool_t foundExcludedPart = kFALSE;
4716 Bool_t foundShower = kFALSE;
4717 Int_t pdgCodeMotherPrev = 0;
4718 Int_t pdgCodeMotherPPrevMother = 0;
4726 TParticle* mother = (TParticle *)mcEvent->Particle(source);
4727 source = mother->GetMother(0);
4729 Int_t pdgCodeMother = mother->GetPdgCode();
4731 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4732 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4733 foundShower = kTRUE;
4736 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4737 foundShower = kTRUE;
4749 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4750 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4751 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312
4753 foundExcludedPart = kTRUE;
4756 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4757 pdgCodeMotherPrev = pdgCodeMother;
4758 if (source == -1) depth = 20;
4764 if (foundExcludedPart){
4770 }
else if (foundShower){
4785 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4786 if (AODMCTrackArray == NULL)
return kFALSE;
4787 AliAODMCParticle* currentParticle = AODMCParticle;
4788 if (TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4789 if (currentParticle->GetMother() != -1){
4790 AliAODMCParticle* particleMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4791 if (particleMother){
4792 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4793 currentParticle = particleMother;
4797 if (currentParticle->GetMother() > -1){
4798 Double_t deltaX = currentParticle->Xv() - prodVtxX;
4799 Double_t deltaY = currentParticle->Yv() - prodVtxY;
4800 Double_t deltaZ = currentParticle->Zv() - prodVtxZ;
4803 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4805 Bool_t dalitzCand = kFALSE;
4807 AliAODMCParticle* firstmother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4808 if (!firstmother)
return kFALSE;
4809 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4810 Bool_t intDecay = kFALSE;
4811 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4812 if ( intDecay && TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4817 Long_t source = currentParticle->GetMother();
4818 Bool_t foundExcludedPart = kFALSE;
4819 Bool_t foundShower = kFALSE;
4820 Int_t pdgCodeMotherPrev = 0;
4821 Int_t pdgCodeMotherPPrevMother = 0;
4829 AliAODMCParticle* mother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(source));
4830 source = mother->GetMother();
4832 Int_t pdgCodeMother = mother->GetPdgCode();
4834 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4835 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4836 foundShower = kTRUE;
4839 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4840 foundShower = kTRUE;
4852 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4853 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4854 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312)
4856 foundExcludedPart = kTRUE;
4859 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4860 pdgCodeMotherPrev = pdgCodeMother;
4861 if (source == -1) depth = 20;
4867 if (foundExcludedPart){
4873 }
else if (foundShower){
4888 if (particle != NULL && mcEvent != NULL){
4889 Int_t pdgSecondary = 0;
4893 Long_t motherID = particle->GetMother(0);
4894 Long_t grandMotherID = -1;
4898 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4900 if (grandMotherID > -1){
4902 pdgSecondary = mcEvent->Particle(grandMotherID)->GetPdgCode();
4909 Long_t motherID = particle->GetMother(0);
4910 Long_t grandMotherID = -1;
4911 Long_t greatGrandMotherID = -1;
4915 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4917 if (grandMotherID > -1){
4919 greatGrandMotherID = mcEvent->Particle(grandMotherID)->GetMother(0);
4921 if (greatGrandMotherID > -1){
4923 pdgSecondary = mcEvent->Particle(greatGrandMotherID)->GetPdgCode();
4929 if (TMath::Abs(pdgSecondary) == 3122 )
4932 else if ( TMath::Abs(pdgSecondary) == 310 )
4935 else if ( TMath::Abs(pdgSecondary) == 130 )
4938 else if ( TMath::Abs(pdgSecondary) == 221 )
4941 else if ( TMath::Abs(pdgSecondary) != 0 )
4951 if (particle != NULL && aodmcArray != NULL){
4952 Int_t pdgSecondary = 0;
4956 Long_t motherID = particle->GetMother();
4957 Long_t grandMotherID = -1;
4961 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4963 if (grandMotherID > -1){
4965 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetPdgCode();
4972 Long_t motherID = particle->GetMother();
4973 Long_t grandMotherID = -1;
4974 Long_t greatGrandMotherID = -1;
4978 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4980 if (grandMotherID > -1){
4982 greatGrandMotherID = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetMother();
4984 if (greatGrandMotherID > -1){
4986 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(greatGrandMotherID))->GetPdgCode();
4992 if (TMath::Abs(pdgSecondary) == 3122 )
4995 else if ( TMath::Abs(pdgSecondary) == 310 )
4998 else if ( TMath::Abs(pdgSecondary) == 130 )
5001 else if ( TMath::Abs(pdgSecondary) == 221 )
5004 else if ( TMath::Abs(pdgSecondary) != 0 )
5014 if (periodName.CompareTo(
"") == 0){
5017 if (periodName.CompareTo(
"") == 0) {
5020 AliError(
"No correct period could be set, periodName string empty");
5025 if (periodName.CompareTo(
"LHC10b") == 0 || periodName.CompareTo(
"LHC10c") == 0 || periodName.CompareTo(
"LHC10d") == 0 || periodName.CompareTo(
"LHC10e") == 0 ||
5026 periodName.CompareTo(
"LHC10f") == 0 || periodName.CompareTo(
"LHC10g") == 0 || periodName.CompareTo(
"LHC10bg") == 0
5030 }
else if (periodName.CompareTo(
"LHC10h") == 0) {
5033 }
else if (periodName.CompareTo(
"LHC11a") == 0) {
5036 }
else if (periodName.CompareTo(
"LHC11b") == 0) {
5039 }
else if (periodName.CompareTo(
"LHC11c") == 0 || periodName.CompareTo(
"LHC11d") == 0 || periodName.CompareTo(
"LHC11e") == 0 || periodName.CompareTo(
"LHC11f") == 0 ||
5040 periodName.CompareTo(
"LHC11g") == 0
5044 }
else if (periodName.CompareTo(
"LHC11h") == 0) {
5047 }
else if (periodName.CompareTo(
"LHC12a") == 0 || periodName.CompareTo(
"LHC12b") == 0 || periodName.CompareTo(
"LHC12c") == 0 || periodName.CompareTo(
"LHC12d") == 0 ||
5048 periodName.CompareTo(
"LHC12e") == 0 || periodName.CompareTo(
"LHC12f") == 0 || periodName.CompareTo(
"LHC12g") == 0 || periodName.CompareTo(
"LHC12h") == 0 ||
5049 periodName.CompareTo(
"LHC12i") == 0 || periodName.CompareTo(
"LHC12ai") == 0
5053 }
else if (periodName.CompareTo(
"LHC13b") == 0 || periodName.CompareTo(
"LHC13c") == 0 || periodName.CompareTo(
"LHC13bc") == 0){