32 #include <TClonesArray.h>
36 #include <THnSparse.h>
38 #include <TLorentzVector.h>
39 #include <TParameter.h>
40 #include <TParticle.h>
43 #include <TObjArray.h>
46 #include "AliAODEvent.h"
47 #include "AliESDEvent.h"
48 #include "AliAnalysisManager.h"
49 #include "AliAnalysisTask.h"
50 #include "AliCentrality.h"
52 #include "AliAODJet.h"
53 #include "AliVCluster.h"
54 #include "AliVTrack.h"
55 #include <AliVEvent.h>
56 #include <AliVParticle.h>
62 #include "AliESDCaloCluster.h"
63 #include "AliEMCALTriggerPatchInfo.h"
66 #include <AliInputEventHandler.h>
67 #include <AliVEventHandler.h>
68 #include "AliESDInputHandler.h"
80 fEventTrigEMCALL1Gamma1(0),
81 fEventTrigEMCALL1Gamma2(0),
83 fPhimin(-10), fPhimax(10),
84 fEtamin(-0.9), fEtamax(0.9),
90 fTracksCont(0), fCaloClustersCont(0),
94 fMainPatchType(kManual),
97 fMainTrigCat(kTriggerLevel1Gamma),
100 fMainTrigSimple(kFALSE),
101 fHistTriggerBitInfo(0),
102 fHistMaxTriggerBitInfo(0),
103 fHistEventSelection(0),
104 fHistRecalcGASize(0),
105 fHistRecalcGAEnergy(0),
106 fHistClusEvPatchE(0),
107 fHistdEtaPatchvdPhiPatch(0),
108 fHistRawJetPtvPatchE(0),
109 fHistMatchedClusJet(0),
110 fHistMatchdetadphi(0),
111 fHistdEtaPatchvdPhiPatchCMtoGeo(0),
112 fHistEventClusSpect(0),
116 SetMakeGeneralHistograms(kTRUE);
124 fEventTrigEMCALL1Gamma1(0),
125 fEventTrigEMCALL1Gamma2(0),
127 fPhimin(-10), fPhimax(10),
128 fEtamin(-0.9), fEtamax(0.9),
134 fTracksCont(0), fCaloClustersCont(0),
138 fMainPatchType(kManual),
141 fMainTrigCat(kTriggerLevel1Gamma),
144 fMainTrigSimple(kFALSE),
145 fHistTriggerBitInfo(0),
146 fHistMaxTriggerBitInfo(0),
147 fHistEventSelection(0),
148 fHistRecalcGASize(0),
149 fHistRecalcGAEnergy(0),
150 fHistClusEvPatchE(0),
151 fHistdEtaPatchvdPhiPatch(0),
152 fHistRawJetPtvPatchE(0),
153 fHistMatchedClusJet(0),
154 fHistMatchdetadphi(0),
155 fHistdEtaPatchvdPhiPatchCMtoGeo(0),
156 fHistEventClusSpect(0),
162 DefineInput(0,TChain::Class());
163 DefineOutput(1, TList::Class());
194 fHistClusEvPatchE =
new TH2F(
"ClusterEvPatchE",
"Cluster Energy v Patch E; Cluster Energy (GeV); Trigger Patch Energy (GeV)",100,0,100,100,0,100);
195 fHistdEtaPatchvdPhiPatch =
new TH2F(
"dEtaPatchdPhiPatch; #eta; #phi",
"dEtaPatchdPhiPatch; #Delta#eta; #Delta#phi",100,-0.1,0.1,100,-0.1,0.1);
196 fHistRawJetPtvPatchE =
new TH2F(
"RawJetPtvTriggerE",
"RawJetPtvTriggerE; Jet Pt (GeV); Trigger Patch Energy (GeV)",100,0,100,100,0,100);
200 fHistRecalcGASize =
new TH2F(
"RecalcGAPatchSize",
"Patch_Size; #eta(Towers); #phi(Towers)",40,0,40,40,0,40);
203 fHistEventClusSpect =
new TH1F (
"EventClusterSpectrum",
"ClusterEnergySpectrum",105,-5,100);
256 Int_t fgkNCentBins = 21;
260 Int_t fgkNVZEROBins = 100;
264 const Int_t fgkNEPatch = 100;
268 const Int_t fgkNADC = 100;
272 const Int_t fgkNEta = 10;
273 const Int_t fgkNPhi = 10;
275 const Int_t nDim = 8;
276 const Int_t nBins[nDim] = {fgkNCentBins,fgkNVZEROBins,fgkNEta,fgkNPhi,fgkNEPatch,fgkNADC,fgkNEta,fgkNPhi};
277 const Double_t xmin0[nDim] = {kMinCent,kMinVZERO,-0.7,1.4,kMinEPatch,kMinADC,-0.7,1.4};
278 const Double_t xmax0[nDim] = {kMaxCent,kMaxVZERO,0.7,3.14,kMaxEPatch,kMaxADC, 0.7,3.14};
279 fhnTriggerInfo =
new THnSparseF(
"fhnTriggerInfo",
"hnTriggerInfo;cent;V0mult;EtaCMPatch;PhiCMPatch;Epatch;ADCpatch;EtaGeoPatch;PhiGeoPatch",nDim,nBins,xmin0,xmax0);
296 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
298 AliFatal(
"Input handler needed");
304 bitcoded1 = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9 | 1<<10 | 1<<11 ;
307 cout <<
"_______________Created Sparse__________________" << endl;
329 if (!
fJets)
return kTRUE;
331 UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
353 if (dynamic_cast<AliAODEvent*>(InputEvent())) useAOD = kTRUE;
354 else useAOD = kFALSE;
363 AliError(Form(
"ERROR: fESD not available\n"));
372 AliError(Form(
"ERROR: fAOD not available\n"));
379 InputEvent()->GetPrimaryVertex()->GetXYZ(fvertex);
384 AliError(Form(
"ERROR: list not attached\n"));
392 TClonesArray *jets = 0;
394 jets =
dynamic_cast<TClonesArray*
>(list->FindObject(
fJets));
396 AliError(Form(
"Pointer to jets %s == 0",
fJets->GetName()));
401 const Int_t Njets = jets->GetEntries();
402 if(Njets<1)
return kTRUE;
411 TLorentzVector nPart;
412 cluster->GetMomentum(nPart,
fVertex);
428 Double_t VZEROAmp = (
Double_t)(InputEvent()->GetVZEROData()->GetTriggerChargeA() + InputEvent()->GetVZEROData()->GetTriggerChargeC());
429 Double_t PatchEtaMax, PatchEtaMin, PatchPhiMax, PatchPhiMin, PatchAreaE, PatchAreaP;
445 PatchAreaE = PatchEtaMax - PatchEtaMin;
446 PatchAreaP = PatchPhiMax - PatchPhiMin;
480 for (
Int_t iJets = 0; iJets < Njets; ++iJets) {
485 float jetphi = jet->
Phi();
489 Int_t JetTracks = jet -> GetNumberOfTracks();
494 jetarea = jet->
Area();
514 if(!clusMatch)
continue;
517 Double_t mClusterE = clusMatch->E();
519 clusMatch->GetPosition(pos_mc);
520 TVector3 mcp(pos_mc);
523 Double_t mtchPosition = maxMatchedPatchPhi * maxMatchedPatchPhi + maxMatchedPatchEta * maxMatchedPatchEta;
524 Double_t rGApatch = TMath::Sqrt(mtchPosition);
528 rJetCluster = TMath::Sqrt(PatchClusterdiff);
531 if ( rJetCluster <= rGApatch ){
535 dEtaPatch =
fMaxPatch->GetEtaGeo() - mcp.PseudoRapidity();
536 dPhiPatch =
fMaxPatch->GetPhiGeo() - mcp.Phi();
540 Double_t JetTrig[18] = {jetptraw, jetPt, jeteta, jetphi, jet->
E(),
fMaxPatch->GetPatchE(),
fMaxPatch->GetEtaGeo(),
fMaxPatch->GetPhiGeo(), (
Double_t)
fMaxPatch->GetADCAmp(), mClusterE, mcp.PseudoRapidity(), mcp.Phi() };
553 cout<<
"###########################"<<endl;
554 cout<<
"#### Task Finished ####"<<endl;
555 cout<<
"###########################"<<endl;
556 cout<<
"###########################"<<endl;
571 for (
Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
572 AliEMCALTriggerPatchInfo *patch = (AliEMCALTriggerPatchInfo*)
fTriggerPatchInfo->At( iPatch );
573 if (!patch)
continue;
592 if (patch->IsRecalcGamma() == 1 ){
593 if(patch->GetPatchE()>emax) {
595 emax = patch->GetPatchE();
608 if (jet->
Area()==0)
return 0;
628 const Int_t dim = count;
635 while(c<dim && i<32){
640 hnTitle += Form(
";%s",label.Data());
648 return new THnSparseD(name, hnTitle.Data(), dim,
nbins, xmin, xmax);
668 label =
"Jet Corr Pt";
696 label =
"Trigger Patch E";
703 label =
"Trigger Patch Eta";
710 label =
"Trigger Patch Phi";
717 label =
"Trigger Patch ADC";
731 label =
"Cluster Eta";
738 label =
"Cluster Phi";
AliEMCALTriggerPatchInfo * fMaxPatch
// AOD Object
TH1F * fHistEventSelection
TH1F * fHistRecalcGAEnergy
TH2F * fHistRawJetPtvPatchE
AliAnalysisTaskEmcalJetTriggerMatcher()
Bool_t fEventTrigEMCALL1Gamma1
THnSparse * fhnTriggerInfo
AliESDEvent * fESD
Clusters.
AliAODEvent * fAOD
// ESD object
TList * list
TDirectory file where lists per trigger are stored in train ouput.
THnSparse * fhnJetTrigger
virtual THnSparse * NewTHnSparseDJetTrigger(const char *name, UInt_t entries)
TH1F * fHistTriggerBitInfo
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
virtual void Terminate(Option_t *)
virtual Int_t AcceptMyJet(AliEmcalJet *jet)
Bool_t IsJetCluster(AliEmcalJet *jet, Int_t iclus, Bool_t sorted=kFALSE) const
UShort_t GetNumberOfClusters() const
AliRhoParameter * fRho
! event rho
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Double_t MaxTrackPt() const
Int_t GetNClusters() const
void ExecOnce()
Perform steps needed to initialize the analysis.
Double_t fCent
!event centrality
TriggerCategory fMainTrigCat
virtual void UserCreateOutputObjects()
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doSimpleOffline=kFALSE)
Get main trigger match.
AliVCluster * GetCluster(Int_t i) const
TClonesArray * fJets
! jets
TH2F * fHistdEtaPatchvdPhiPatchCMtoGeo
virtual ~AliAnalysisTaskEmcalJetTriggerMatcher()
AliEmcalList * fOutput
!output list
TClonesArray * fTracks
!tracks
AliClusterContainer * fCaloClustersCont
Tracks.
TH1F * fHistMaxTriggerBitInfo
Double_t fVertex[3]
!event vertex
TH1F * fHistEventClusSpect
Plot of Trigger Geo pos - Trigger COM pos.
Bool_t fCreateHisto
whether or not create histograms
MainPatchType fMainPatchType
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
void UserCreateOutputObjects()
Main initialization function on the worker.
virtual void GetDimParamsJetTrigger(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
Bool_t fEventTrigEMCALL1Gamma2
Double_t fPhimin
pointer to esd or aod input
Double_t fRhoVal
! event rho value, same for local rho
AliVCluster * GetNextAcceptCluster()
AliParticleContainer * fTracksCont
TH2F * fHistdEtaPatchvdPhiPatch
Matched Cluster E vs Patch E.
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.