1 #ifndef AliAnalysisTaskFullpAJets_H
2 #define AliAnalysisTaskFullpAJets_H
16 class AliESDtrackCuts;
19 class AliEMCALGeometry;
20 class AliEMCALRecoUtils;
24 #include "AliAnalysisTaskEmcalJet.h"
25 #include "AliAnalysisTaskEmcal.h"
27 class AliAnalysisTaskFullpAJets : public AliAnalysisTaskEmcalJet
29 // AlipAJetData Helper Class
34 AlipAJetData(const char *name, Bool_t isFull, Int_t nEntries);
35 virtual ~AlipAJetData();
37 // User Defined Sub-Routines
38 void InitializeJetData(TClonesArray *jetList, Int_t nEntries);
41 void SetName(const char *name);
42 void SetIsJetsFull(Bool_t isFull);
43 void SetTotalEntries(Int_t nEntries);
44 void SetTotalJets(Int_t nJets);
45 void SetTotalSignalJets(Int_t nSignalJets);
46 void SetSignalCut(Double_t Pt);
47 void SetLeading(Int_t index, Double_t Pt);
48 void SetSubLeading(Int_t index, Double_t Pt);
49 void SetJetIndex(Int_t index, Int_t At);
50 void SetSignalJetIndex(Int_t index, Int_t At);
51 void SetIsJetInArray(Bool_t isInArray, Int_t At);
52 void SetAreaCutFraction(Double_t areaFraction);
53 void SetJetR(Double_t jetR);
54 void SetNEF(Double_t nef);
55 void SetSignalTrackPtBias(Bool_t chargedBias);
58 Int_t GetTotalEntries();
60 Int_t GetTotalSignalJets();
61 Double_t GetSignalCut();
62 Int_t GetLeadingIndex();
63 Double_t GetLeadingPt();
64 Int_t GetSubLeadingIndex();
65 Double_t GetSubLeadingPt();
66 Int_t GetJetIndex(Int_t At);
67 Int_t GetSignalJetIndex(Int_t At);
68 Bool_t GetIsJetInArray(Int_t At);
69 Double_t GetJetMaxChargedPt(Int_t At);
72 Int_t* GetJets() const {return fJetsIndex;} //!
73 Int_t* GetSignalJets() const {return fJetsSCIndex;} //!
78 const char *fName; //!
86 Double_t fAreaCutFrac;
88 Bool_t fSignalTrackBias;
92 Int_t fPtSubLeadingIndex;
93 Double_t fPtSubLeading;
95 Int_t *fJetsIndex; //!
96 Int_t *fJetsSCIndex; //!
97 Bool_t *fIsJetInArray; //!
98 Double_t *fJetMaxChargedPt; //!
101 // AlipAJetHistos Helper Class
106 AlipAJetHistos(const char *name);
107 AlipAJetHistos(const char *name, TString centag, Bool_t doNEF=kFALSE);
108 AlipAJetHistos(const char *name, TString centag, Bool_t doNEF, Bool_t doNEFSignalOnly, Bool_t doTHnSparse);
110 virtual ~AlipAJetHistos();
112 // User Defined Sub-Routines
114 void FillRho(Double_t eventCentrality, Double_t rho);
115 void FillBSJS(Double_t eventCentrality, Double_t rho, Double_t signalCut, TClonesArray *jetList, Int_t *indexJetList, Int_t nIndexJetList);
116 void FillDeltaPt(Double_t eventCentrality, Double_t rho, Double_t jetRadius, Double_t *RCArray, Int_t nRC);
117 void FillDeltaPtSignal(Double_t eventCentrality, Double_t rho, Double_t jetRadius, Double_t *RCArray, Int_t nRC);
118 void FillDeltaPtNColl(Double_t eventCentrality, Double_t rho, Double_t jetRadius, Double_t *RCArray, Int_t nRC);
119 void FillBackgroundFluctuations(Double_t eventCentrality, Double_t rho, Double_t jetRadius);
120 void FillLeadingJetPtRho(Double_t jetPt, Double_t rho);
121 void DoNEFQAPlots(Bool_t doNEFAna);
122 void DoNEFSignalOnly(Bool_t doNEFSignalOnly);
123 void DoNEFAnalysis(Double_t nefCut, Double_t signalCut, TClonesArray *jetList, Int_t *indexJetList, Int_t nIndexJetList, TObjArray *clusterList, TClonesArray *orgClusterList, AliVEvent *event, AliEMCALGeometry *geometry, AliEMCALRecoUtils *recoUtils, AliVCaloCells *cells);
124 void FillMiscJetStats(TClonesArray *jetList, Int_t *indexJetList, Int_t nIndexJetList, TClonesArray *trackList, TClonesArray *clusterList, Double_t *vertex);
125 void FillJetEventCentrality(Double_t leadingJetPt, AliVEvent *event);
128 void SetName(const char *name);
129 void SetCentralityTag(TString name);
130 void SetCentralityRange(Int_t bins, Double_t low, Double_t up);
131 void SetPtRange(Int_t bins, Double_t low, Double_t up);
132 void SetRhoPtRange(Int_t bins, Double_t low, Double_t up);
133 void SetDeltaPtRange(Int_t bins, Double_t low, Double_t up);
134 void SetBackgroundFluctuationsPtRange(Int_t bins, Double_t low, Double_t up);
135 void SetLeadingJetPtRange(Int_t bins, Double_t low, Double_t up);
136 void SetLeadingChargedTrackPtRange(Int_t bins, Double_t low, Double_t up);
137 void SetNEFRange(Int_t bins, Double_t low, Double_t up);
138 void SetSignalTrackPtBias(Bool_t chargedBias);
139 void SetNEFJetDimensions(Int_t n);
140 void SetNEFClusterDimensions(Int_t n);
141 void SetRhoValue(Double_t value);
142 void DoTHnSparse(Bool_t doTHnSparse);
144 // User Defined Functions
145 TList* GetOutputHistos(); //!
149 TList *fOutput; //! Output list
152 // This set of Histograms is for filling the Rho Spectral distributions
154 TH1F *fh80100Rho; //!
158 // This set of Histograms is for filling the Background Subtracted Jet Spectra
160 TH1F *fh80100BSPt; //!
164 // This set of Histograms is for filling the Background Subtracted Signal Jet Spectra
165 TH1F *fh020BSPtSignal; //!
166 TH1F *fh80100BSPtSignal; //!
167 TH1F *fhBSPtSignal; //!
168 TH2F *fhBSPtCenSignal; //!
170 // This set of Histograms is for filling Delta Pt where the RC are at least 2R away from the leading Signal
171 TH1F *fh020DeltaPt; //!
172 TH1F *fh80100DeltaPt; //!
174 TH2F *fhDeltaPtCen; //!
176 // This set of Histograms is for filling Delta Pt where the RC have to spatial restrictions
177 TH1F *fh020DeltaPtSignal; //!
178 TH1F *fh80100DeltaPtSignal; //!
179 TH1F *fhDeltaPtSignal; //!
180 TH2F *fhDeltaPtCenSignal; //!
182 // This set of Histograms is for filling Delta Pt with NColl
183 TH1F *fh020DeltaPtNColl; //!
184 TH1F *fh80100DeltaPtNColl; //!
185 TH1F *fhDeltaPtNColl; //!
186 TH2F *fhDeltaPtCenNColl; //!
188 // This set of Histograms is for filling Background Fluctuations Spectra
189 TH1F *fh020BckgFlucPt; //!
190 TH1F *fh80100BckgFlucPt; //!
191 TH1F *fhBckgFlucPt; //!
192 TH2F *fhBckgFlucPtCen; //!
196 TProfile *fpLJetRho; //!
199 TH3F *fhJetPtEtaPhi; //!
200 TH2F *fhJetPtArea; //!
201 TH2F *fhJetConstituentPt; //!
202 TH2F *fhJetTracksPt; //!
203 TH2F *fhJetClustersPt; //!
204 TH2F *fhJetConstituentCounts; //!
205 TH2F *fhJetTracksCounts; //!
206 TH2F *fhJetClustersCounts; //!
207 TH2F *fhJetPtZConstituent; //!
208 TH2F *fhJetPtZTrack; //!
209 TH2F *fhJetPtZCluster; //!
210 TH2F *fhJetPtZLeadingConstituent; //!
211 TH2F *fhJetPtZLeadingTrack; //!
212 TH2F *fhJetPtZLeadingCluster; //!
214 // Event Centrality vs Leading Jet Pt
215 TH2F *fhEventCentralityVsZNA; //!
216 TH3F *fhEventCentralityVsZNAPt; //!
218 // Histograms for Neutral Energy Fraction
219 TList *fNEFOutput; //! NEF QA Plots
221 TH2F *fhJetPtNEF; //!
223 THnSparse *fhJetNEFInfo; //! Jet NEF Information Histogram
224 THnSparse *fhJetNEFSignalInfo; //! Signal Jet NEF Information Histogram
225 THnSparse *fhClusterNEFInfo; //! Cluster Jet NEF Information Histogram
226 THnSparse *fhClusterNEFSignalInfo; //! Cluster Signal Jet NEF Information Histogram
228 TH1F *fhClusterShapeAll; //!
229 TH2F *fhClusterPtCellAll; //!
232 const char *fName; //!
233 TString fCentralityTag;
235 Int_t fCentralityBins;
236 Double_t fCentralityLow;
237 Double_t fCentralityUp;
248 Double_t fDeltaPtLow;
251 Int_t fBckgFlucPtBins;
252 Double_t fBckgFlucPtLow;
253 Double_t fBckgFlucPtUp;
261 Int_t fLChargedTrackPtBins;
262 Double_t fLChargedTrackPtLow;
263 Double_t fLChargedTrackPtUp;
265 Bool_t fDoNEFQAPlots;
266 Bool_t fDoNEFSignalOnly;
267 Bool_t fSignalTrackBias;
277 // These members are 'sourced' from the base class and are initalized in the constructor
278 Double_t fEMCalPhiMin;
279 Double_t fEMCalPhiMax;
280 Double_t fEMCalEtaMin;
281 Double_t fEMCalEtaMax;
284 // AliAnalysisTaskFullpAJets
286 AliAnalysisTaskFullpAJets();
287 AliAnalysisTaskFullpAJets(const char *name);
288 virtual ~AliAnalysisTaskFullpAJets();
290 virtual void UserCreateOutputObjects();
291 virtual void UserExecOnce();
292 virtual void UserExec(Option_t *option);
293 virtual void Terminate(Option_t *);
295 // User Defined Sub-Routines
301 void InitChargedJets();
303 void GenerateTPCRandomConesPt();
304 void GenerateEMCalRandomConesPt();
306 void EstimateChargedRho0();
307 void EstimateChargedRho1();
308 void EstimateChargedRho2();
309 void EstimateChargedRhoN();
310 void EstimateChargedRhoScale();
311 void EstimateChargedRhokT();
312 void EstimateChargedRhokTScale();
313 void EstimateChargedRhoCMS();
314 void EstimateChargedRhoCMSScale();
316 void EstimateFullRho0();
317 void EstimateFullRho1();
318 void EstimateFullRho2();
319 void EstimateFullRhoN();
320 void EstimateFullRhoDijet();
321 void EstimateFullRhokT();
322 void EstimateFullRhoCMS();
324 void FullJetEnergyDensityProfile();
325 void ChargedJetEnergyDensityProfile();
327 void DeleteJetData(Int_t delOption);
329 // User Defined Functions
330 Bool_t IsDiJetEvent();
331 Bool_t InsideRect(Double_t phi,Double_t phi_min,Double_t phi_max,Double_t eta,Double_t eta_min,Double_t eta_max);
332 Bool_t IsInEMCal(Double_t phi,Double_t eta);
333 Bool_t IsInEMCalFull(Double_t r,Double_t phi,Double_t eta);
334 Bool_t IsInEMCalPart(Double_t r,Double_t phi,Double_t eta);
335 Bool_t IsInTPCFull(Double_t r,Double_t phi,Double_t eta);
336 Bool_t IsInTPC(Double_t r,Double_t phi,Double_t eta,Bool_t Complete);
337 Bool_t IsJetOverlap(AliEmcalJet *jet1,AliEmcalJet *jet2,Bool_t EMCalOn);
339 Double_t AreaWithinTPC(Double_t r,Double_t eta);
340 Double_t AreaWithinEMCal(Double_t r,Double_t phi,Double_t eta);
341 Double_t AreaEdge(Double_t r,Double_t z);
342 Double_t AreaOverlap(Double_t r,Double_t x,Double_t y);
343 Double_t TransverseArea(Double_t r,Double_t psi0,Double_t phi,Double_t eta);
344 Double_t MedianRhokT(Double_t *pTkTEntries, Double_t *RhokTEntries, Int_t nEntries);
346 // Used to set the R for the jet finders
347 inline void SetRjet(Int_t r)
352 // Used to set the Centrality Tag
353 inline void SetCentralityTag(TString centag)
355 fCentralityTag = centag.Data();
358 // Used to set apriori Scaling Factor
359 inline void SetScaleFactor(Double_t factor)
361 fScaleFactor = factor;
364 // Used to set the minimum pT required to analyize picotracks
365 inline void SetTrackPtCut(Double_t pT)
370 // Used to set the minimum pT required to analyize picotracks
371 inline void SetClusterPtCut(Double_t pT)
376 // Used to set Tracks collection name
377 inline void SetTrackName(TString name)
382 // Used to set Clusters collection name
383 inline void SetClusterName(TString name)
388 // Used to set kT Charged Jet collection name
389 inline void SetkTChargedJetName(TString name)
391 fkTChargedName = name;
394 // Used to set anti-kT Charged Jet collection name
395 inline void SetAkTChargedJetName(TString name)
397 fAkTChargedName = name;
400 // Used to set kT Full Jet collection name
401 inline void SetkTFullJetName(TString name)
406 // Used to set anti-kT Full Jet collection name
407 inline void SetAkTFullJetName(TString name)
412 // Used to set Ncoll for Delta Pt
413 inline void SetNColl(Double_t ncoll)
418 inline void SetNEFSignalJetCut(Double_t nef)
420 fNEFSignalJetCut = nef;
423 inline void DoNEFCalibration(Bool_t doNEF)
428 inline void SetJetChargeBias(Bool_t trackBias)
430 fSignalTrackBias = trackBias;
433 inline void DoTrackQA(Bool_t doQA)
438 inline void DoClusterQA(Bool_t doQA)
443 inline void CalculateRhoJet(Int_t doRhoJet)
445 fCalculateRhoJet = doRhoJet;
448 inline void DoNEFSignalOnly(Bool_t doNEF)
450 fDoNEFSignalOnly = doNEF;
453 inline void DoVertexRCut(Bool_t doCut)
455 fDoVertexRCut = doCut;
458 inline void SetMCParticleLevel(Bool_t mcPartLevel)
460 fMCPartLevel = mcPartLevel;
463 inline void SetJetRAcceptance(Double_t r)
468 inline void DoTHnSparse(Bool_t doTHnSparse)
470 fDoTHnSparse = doTHnSparse;
473 inline void DoJetRhoDensity(Bool_t doJetRhoDensity)
475 fDoJetRhoDensity = doJetRhoDensity;
479 TList *fOutput; //! Output list
480 TList *flTrack; //! Track QA List
481 TList *flCluster; //! Cluster QA List
484 TH1F *fhTrackEta; //!
485 TH1F *fhTrackPhi; //!
486 TH1F *fhGlobalTrackPt; //!
487 TH1F *fhGlobalTrackEta; //!
488 TH1F *fhGlobalTrackPhi; //!
489 TH1F *fhComplementaryTrackPt; //!
490 TH1F *fhComplementaryTrackEta; //!
491 TH1F *fhComplementaryTrackPhi; //!
492 TH1F *fhClusterPt; //!
493 TH1F *fhClusterEta; //!
494 TH1F *fhClusterPhi; //!
495 TH1F *fhCentrality; //!
496 TH1F *fhEMCalCellCounts; //! Plots the distribution of cluster counts in the EMCal. Used to determine which cells are hot (if any...)
498 TH1F *fhChargeAndNeutralEvents; //!
499 TH1F *fhChargeOnlyEvents; //!
500 TH1F *fhNeutralOnlyEvents; //!
501 TH1F *fhNothingEvents; //!
502 TH1F *fhEMCalChargeAndNeutralEvents; //!
503 TH1F *fhEMCalChargeOnlyEvents; //!
504 TH1F *fhEMCalNeutralOnlyEvents; //!
505 TH1F *fhEMCalNothingEvents; //!
507 TH2F *fhTrackEtaPhi; //!
508 TH2F *fhTrackPhiPt; //!
509 TH2F *fhTrackEtaPt; //!
510 TH2F *fhGlobalTrackEtaPhi; //!
511 TH2F *fhGlobalTrackPhiPt; //!
512 TH2F *fhGlobalTrackEtaPt; //!
513 TH2F *fhComplementaryTrackEtaPhi; //!
514 TH2F *fhComplementaryTrackPhiPt; //!
515 TH2F *fhComplementaryTrackEtaPt; //!
517 TH2F *fhClusterEtaPhi; //!
518 TH2F *fhClusterPhiPt; //!
519 TH2F *fhClusterEtaPt; //!
521 TH2F *fhEMCalEventMult; //!
522 TH2F *fhTPCEventMult; //!
523 TH2F *fhEMCalTrackEventMult; //!
525 TProfile *fpEMCalEventMult; //!
526 TProfile *fpTPCEventMult; //!
528 TProfile2D *fpTrackPtProfile; //!
529 TProfile2D *fpClusterPtProfile; //!
531 TProfile3D *fpFullJetEDProfile; //!
532 TProfile3D *fpChargedJetEDProfile; //!
533 TProfile3D *fpChargedJetEDProfileScaled; //!
535 AlipAJetHistos *fTPCRawJets; //!
536 AlipAJetHistos *fEMCalRawJets; //!
538 AlipAJetHistos *fRhoChargedCMSScale; //!
539 AlipAJetHistos *fRhoChargedScale; //!
541 AlipAJetHistos *fRhoFull0; //!
542 AlipAJetHistos *fRhoFull1; //!
543 AlipAJetHistos *fRhoFull2; //!
544 AlipAJetHistos *fRhoFullN; //!
545 AlipAJetHistos *fRhoFullDijet; //!
546 AlipAJetHistos *fRhoFullkT; //!
547 AlipAJetHistos *fRhoFullCMS; //!
549 AlipAJetHistos *fRhoCharged0; //!
550 AlipAJetHistos *fRhoCharged1; //!
551 AlipAJetHistos *fRhoCharged2; //!
552 AlipAJetHistos *fRhoChargedN; //!
553 AlipAJetHistos *fRhoChargedkT; //!
554 AlipAJetHistos *fRhoChargedkTScale; //!
555 AlipAJetHistos *fRhoChargedCMS; //!
557 AlipAJetData *fTPCJet; //!
558 AlipAJetData *fTPCFullJet; //!
559 AlipAJetData *fTPCOnlyJet; //!
560 AlipAJetData *fTPCJetUnbiased; //!
561 AlipAJetData *fTPCkTFullJet; //!
562 AlipAJetData *fEMCalJet; //!
563 AlipAJetData *fEMCalFullJet; //!
564 AlipAJetData *fEMCalPartJet; //!
565 AlipAJetData *fEMCalPartJetUnbiased; //!
566 AlipAJetData *fEMCalkTFullJet; //!
569 Bool_t fIsInitialized;
570 Int_t fRJET; // Used to set Anti_kt R. Called from AddTask Macro
571 Long_t fnEvents; // Counter for the number of events that made the physics selection with TPC+EMCal
572 Long_t fnEventsCharged; // Counter for the number of events that made the physics selection with TPC only
573 Long_t fnDiJetEvents; // Counter for the number of dijet events
574 AliVEvent *fEvent; //!
575 AliEMCALRecoUtils *fRecoUtil; //!
576 AliEMCALGeometry *fEMCALGeometry; //!
577 AliVCaloCells *fCells; //!
579 Bool_t fDoNEFSignalOnly;
580 Bool_t fSignalTrackBias;
583 Int_t fCalculateRhoJet;
584 Bool_t fDoVertexRCut;
587 Bool_t fDoJetRhoDensity;
589 // Protected Global Variables
590 Double_t fEMCalPhiMin;
591 Double_t fEMCalPhiMax;
592 Double_t fEMCalPhiTotal;
593 Double_t fEMCalEtaMin;
594 Double_t fEMCalEtaMax;
595 Double_t fEMCalEtaTotal;
600 Double_t fTPCPhiTotal;
603 Double_t fTPCEtaTotal;
606 Double_t fParticlePtLow;
607 Double_t fParticlePtUp;
608 Int_t fParticlePtBins;
610 Double_t fJetR; // Jet resolution parameter
611 Double_t fJetRAccept; // Jet radius used for additional acceptance constraint. Used to restrict eta acceptance in full ana
612 Double_t fFullEDJetR; // Radius used to calculate boundaries for jet within EMCal
613 Double_t fChargedEDJetR; // Radius used to calculate boundaries (in eta) for jet within TPC
614 Double_t fJetRForRho; // Required distance a track/cluster must be away from a jet for rho calculation
615 Double_t fJetAreaCutFrac; // Fudge factor for selecting on jets with threshold Pt or higher
616 Double_t fJetAreaThreshold;
617 Int_t fnEMCalCells; // Total number of cells in the EMCal
618 Double_t fScaleFactor; // Scale Factor obtained from Megan/Rosi
619 Double_t fNColl; // Used for partial rejection of signal from RC. Obtained via Glauber Calculations
620 Double_t fTrackMinPt;
621 Double_t fClusterMinPt;
622 Double_t fNEFSignalJetCut;
624 TString fCentralityTag;
625 Int_t fCentralityBins;
626 Double_t fCentralityLow;
627 Double_t fCentralityUp;
628 Double_t fEventCentrality;
630 Double_t fRhoFull; // From Full Rho 0
631 Double_t fRhoCharged; // From Charged Rho 0
633 // General Global variables
637 Int_t fnCaloClusters;
639 Int_t fnAKTChargedJets;
641 Int_t fnKTChargedJets;
642 Int_t fnBckgClusters;
644 Double_t fTPCJetThreshold;
645 Double_t fEMCalJetThreshold;
648 Double_t fVertexWindow;
649 Double_t fVertexMaxR;
651 // Tracks and Clusters string names
655 // Jet Finder string names
656 TString fkTChargedName;
657 TString fAkTChargedName;
659 TString fAkTFullName;
661 // Dynamic Array variables
662 TClonesArray *fOrgTracks; //!
663 TClonesArray *fOrgClusters; //!
664 TClonesArray *fmyAKTFullJets; //!
665 TClonesArray *fmyAKTChargedJets; //!
666 TClonesArray *fmyKTFullJets; //!
667 TClonesArray *fmyKTChargedJets; //!
669 TObjArray *fmyTracks; //!
670 TObjArray *fmyClusters; //!
672 Double_t *fEMCalRCBckgFluc; //! Stores the pT of RC Background clusters in EMCal at least 2R away from Leading Signal
673 Double_t *fTPCRCBckgFluc; //! Stores the pT of RC Background clusters in TPC at least 2R away from Leading Signal
674 Double_t *fEMCalRCBckgFlucSignal; //! Stores the pT of RC Background clusters in EMCal with no spatial restrictions
675 Double_t *fTPCRCBckgFlucSignal; //! Stores the pT of RC Background clusters in TPC with no spatial restrictions
676 Double_t *fEMCalRCBckgFlucNColl; //! Stores the pT of RC Background clusters in EMCal with no spatial restrictions
677 Double_t *fTPCRCBckgFlucNColl; //! Stores the pT of RC Background clusters in TPC with no spatial restrictions
679 AliAnalysisTaskFullpAJets(const AliAnalysisTaskFullpAJets&); // not implemented
680 AliAnalysisTaskFullpAJets& operator=(const AliAnalysisTaskFullpAJets&); // not implemented
682 ClassDef(AliAnalysisTaskFullpAJets, 1); // example of analysis