18 #include <TGeoManager.h>
19 #include <TStreamerInfo.h>
22 #include "AliMCEvent.h"
23 #include "AliAODMCHeader.h"
24 #include "AliGenPythiaEventHeader.h"
25 #include "AliGenCocktailEventHeader.h"
26 #include "AliGenHijingEventHeader.h"
27 #include "AliESDEvent.h"
28 #include "AliAODEvent.h"
29 #include "AliVTrack.h"
30 #include "AliVParticle.h"
31 #include "AliMixedEvent.h"
33 #include "AliESDVZERO.h"
34 #include "AliVCaloCells.h"
35 #include "AliAnalysisManager.h"
36 #include "AliInputEventHandler.h"
37 #include "AliAODMCParticle.h"
42 #include "AliPHOSGeoUtils.h"
43 #include "AliEMCALGeometry.h"
44 #include "AliEMCALRecoUtils.h"
51 #include "AliAODJet.h"
52 #include "AliAODJetEventBackground.h"
62 TObject(), fEventNumber(-1),
63 fDataType(0), fDebug(0),
64 fFiducialCut(0x0), fCheckFidCut(kFALSE),
65 fComparePtHardAndJetPt(0), fPtHardAndJetPtFactor(0),
66 fComparePtHardAndClusterPt(0),fPtHardAndClusterPtFactor(0),
67 fCTSPtMin(0), fEMCALPtMin(0), fPHOSPtMin(0),
68 fCTSPtMax(0), fEMCALPtMax(0), fPHOSPtMax(0),
69 fUseEMCALTimeCut(1), fUseParamTimeCut(0),
70 fUseTrackTimeCut(0), fAccessTrackTOF(0),
71 fEMCALTimeCutMin(-10000), fEMCALTimeCutMax(10000),
72 fEMCALParamTimeCutMin(), fEMCALParamTimeCutMax(),
73 fTrackTimeCutMin(-10000), fTrackTimeCutMax(10000),
76 fCTSTracks(0x0), fEMCALClusters(0x0),
77 fDCALClusters(0x0), fPHOSClusters(0x0),
78 fEMCALCells(0x0), fPHOSCells(0x0),
79 fInputEvent(0x0), fOutputEvent(0x0),fMC(0x0),
80 fFillCTS(0), fFillEMCAL(0),
81 fFillDCAL(0), fFillPHOS(0),
82 fFillEMCALCells(0), fFillPHOSCells(0),
83 fRecalculateClusters(kFALSE),fCorrectELinearity(kTRUE),
84 fSelectEmbeddedClusters(kFALSE),
85 fSmearShowerShape(0), fSmearShowerShapeWidth(0), fRandom(),
86 fTrackStatus(0), fSelectSPDHitTracks(0),
87 fTrackMult(0), fTrackMultEtaCut(0.9),
88 fReadStack(kFALSE), fReadAODMCParticles(kFALSE),
89 fDeltaAODFileName(
""), fFiredTriggerClassName(
""),
91 fEventTriggerMask(0), fMixEventTriggerMask(0), fEventTriggerAtSE(0),
92 fEventTrigMinBias(0), fEventTrigCentral(0),
93 fEventTrigSemiCentral(0), fEventTrigEMCALL0(0),
94 fEventTrigEMCALL1Gamma1(0), fEventTrigEMCALL1Gamma2(0),
95 fEventTrigEMCALL1Jet1(0), fEventTrigEMCALL1Jet2(0),
96 fBitEGA(0), fBitEJE(0),
99 fTaskName(
""), fCaloUtils(0x0),
100 fWeightUtils(0x0), fEventWeight(1),
101 fMixedEvent(NULL), fNMixedEvent(0), fVertex(NULL),
102 fListMixedTracksEvents(), fListMixedCaloEvents(),
103 fLastMixedTracksEvent(-1), fLastMixedCaloEvent(-1),
104 fWriteOutputDeltaAOD(kFALSE),
105 fEMCALClustersListName(
""), fZvtxCut(0.),
106 fAcceptFastCluster(kFALSE), fRemoveLEDEvents(kFALSE),
108 fRemoveBadTriggerEvents(0), fTriggerPatchClusterMatch(1),
109 fTriggerPatchTimeWindow(), fTriggerL0EventThreshold(0),
110 fTriggerL1EventThreshold(0), fTriggerL1EventThresholdFix(0),
111 fTriggerClusterBC(0), fTriggerClusterIndex(0), fTriggerClusterId(0),
112 fIsExoticEvent(0), fIsBadCellEvent(0), fIsBadMaxCellEvent(0),
113 fIsTriggerMatch(0), fIsTriggerMatchOpenCut(),
114 fTriggerClusterTimeRecal(kTRUE), fRemoveUnMatchedTriggers(kTRUE),
115 fDoPileUpEventRejection(kFALSE), fDoV0ANDEventSelection(kFALSE),
116 fDoVertexBCEventSelection(kFALSE),
117 fDoRejectNoTrackEvents(kFALSE),
118 fUseEventsWithPrimaryVertex(kFALSE),
120 fTimeStampEventSelect(0),
121 fTimeStampEventFracMin(0), fTimeStampEventFracMax(0),
122 fTimeStampRunMin(0), fTimeStampRunMax(0),
123 fNPileUpClusters(-1), fNNonPileUpClusters(-1), fNPileUpClustersCut(3),
124 fVertexBC(-200), fRecalculateVertexBC(0),
125 fCentralityClass(
""), fCentralityOpt(0),
126 fEventPlaneMethod(
""),
127 fAcceptOnlyHIJINGLabels(0), fNMCProducedMin(0), fNMCProducedMax(0),
128 fFillInputNonStandardJetBranch(kFALSE),
129 fNonStandardJets(new TClonesArray(
"AliAODJet",100)),fInputNonStandardJetBranchName(
"jets"),
130 fFillInputBackgroundJetBranch(kFALSE),
131 fBackgroundJets(0x0),fInputBackgroundJetBranchName(
"jets"),
132 fAcceptEventsWithBit(0), fRejectEventsWithBit(0), fRejectEMCalTriggerEventsWith2Tresholds(0),
230 if(TMath::Abs(dca) < cut)
249 UInt_t trigFired = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
251 for(Int_t ibit = 0; ibit < nAccept; ibit++)
256 if(accept)
return kTRUE ;
275 UInt_t trigFired = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
277 for(Int_t ibit = 0; ibit < nReject; ibit++)
282 if(reject)
return kFALSE ;
299 AliDebug(1,Form(
"FiredTriggerClass <%s>, selected class <%s>, compare name %d",
308 AliDebug(1,
"Accepted triggered event");
332 eventType = ((AliVHeader*)
fInputEvent->GetHeader())->GetEventType();
334 AliDebug(3,Form(
"Event type %d",eventType));
344 AliDebug(1,
"Pass event species selection");
350 UInt_t isTrigger = kFALSE;
351 UInt_t isMB = kFALSE;
359 AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager();
360 AliInputEventHandler *inputHandler =
dynamic_cast<AliInputEventHandler*
>(manager->GetInputEventHandler());
362 if(!inputHandler)
return kFALSE ;
367 if(!isTrigger && !isMB)
return kFALSE;
370 AliDebug(0,
"Pass uninteresting triggered events rejection in case of mixing analysis");
382 if(!okA || !okR)
return kFALSE;
384 AliDebug(1,
"Pass event bit rejection");
417 AliDebug(1,Form(
"ACCEPT triggered event? \n exotic? %d - bad cell %d - bad Max cell %d - BC %d - Matched %d\n",
426 AliDebug(1,
"Pass EMCal triggered event rejection \n");
435 AliDebug(1,Form(
"Do not count events from fast cluster, trigger name %s\n",
fFiredTriggerClassName.Data()));
451 if(reject)
return kFALSE;
453 AliDebug(1,
"Pass LED event rejection");
474 Int_t nTriggerJets = pygeh->NTriggerJets();
475 Float_t ptHard = pygeh->GetPtHard();
477 AliDebug(1,Form(
"Njets: %d, pT Hard %f",nTriggerJets, ptHard));
479 Float_t tmpjet[]={0,0,0,0};
480 for(Int_t ijet = 0; ijet< nTriggerJets; ijet++)
482 pygeh->TriggerJet(ijet, tmpjet);
483 jet =
new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
485 AliDebug(1,Form(
"jet %d; pycell jet pT %f",ijet, jet->Pt()));
490 AliInfo(Form(
"Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n",
513 Float_t ptHard = pygeh->GetPtHard();
515 Int_t nclusters =
fInputEvent->GetNumberOfCaloClusters();
516 for (Int_t iclus = 0; iclus < nclusters; iclus++)
518 AliVCluster * clus =
fInputEvent->GetCaloCluster(iclus) ;
519 Float_t ecluster = clus->E();
523 AliInfo(Form(
"Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f",ecluster,clus->GetType(),
fPtHardAndClusterPtFactor,ptHard));
543 AliDebug(1,
"Stack is not available");
555 return fMC->Header();
559 AliInfo(
"Header is not available");
576 AliGenEventHeader * eventHeader =
fMC->GenEventHeader();
582 AliGenCocktailEventHeader *cocktail =
dynamic_cast<AliGenCocktailEventHeader *
>(eventHeader);
584 if(!cocktail) return ;
586 TList *genHeaders = cocktail->GetHeaders();
588 Int_t nGenerators = genHeaders->GetEntries();
591 for(Int_t igen = 0; igen < nGenerators; igen++)
593 AliGenEventHeader * eventHeader2 = (AliGenEventHeader*)genHeaders->At(igen) ;
594 TString name = eventHeader2->GetName();
601 if(name.Contains(
"Hijing",TString::kIgnoreCase))
return ;
610 if( nGenerators <= 0) return ;
614 for(Int_t igen = 0; igen < nGenerators; igen++)
616 AliGenEventHeader * eventHeader =
GetAODMCHeader()->GetCocktailHeader(igen) ;
617 TString name = eventHeader->GetName();
624 if(name.Contains(
"Hijing",TString::kIgnoreCase))
return ;
638 AliGenEventHeader * eventHeader =
fMC->GenEventHeader();
644 AliGenCocktailEventHeader *cocktail =
dynamic_cast<AliGenCocktailEventHeader *
>(eventHeader);
646 if(!cocktail)
return 0x0 ;
648 TList *genHeaders = cocktail->GetHeaders();
650 Int_t nGenerators = genHeaders->GetEntries();
653 for(Int_t igen = 0; igen < nGenerators; igen++)
655 AliGenEventHeader * eventHeader2 = (AliGenEventHeader*)genHeaders->At(igen) ;
656 TString name = eventHeader2->GetName();
660 if(name.Contains(
"Hijing",TString::kIgnoreCase))
return eventHeader2 ;
671 if( nGenerators <= 0)
return 0x0;
675 for(Int_t igen = 0; igen < nGenerators; igen++)
677 AliGenEventHeader * eventHeader =
GetAODMCHeader()->GetCocktailHeader(igen) ;
678 TString name = eventHeader->GetName();
682 if(name.Contains(
"Hijing",TString::kIgnoreCase))
return eventHeader ;
701 AliInfo(
"Input are not AODs");
712 AliInfo(
"Input are not AODs");
728 Int_t vertexBC=vtx->GetBC();
739 for(Int_t i = 0 ; i < ntr ; i++)
741 AliVTrack * track = (AliVTrack*) (
GetCTSTracks()->At(i));
744 ULong_t status = track->GetStatus();
745 Bool_t okTOF = (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ;
746 vertexBC = track->GetTOFBunchCrossing(bz);
747 Float_t pt = track->Pt();
752 Double_t dca[2] = {1e6,1e6};
753 Double_t covar[3] = {1e6,1e6,1e6};
754 track->PropagateToDCA(vtx,bz,100.,dca,covar);
758 if (vertexBC !=0 &&
fVertexBC != AliVTrack::kTOFBCNA)
return vertexBC;
759 else if(vertexBC == 0) bc0 = kTRUE;
763 if( bc0 ) vertexBC = 0 ;
764 else vertexBC = AliVTrack::kTOFBCNA ;
777 AliInfo(
"Cannot access stack and mcparticles at the same time, change them");
871 for(Int_t i = 0; i < 19; i++)
912 AliGenHijingEventHeader* hijingHeader =
dynamic_cast<AliGenHijingEventHeader *
> (
GetGenEventHeader());
916 if(!hijingHeader || label < 0 )
return kFALSE;
932 Int_t nprimaries =
GetStack()->GetNtrack();
934 if(label > nprimaries)
return kFALSE;
936 TParticle * mom =
GetStack()->Particle(label);
939 Int_t iParent = mom->GetFirstMother();
950 iParent = mom->GetFirstMother();
960 if(!mcparticles)
return kFALSE;
962 Int_t nprimaries = mcparticles->GetEntriesFast();
964 if(label > nprimaries)
return kFALSE;
974 AliAODMCParticle * mom = (AliAODMCParticle *) mcparticles->At(label);
977 Int_t iParent = mom->GetMother();
987 mom = (AliAODMCParticle *) mcparticles->At(iMom);
988 iParent = mom->GetMother();
1011 if( tof < minCut || tof > maxCut )
return kFALSE ;
1027 fPileUpParamSPD[2] , fPileUpParamSPD[3] , fPileUpParamSPD[4] );
1112 AliInfo(
"Input event not available, skip event analysis");
1123 if(!accept)
return kFALSE;
1125 AliDebug(1,
"Pass Event trigger selection");
1135 AliDebug(1,
"Pass Pt Hard - Jet rejection");
1141 AliDebug(1,
"Pass Pt Hard - Cluster rejection");
1150 AliESDEvent* esd =
dynamic_cast<AliESDEvent*
> (
fInputEvent);
1153 Int_t timeStamp = esd->GetTimeStamp();
1161 AliDebug(1,
"Pass Time Stamp rejection");
1176 if( TMath::Abs(
fVertex[0][0] ) < 1.e-6 &&
1177 TMath::Abs(
fVertex[0][1] ) < 1.e-6 &&
1178 TMath::Abs(
fVertex[0][2] ) < 1.e-6 )
return kFALSE;
1181 AliDebug(1,
"Pass primary vertex rejection");
1191 if(bPileup)
return kFALSE;
1193 AliDebug(1,
"Pass Pile-Up event rejection");
1200 Bool_t bV0AND = ((v0->GetV0ADecision()==1) && (v0->GetV0CDecision()==1));
1206 AliDebug(1,
"Reject event by V0AND");
1210 AliDebug(1,
"Pass V0AND event rejection");
1226 AliDebug(1,
"Pass centrality rejection");
1261 AliDebug(1,
"Pass rejection of null track events");
1268 AliDebug(1,
"Pass rejection of events with vertex at BC!=0");
1291 AliDebug(1,
"Event accepted for analysis");
1309 AliInfo(Form(
"Unknown centrality option %d, use 10, 20 or 100\n",
fCentralityOpt));
1326 AliDebug(1,Form(
"Bad EP for <Q> method : %f\n",ep));
1331 if((ep > TMath::Pi()/2 || ep < -TMath::Pi()/2))
1340 AliDebug(3,Form(
"Event plane angle %f",ep));
1366 vertex[0] =
fVertex[evtIndex][0];
1367 vertex[1] =
fVertex[evtIndex][1];
1368 vertex[2] =
fVertex[evtIndex][2];
1390 fVertex[i] =
new Double_t[3] ;
1407 AliWarning(
"NULL primary vertex");
1425 AliWarning(
"No vertex found");
1427 AliDebug(1,Form(
"Multi Event %d Vertex : %f,%f,%f",iev,
fVertex[iev][0],
fVertex[iev][1],
fVertex[iev][2]));
1441 AliDebug(1,
"Begin");
1443 Double_t pTrack[3] = {0,0,0};
1445 Int_t nTracks =
fInputEvent->GetNumberOfTracks() ;
1450 for(Int_t i = 0; i < 19; i++)
1456 Bool_t bc0 = kFALSE;
1459 for (Int_t itrack = 0; itrack < nTracks; itrack++)
1461 AliVTrack * track = (AliVTrack*)
fInputEvent->GetTrack(itrack) ;
1466 ULong_t status = track->GetStatus();
1477 Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ;
1478 Double_t tof = -1000;
1479 Int_t trackBC = -1000 ;
1485 trackBC = track->GetTOFBunchCrossing(bz);
1488 tof = track->GetTOFsignal()*1e-3;
1493 if (trackBC != 0 && trackBC != AliVTrack::kTOFBCNA)
fVertexBC = trackBC;
1494 else if(trackBC == 0) bc0 = kTRUE;
1507 fMomentum.SetPxPyPzE(pTrack[0],pTrack[1],pTrack[2],0);
1513 Float_t dcaTPC =-999;
1515 if(
fDataType ==
kAOD ) dcaTPC = ((AliAODTrack*) track)->DCA();
1520 Double_t dca[2] = {1e6,1e6};
1521 Double_t covar[3] = {1e6,1e6,1e6};
1522 Bool_t okDCA = track->PropagateToDCA(
fInputEvent->GetPrimaryVertex(),bz,100.,dca,covar);
1542 AliDebug(2,Form(
"Selected tracks pt %3.2f, phi %3.2f, eta %3.2f",
1558 AliDebug(1,Form(
"AOD entries %d, input tracks %d, pass status %d, multipliticy %d",
fCTSTracks->GetEntriesFast(), nTracks, nstatus,
fTrackMult));
1576 vindex =
fMixedEvent->EventIndexForCaloCluster(iclus);
1582 AliDebug(2,Form(
"Input cluster E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f",
1604 if(
GetCaloUtils()->IsRecalculationOfClusterPositionOn())
1612 if(
GetCaloUtils()->GetEMCALRecoUtils()->IsTimeRecalibrationOn())
1614 Double_t tof = clus->GetTOF();
1638 AliDebug(2,Form(
"Bad cluster E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f",
1651 Bool_t shared = kFALSE;
1653 if(
GetCaloUtils()->MaskFrameCluster(iSupMod, ieta))
return;
1658 if(clus->GetNLabels()==0 || clus->GetLabel() < 0)
return;
1672 AliDebug(5,Form(
"Correct Non Lin: Old E %3.2f, New E %3.2f",
1677 if(
GetCaloUtils()->GetEMCALRecoUtils()->IsClusterEnergySmeared() )
1682 AliDebug(5,Form(
"Smear energy: Old E %3.2f, New E %3.2f",clus->E(),rdmEnergy));
1684 clus->SetE(rdmEnergy);
1688 Double_t tof = clus->GetTOF()*1e9;
1690 Int_t bc = TMath::Nint(tof/50) + 9;
1710 AliDebug(2,Form(
"Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f",
1714 clus->SetID(iclus) ;
1717 Bool_t bEMCAL = kFALSE;
1718 Bool_t bDCAL = kFALSE;
1733 AliDebug(2,Form(
"Smear shower shape - Original: %2.4f\n", clus->GetM02()));
1754 AliDebug(1,
"Begin");
1764 for(Int_t i = 0; i < 19; i++)
1773 Int_t nclusters =
fInputEvent->GetNumberOfCaloClusters();
1774 for (Int_t iclus = 0; iclus < nclusters; iclus++)
1776 AliVCluster * clus = 0;
1777 if ( (clus =
fInputEvent->GetCaloCluster(iclus)) )
1779 if (clus->IsEMCAL())
1792 TClonesArray * clusterList = 0x0;
1809 Int_t nclusters = clusterList->GetEntriesFast();
1810 for (Int_t iclus = 0; iclus < nclusters; iclus++)
1812 AliVCluster * clus =
dynamic_cast<AliVCluster*
> (clusterList->At(iclus));
1815 else AliWarning(
"Null cluster in list!");
1823 for(Int_t i = 0; i < 19; i++)
1829 for (Int_t iclus = 0; iclus <
fInputEvent->GetNumberOfCaloClusters(); iclus++)
1831 AliVCluster * clus = 0;
1833 if ( (clus =
fInputEvent->GetCaloCluster(iclus)) )
1835 if (clus->IsEMCAL())
1840 Double_t tof = clus->GetTOF();
1849 Int_t bc = TMath::Nint(tof/50) + 9;
1885 AliDebug(1,
"Begin");
1888 Int_t nclusters =
fInputEvent->GetNumberOfCaloClusters();
1889 for (Int_t iclus = 0; iclus < nclusters; iclus++)
1891 AliVCluster * clus = 0;
1892 if ( (clus =
fInputEvent->GetCaloCluster(iclus)) )
1901 vindex =
fMixedEvent->EventIndexForCaloCluster(iclus);
1902 if(
GetCaloUtils()->ClusterContainsBadChannel(
kPHOS,clus->GetCellsAbsId(), clus->GetNCells()))
1924 AliDebug(2,Form(
"Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f",
1929 clus->SetID(iclus) ;
1938 AliDebug(1,Form(
"AOD entries %d",
fPHOSClusters->GetEntriesFast()));
1969 AliESDVZERO* esdV0 =
dynamic_cast<AliESDVZERO*
> (v0);
1970 for (Int_t i = 0; i < 32; i++)
1974 fV0ADC[0] += (Int_t)esdV0->GetAdcV0C(i);
1975 fV0ADC[1] += (Int_t)esdV0->GetAdcV0A(i);
1978 fV0Mul[0] += (Int_t)v0->GetMultiplicityV0C(i);
1979 fV0Mul[1] += (Int_t)v0->GetMultiplicityV0A(i);
1986 AliDebug(1,
"Cannot retrieve V0 ESD! Run w/ null V0 charges");
1997 AliDebug(2,
"Begin");
2004 AliFatal(
"No non-standard jet branch name specified. Specify among existing ones.");
2029 AliDebug(1,
"Begin");
2036 AliFatal(
"No background jet branch name specified. Specify among existing ones.");
2050 AliDebug(1,
"FillInputBackgroundJets");
2061 Int_t trigtimes[30], globCol, globRow,ntimes, i;
2068 AliVCaloTrigger *caloTrigger =
GetInputEvent()->GetCaloTrigger(
"EMCAL" );
2073 if( caloTrigger->GetEntries() > 0 )
2076 caloTrigger->Reset();
2079 while( caloTrigger->Next() )
2082 caloTrigger->GetPosition( globCol, globRow );
2088 caloTrigger->GetNL0Times( ntimes );
2096 caloTrigger->GetL0Times( trigtimes );
2100 for( i = 0; i < ntimes; i++ )
2103 if( trigtimes[i] >= tmin && trigtimes[i] <= tmax )
2109 patches.Set(nPatch+1);
2110 patches.AddAt(absId,nPatch++);
2117 caloTrigger->GetTriggerBits(bit);
2120 caloTrigger->GetL1TimeSum(sum);
2130 if(!isEGA1 && !isEJE1 && !isEGA2 && !isEJE2)
continue;
2132 Int_t patchsize = -1;
2133 if (isEGA1 || isEGA2) patchsize = 2;
2134 else if (isEJE1 || isEJE2) patchsize = 16;
2141 for(Int_t irow=0; irow < patchsize; irow++)
2143 for(Int_t icol=0; icol < patchsize; icol++)
2147 patches.Set(nPatch+1);
2148 patches.AddAt(absId,nPatch++);
2157 if(patches.GetSize()<=0) AliInfo(Form(
"No patch found! for triggers: %s and selected <%s>",
2194 TClonesArray * clusterList = 0;
2205 Int_t nclusters =
fInputEvent->GetNumberOfCaloClusters();
2207 nclusters = clusterList->GetEntriesFast();
2209 Int_t nPatch = patches.GetSize();
2213 Float_t tofPatchMax = 100000;
2214 Float_t ePatchMax =-1;
2216 Float_t tofMax = 100000;
2220 Int_t idclusMax =-1;
2221 Bool_t badClMax = kFALSE;
2222 Bool_t badCeMax = kFALSE;
2223 Bool_t exoMax = kFALSE;
2225 Int_t absIdMaxMax = -1;
2227 Int_t nOfHighECl = 0 ;
2237 Float_t minE = triggerThreshold / 2.;
2243 AliDebug(1,Form(
"IsL1Trigger %d, IsL1JetTrigger? %d, IsL0Trigger %d, L1 threshold %2.1f, L0 threshold %2.1f, Min cluster E %2.2f",
IsEventEMCALL1Jet(),
IsEventEMCALL1(),
IsEventEMCALL0(),
fTriggerL1EventThreshold,
fTriggerL0EventThreshold,minE));
2248 for (Int_t iclus = 0; iclus < nclusters; iclus++)
2250 AliVCluster * clus = 0;
2251 if(clusterList) clus = (AliVCluster*) clusterList->At(iclus);
2254 if ( !clus ) continue ;
2256 if ( !clus->IsEMCAL() )
continue ;
2259 if ( clus->E() < minE )
continue ;
2265 clus->GetCellsAbsId(),clus->GetNCells());
2266 UShort_t cellMax[] = {(UShort_t) absIdMax};
2283 if(!exotic && clus->GetNCells() < 2) exotic = kTRUE;
2285 Float_t energy = clus->E();
2286 Int_t idclus = clus->GetID();
2288 Double_t tof = clus->GetTOF();
2302 badClMax = badCluster;
2307 absIdMaxMax = absIdMax;
2312 if(!badCluster && !exotic)
2318 for(Int_t iabsId =0; iabsId < nPatch; iabsId++)
2325 for(Int_t ipatch = 0; ipatch < 4; ipatch++)
2327 if(absIdMax == absIDCell[ipatch])
2330 if(energy > ePatchMax)
2353 tofPatchMax = tofMax;
2362 Double_t tofPatchMaxUS = TMath::Abs(tofPatchMax);
2397 Int_t patchAbsIdOpenTime = -1;
2398 for(Int_t iabsId =0; iabsId < patchOpen.GetSize(); iabsId++)
2401 patchAbsIdOpenTime = patchOpen.At(iabsId);
2406 for(Int_t ipatch = 0; ipatch < 4; ipatch++)
2408 if(absIdMaxMax == absIDCell[ipatch])
2417 Int_t patchAbsId = -1;
2418 Int_t globalCol = -1;
2419 Int_t globalRow = -1;
2424 Int_t patchAbsIdNeigh = -1;
2425 for(Int_t icol = globalCol-1; icol <= globalCol+1; icol++)
2427 if(icol < 0 || icol > 47)
continue;
2429 for(Int_t irow = globalRow; irow <= globalRow+1; irow++)
2431 if(irow < 0 || irow > 63)
continue;
2435 if ( patchAbsIdNeigh < 0 )
continue;
2437 for(Int_t iabsId =0; iabsId < patches.GetSize(); iabsId++)
2439 if(patchAbsIdNeigh == patches.At(iabsId))
2450 Int_t patchAbsIdNeighOpenTime = -1;
2451 for(Int_t icol = globalCol-1; icol <= globalCol+1; icol++)
2453 if(icol < 0 || icol > 47)
continue;
2455 for(Int_t irow = globalRow; irow <= globalRow+1; irow++)
2457 if(irow < 0 || irow > 63)
continue;
2461 if ( patchAbsIdNeighOpenTime < 0 )
continue;
2463 for(Int_t iabsId =0; iabsId < patchOpen.GetSize(); iabsId++)
2465 if(patchAbsIdNeighOpenTime == patchOpen.At(iabsId))
2495 AliVCaloTrigger *caloTrigger =
GetInputEvent()->GetCaloTrigger(
"EMCAL" );
2546 printf(
"***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
2547 printf(
"Task name : %s\n",
fTaskName.Data()) ;
2549 printf(
"CTS Min pT : %2.1f GeV/c\n",
fCTSPtMin) ;
2550 printf(
"EMCAL Min pT : %2.1f GeV/c\n",
fEMCALPtMin) ;
2551 printf(
"PHOS Min pT : %2.1f GeV/c\n",
fPHOSPtMin) ;
2552 printf(
"CTS Max pT : %2.1f GeV/c\n",
fCTSPtMax) ;
2553 printf(
"EMCAL Max pT : %2.1f GeV/c\n",
fEMCALPtMax) ;
2554 printf(
"PHOS Max pT : %2.1f GeV/c\n",
fPHOSPtMax) ;
2556 printf(
"Use CTS = %d\n",
fFillCTS) ;
2569 printf(
"Use Triggers selected in SE base class %d; If not what Trigger Mask? %d; MB Trigger Mask for mixed %d \n",
2593 Int_t ncellsSM3 = 0;
2594 for(Int_t icell = 0; icell <
fInputEvent->GetEMCALCells()->GetNumberOfCells(); icell++)
2596 Int_t absID =
fInputEvent->GetEMCALCells()->GetCellNumber(icell);
2598 if(
fInputEvent->GetEMCALCells()->GetAmplitude(icell) > 0.1 && sm==3) ncellsSM3++;
2601 Int_t ncellcut = 21;
2604 if(ncellsSM3 >= ncellcut)
2606 AliDebug(1,Form(
"Reject event with ncells in SM3 %d, cut %d, trig %s",
2621 if(label < 0) return ;
2623 AliAODEvent * evt =
dynamic_cast<AliAODEvent*
> (
fInputEvent) ;
2626 TClonesArray * arr =
dynamic_cast<TClonesArray*
>(evt->FindListObject(
"mcparticles")) ;
2629 if(label < arr->GetEntriesFast())
2631 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(label));
2632 if(!particle) return ;
2634 if(label == particle->Label())
return ;
2640 for(Int_t ind = 0; ind < arr->GetEntriesFast(); ind++ )
2642 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(ind));
2643 if(!particle) continue ;
2645 if(label == particle->Label())
2690 AliDebug(1,Form(
"Select trigger mask bit %d - Trigger Event %s - Select <%s>",
2808 AliDebug(1,Form(
"Event bits: \n \t MB %d, Cen %d, Sem %d, L0 %d, L1G1 %d, L1G2 %d, L1J1 %d, L1J2 %d",
2828 TFile*
file = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
2830 const TList *clist = file->GetStreamerInfoCache();
2834 TStreamerInfo *cinfo = (TStreamerInfo*)clist->FindObject(
"AliESDCaloTrigger");
2838 cinfo = (TStreamerInfo*)clist->FindObject(
"AliAODCaloTrigger");
2844 Int_t classversionid = cinfo->GetClassVersion();
2847 if (classversionid >= verid)
2852 }
else AliInfo(
"AliCaloTrackReader()::SetEventTriggerBit() - Streamer info for trigger class not available, bit not changed");
2853 }
else AliInfo(
"AliCaloTrackReader::SetEventTriggerBit() - Streamer list not available!, bit not changed");
2882 fVertex[i] =
new Double_t[3] ;
Bool_t IsPileUpFromSPD() const
Double_t fEventWeight
Weight assigned to the event when filling histograms.
Bool_t fUseTrackDCACut
Do DCA selection.
TArrayI GetTriggerPatches(Int_t tmin, Int_t tmax)
Recover the patches that triggered, either L0 or L1.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
virtual void FillInputVZERO()
Int_t fV0ADC[2]
Integrated V0 signal.
Bool_t fComparePtHardAndClusterPt
In MonteCarlo, jet events, reject events with too large cluster energy.
AliAnaWeights * fWeightUtils
Pointer to AliAnaWeights.
AliCalorimeterUtils * GetCaloUtils() const
Float_t fTimeStampEventFracMin
Minimum value of time stamp fraction event.
Bool_t fReadAODMCParticles
Access kine information from filtered AOD MC particles.
virtual void FillInputNonStandardJets()
Double_t fEMCALTimeCutMax
Remove clusters/cells with time larger than this value, in ns.
Int_t fBitEJE
Trigger bit on VCaloTrigger for EJE.
TLorentzVector fMomentum
! Temporal TLorentzVector container, avoid declaration of TLorentzVectors per event.
Double_t fTimeStampRunMin
Minimum value of time stamp in run.
Bool_t fDoPileUpEventRejection
Select pile-up events by SPD.
void SetCentrality(Float_t cen)
Bool_t fAcceptOnlyHIJINGLabels
Select clusters or tracks that where generated by HIJING, reject other generators in case of cocktail...
TObjArray * fPHOSClusters
Temporal array with PHOS CaloClusters.
Double_t fTrackDCACut[3]
Remove tracks with DCA larger than cut, parameters of function stored here.
Bool_t fUseEventsWithPrimaryVertex
Select events with primary vertex.
virtual AliVCaloCells * GetPHOSCells() const
Bool_t fIsBadCellEvent
Bad cell triggered event flag, any cell in cluster is bad.
Bool_t IsCorrectionOfClusterEnergyOn() const
Bool_t fEventTrigEMCALL1Gamma1
Event is L1-Gamma, threshold 1 on its name, it should correspond kEMCEGA.
virtual AliHeader * GetHeader() const
Bool_t CheckEventTriggers()
Bool_t IsEventEMCALL1Jet1() const
Bool_t IsEventEMCALL1Gamma1() const
AliEMCALRecoUtils * GetEMCALRecoUtils() const
void SetEMCALTriggerThresholds()
Bool_t ReadAODMCParticles() const
TString fEventPlaneMethod
Name of event plane method, by default "Q".
Int_t fTrackBCEventCut[19]
Fill one entry per event if there is a track in a given BC, depend on track pT, acceptance cut...
Bool_t fDoVertexBCEventSelection
Select events with vertex on BC=0 or -100.
AliMixedEvent * fMixedEvent
! Mixed event object. This class is not the owner.
virtual AliVEvent * GetInputEvent() const
Bool_t IsPileUpFromSPDAndNotEMCal() const
Check if event is from pile-up determined by SPD and not by EMCal.
Bool_t IsEventEMCALL1() const
Float_t fPtHardAndClusterPtFactor
Factor between ptHard and cluster pT to reject/accept event.
Bool_t fAcceptFastCluster
Accept events from fast cluster, exclude these events for LHC11a.
Bool_t fSmearShowerShape
Smear shower shape (use in MC).
AliVEvent * fInputEvent
! pointer to esd or aod input.
Calculate the weight to the event to be applied when filling histograms.
virtual void SetInputEvent(AliVEvent *input)
Double_t fTrackTimeCutMax
Remove tracks with time larger than this value, in ns.
Int_t fTriggerClusterBC
Event triggered by a cluster in BC -5 0 to 5.
TString fEMCALClustersListName
Alternative list of clusters produced elsewhere and not from InputEvent.
void RecalculateClusterTrackMatching(AliVEvent *event, TObjArray *clusterArray=0x0)
Recalculate track matching.
Bool_t fWriteOutputDeltaAOD
Write the created delta AOD objects into file.
Int_t fV0Mul[2]
Integrated V0 Multiplicity.
void RecalculateClusterDistanceToBadChannel(AliVCaloCells *cells, AliVCluster *clu)
Float_t fEMCALPtMin
pT Threshold on emcal clusters.
Bool_t fTriggerClusterTimeRecal
In case cluster already calibrated, do not try to recalibrate even if recalib on in AliEMCALRecoUtils...
Double_t ** fVertex
! Vertex array 3 dim for each mixed event buffer.
void SetGeneratorMinMaxParticles()
UInt_t fEventTriggerMask
Select this triggerered event.
virtual Int_t GetEventCentrality() const
virtual Bool_t IsHIJINGLabel(Int_t label)
virtual AliGenEventHeader * GetGenEventHeader() const
virtual AliCentrality * GetCentrality() const
AliVCaloCells * fPHOSCells
! Temporal array with PHOS AliVCaloCells.
Bool_t IsEventEMCALL1Gamma2() const
virtual AliMixedEvent * GetMixedEvent() const
Bool_t fFillInputBackgroundJetBranch
Flag to use data from background jets.
void SetTrackEventBC(Int_t bc)
virtual Bool_t ComparePtHardAndClusterPt()
TList * fAODBranchList
List with AOD branches created and needed in analysis.
void RemapMCLabelForAODs(Int_t &label)
Bool_t fEventTrigSemiCentral
Event is AliVEvent::kSemiCentral on its name, it should correspond to PbPb.
TRandom3 fRandom
! Random generator.
Bool_t AcceptDCA(Float_t pt, Float_t dca)
Bool_t IsPileUpFromNotSPDAndNotEMCal() const
Check if event not from pile-up determined neither by SPD nor by EMCal.
Bool_t fFillCTS
Use data from CTS.
virtual void InitParameters()
Initialize the parameters with default.
virtual void GetVertex(Double_t v[3]) const
Bool_t IsRecalibrationOn() const
virtual Bool_t FillInputEvent(Int_t iEntry, const char *currentFileName)
Float_t fPHOSPtMin
pT Threshold on phos clusters.
Bool_t fSelectEmbeddedClusters
Use only simulated clusters that come from embedding.
Bool_t fEventTrigMinBias
Event is min bias on its name, it should correspond to AliVEvent::kMB, AliVEvent::kAnyInt.
Float_t fEMCALParamTimeCutMin[4]
Remove clusters/cells with time smaller than parametrized value, in ns.
Int_t fEventNumber
Event number.
void RecalculateClusterPID(AliVCluster *clu)
TString fTaskName
Name of task that executes the analysis.
Bool_t fRemoveBadTriggerEvents
Remove triggered events because trigger was exotic, bad, or out of BC.
Bool_t IsPileUpFromSPDOrEMCal() const
Check if event is from pile-up determined by SPD or EMCal.
Bool_t IsPileUpFromEMCalAndNotSPD() const
Check if event is from pile-up determined by EMCal, not by SPD.
Bool_t fEventTrigEMCALL1Gamma2
Event is L1-Gamma, threshold 2 on its name, it should correspond kEMCEGA.
Bool_t fEventTrigEMCALL1Jet1
Event is L1-Gamma, threshold 1 on its name, it should correspond kEMCEGA.
Bool_t fFillEMCALCells
Use data from EMCAL.
Int_t fTriggerClusterId
Id of trigger cluster (cluster->GetID()).
Float_t fCTSPtMax
pT Threshold on charged particles.
Double_t fEMCALParamTimeCutMax[4]
Remove clusters/cells with time larger than parametrized value, in ns.
virtual void FillInputEMCALCells()
Connects the array with EMCAL cells and the pointer.
Bool_t fFillPHOSCells
Use data from PHOS.
virtual AliVCaloCells * GetEMCALCells() const
Bool_t fRemoveLEDEvents
Remove events where LED was wrongly firing - EMCAL LHC11a.
AliEMCALGeometry * GetEMCALGeometry() const
Bool_t fIsBadMaxCellEvent
Bad cell triggered event flag, only max energy cell is bad.
void RecalculateClusterShowerShapeParameters(AliVCaloCells *cells, AliVCluster *clu)
TString fFiredTriggerClassName
Name of trigger event type used to do the analysis.
virtual TClonesArray * GetAODMCParticles() const
TString GetFiredTriggerClasses() const
TObjArray * fEMCALClusters
Temporal array with EMCAL CaloClusters.
Bool_t IsEventEMCALL1Jet() const
Float_t fPHOSPtMax
pT Threshold on phos clusters.
Int_t GetMaxEnergyCell(AliVCaloCells *cells, const AliVCluster *clu, Float_t &fraction) const
For a given CaloCluster, it gets the absId of the cell with maximum energy deposit.
Bool_t fAccessTrackTOF
Access the track TOF, in case of problems when accessing GetTOFBunchCrossing.
virtual Bool_t CheckForPrimaryVertex() const
Int_t fEMCalBCEvent[19]
Fill one entry per event if there is a cluster in a given BC.
TString fInputBackgroundJetBranchName
Name of background jet branch.
virtual AliEventplane * GetEventPlane() const
Bool_t fEventTriggerAtSE
Select triggered event at SE base task or here.
Float_t fEMCALPtMax
pT Threshold on emcal clusters.
Int_t fEventType
Set the event species: 7 physics, 0 MC, 8 LED (not useful now)
virtual Bool_t ComparePtHardAndJetPt()
Bool_t IsInFiducialCut(Float_t eta, Float_t phi, Int_t det) const
Bool_t fEventTrigCentral
Event is AliVEvent::kCentral on its name, it should correspond to PbPb.
Float_t fTrackMultEtaCut
Track multiplicity eta cut.
Int_t fCentralityBin[2]
Minimum and maximum value of the centrality for the analysis.
virtual void FillInputPHOSCells()
Connects the array with PHOS cells and the pointer.
Base class for event, clusters and tracks filtering and preparation for the analysis.
TObjArray * fDCALClusters
Temporal array with DCAL CaloClusters, not needed in the normal case, use just EMCal array with DCal ...
Bool_t fUseTrackTimeCut
Do time cut selection.
virtual TString GetEventPlaneMethod() const
Bool_t AcceptEventWithTriggerBit()
TArrayI fAcceptEventsWithBit
Accept events if trigger bit is on.
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
void MatchTriggerCluster(TArrayI patches)
Bool_t fTimeStampEventSelect
Select events within a fraction of data taking time.
Double_t fTimeStampRunMax
Maximum value of time stamp in run.
Double_t fEMCALTimeCutMin
Remove clusters/cells with time smaller than this value, in ns.
Bool_t fEventTrigEMCALL1Jet2
Event is L1-Gamma, threshold 2 on its name, it should correspond kEMCEGA.
void SetEMCalEventBCcut(Int_t bc)
Int_t fNPileUpClustersCut
Cut to select event as pile-up.
Bool_t fCheckFidCut
Do analysis for clusters in defined region.
virtual ~AliCaloTrackReader()
Destructor.
Bool_t fEventTrigEMCALL0
Event is EMCal L0 on its name, it should correspond to AliVEvent::kEMC7, AliVEvent::kEMC1.
Bool_t IsWeightSettingOn() const
Int_t fTrackBCEvent[19]
Fill one entry per event if there is a track in a given BC.
virtual void FillInputEMCALAlgorithm(AliVCluster *clus, Int_t iclus)
Bool_t fComparePtHardAndJetPt
In MonteCarlo, jet events, reject fake events with wrong jet energy.
Int_t fNNonPileUpClusters
Number of clusters with time below 20 ns.
Int_t fNMixedEvent
Number of events in mixed event buffer.
Int_t fCentralityOpt
Option for the returned value of the centrality, possible options 5, 10, 100.
Float_t fZvtxCut
Cut on vertex position.
void RecalculateClusterPosition(AliVCaloCells *cells, AliVCluster *clu)
Recalculate EMCAL cluster position.
AliCaloTrackReader()
Constructor. Initialize parameters.
Bool_t fTriggerPatchClusterMatch
Search for the trigger patch and check if associated cluster was the trigger.
Bool_t fUseParamTimeCut
Use simple or parametrized time cut.
AliFiducialCut * fFiducialCut
Acceptance cuts.
Bool_t fRejectEMCalTriggerEventsWith2Tresholds
Reject events EG2 also triggered by EG1 or EJ2 also triggered by EJ1.
virtual void FillInputEMCAL()
Bool_t fFillEMCAL
Use data from EMCAL.
Bool_t fFillPHOS
Use data from PHOS.
AliVCaloCells * fEMCALCells
! Temporal array with EMCAL AliVCaloCells.
virtual AliAODMCHeader * GetAODMCHeader() const
void SetEventTriggerBit()
void CorrectClusterEnergy(AliVCluster *cl)
Correct cluster energy non linearity.
Float_t fCTSPtMin
pT Threshold on charged particles.
virtual AliStack * GetStack() const
Float_t fTriggerL0EventThreshold
L0 Threshold to look for triggered events, set outside.
Float_t fTimeStampEventFracMax
Maximum value of time stamp fraction event.
virtual void ResetLists()
Reset lists, called in AliAnaCaloTrackCorrMaker.
Int_t fNPileUpClusters
Number of clusters with time avobe 20 ns.
Int_t fTrackMult
Track multiplicity.
AliAODEvent * fOutputEvent
! pointer to aod output.
Bool_t fRecalculateClusters
Correct clusters, recalculate them if recalibration parameters is given.
Bool_t fDoRejectNoTrackEvents
Reject events with no selected tracks in event.
Bool_t IsEventEMCALL1Jet2() const
Bool_t fReadStack
Access kine information from stack.
Bool_t fIsTriggerMatchOpenCut[3]
Could not match the event to a trigger patch?, retry opening cuts.
UInt_t fMixEventTriggerMask
Select this triggerered event for mixing, tipically kMB or kAnyINT.
virtual void FillVertexArray()
Bool_t IsInTimeWindow(Double_t tof, Float_t energy) const
Bool_t fRemoveUnMatchedTriggers
Analyze events where trigger patch and cluster where found or not.
virtual Double_t GetEventPlaneAngle() const
TObjArray * fCTSTracks
Temporal array with tracks.
Int_t fTriggerPatchTimeWindow[2]
Trigger patch selection window.
AliMCEvent * fMC
! Monte Carlo Event Handler.
Float_t fPtHardAndJetPtFactor
Factor between ptHard and jet pT to reject/accept event.
Double_t fPileUpParamSPD[5]
TString fDeltaAODFileName
Delta AOD file name.
Int_t GetVertexBC() const
Bool_t IsPileUpFromEMCal() const
Check if event is from pile-up determined by EMCal.
virtual Double_t GetWeight()
Bool_t fFillInputNonStandardJetBranch
Flag to use data from non standard jets.
TClonesArray * fNonStandardJets
! Temporal array with jets.
Int_t fEMCalBCEventCut[19]
Fill one entry per event if there is a cluster in a given BC, depend on cluster E, acceptance cut.
Int_t fTriggerClusterIndex
Index in clusters array of trigger cluster.
Bool_t fTriggerL1EventThresholdFix
L1 Threshold is fix and set outside.
Float_t fSmearShowerShapeWidth
Smear shower shape landau function "width" (use in MC).
virtual void FillInputCTS()
Int_t fBitEGA
Trigger bit on VCaloTrigger for EGA.
Bool_t RejectEventWithTriggerBit()
virtual void FillInputBackgroundJets()
Bool_t fDoV0ANDEventSelection
Select events depending on V0AND.
AliAODJetEventBackground * fBackgroundJets
! Background jets.
Bool_t fCorrectELinearity
Correct cluster linearity, always on.
Int_t fVertexBC
Vertex BC.
Bool_t fIsExoticEvent
Exotic trigger event flag.
TString fInputNonStandardJetBranchName
Name of non standard jet branch.
TArrayI fRejectEventsWithBit
Reject events if trigger bit is on.
Bool_t fUseEMCALTimeCut
Do time cut selection.
Int_t fNMCProducedMax
In case of cocktail, select particles in the list with label up to this value.
Int_t fDataType
Select MC: Kinematics, Data: ESD/AOD, MCData: Both.
virtual Bool_t SelectTrack(AliVTrack *, Double_t *)
Bool_t fFillDCAL
Use data from DCAL, not needed in the normal case, use just EMCal array with DCal limits...
void SetTrackEventBCcut(Int_t bc)
Bool_t fIsTriggerMatch
Could match the event to a trigger patch?
Float_t fTriggerL1EventThreshold
L1 Threshold to look for triggered events, set in data.
TString fCentralityClass
Name of selected centrality class.
ULong_t fTrackStatus
Track selection bit, select tracks refitted in TPC, ITS ...
Bool_t IsPileUpFromSPDAndEMCal() const
Check if event is from pile-up determined by SPD and EMCal.
virtual void FillInputPHOS()
Fill the array with PHOS filtered clusters.
Int_t fNMCProducedMin
In case of cocktail, select particles in the list with label from this value.
virtual TObjArray * GetCTSTracks() const
Bool_t fRecalculateVertexBC
Recalculate vertex BC from tracks pointing to vertex.
Float_t RecalibrateClusterEnergy(AliVCluster *cluster, AliVCaloCells *cells)
Recalibrate the cluster energy, considering the recalibration map and the energy of the cells that co...
void SetEMCalEventBC(Int_t bc)
Bool_t CheckCellFiducialRegion(AliVCluster *cluster, AliVCaloCells *cells) const
Bool_t IsEventEMCALL0() const