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() ){
542 if (!mcHandler->TreeTR() ) {
560 if(event->IsA()==AliESDEvent::Class()){
561 AliTriggerAnalysis fTriggerAnalysis;
562 fHasV0AND = fTriggerAnalysis.IsOfflineTriggerFired((
AliESDEvent*)event, AliTriggerAnalysis::kV0AND);
589 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
590 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
591 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
596 if(event->IsA()==AliESDEvent::Class()){
600 for(
Int_t i=0; i<nPileVert;i++){
601 const AliESDVertex* pv = ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
602 Int_t nc2 = pv->GetNContributors();
607 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
619 if(
fUtils->IsPileUpMV(event)){
625 if(
fUtils->IsFirstEventInChunk(event)){
631 if(
fUtils->IsPileUpEvent(event)){
637 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
646 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
652 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
685 AliEventplane *EventPlane =
event->GetEventplane();
710 AliInfo(
"Entering loading of weights for centrality flattening");
733 AliInfo(
"Entering loading of weights for multiplicity weighting");
767 AliInfo(
"Entering loading of histograms for weighting");
833 AliInfo(
"Centrality flattening was enabled");
838 AliInfo(
"Multiplicity weighting was enabled");
842 AliInfo(
"Particle Weighting was enabled");
847 AliInfo(Form(
"Set Event Cut Number: %s",analysisCutSelection.Data()));
848 if(analysisCutSelection.Length()!=
kNCuts) {
849 AliError(Form(
"Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(),
kNCuts));
852 if(!analysisCutSelection.IsAlnum()){
853 AliError(
"Cut selection is not alphanumeric");
860 TString analysisCutSelectionLowerCase = Form(
"%s",analysisCutSelection.Data());
861 analysisCutSelectionLowerCase.ToLower();
862 const char *cutSelection = analysisCutSelectionLowerCase.Data();
863 #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0' 896 }
else return kFALSE;
902 }
else return kFALSE;
908 }
else return kFALSE;
914 }
else return kFALSE;
920 }
else return kFALSE;
926 }
else return kFALSE;
932 }
else return kFALSE;
938 }
else return kFALSE;
941 AliError(
"Cut id out of range");
945 AliError(
"Cut id %d not recognized");
959 printf(
"\nEvent cutnumber \n");
961 printf(
"%d",
fCuts[ic]);
965 printf(
"Running in pp mode \n");
968 printf(
"\t only events triggered by V0OR will be analysed \n");
970 printf(
"\t only events where SDD was present will be analysed \n");
974 printf(
"\t only events triggered by V0AND will be analysed \n");
976 printf(
"\t only events where SDD was present will be analysed and triggered by VOAND\n");
987 printf(
"Running in PbPb mode \n");
989 printf(
"\t centrality selection based on V0M \n");
991 printf(
"\t centrality selection based on Cl1 \n");
1007 printf(
"\t only events triggered by kMB, kCentral, kSemiCentral will be analysed \n");
1015 printf(
"Running in pPb mode \n");
1017 printf(
"\t centrality selection based on V0A \n");
1019 printf(
"\t centrality selection based on Cl1 \n");
1025 printf(
"\t only events triggered by kINT7 will be analysed \n");
1032 else printf(
"\t No vertex cut \n");
1035 printf(
"\t Doing pile up removal \n");
1037 printf(
"\t Doing extra pile up removal V0M vs TPCout \n");
1041 printf(
"MC event cuts: \n");
1045 printf(
"\t maximum factor between jet and pt hard = %2.2f \n",
fMaxFacPtHard);
1099 AliError(Form(
"SetHeavyIon not defined %d",isHeavyIon));
1109 if(minCentrality<0||minCentrality>9){
1110 AliError(Form(
"minCentrality not defined %d",minCentrality));
1122 if(maxCentrality<0||maxCentrality>9){
1123 AliError(Form(
"maxCentrality not defined %d",maxCentrality));
1134 switch(selectSpecialTrigger){
1164 fOfflineTriggerMask=AliVEvent::kPHI7 | AliVEvent::kPHI1 | AliVEvent::kPHI8 | AliVEvent::kPHOSPb;
1191 AliError(
"Warning: Special Trigger Not known");
1202 switch(selectSpecialSubTriggerClass){
1213 AliError(
"Warning: Special Subtrigger Class Not known");
1217 switch(selectSpecialSubTriggerClass){
1242 AliError(
"Warning: Special Subtrigger Class Not known");
1246 switch(selectSpecialSubTriggerClass){
1307 AliError(
"Warning: Special Subtrigger Class Not known");
1311 switch(selectSpecialSubTriggerClass){
1358 AliError(
"Warning: Special Subtrigger Class Not known");
1362 switch(selectSpecialSubTriggerClass){
1411 AliError(
"Warning: Special Subtrigger Class Not known");
1415 switch(selectSpecialSubTriggerClass){
1443 AliError(
"Warning: Special Subtrigger Class Not known");
1447 switch(selectSpecialSubTriggerClass){
1491 AliError(
"Warning: Special Subtrigger Class Not known");
1495 switch(selectSpecialSubTriggerClass){
1587 AliError(
"Warning: Special Subtrigger Class Not known");
1591 switch(selectSpecialSubTriggerClass){
1669 AliError(
"Warning: Special Subtrigger Class Not known");
1693 switch(removePileUp){
1827 AliError(
"RemovePileUpCut not defined");
1836 switch(extraSignal){
1850 AliError(Form(
"Extra Signal Rejection not defined %d",extraSignal));
1885 AliError(Form(
"Vertex Cut not defined %d",vertexCut));
1931 AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject(
"MultSelection");
1933 AliWarning (
"AliMultSelection object not found !");
1937 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
1938 else return MultSelection->GetMultiplicityPercentile(
"V0M");
1939 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
1942 AliCentrality *fESDCentrality = (AliCentrality*)esdEvent->GetCentrality();
1944 if(
fIsHeavyIon==2)
return fESDCentrality->GetCentralityPercentile(
"V0A");
1945 else return fESDCentrality->GetCentralityPercentile(
"V0M");
1953 AliMultSelection *MultSelection = (AliMultSelection*)aodEvent->FindListObject(
"MultSelection");
1955 AliWarning (
"AliMultSelection object not found !");
1959 if(
fIsHeavyIon==2)
return MultSelection->GetMultiplicityPercentile(
"V0A");
1960 else return MultSelection->GetMultiplicityPercentile(
"V0M",kTRUE);
1961 }
else if(
fDetectorCentrality==1)
return MultSelection->GetMultiplicityPercentile(
"CL1",kTRUE);
1964 if(aodEvent->GetHeader()){
return ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();}
1979 Int_t primaryTracksPP[9] = { 0, 2, 5, 10, 15,
1994 if(centrality<0 && !mcEvent)
return kFALSE;
1996 Int_t centralityC=0;
1998 centralityC=
Int_t(centrality/10);
2004 centralityC=
Int_t(centrality);
2007 }
else return kFALSE;
2010 centralityC=
Int_t(centrality);
2017 Int_t PrimaryTracks10[11][2] =
2031 Int_t PrimaryTracksLHC11h10[11][2] =
2045 Int_t PrimaryTracksLHC15o10[11][2] =
2059 Int_t PrimaryTracks5a[11][2] =
2073 Int_t PrimaryTracksLHC11h5a[11][2] =
2087 Int_t PrimaryTracksLHC15o5a[11][2] =
2101 Int_t PrimaryTracks5b[11][2] =
2115 Int_t PrimaryTracksLHC11h5b[11][2] =
2129 Int_t PrimaryTracksLHC15o5b[11][2] =
2143 Int_t PrimaryTracksLHC17n10[11][2] =
2159 if(event->IsA()==AliESDEvent::Class()) column = 0;
2160 if(event->IsA()==AliAODEvent::Class()) column = 1;
2187 centralityC=
Int_t(centrality/10);
2213 centralityC=
Int_t(centrality);
2216 }
else return kFALSE;
2239 centralityC=
Int_t(centrality);
2252 Double_t fVertexZ=
event->GetPrimaryVertex()->GetZ();
2256 fVertexZSPD = fESDEvent->GetPrimaryVertexSPD()->GetZ();
2260 fVertexZSPD = fAODEvent->GetPrimaryVertexSPD()->GetZ();
2263 if(TMath::Abs(fVertexZ)>
fMaxVertexZ)
return kFALSE;
2267 if (TMath::Abs(fVertexZ-fVertexZSPD) > 0.1)
return kFALSE;
2270 if(!
fUtils->IsVertexSelected2013pA(event))
return kFALSE;
2281 TBits fIR1 =
event->GetHeader()->GetIRInt1InteractionMap();
2282 TBits fIR2 =
event->GetHeader()->GetIRInt2InteractionMap();
2283 UShort_t bunchCrossings =
event->GetBunchCrossNumber();
2285 for(
Int_t i = 0; i<180;i++){
2286 if(fIR1.TestBitNumber(i))
2291 Bool_t isOutOfBunchPileup = 0;
2294 if(pf1 < -89) pf1 = -89;
2295 if(pf2 > 89) pf2 = 89;
2296 Int_t pf2maxForT0 = pf2;
2298 for (
Int_t i=pf1;i<=pf2;i++) {
2300 if (i<=pf2maxForT0) isOutOfBunchPileup|=fIR2.TestBitNumber(90+i);
2301 if (i>0 && i<=ir1skip)
continue;
2302 isOutOfBunchPileup|=fIR1.TestBitNumber(90+i);
2304 return isOutOfBunchPileup;
2310 Bool_t isPileUpV0MTPCout=0;
2315 multV0M =
event->GetVZEROData()->GetMTotV0A();
2317 multV0M =
event->GetVZEROData()->GetMTotV0A() +
event->GetVZEROData()->GetMTotV0C() ;
2322 if (multV0M < valFunc ) isPileUpV0MTPCout=1;
2325 return isPileUpV0MTPCout;
2334 if (fESDEvent->GetPrimaryVertex() != NULL){
2335 if(fESDEvent->GetPrimaryVertex()->GetNContributors()>0) {
2337 return fESDEvent->GetPrimaryVertex()->GetNContributors();
2341 if(fESDEvent->GetPrimaryVertexSPD() !=NULL){
2342 if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2344 return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
2346 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fESDEvent->GetPrimaryVertex()->GetName()));
2355 if (fAODEvent->GetPrimaryVertex() != NULL){
2356 if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
2357 return fAODEvent->GetPrimaryVertex()->GetNContributors();
2360 if(fAODEvent->GetPrimaryVertexSPD() !=NULL){
2361 if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
2362 return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
2364 AliWarning(Form(
"Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
2377 AliGenCocktailEventHeader *cHeader = 0x0;
2378 Bool_t headerFound = kFALSE;
2398 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2399 if(cHeader) headerFound = kTRUE;
2407 TList *genHeaders = 0x0;
2408 if(cHeader) genHeaders = cHeader->GetHeaders();
2409 AliGenEventHeader* gh = 0;
2410 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2411 gh = (AliGenEventHeader*)genHeaders->At(i);
2412 TString GeneratorName = gh->GetName();
2413 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2414 Bool_t eventAccepted = kTRUE;
2415 TParticle * jet = 0;
2416 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(gh)->NTriggerJets();
2419 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2420 dynamic_cast<AliGenPythiaEventHeader*
>(gh)->TriggerJet(ijet, tmpjet);
2421 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2424 eventAccepted= kFALSE;
2428 if (jet)
delete jet;
2430 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2431 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2432 if (!particle)
continue;
2433 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2435 eventAccepted= kFALSE;
2443 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2445 70, 85, 99, 115, 132,
2446 150, 169, 190, 212, 235,
2448 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2449 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2450 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2451 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2453 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2454 if (bin < 20) weight = weightsBins[bin];
2457 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2459 70, 85, 99, 115, 132,
2460 150, 169, 190, 212, 235,
2462 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2463 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2464 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2465 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2468 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2469 if (bin < 20) weight = weightsBins[bin];
2472 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2474 70, 85, 99, 115, 132,
2475 150, 169, 190, 212, 235,
2477 Double_t weightsBins[20] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2478 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2479 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2480 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2482 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2483 if (bin < 20) weight = weightsBins[bin];
2487 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2490 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2491 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2492 1.933238e-05, 1.562895e-05};
2494 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2495 if (bin < 12) weight = weightsBins[bin];
2498 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2499 84, 117, 152, 191, 1000000,
2501 21, 28, 36, 45, 57 };
2502 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2503 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2504 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2505 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2509 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2510 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2511 if (bin < 19) weight = weightsBins[bin];
2514 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2515 84, 117, 152, 191, 1000000,
2517 21, 28, 36, 45, 57 };
2519 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2520 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2521 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2522 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2525 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2526 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2527 if (bin < 19) weight = weightsBins[bin];
2530 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2532 70, 85, 99, 115, 132,
2533 150, 169, 190, 212, 235,
2535 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2536 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2537 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2538 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2540 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2541 if (bin < 20) weight = weightsBins[bin];
2544 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2545 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2547 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2548 if (bin < 5) weight = weightsBins[bin];
2551 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2552 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2554 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2555 if (bin < 6) weight = weightsBins[bin];
2558 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2559 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2561 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2562 if (bin < 7) weight = weightsBins[bin];
2565 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2566 84, 117, 152, 191, 234,
2568 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2569 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2571 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2572 if (bin < 10) weight = weightsBins[bin];
2575 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};
2576 Double_t weightsBins[20] = {2.648510E+01, 7.963350E+00, 3.926460E+00, 1.535630E+00, 5.125940E-01, 1.982910E-01, 6.705810E-02, 2.214220E-02, 9.872830E-03, 3.460430E-03, 1.426840E-03, 5.212990E-04, 2.534030E-04, 1.157210E-04, 6.609650E-05, 3.424850E-05, 1.833500E-05, 1.022650E-05, 5.878600E-06, 8.550350E-06};
2578 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2579 if (bin < 20) weight = weightsBins[bin];
2581 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};
2582 Double_t weightsBins[20] = {2.638850E+01, 8.160880E+00, 3.937510E+00, 1.485000E+00, 5.382460E-01, 2.034610E-01, 6.293600E-02, 2.206170E-02, 9.319700E-03, 3.354230E-03, 1.392300E-03, 5.023470E-04, 2.645860E-04, 1.299660E-04, 6.415310E-05, 3.469890E-05, 1.816550E-05, 1.047480E-05, 5.728760E-06, 8.547820E-06};
2584 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2585 if (bin < 20) weight = weightsBins[bin];
2591 if (weight == -1)
return kFALSE;
2592 else return eventAccepted;
2597 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2598 TString eventHeaderName = eventHeader->ClassName();
2599 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2600 Bool_t eventAccepted = kTRUE;
2601 TParticle * jet = 0;
2602 Int_t nTriggerJets =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->NTriggerJets();
2603 Float_t ptHard =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
2605 for(
Int_t ijet = 0; ijet< nTriggerJets; ijet++){
2606 dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->TriggerJet(ijet, tmpjet);
2607 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
2610 eventAccepted= kFALSE;
2615 for(Long_t i = 0; i < mcEvent->GetNumberOfPrimaries(); i++) {
2616 TParticle* particle = (TParticle *)mcEvent->Particle(i);
2617 if (!particle)
continue;
2618 if (TMath::Abs(particle->GetPdgCode()) == 111 || TMath::Abs(particle->GetPdgCode()) == 221){
2620 eventAccepted= kFALSE;
2628 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2630 70, 85, 99, 115, 132,
2631 150, 169, 190, 212, 235,
2633 Double_t weightsBins[20] = { 43.7553, 13.5848, 6.788, 2.67826, 0.975255,
2634 0.39069, 0.127342, 0.0465597, 0.0206539, 0.00750243,
2635 0.00319118, 0.00122291, 0.000641232, 0.000321437, 0.000168273,
2636 9.17033e-05, 5.34755e-05, 3.01354e-05, 1.74518e-05, 2.8004e-05};
2638 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2639 if (bin < 20) weight = weightsBins[bin];
2642 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2644 70, 85, 99, 115, 132,
2645 150, 169, 190, 212, 235,
2647 Double_t weightsBins[20] = { 43.8654, 13.6215, 6.79856, 2.67526, 0.978794,
2648 0.390797, 0.127769, 0.0465714, 0.0206173, 0.00750282,
2649 0.00318773, 0.00122533, 0.000644385, 0.000321225, 0.00016846,
2650 9.18305e-05, 5.33507e-05, 3.00677e-05, 1.74608e-05, 2.80823e-05};
2653 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2654 if (bin < 20) 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] = { 16.0869, 4.61169, 2.14976, 0.782544, 0.264854,
2663 9.7619E-02, 2.92747E-02, 9.89515E-03, 4.05152E-03, 1.35393E-03,
2664 5.29864E-04, 1.88317E-04, 9.23E-05, 4.29E-05, 2.09E-05,
2665 1.06E-05, 5.76E-06, 3.00E-06, 1.62E-06, 2.10E-06 };
2667 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2668 if (bin < 20) weight = weightsBins[bin];
2672 Double_t ptHardBinRanges[13] = { 5, 7, 9, 12, 16,
2675 Double_t weightsBins[12] = { 7.858393e-03, 4.718691e-03, 4.077575e-03, 2.814527e-03, 1.669625e-03,
2676 1.007535e-03, 4.536554e-04, 2.111041e-04, 1.094840e-04, 4.404973e-05,
2677 1.933238e-05, 1.562895e-05};
2679 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2680 if (bin < 12) weight = weightsBins[bin];
2683 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2684 84, 117, 152, 191, 1000000,
2686 21, 28, 36, 45, 57 };
2687 Double_t weightsBins[19] = { 4.43629 , 0.49523, 0.0394921, 0.00383174, 0.000446559,
2688 6.37374e-05, 1.03134e-05, 2.27012e-06, 7.59281e-07, 0,
2689 2.62906, 1.12884, 0.656873, 0.262822, 0.0876732,
2690 0.0307759, 0.0087083, 0.0027664, 0.00106203};
2694 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2695 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2696 if (bin < 19) weight = weightsBins[bin];
2699 Double_t ptHardBinRanges[20] = { 5, 11, 21, 36, 57,
2700 84, 117, 152, 191, 1000000,
2702 21, 28, 36, 45, 57 };
2704 Double_t weightsBins[19] = { 4.43897 , 0.495766, 0.039486, 0.00383011, 0.000447104,
2705 6.37277e-05, 1.03166e-05, 2.26971e-06, 7.59023e-07, 0,
2706 2.63331, 1.12815, 0.657034, 0.262756, 0.0877227,
2707 0.0307638, 0.00870635, 0.00276658, 0.00106229};
2710 if (binFromFile != -1 && binFromFile >9 && ptHard < 57) bin = 9;
2711 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2712 if (bin < 19) weight = weightsBins[bin];
2715 Double_t ptHardBinRanges[21] = { 5, 7, 9, 12, 16,
2717 70, 85, 99, 115, 132,
2718 150, 169, 190, 212, 235,
2720 Double_t weightsBins[20] = { 28.3084, 8.43277, 4.07753, 1.54359, 0.543318,
2721 0.208394, 0.0652349, 0.0186904, 0.00834528, 0.00301414,
2722 0.00125939, 0.000474403, 0.000244052, 0.00011924, 6.09838e-05,
2723 3.24148e-05, 1.84314e-05, 1.00926e-05, 5.68632e-06, 8.38092e-06};
2725 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2726 if (bin < 20) weight = weightsBins[bin];
2729 Double_t ptHardBinRanges[6] = { 7, 9, 12, 16, 21, 1000};
2730 Double_t weightsBins[5] = { 0.00672445, 0.00799158, 0.00678934, 0.00463908, 0.00600068};
2732 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2733 if (bin < 5) weight = weightsBins[bin];
2736 Double_t ptHardBinRanges[7] = { 14, 19, 26, 35, 48, 66, 1000};
2737 Double_t weightsBins[6] = { 0.00608281, 0.00393646, 0.00200138, 0.000986267, 0.000389051, 0.0001863};
2739 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2740 if (bin < 6) weight = weightsBins[bin];
2743 Double_t ptHardBinRanges[8] = { 0, 5, 11, 21, 36, 57, 84, 1000};
2744 Double_t weightsBins[7] = { 0.00151999, 0.000100346, 1.27688e-05, 1.82388e-06, 3.08506e-07, 6.00308e-08, 1.88414e-08};
2746 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2747 if (bin < 7) weight = weightsBins[bin];
2750 Double_t ptHardBinRanges[11] = { 5, 11, 21, 36, 57,
2751 84, 117, 152, 191, 234,
2753 Double_t weightsBins[10] = { 2.24185e-6 , 2.48463e-7, 2.23171e-8, 2.43667e-9, 3.29934e-10,
2754 5.34592e-11, 1.00937e-11, 2.6493e-12, 8.53912e-13, 5.43077e-13};
2756 while (!((ptHard< ptHardBinRanges[bin+1] && ptHard > ptHardBinRanges[bin]) || (ptHard == ptHardBinRanges[bin]) ) )bin++;
2757 if (bin < 10) weight = weightsBins[bin];
2762 if (weight == -1)
return kFALSE;
2763 else return eventAccepted;
2778 AliGenCocktailEventHeader *cHeader = 0x0;
2779 Bool_t headerFound = kFALSE;
2797 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2798 if(cHeader) headerFound = kTRUE;
2807 TList *genHeaders = 0x0;
2808 if(cHeader) genHeaders = cHeader->GetHeaders();
2809 AliGenEventHeader* gh = 0;
2810 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2811 gh = (AliGenEventHeader*)genHeaders->At(i);
2812 TString GeneratorName = gh->GetName();
2813 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2814 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(gh);
2815 NTrials = gPythia->Trials();
2816 XSection = gPythia->GetXsection();
2821 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2823 TString eventHeaderName = eventHeader->ClassName();
2824 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2825 AliGenPythiaEventHeader* gPythia =
dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader);
2826 NTrials = gPythia->Trials();
2827 XSection = gPythia->GetXsection();
2843 AliGenCocktailEventHeader *cHeader = 0x0;
2844 Bool_t headerFound = kFALSE;
2858 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(mcEvent->GenEventHeader());
2859 if(cHeader) headerFound = kTRUE;
2866 TList *genHeaders = 0x0;
2867 if(cHeader) genHeaders = cHeader->GetHeaders();
2868 AliGenEventHeader* gh = 0;
2869 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
2870 gh = (AliGenEventHeader*)genHeaders->At(i);
2871 TString GeneratorName = gh->GetName();
2872 if (GeneratorName.CompareTo(
"AliGenPythiaEventHeader") == 0 || GeneratorName.Contains(
"Pythia8Jets")){
2873 return dynamic_cast<AliGenPythiaEventHeader*
>(gh)->
GetPtHard();
2877 AliGenEventHeader * eventHeader = mcEvent->GenEventHeader();
2879 TString eventHeaderName = eventHeader->ClassName();
2880 if (eventHeaderName.CompareTo(
"AliGenPythiaEventHeader") == 0 || eventHeaderName.Contains(
"Pythia8Jets")){
2881 return dynamic_cast<AliGenPythiaEventHeader*
>(eventHeader)->
GetPtHard();
2896 Int_t runRangesEMCalL0 [35] = { 144871, 145288, 146375, 146382,
2898 150209, 153056, 153911, 153915,
2899 158135, 158136, 158178, 158182, 160683,
2900 160764, 161139, 161256, 161379, 161457,
2901 161525, 161556, 161558, 161609, 161630,
2903 173731, 177144, 177147, 177653, 177724, 178327,
2908 Double_t thresholdEMCalL0[34] = { 2.11, 3.43, 1.71, 2.05,
2910 1.94, 3.39, 4.01, 5.25, 5.5,
2911 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,
2912 2.01, 1.75, 1.52, 2.01, 1.52, 1.85,
2916 Double_t spreadEMCalL0[34] = { 0., 0., 0, 0,
2919 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
2920 0., 0., 0., 0., 0.2, 0.2,
2925 Int_t runRangesEMCalL1[4] = { 179796,
2930 Double_t thresholdEMCalL1[3] = { 9.5, 11.5, 5.5};
2931 Double_t spreadEMCalL1[3] = { 1.0, 0.5, 0.6};
2933 Int_t runRangesEMCalL1G2[3] = { 195180,
2937 Double_t thresholdEMCalL1G2[2] = { 7.2, 3.75};
2938 Double_t spreadEMCalL1G2[2] = { 0.3, 0.25};
2940 Int_t runnumber =
event->GetRunNumber();
2943 if (runnumber < runRangesEMCalL0[0])
return kTRUE;
2945 while (!(runnumber >= runRangesEMCalL0[binRun] && runnumber < runRangesEMCalL0[binRun+1] ) && binRun < 34 ){
2949 if (binRun==34)
return kFALSE;
2950 Double_t threshold = thresholdEMCalL0[binRun];
2952 if (isMC && spreadEMCalL0[binRun] != 0.){
2953 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
2954 triggerSmearing->SetParameter(0, 1/(spreadEMCalL0[binRun]*TMath::Sqrt(TMath::Pi()*2)));
2955 triggerSmearing->SetParameter(1, thresholdEMCalL0[binRun]);
2956 triggerSmearing->SetParameter(2, spreadEMCalL0[binRun]);
2957 threshold = triggerSmearing->GetRandom();
2958 delete triggerSmearing;
2963 TClonesArray * arrClustersMimic = NULL;
2965 nclus =
event->GetNumberOfCaloClusters();
2967 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
2968 if(!arrClustersMimic)
2969 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
2970 nclus = arrClustersMimic->GetEntries();
2973 if(nclus == 0)
return kFALSE;
2976 Bool_t eventIsAccepted = kFALSE;
2977 for(
Int_t i = 0; i < nclus; i++){
2978 AliVCluster* clus = NULL;
2979 if(event->IsA()==AliESDEvent::Class()){
2980 if(arrClustersMimic)
2981 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
2983 clus =
event->GetCaloCluster(i);
2984 }
else if(event->IsA()==AliAODEvent::Class()){
2985 if(arrClustersMimic)
2986 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
2988 clus =
event->GetCaloCluster(i);
2991 if (!clus)
continue;
2992 if (!clus->IsEMCAL())
continue;
2993 if (clus->GetM02()<0.1)
continue;
2994 if (clus->GetNCells()<2)
continue;
2995 if (clus->E() > threshold ){
2997 eventIsAccepted = kTRUE;
3000 return eventIsAccepted;
3007 if (runnumber < runRangesEMCalL1[0])
return kTRUE;
3009 while (!(runnumber >= runRangesEMCalL1[binRun] && runnumber < runRangesEMCalL1[binRun+1] ) && binRun < 3 ){
3013 if (binRun==3)
return kFALSE;
3014 Double_t threshold = thresholdEMCalL1[binRun];
3016 if (isMC && spreadEMCalL1[binRun] != 0.){
3017 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3018 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3019 triggerSmearing->SetParameter(1, thresholdEMCalL1[binRun]);
3020 triggerSmearing->SetParameter(2, spreadEMCalL1[binRun]);
3021 threshold = triggerSmearing->GetRandom();
3022 delete triggerSmearing;
3027 TClonesArray * arrClustersMimic = NULL;
3030 nclus =
event->GetNumberOfCaloClusters();
3032 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3033 if(!arrClustersMimic)
3034 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3035 nclus = arrClustersMimic->GetEntries();
3038 if(nclus == 0)
return kFALSE;
3041 Bool_t eventIsAccepted = kFALSE;
3042 for(
Int_t i = 0; i < nclus; i++){
3043 AliVCluster* clus = NULL;
3044 if(event->IsA()==AliESDEvent::Class()){
3045 if(arrClustersMimic)
3046 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3048 clus =
event->GetCaloCluster(i);
3049 }
else if(event->IsA()==AliAODEvent::Class()){
3050 if(arrClustersMimic)
3051 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3053 clus =
event->GetCaloCluster(i);
3055 if (!clus)
continue;
3056 if (!clus->IsEMCAL())
continue;
3057 if (clus->GetM02()<0.1)
continue;
3058 if (clus->GetNCells()<2)
continue;
3059 if (clus->E() > threshold ){
3061 eventIsAccepted = kTRUE;
3064 return eventIsAccepted;
3066 if (runnumber < runRangesEMCalL1G2[0])
return kTRUE;
3068 while (!(runnumber >= runRangesEMCalL1G2[binRun] && runnumber < runRangesEMCalL1G2[binRun+1] ) && binRun < 2 ){
3072 if (binRun==2)
return kFALSE;
3073 Double_t threshold = thresholdEMCalL1G2[binRun];
3074 if (isMC && spreadEMCalL1G2[binRun] != 0.){
3075 TF1* triggerSmearing =
new TF1(
"triggerSmearing",
"[0]*exp(-0.5*((x-[1])/[2])**2)",0,15);
3076 triggerSmearing->SetParameter(0, 1/(spreadEMCalL1G2[binRun]*TMath::Sqrt(TMath::Pi()*2)));
3077 triggerSmearing->SetParameter(1, thresholdEMCalL1G2[binRun]);
3078 triggerSmearing->SetParameter(2, spreadEMCalL1G2[binRun]);
3079 threshold = triggerSmearing->GetRandom();
3080 delete triggerSmearing;
3085 TClonesArray * arrClustersMimic = NULL;
3087 nclus =
event->GetNumberOfCaloClusters();
3089 arrClustersMimic =
dynamic_cast<TClonesArray*
>(
event->FindListObject(Form(
"%sClustersBranch",
fCorrTaskSetting.Data())));
3090 if(!arrClustersMimic)
3091 AliFatal(Form(
"%sClustersBranch was not found in AliConvEventCuts! Check the correction framework settings!",
fCorrTaskSetting.Data()));
3092 nclus = arrClustersMimic->GetEntries();
3095 if(nclus == 0)
return kFALSE;
3098 Bool_t eventIsAccepted = kFALSE;
3099 for(
Int_t i = 0; i < nclus; i++){
3100 AliVCluster* clus = NULL;
3101 if(event->IsA()==AliESDEvent::Class()){
3102 if(arrClustersMimic)
3103 clus =
new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersMimic->At(i));
3105 clus =
event->GetCaloCluster(i);
3106 }
else if(event->IsA()==AliAODEvent::Class()){
3107 if(arrClustersMimic)
3108 clus =
new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersMimic->At(i));
3110 clus =
event->GetCaloCluster(i);
3112 if (!clus)
continue;
3113 if (!clus->IsEMCAL())
continue;
3114 if (clus->GetM02()<0.1)
continue;
3115 if (clus->GetNCells()<2)
continue;
3116 if (clus->E() > threshold ){
3118 eventIsAccepted = kTRUE;
3121 return eventIsAccepted;
3138 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3141 UInt_t isSelected = AliVEvent::kAny;
3143 if (fInputHandler==NULL)
return kFALSE;
3144 if( fInputHandler->GetEventSelection() ||
event->IsA()==AliAODEvent::Class()) {
3146 TString firedTrigClass =
event->GetFiredTriggerClasses();
3187 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3189 if (fInputHandler->IsEventSelected() & AliVEvent::kMB) isSelected = 0;
3191 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3195 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3196 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3198 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3199 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3206 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3208 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3210 if (firedTrigClass.Contains(
"7EG2")) isSelected = 0;
3213 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3214 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3215 if (firedTrigClass.Contains(
"8EG2")) isSelected = 0;
3218 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3220 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3223 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3224 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3229 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3230 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3231 if (firedTrigClass.Contains(
"7EG1")) isSelected = 0;
3233 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8) isSelected = 0;
3234 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3235 if (firedTrigClass.Contains(
"8EG1")) isSelected = 0;
3237 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3238 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3240 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7) isSelected = 0;
3241 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7) isSelected = 0;
3245 if (isSelected != 0 ){
3277 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3278 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3279 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3283 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3284 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3285 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3289 for (
Int_t i=0; i<ClassesList->GetEntriesFast();++i){
3290 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3291 if (firedTrigClass.Contains(NameClass->GetString())) isSelected = 1;
3296 for (
Int_t i=0; i<ClassesList->GetEntriesFast(); i++){
3297 TObjString *NameClass = (TObjString*)ClassesList->At(i);
3298 if (firedTrigClass.Contains(NameClass->GetString())) CheckClass+=
"1";
3299 else CheckClass+=
"0";
3301 if(CheckClass.Contains(
"0")) isSelected = 0;
3308 fIsSDDFired = !(fInputHandler->IsEventSelected() & AliVEvent::kFastOnly);
3310 Bool_t mimickedTrigger = kTRUE;
3317 if (mimickedTrigger){
3318 if (fInputHandler->IsEventSelected() & AliVEvent::kMB)
hTriggerClass->Fill(0);
3319 if (fInputHandler->IsEventSelected() & AliVEvent::kINT7)
hTriggerClass->Fill(1);
3320 if (fInputHandler->IsEventSelected() & AliVEvent::kMUON)
hTriggerClass->Fill(2);
3321 if (fInputHandler->IsEventSelected() & AliVEvent::kHighMult)
hTriggerClass->Fill(3);
3322 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC1)
hTriggerClass->Fill(4);
3323 if (fInputHandler->IsEventSelected() & AliVEvent::kCINT5)
hTriggerClass->Fill(5);
3324 if (fInputHandler->IsEventSelected() & AliVEvent::kCMUS5)
hTriggerClass->Fill(6);
3326 if (fInputHandler->IsEventSelected() & AliVEvent::kMUSH7)
hTriggerClass->Fill(7);
3328 if (fInputHandler->IsEventSelected() & AliVEvent::kMUL7)
hTriggerClass->Fill(8);
3330 if (fInputHandler->IsEventSelected() & AliVEvent::kMUU7)
hTriggerClass->Fill(9);
3332 if (fInputHandler->IsEventSelected() & AliVEvent::kEMC7)
hTriggerClass->Fill(10);
3334 if (fInputHandler->IsEventSelected() & AliVEvent::kMUS7)
hTriggerClass->Fill(11);
3335 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI1)
hTriggerClass->Fill(12);
3336 if (fInputHandler->IsEventSelected() & AliVEvent::kPHI7)
hTriggerClass->Fill(13);
3339 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEJE)
hTriggerClass->Fill(14);
3340 if (fInputHandler->IsEventSelected() & AliVEvent::kEMCEGA)
hTriggerClass->Fill(15);
3341 if (fInputHandler->IsEventSelected() & AliVEvent::kCentral)
hTriggerClass->Fill(16);
3342 if (fInputHandler->IsEventSelected() & AliVEvent::kSemiCentral)
hTriggerClass->Fill(17);
3343 if (fInputHandler->IsEventSelected() & AliVEvent::kDG5)
hTriggerClass->Fill(18);
3344 if (fInputHandler->IsEventSelected() & AliVEvent::kZED)
hTriggerClass->Fill(19);
3345 if (fInputHandler->IsEventSelected() & AliVEvent::kSPI7)
hTriggerClass->Fill(20);
3347 if (fInputHandler->IsEventSelected() & AliVEvent::kINT8)
hTriggerClass->Fill(21);
3348 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClass->Fill(22);
3349 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClass->Fill(23);
3350 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonLikeLowPt8)
hTriggerClass->Fill(24);
3351 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClass->Fill(25);
3352 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClass->Fill(26);
3353 if (fInputHandler->IsEventSelected() & AliVEvent::kUserDefined)
hTriggerClass->Fill(27);
3354 if (fInputHandler->IsEventSelected() & AliVEvent::kTRD)
hTriggerClass->Fill(28);
3355 if (fInputHandler->IsEventSelected() & AliVEvent::kFastOnly)
hTriggerClass->Fill(29);
3356 if (fInputHandler->IsEventSelected() & AliVEvent::kAnyINT)
hTriggerClass->Fill(30);
3357 if (fInputHandler->IsEventSelected() & AliVEvent::kAny)
hTriggerClass->Fill(31);
3358 if (!fInputHandler->IsEventSelected())
hTriggerClass->Fill(34);
3364 if (mimickedTrigger){
3396 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleLowPt8)
hTriggerClassSelected->Fill(22);
3397 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonSingleHighPt8)
hTriggerClassSelected->Fill(23);
3399 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt8)
hTriggerClassSelected->Fill(25);
3400 if (fInputHandler->IsEventSelected() & AliVEvent::kMuonUnlikeLowPt0)
hTriggerClassSelected->Fill(26);
3410 if(!isSelected)
return kFALSE;
3412 if (!mimickedTrigger )
return kFALSE;
3439 if(rejection == 0)
return;
3441 AliGenCocktailEventHeader *cHeader = 0x0;
3442 AliAODMCHeader *cHeaderAOD = 0x0;
3443 Bool_t headerFound = kFALSE;
3444 AliMCEvent *fMCEvent = 0x0;
3445 TClonesArray *fMCEventAOD = 0x0;
3446 if(event->IsA()==AliMCEvent::Class()){
3447 if(dynamic_cast<AliMCEvent*>(event)){
3448 cHeader =
dynamic_cast<AliGenCocktailEventHeader*
>(
dynamic_cast<AliMCEvent*
>(event)->GenEventHeader());
3449 fMCEvent =
dynamic_cast<AliMCEvent*
>(event);
3450 if(cHeader) headerFound = kTRUE;
3453 if(event->IsA()==AliAODEvent::Class()){
3454 cHeaderAOD =
dynamic_cast<AliAODMCHeader*
>(
event->FindListObject(AliAODMCHeader::StdBranchName()));
3455 fMCEventAOD =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
3456 if(cHeaderAOD) headerFound = kTRUE;
3459 if (
fDebugLevel > 0 ) cout <<
"event starts here" << endl;
3461 TList *genHeaders = 0x0;
3462 if(cHeader) genHeaders = cHeader->GetHeaders();
3464 genHeaders = cHeaderAOD->GetCocktailHeaders();
3465 if(genHeaders->GetEntries()==1){
3470 AliGenEventHeader* gh = 0;
3472 Int_t firstindexA = 0;
3473 Int_t lastindexA = -1;
3474 if(rejection == 1 || rejection == 3)
fnHeaders = 1;
3476 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3477 gh = (AliGenEventHeader*)genHeaders->At(i);
3478 TString GeneratorName = gh->GetName();
3479 lastindexA = lastindexA + gh->NProduced();
3481 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3482 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3484 if(GeneratorName.CompareTo(GeneratorInList) == 0){
3486 if (GeneratorInList.CompareTo(
"PARAM") == 0 || GeneratorInList.CompareTo(
"BOX") == 0 ){
3490 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindexA+10)->GetPdgCode() ==
fAddedSignalPDGCode ){
3504 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA));
3507 if (gh->NProduced() > 10){
3508 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindexA+10));
3530 firstindexA = firstindexA + gh->NProduced();
3539 if(rejection == 1 || rejection == 3){
3541 fNotRejectedEnd[0] = ((AliGenEventHeader*)genHeaders->At(0))->NProduced()-1;
3542 fGeneratorNames[0] = ((AliGenEventHeader*)genHeaders->At(0))->GetName();
3547 Int_t firstindex = 0;
3548 Int_t lastindex = -1;
3551 for(
Int_t i = 0; i<genHeaders->GetEntries();i++){
3552 gh = (AliGenEventHeader*)genHeaders->At(i);
3553 TString GeneratorName = gh->GetName();
3554 lastindex = lastindex + gh->NProduced();
3555 if (
fDebugLevel > 0 ) cout << i <<
"\t" << GeneratorName.Data() << endl;
3556 for(
Int_t j = 0; j<HeaderList->GetEntries();j++){
3557 TString GeneratorInList = ((TObjString*)HeaderList->At(j))->GetString();
3558 if(GeneratorName.CompareTo(GeneratorInList) == 0){
3559 if (GeneratorInList.CompareTo(
"PARAM") == 0 || GeneratorInList.CompareTo(
"BOX") == 0 ){
3564 if (gh->NProduced() > 10 && fMCEvent->Particle(firstindex+10)->GetPdgCode() ==
fAddedSignalPDGCode){
3583 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex));
3586 if (gh->NProduced() > 10) {
3587 AliAODMCParticle *aodMCParticle2 =
static_cast<AliAODMCParticle*
>(fMCEventAOD->At(firstindex+10));
3617 firstindex = firstindex + gh->NProduced();
3620 for (
Int_t i = 0; i < number; i++){
3630 fNotRejectedEnd[0] =
static_cast<AliMCEvent*
>(event)->GetNumberOfPrimaries()-1;
3647 if(index < 0)
return 0;
3650 if(!InputEvent || InputEvent->IsA()==AliESDEvent::Class()){
3651 if(!mcEvent)
return 0;
3652 if(index >= mcEvent->GetNumberOfPrimaries()){
3653 if( ((TParticle*)mcEvent->Particle(index))->GetMother(0) < 0)
return 0;
3661 if(i == 0) accepted = 2;
3664 if (debug > 1 && !accepted) cout <<
"rejected:" << index << endl;
3666 else if(InputEvent->IsA()==AliAODEvent::Class()){
3667 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(InputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
3668 if (AODMCTrackArray){
3669 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
3670 if(!aodMCParticle)
return 0;
3671 if(!aodMCParticle->IsPrimary()){
3672 if( aodMCParticle->GetMother() < 0)
return 0;
3675 index = TMath::Abs(static_cast<AliAODMCParticle*>(AODMCTrackArray->At(index))->GetLabel());
3679 if(i == 0) accepted = 2;
3692 if (mcEvent){isMC = kTRUE;}
3720 Int_t runnumber =
event->GetRunNumber();
3721 if ((runnumber>=144871) && (runnumber<=146860)) {
3723 AliVCaloCells *cells =
event->GetEMCALCells();
3724 const Short_t nCells = cells->GetNumberOfCells();
3726 if (event->IsA()==AliESDEvent::Class()) AliAnalysisManager::GetAnalysisManager()->LoadBranch(
"EMCALCells.");
3728 AliInputEventHandler *fInputHandler=(AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3729 if (!fInputHandler)
return 3;
3732 Int_t nCellCount[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
3733 for(
Int_t iCell=0; iCell<nCells; ++iCell) {
3734 Short_t cellId = cells->GetCellNumber(iCell);
3735 Double_t cellE = cells->GetCellAmplitude(cellId);
3736 Int_t sm = cellId / (24*48);
3737 if (cellE>0.1) ++nCellCount[sm];
3740 Bool_t fIsLedEvent = kFALSE;
3741 if (nCellCount[4] > 100) {
3742 fIsLedEvent = kTRUE;
3744 if ((runnumber>=146858) && (runnumber<=146860)) {
3745 if ((fInputHandler->IsEventSelected() & AliVEvent::kMB) && (nCellCount[3]>=21))
3746 fIsLedEvent = kTRUE;
3747 else if ((fInputHandler->IsEventSelected() & AliVEvent::kEMC1) && (nCellCount[3]>=35))
3748 fIsLedEvent = kTRUE;
3758 Int_t nClustersLayer0 =
event->GetNumberOfITSClusters(0);
3759 Int_t nClustersLayer1 =
event->GetNumberOfITSClusters(1);
3760 Int_t nTracklets =
event->GetMultiplicity()->GetNumberOfTracklets();
3765 if(event->IsA()==AliESDEvent::Class()){
3769 for(
Int_t i=0; i<nPileVert;i++){
3770 const AliESDVertex* pv= ((
AliESDEvent*)event)->GetPileupVertexSPD(i);
3771 Int_t nc2 = pv->GetNContributors();
3776 if (TMath::Abs(distZMax) < TMath::Abs(distZ) ){
3790 if(event->IsPileupFromSPD(3,0.8,3.,2.,5.) ){
3794 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
3800 if(
fUtils->IsPileUpEvent(event) ){
3804 if (
fUtils->IsSPDClusterVsTrackletBG(event)){
3825 AliEventplane *EventPlane =
event->GetEventplane();
3838 AliInfo(
"Inside the GetWeightForCentralityFlattening function");
3841 if(!event || event->IsA()==AliESDEvent::Class()){
3844 AliCentrality *fESDCentrality=(AliCentrality*)esdEvent->GetCentrality();
3846 centrality = fESDCentrality->GetCentralityPercentile(
"V0M");
3849 }
else if(event->IsA()==AliAODEvent::Class()){
3852 if(aodEvent->GetHeader()){
3853 centrality = ((AliVAODHeader*)aodEvent->GetHeader())->
GetCentrality();
3859 Float_t GetValueForWeight = 1.;
3862 Bool_t CorrCentrLoop = kFALSE;
3868 CorrCentrLoop = kTRUE;
3872 CorrCentrLoop = kTRUE;
3874 CorrCentrLoop = kFALSE;
3877 if (CorrCentrLoop && GetValueForWeight != 0. && maximum !=0. && isfinite(GetValueForWeight) && isfinite(maximum) ){
3878 weightCentrality = maximum/GetValueForWeight;
3879 if (!isfinite(GetValueForWeight)) weightCentrality = 1.;
3880 if (!isfinite(weightCentrality)) weightCentrality = 1.;
3883 return weightCentrality;
3902 if (relativeErrorData < 0.2 && relativeErrorMC < 0.2 ){
3903 if (isfinite(valueMultData) && isfinite(valueMultMC) ){
3904 weightMult = valueMultData/valueMultMC;
3923 if(index < 0)
return 0;
3931 if (kCaseGen == 0)
return 1;
3936 if(!event || event->IsA()==AliESDEvent::Class()){
3937 mesonPt = ((TParticle*)mcEvent->Particle(index))->Pt();
3939 PDGCode = ((TParticle*)mcEvent->Particle(index))->GetPdgCode();
3940 }
else if(event->IsA()==AliAODEvent::Class()){
3941 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
3942 if (AODMCTrackArray){
3943 AliAODMCParticle *aodMCParticle =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(index));
3944 mesonPt = aodMCParticle->Pt();
3946 PDGCode = aodMCParticle->GetPdgCode();
3952 Float_t functionResultMC = 1.;
3963 Float_t functionResultData = 1;
3975 if (PDGCode == 111 || PDGCode == 221){
3976 if (functionResultData != 0. && functionResultMC != 0. && isfinite(functionResultData) && isfinite(functionResultMC)){
3977 weight = functionResultData/functionResultMC;
3978 if ( kCaseGen == 3){
3979 if (PDGCode == 111){
3984 if (PDGCode == 221){
3990 if (!isfinite(functionResultData)) weight = 1.;
3991 if (!isfinite(weight)) weight = 1.;
3993 }
else if (PDGCode == 310 && functionResultMC != 0 && isfinite(functionResultMC)){
3994 weight = functionResultMC;
4010 printf(
" Gamma Conversion Cuts %s :: pPb Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),-0.465);
4013 printf(
" Gamma Conversion Cuts %s :: Pbp Run doing Eta Shift of %f \n\n",(
GetCutNumber()).
Data(),0.465);
4016 else printf(
" Gamma Conversion Cuts %s :: Automatic Eta Shift requested but Period is not known -> No Shift \n\n",(
GetCutNumber()).
Data());
4028 AliError(Form(
"%s: fTriggerPatchInfo not available",GetName()));
4036 AliEMCALTriggerPatchInfo *patch;
4037 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4039 if (patch->IsMainTrigger()) {
4056 if (event->IsA()==AliESDEvent::Class()){
4066 AliError(Form(
"%s: Could not retrieve calo triggers %s!", GetName(),
fCaloTriggersName.Data()));
4072 if (event->IsA()==AliESDEvent::Class()){
4104 AliEMCALTriggerPatchInfo *patch;
4106 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
4111 if (patch->IsGammaHigh()){
4115 if (patch->IsGammaLow()){
4119 if (patch->IsJetHigh()){
4123 if (patch->IsJetLow()){
4127 if (patch->IsLevel0()){
4138 AliDebug(2,
"Patch summary: ");
4139 AliDebug(2, Form(
"Number of patches: %d", nPatch));
4140 AliDebug(2, Form(
"Level0: [%d]" ,nL0));
4141 AliDebug(2, Form(
"Jet: low[%d], high[%d]" ,nJ2, nJ1));
4142 AliDebug(2, Form(
"Gamma: low[%d], high[%d]" ,nG2, nG1));
4154 SETBIT(triggers,
kG1);
4156 SETBIT(triggers,
kG2);
4158 SETBIT(triggers,
kJ1);
4160 SETBIT(triggers,
kJ2);
4162 SETBIT(triggers,
kL0);
4181 TClonesArray *arr = 0;
4183 if (!sname.IsNull()) {
4184 arr =
dynamic_cast<TClonesArray*
>(
event->FindListObject(sname));
4186 AliWarning(Form(
"%s: Could not retrieve array with name %s!", GetName(), name));
4196 TString objname(arr->GetClass()->GetName());
4197 TClass cls(objname);
4198 if (!cls.InheritsFrom(clname)) {
4199 AliWarning(Form(
"%s: Objects of type %s in %s are not inherited from %s!",
4200 GetName(), cls.GetName(), name, clname));
4209 if (eventpos < 0)
return kFALSE;
4210 TParticle* particle = (TParticle *)mcEvent->Particle(eventpos);
4211 if (!particle)
return kFALSE;
4212 if (TMath::Abs(particle->GetPdgCode()) == 11 ){
4213 if (particle->GetMother(0) != -1){
4214 TParticle* particleMother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4215 if (particleMother){
4216 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4217 particle = particleMother;
4221 if (particle->GetMother(0) != -1){
4222 Double_t deltaX = particle->Vx() - prodVtxX;
4223 Double_t deltaY = particle->Vy() - prodVtxY;
4224 Double_t deltaZ = particle->Vz() - prodVtxZ;
4227 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4230 Bool_t dalitzCand = kFALSE;
4232 TParticle* firstmother = (TParticle *)mcEvent->Particle(particle->GetMother(0));
4233 if (!firstmother)
return kFALSE;
4234 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4235 Bool_t intDecay = kFALSE;
4236 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4237 if ( intDecay && TMath::Abs(particle->GetPdgCode()) == 11 ){
4242 Long_t source = particle->GetMother(0);
4243 Bool_t foundExcludedPart = kFALSE;
4244 Bool_t foundShower = kFALSE;
4245 Int_t pdgCodeMotherPrev = 0;
4246 Int_t pdgCodeMotherPPrevMother = 0;
4254 TParticle* mother = (TParticle *)mcEvent->Particle(source);
4255 source = mother->GetMother(0);
4257 Int_t pdgCodeMother = mother->GetPdgCode();
4259 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4260 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4261 foundShower = kTRUE;
4264 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4265 foundShower = kTRUE;
4277 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4278 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4279 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312
4281 foundExcludedPart = kTRUE;
4284 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4285 pdgCodeMotherPrev = pdgCodeMother;
4286 if (source == -1) depth = 20;
4292 if (foundExcludedPart){
4298 }
else if (foundShower){
4313 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
4314 if (AODMCTrackArray == NULL)
return kFALSE;
4315 AliAODMCParticle* currentParticle = AODMCParticle;
4316 if (TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4317 if (currentParticle->GetMother() != -1){
4318 AliAODMCParticle* particleMother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4319 if (particleMother){
4320 if (TMath::Abs(particleMother->GetPdgCode()) == 22)
4321 currentParticle = particleMother;
4325 if (currentParticle->GetMother() > -1){
4326 Double_t deltaX = currentParticle->Xv() - prodVtxX;
4327 Double_t deltaY = currentParticle->Yv() - prodVtxY;
4328 Double_t deltaZ = currentParticle->Zv() - prodVtxZ;
4331 Double_t realRadius3D = TMath::Sqrt(deltaX*deltaX+deltaY*deltaY+deltaZ*deltaZ);
4333 Bool_t dalitzCand = kFALSE;
4335 AliAODMCParticle* firstmother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(currentParticle->GetMother()));
4336 if (!firstmother)
return kFALSE;
4337 Int_t pdgCodeFirstMother = firstmother->GetPdgCode();
4338 Bool_t intDecay = kFALSE;
4339 if ( pdgCodeFirstMother == 111 || pdgCodeFirstMother == 221 ) intDecay = kTRUE;
4340 if ( intDecay && TMath::Abs(currentParticle->GetPdgCode()) == 11 ){
4345 Long_t source = currentParticle->GetMother();
4346 Bool_t foundExcludedPart = kFALSE;
4347 Bool_t foundShower = kFALSE;
4348 Int_t pdgCodeMotherPrev = 0;
4349 Int_t pdgCodeMotherPPrevMother = 0;
4357 AliAODMCParticle* mother =
static_cast<AliAODMCParticle*
>(AODMCTrackArray->At(source));
4358 source = mother->GetMother();
4360 Int_t pdgCodeMother = mother->GetPdgCode();
4362 if (pdgCodeMother == pdgCodeMotherPrev && pdgCodeMother == pdgCodeMotherPPrevMother) depth = 20;
4363 if (TMath::Abs(pdgCodeMother) == 11 && TMath::Abs(pdgCodeMotherPrev) == 22 && TMath::Abs(pdgCodeMotherPPrevMother) == 11 ){
4364 foundShower = kTRUE;
4367 if (TMath::Abs(pdgCodeMother) == 22 && TMath::Abs(pdgCodeMotherPrev) == 11 && TMath::Abs(pdgCodeMotherPPrevMother) == 22 ){
4368 foundShower = kTRUE;
4380 if (TMath::Abs(pdgCodeMother) == 310 || TMath::Abs(pdgCodeMother) == 130 || TMath::Abs(pdgCodeMother) == 321 ||
4381 TMath::Abs(pdgCodeMother) == 3122 || TMath::Abs(pdgCodeMother) == 3212 || TMath::Abs(pdgCodeMother) == 3222 ||
4382 TMath::Abs(pdgCodeMother) == 3112 || TMath::Abs(pdgCodeMother) == 3322 || TMath::Abs(pdgCodeMother) == 3312)
4384 foundExcludedPart = kTRUE;
4387 pdgCodeMotherPPrevMother = pdgCodeMotherPrev;
4388 pdgCodeMotherPrev = pdgCodeMother;
4389 if (source == -1) depth = 20;
4395 if (foundExcludedPart){
4401 }
else if (foundShower){
4416 if (particle != NULL && mcEvent != NULL){
4417 Int_t pdgSecondary = 0;
4421 Long_t motherID = particle->GetMother(0);
4422 Long_t grandMotherID = -1;
4426 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4428 if (grandMotherID > -1){
4430 pdgSecondary = mcEvent->Particle(grandMotherID)->GetPdgCode();
4437 Long_t motherID = particle->GetMother(0);
4438 Long_t grandMotherID = -1;
4439 Long_t greatGrandMotherID = -1;
4443 grandMotherID = mcEvent->Particle(motherID)->GetMother(0);
4445 if (grandMotherID > -1){
4447 greatGrandMotherID = mcEvent->Particle(grandMotherID)->GetMother(0);
4449 if (greatGrandMotherID > -1){
4451 pdgSecondary = mcEvent->Particle(greatGrandMotherID)->GetPdgCode();
4457 if (TMath::Abs(pdgSecondary) == 3122 )
4460 else if ( TMath::Abs(pdgSecondary) == 310 )
4463 else if ( TMath::Abs(pdgSecondary) == 130 )
4466 else if ( TMath::Abs(pdgSecondary) == 221 )
4469 else if ( TMath::Abs(pdgSecondary) != 0 )
4479 if (particle != NULL && aodmcArray != NULL){
4480 Int_t pdgSecondary = 0;
4484 Long_t motherID = particle->GetMother();
4485 Long_t grandMotherID = -1;
4489 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4491 if (grandMotherID > -1){
4493 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetPdgCode();
4500 Long_t motherID = particle->GetMother();
4501 Long_t grandMotherID = -1;
4502 Long_t greatGrandMotherID = -1;
4506 grandMotherID = ((AliAODMCParticle*)aodmcArray->At(motherID))->GetMother();
4508 if (grandMotherID > -1){
4510 greatGrandMotherID = ((AliAODMCParticle*)aodmcArray->At(grandMotherID))->GetMother();
4512 if (greatGrandMotherID > -1){
4514 pdgSecondary = ((AliAODMCParticle*)aodmcArray->At(greatGrandMotherID))->GetPdgCode();
4520 if (TMath::Abs(pdgSecondary) == 3122 )
4523 else if ( TMath::Abs(pdgSecondary) == 310 )
4526 else if ( TMath::Abs(pdgSecondary) == 130 )
4529 else if ( TMath::Abs(pdgSecondary) == 221 )
4532 else if ( TMath::Abs(pdgSecondary) != 0 )
4542 if (periodName.CompareTo(
"") == 0){
4545 if (periodName.CompareTo(
"") == 0) {
4548 AliError(
"No correct period could be set, periodName string empty");
4553 if (periodName.CompareTo(
"LHC10b") == 0 || periodName.CompareTo(
"LHC10c") == 0 || periodName.CompareTo(
"LHC10d") == 0 || periodName.CompareTo(
"LHC10e") == 0 ||
4554 periodName.CompareTo(
"LHC10f") == 0 || periodName.CompareTo(
"LHC10g") == 0 || periodName.CompareTo(
"LHC10bg") == 0
4558 }
else if (periodName.CompareTo(
"LHC10h") == 0) {
4561 }
else if (periodName.CompareTo(
"LHC11a") == 0) {
4564 }
else if (periodName.CompareTo(
"LHC11b") == 0) {
4567 }
else if (periodName.CompareTo(
"LHC11c") == 0 || periodName.CompareTo(
"LHC11d") == 0 || periodName.CompareTo(
"LHC11e") == 0 || periodName.CompareTo(
"LHC11f") == 0 ||
4568 periodName.CompareTo(
"LHC11g") == 0
4572 }
else if (periodName.CompareTo(
"LHC11h") == 0) {
4575 }
else if (periodName.CompareTo(
"LHC12a") == 0 || periodName.CompareTo(
"LHC12b") == 0 || periodName.CompareTo(
"LHC12c") == 0 || periodName.CompareTo(
"LHC12d") == 0 ||
4576 periodName.CompareTo(
"LHC12e") == 0 || periodName.CompareTo(
"LHC12f") == 0 || periodName.CompareTo(
"LHC12g") == 0 || periodName.CompareTo(
"LHC12h") == 0 ||
4577 periodName.CompareTo(
"LHC12i") == 0 || periodName.CompareTo(
"LHC12ai") == 0
4581 }
else if (periodName.CompareTo(
"LHC13b") == 0 || periodName.CompareTo(
"LHC13c") == 0 || periodName.CompareTo(
"LHC13bc") == 0){
4584 }
else if (periodName.CompareTo(
"LHC13d") == 0 || periodName.CompareTo(
"LHC13e") == 0 || periodName.CompareTo(
"LHC13de") == 0){
4587 }
else if (periodName.CompareTo(
"LHC13f") == 0 ){
4590 }
else if (periodName.CompareTo(
"LHC13g") == 0 ){
4593 }
else if ( periodName.CompareTo(
"LHC15f") == 0 || periodName.CompareTo(
"LHC15g") == 0 || periodName.CompareTo(
"LHC15h") == 0 || periodName.CompareTo(
"LHC15i") == 0 ||
4594 periodName.CompareTo(
"LHC15j") == 0 || periodName.CompareTo(
"LHC15k") == 0 || periodName.CompareTo(
"LHC15l") == 0 || periodName.CompareTo(
"LHC15m") == 0 ||
4595 periodName.CompareTo(
"LHC15fm") == 0
4599 }
else if (periodName.CompareTo(
"LHC15n") == 0 ){
4602 }
else if (periodName.CompareTo(
"LHC15o") == 0 ){
4605 }
else if ( periodName.CompareTo(
"LHC16d") == 0 || periodName.CompareTo(
"LHC16e") == 0 || periodName.CompareTo(
"LHC16g") == 0 || periodName.CompareTo(
"LHC16h") == 0 ||
4606 periodName.CompareTo(
"LHC16i") == 0 || periodName.CompareTo(
"LHC16j") == 0 || periodName.CompareTo(
"LHC16k") == 0 || periodName.CompareTo(
"LHC16l") == 0 ||
4607 periodName.CompareTo(
"LHC16m") == 0 || periodName.CompareTo(
"LHC16n") == 0 || periodName.CompareTo(
"LHC16o") == 0 || periodName.CompareTo(
"LHC16p") == 0){
4610 }
else if (periodName.CompareTo(
"LHC16f") == 0 ){
4613 }
else if (periodName.CompareTo(
"LHC16q") == 0 ){
4616 }
else if (periodName.CompareTo(
"LHC16r") == 0 ){
4619 }
else if (periodName.CompareTo(
"LHC16s") == 0 ){
4622 }
else if (periodName.CompareTo(
"LHC16t") == 0 ){
4625 }
else if ( periodName.CompareTo(
"LHC17c") == 0 || periodName.CompareTo(
"LHC17d") == 0 || periodName.CompareTo(
"LHC17e") == 0 || periodName.CompareTo(
"LHC17f") == 0 ||
4626 periodName.CompareTo(
"LHC17h") == 0 || periodName.CompareTo(
"LHC17i") == 0 || periodName.CompareTo(
"LHC17j") == 0 || periodName.CompareTo(
"LHC17k") == 0 ||
4627 periodName.CompareTo(
"LHC17l") == 0 || periodName.CompareTo(
"LHC17m") == 0 || periodName.CompareTo(
"LHC17o") == 0 ){
4630 }
else if ( periodName.CompareTo(
"LHC17g") == 0 ){
4633 }
else if ( periodName.CompareTo(
"LHC17n") == 0 ){
4636 }
else if ( periodName.CompareTo(
"LHC17p") == 0 ){
4639 }
else if ( periodName.CompareTo(
"LHC17q") == 0 ){
4644 }
else if (periodName.CompareTo(
"LHC10d1") == 0){
4647 }
else if (periodName.CompareTo(
"LHC10d2") == 0){
4650 }
else if (periodName.CompareTo(
"LHC10d4a") == 0){
4653 }
else if (periodName.CompareTo(
"LHC10d4") == 0){
4656 }
else if (periodName.CompareTo(
"LHC10e12") == 0){
4659 }
else if (periodName.CompareTo(
"LHC10e13") == 0){
4662 }
else if (periodName.CompareTo(
"LHC10e20") == 0){
4665 }
else if (periodName.CompareTo(
"LHC10e21") == 0){
4668 }
else if (periodName.CompareTo(
"LHC10f6a") == 0){
4671 }
else if (periodName.CompareTo(
"LHC10f6") == 0){
4674 }
else if (periodName.Contains(
"LHC14j4")){
4677 }
else if (periodName.CompareTo(
"LHC13d2") == 0){
4680 }
else if (periodName.CompareTo(
"LHC13d2b") == 0){
4683 }
else if (periodName.CompareTo(
"LHC12a11a") == 0){
4686 }
else if (periodName.CompareTo(
"LHC12a11b") == 0){
4689 }
else if (periodName.CompareTo(
"LHC12a11c") == 0){
4692 }
else if (periodName.CompareTo(
"LHC12a11d") == 0){
4695 }
else if (periodName.CompareTo(
"LHC12a11e") == 0){
4698 }
else if (periodName.CompareTo(
"LHC12a11f") == 0){
4702 }
else if (periodName.CompareTo(
"LHC12a15c") == 0){
4705 }
else if (periodName.Contains(
"LHC12f1a") ){
4708 }
else if (periodName.Contains(
"LHC12f1b") ){
4711 }
else if (periodName.Contains(
"LHC12i3") ){
4714 }
else if (periodName.CompareTo(
"LHC15g1a") == 0){
4717 }
else if (periodName.CompareTo(
"LHC15g1b") == 0){
4720 }
else if (periodName.CompareTo(
"LHC13e4") == 0){
4723 }
else if (periodName.CompareTo(
"LHC13e5") == 0){
4726 }
else if (periodName.CompareTo(
"LHC14k1a") == 0){
4729 }
else if (periodName.CompareTo(
"LHC14k1b") == 0){
4732 }
else if (periodName.CompareTo(
"LHC12a15f") == 0){
4735 }
else if (periodName.CompareTo(
"LHC12a15g") == 0){
4738 }
else if (periodName.CompareTo(
"LHC12f2a") == 0){
4741 }
else if (periodName.CompareTo(
"LHC14a1a") == 0){
4744 }
else if (periodName.CompareTo(
"LHC14a1b") == 0){
4747 }
else if (periodName.CompareTo(
"LHC14a1c") == 0){
4751 }
else if (periodName.CompareTo(
"LHC14e2a") == 0){
4754 }
else if (periodName.CompareTo(
"LHC14e2b") == 0){
4757 }
else if (periodName.CompareTo(
"LHC14e2c") == 0){
4760 }
else if (periodName.Contains(
"LHC15h1")){
4763 }
else if (periodName.Contains(
"LHC15h2")){
4766 }
else if (periodName.CompareTo(
"LHC16c2") == 0){
4769 }
else if (periodName.CompareTo(
"LHC16c2_plus") == 0){
4773 }
else if (periodName.Contains(
"LHC13b2_efix")){
4776 }
else if (periodName.CompareTo(
"LHC13e7") == 0){
4779 }
else if (periodName.CompareTo(
"LHC14b2") == 0){
4782 }
else if (periodName.CompareTo(
"LHC13b4_fix") == 0){
4785 }
else if (periodName.CompareTo(
"LHC13b4_plus") == 0){
4788 }
else if (periodName.CompareTo(
"LHC16c3a") == 0){
4791 }
else if (periodName.CompareTo(
"LHC16c3b") == 0){
4794 }
else if (periodName.CompareTo(
"LHC16c3c") == 0){
4797 }
else if (periodName.CompareTo(
"LHC15g2") == 0){
4800 }
else if (periodName.CompareTo(
"LHC15a3a") == 0){
4803 }
else if (periodName.CompareTo(
"LHC15a3a_plus") == 0){
4806 }
else if (periodName.CompareTo(
"LHC15a3b") == 0){
4809 }
else if (periodName.CompareTo(
"LHC15d3a") == 0){
4812 }
else if (periodName.CompareTo(
"LHC15d3b") == 0){
4816 }
else if (periodName.CompareTo(
"LHC15g3a3") == 0){
4819 }
else if (periodName.CompareTo(
"LHC15g3a") == 0){
4822 }
else if (periodName.CompareTo(
"LHC15g3c2") == 0){
4825 }
else if (periodName.CompareTo(
"LHC15g3c3") == 0){
4828 }
else if (periodName.CompareTo(
"LHC15g3") == 0){
4831 }
else if (periodName.CompareTo(
"LHC16a2a") == 0){
4834 }
else if (periodName.CompareTo(
"LHC16a2b") == 0){
4837 }
else if (periodName.CompareTo(
"LHC16a2c") == 0){
4840 }
else if (periodName.CompareTo(
"LHC16d3") == 0){
4843 }
else if (periodName.CompareTo(
"LHC17i4") == 0){
4846 }
else if (periodName.CompareTo(
"LHC17g7") == 0){
4849 }
else if (periodName.CompareTo(
"LHC15l1a2") == 0){
4852 }
else if (periodName.CompareTo(
"LHC15l1b2") == 0){
4855 }
else if (periodName.CompareTo(
"LHC16h3") == 0){
4858 }
else if (periodName.CompareTo(
"LHC16h8a") == 0){
4861 }
else if (periodName.CompareTo(
"LHC16h8b") == 0){
4864 }
else if (periodName.CompareTo(
"LHC16k5a") == 0){
4867 }
else if (periodName.CompareTo(
"LHC16k5b") == 0){
4870 }
else if (periodName.CompareTo(
"LHC16k3a") == 0){
4873 }
else if (periodName.CompareTo(
"LHC16k3a2") == 0){
4876 }
else if (periodName.CompareTo(
"LHC17e2") == 0){
4879 }
else if (periodName.Contains(
"LHC15k1a1")){
4882 }
else if (periodName.Contains(
"LHC15k1a2")){
4885 }
else if (periodName.Contains(
"LHC15k1a3")){
4888 }
else if (periodName.Contains(
"LHC16j7")){
4891 }
else if (periodName.Contains(
"LHC16g1")){
4894 }
else if (periodName.Contains(
"LHC16g1a")){