1 #ifndef AliAnalysisTaskFullpAJets_H
2 #define AliAnalysisTaskFullpAJets_H
15 class AliESDtrackCuts;
18 class AliEMCALGeometry;
19 class AliEMCALRecoUtils;
23 #ifndef ALIANALYSISTASKSE_H
24 #include "AliAnalysisTaskSE.h"
27 class AliAnalysisTaskFullpAJets : public AliAnalysisTaskSE
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, const char *centag, Bool_t doNEF=kFALSE);
109 virtual ~AlipAJetHistos();
111 // User Defined Sub-Routines
113 void FillRho(Double_t eventCentrality, Double_t rho);
114 void FillBSJS(Double_t eventCentrality, Double_t rho, Double_t signalCut, TClonesArray *jetList, Int_t *indexJetList, Int_t nIndexJetList);
115 void FillDeltaPt(Double_t eventCentrality, Double_t rho, Double_t jetRadius, Double_t *RCArray, Int_t nRC);
116 void FillDeltaPtSignal(Double_t eventCentrality, Double_t rho, Double_t jetRadius, Double_t *RCArray, Int_t nRC);
117 void FillDeltaPtNColl(Double_t eventCentrality, Double_t rho, Double_t jetRadius, Double_t *RCArray, Int_t nRC);
118 void FillBackgroundFluctuations(Double_t eventCentrality, Double_t rho, Double_t jetRadius);
119 void FillLeadingJetPtRho(Double_t jetPt, Double_t rho);
120 void DoNEFQAPlots(Bool_t doNEFAna);
121 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);
122 void FillMiscJetStats(TClonesArray *jetList, Int_t *indexJetList, Int_t nIndexJetList, TClonesArray *trackList, TClonesArray *clusterList);
125 void SetName(const char *name);
126 void SetCentralityTag(const char *name);
127 void SetCentralityRange(Int_t bins, Double_t low, Double_t up);
128 void SetPtRange(Int_t bins, Double_t low, Double_t up);
129 void SetRhoPtRange(Int_t bins, Double_t low, Double_t up);
130 void SetDeltaPtRange(Int_t bins, Double_t low, Double_t up);
131 void SetBackgroundFluctuationsPtRange(Int_t bins, Double_t low, Double_t up);
132 void SetLeadingJetPtRange(Int_t bins, Double_t low, Double_t up);
133 void SetLeadingChargedTrackPtRange(Int_t bins, Double_t low, Double_t up);
134 void SetNEFRange(Int_t bins, Double_t low, Double_t up);
135 void SetSignalTrackPtBias(Bool_t chargedBias);
137 // User Defined Functions
138 TList* GetOutputHistos(); //!
142 TList *fOutput; //! Output list
145 // This set of Histograms is for filling the Rho Spectral distributions
147 TH1D *fh80100Rho; //!
151 // This set of Histograms is for filling the Background Subtracted Jet Spectra
153 TH1D *fh80100BSPt; //!
156 //TH3D *fhBSPtCenLCT; //!
158 // This set of Histograms is for filling the Background Subtracted Signal Jet Spectra
159 TH1D *fh020BSPtSignal; //!
160 TH1D *fh80100BSPtSignal; //!
161 TH1D *fhBSPtSignal; //!
162 TH2D *fhBSPtCenSignal; //!
164 // This set of Histograms is for filling Delta Pt where the RC are at least 2R away from the leading Signal
165 TH1D *fh020DeltaPt; //!
166 TH1D *fh80100DeltaPt; //!
168 TH2D *fhDeltaPtCen; //!
170 // This set of Histograms is for filling Delta Pt where the RC have to spatial restrictions
171 TH1D *fh020DeltaPtSignal; //!
172 TH1D *fh80100DeltaPtSignal; //!
173 TH1D *fhDeltaPtSignal; //!
174 TH2D *fhDeltaPtCenSignal; //!
176 // This set of Histograms is for filling Delta Pt with NColl
177 TH1D *fh020DeltaPtNColl; //!
178 TH1D *fh80100DeltaPtNColl; //!
179 TH1D *fhDeltaPtNColl; //!
180 TH2D *fhDeltaPtCenNColl; //!
182 // This set of Histograms is for filling Background Fluctuations Spectra
183 TH1D *fh020BckgFlucPt; //!
184 TH1D *fh80100BckgFlucPt; //!
185 TH1D *fhBckgFlucPt; //!
186 TH2D *fhBckgFlucPtCen; //!
190 TProfile *fpLJetRho; //!
191 TH2D *fhJetConstituentPt; //!
192 TH2D *fhJetPtArea; //!
194 // Histograms for Neutral Energy Fraction
195 TList *fNEFOutput; //! NEF QA Plots
198 TH1D *fhNEFSignal; //!
199 TH2D *fhNEFJetPt; //!
200 TH2D *fhNEFJetPtSignal; //!
202 TH2D *fhNEFEtaPhi; //!
203 TH2D *fhNEFEtaPhiSignal; //!
204 TH3D *fhEtaPhiNEF; //!
206 TH2D *fhNEFTotalMult; //!
207 TH2D *fhNEFTotalMultSignal; //!
209 TH2D *fhNEFNeutralMult; //!
210 TH2D *fhNEFNeutralMultSignal; //!
212 TH1D *fhClusterShapeAll; //!
213 TH2D *fhClusterPtCellAll; //!
214 TH3D *fhNEFJetPtFCross; //!
215 TH3D *fhNEFZLeadingFCross; //!
216 TH3D *fhNEFTimeCellCount; //!
217 TH3D *fhNEFTimeDeltaTime; //!
220 const char *fName; //!
221 const char *fCentralityTag; //!
223 Int_t fCentralityBins;
224 Double_t fCentralityLow;
225 Double_t fCentralityUp;
236 Double_t fDeltaPtLow;
239 Int_t fBckgFlucPtBins;
240 Double_t fBckgFlucPtLow;
241 Double_t fBckgFlucPtUp;
249 Int_t fLChargedTrackPtBins;
250 Double_t fLChargedTrackPtLow;
251 Double_t fLChargedTrackPtUp;
253 Bool_t fDoNEFQAPlots;
254 Bool_t fSignalTrackBias;
260 // These members are 'sourced' from the base class and are initalized in the constructor
261 Double_t fEMCalPhiMin;
262 Double_t fEMCalPhiMax;
263 Double_t fEMCalEtaMin;
264 Double_t fEMCalEtaMax;
267 // AliAnalysisTaskFullpAJets
269 AliAnalysisTaskFullpAJets();
270 AliAnalysisTaskFullpAJets(const char *name);
271 virtual ~AliAnalysisTaskFullpAJets();
273 virtual void UserCreateOutputObjects();
274 virtual void UserExecOnce();
275 virtual void UserExec(Option_t *option);
276 virtual void Terminate(Option_t *);
278 // User Defined Sub-Routines
283 void InitChargedJets();
285 void GenerateTPCRandomConesPt();
286 void GenerateEMCalRandomConesPt();
288 void EstimateChargedRho0();
289 void EstimateChargedRho1();
290 void EstimateChargedRho2();
291 void EstimateChargedRhoN();
292 void EstimateChargedRhoScale();
293 void EstimateChargedRhokT();
294 void EstimateChargedRhokTScale();
295 void EstimateChargedRhoCMS();
296 void EstimateChargedRhoCMSScale();
298 void EstimateFullRho0();
299 void EstimateFullRho1();
300 void EstimateFullRho2();
301 void EstimateFullRhoN();
302 void EstimateFullRhoDijet();
303 void EstimateFullRhokT();
304 void EstimateFullRhoCMS();
306 void DeleteJetData(Bool_t EMCalOn);
308 // User Defined Functions
309 Bool_t IsDiJetEvent();
310 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);
311 Bool_t IsInEMCal(Double_t phi,Double_t eta);
312 Bool_t IsInEMCalFull(Double_t r,Double_t phi,Double_t eta);
313 Bool_t IsInEMCalPart(Double_t r,Double_t phi,Double_t eta);
314 Bool_t IsInTPCFull(Double_t r,Double_t phi,Double_t eta);
315 Bool_t IsInTPC(Double_t r,Double_t phi,Double_t eta,Bool_t Complete);
316 Bool_t IsJetOverlap(AliEmcalJet *jet1,AliEmcalJet *jet2,Bool_t EMCalOn);
318 Double_t AreaWithinTPC(Double_t r,Double_t eta);
319 Double_t AreaWithinEMCal(Double_t r,Double_t phi,Double_t eta);
320 Double_t AreaEdge(Double_t r,Double_t z);
321 Double_t AreaOverlap(Double_t r,Double_t x,Double_t y);
322 Double_t TransverseArea(Double_t r,Double_t psi0,Double_t phi,Double_t eta);
323 Double_t MedianRhokT(Double_t *pTkTEntries, Double_t *RhokTEntries, Int_t nEntries);
325 // Used to set the R for the jet finders
326 inline void SetRjet(Int_t r)
331 // Used to set the Centrality Tag
332 inline void SetCentralityTag(const char *centag)
334 fCentralityTag = centag;
337 // Used to set apriori Scaling Factor
338 inline void SetScaleFactor(Double_t factor)
340 fScaleFactor = factor;
343 // Used to set the minimum pT required to analyize picotracks
344 inline void SetTrackPtCut(Double_t pT)
349 // Used to set the minimum pT required to analyize picotracks
350 inline void SetClusterPtCut(Double_t pT)
355 // Used to set Tracks collection name
356 inline void SetTrackName(TString name)
361 // Used to set Clusters collection name
362 inline void SetClusterName(TString name)
367 // Used to set kT Charged Jet collection name
368 inline void SetkTChargedJetName(TString name)
370 fkTChargedName = name;
373 // Used to set anti-kT Charged Jet collection name
374 inline void SetAkTChargedJetName(TString name)
376 fAkTChargedName = name;
379 // Used to set kT Full Jet collection name
380 inline void SetkTFullJetName(TString name)
385 // Used to set anti-kT Full Jet collection name
386 inline void SetAkTFullJetName(TString name)
391 // Used to set Ncoll for Delta Pt
392 inline void SetNColl(Double_t ncoll)
397 inline void SetNEFSignalJetCut(Double_t nef)
399 fNEFSignalJetCut = nef;
402 inline void DoNEFCalibration(Bool_t doNEF)
407 inline void SetJetChargeBias(Bool_t trackBias)
409 fSignalTrackBias = trackBias;
413 TList *fOutput; //! Output list
416 TH1D *fhTrackEta; //!
417 TH1D *fhTrackPhi; //!
418 TH1D *fhGlobalTrackPt; //!
419 TH1D *fhGlobalTrackEta; //!
420 TH1D *fhGlobalTrackPhi; //!
421 TH1D *fhComplementaryTrackPt; //!
422 TH1D *fhComplementaryTrackEta; //!
423 TH1D *fhComplementaryTrackPhi; //!
424 TH1D *fhClusterPt; //!
425 TH1D *fhClusterEta; //!
426 TH1D *fhClusterPhi; //!
427 TH1D *fhCentrality; //!
428 TH1D *fhEMCalCellCounts; //! Plots the distribution of cluster counts in the EMCal. Used to determine which cells are hot (if any...)
430 TH2D *fhTrackEtaPhi; //!
431 TH2D *fhTrackPhiPt; //!
432 TH2D *fhTrackEtaPt; //!
433 TH2D *fhGlobalTrackEtaPhi; //!
434 TH2D *fhGlobalTrackPhiPt; //!
435 TH2D *fhGlobalTrackEtaPt; //!
436 TH2D *fhComplementaryTrackEtaPhi; //!
437 TH2D *fhComplementaryTrackPhiPt; //!
438 TH2D *fhComplementaryTrackEtaPt; //!
440 TH2D *fhClusterEtaPhi; //!
441 TH2D *fhClusterPhiPt; //!
442 TH2D *fhClusterEtaPt; //!
443 TH2D *fhRhoScale; //!
445 TH2D *fhEMCalEventMult; //!
446 TH2D *fhTPCEventMult; //!
447 TH2D *fhEMCalTrackEventMult; //!
449 TH3D *fhTrackEtaPhiPt; //!
450 TH3D *fhGlobalTrackEtaPhiPt; //!
451 TH3D *fhComplementaryTrackEtaPhiPt; //!
452 TH3D *fhClusterEtaPhiPt; //!
454 TProfile *fpEMCalEventMult; //!
455 TProfile *fpTPCEventMult; //!
456 TProfile *fpRhoScale; //! Scale of rho_total/rho_charged event/event vs centrality
458 TProfile2D *fpTrackPtProfile; //!
459 TProfile2D *fpClusterPtProfile; //!
461 AlipAJetHistos *fTPCRawJets; //!
462 AlipAJetHistos *fEMCalRawJets; //!
464 AlipAJetHistos *fRhoFull0; //!
465 AlipAJetHistos *fRhoFull1; //!
466 AlipAJetHistos *fRhoFull2; //!
467 AlipAJetHistos *fRhoFullN; //!
468 AlipAJetHistos *fRhoFullDijet; //!
469 AlipAJetHistos *fRhoFullkT; //!
470 AlipAJetHistos *fRhoFullCMS; //!
472 AlipAJetHistos *fRhoCharged0; //!
473 AlipAJetHistos *fRhoCharged1; //!
474 AlipAJetHistos *fRhoCharged2; //!
475 AlipAJetHistos *fRhoChargedN; //!
476 AlipAJetHistos *fRhoChargedkT; //!
477 AlipAJetHistos *fRhoChargedkTScale; //!
478 AlipAJetHistos *fRhoChargedCMS; //!
480 AlipAJetHistos *fRhoChargedScale; //!
481 AlipAJetHistos *fRhoChargedCMSScale; //!
483 AlipAJetData *fTPCJet; //!
484 AlipAJetData *fTPCFullJet; //!
485 AlipAJetData *fTPCOnlyJet; //!
486 AlipAJetData *fTPCJetUnbiased; //!
487 AlipAJetData *fTPCkTFullJet; //!
488 AlipAJetData *fEMCalJet; //!
489 AlipAJetData *fEMCalFullJet; //!
490 AlipAJetData *fEMCalPartJet; //!
491 AlipAJetData *fEMCalPartJetUnbiased; //!
492 AlipAJetData *fEMCalkTFullJet; //!
495 Bool_t fIsInitialized;
496 Int_t fRJET; // Used to set Anti_kt R. Called from AddTask Macro
497 Long_t fnEvents; // Counter for the number of events that made the physics selection with TPC+EMCal
498 Long_t fnEventsCharged; // Counter for the number of events that made the physics selection with TPC only
499 Long_t fnDiJetEvents; // Counter for the number of dijet events
500 AliVEvent *fEvent; //!
501 AliEMCALRecoUtils *fRecoUtil; //!
502 AliEMCALGeometry *fEMCALGeometry; //!
503 AliVCaloCells *fCells; //!
505 Bool_t fSignalTrackBias;
507 // Protected Global Variables
508 Double_t fEMCalPhiMin;
509 Double_t fEMCalPhiMax;
510 Double_t fEMCalPhiTotal;
511 Double_t fEMCalEtaMin;
512 Double_t fEMCalEtaMax;
513 Double_t fEMCalEtaTotal;
518 Double_t fTPCPhiTotal;
521 Double_t fTPCEtaTotal;
524 Double_t fParticlePtLow;
525 Double_t fParticlePtUp;
526 Int_t fParticlePtBins;
529 Double_t fJetRForRho; // Required distance a track/cluster must be away from a jet for rho calculation
530 Double_t fJetAreaCutFrac; // Fudge factor for selecting on jets with threshold Pt or higher
531 Double_t fJetAreaThreshold;
532 Int_t fnEMCalCells; // Total number of cells in the EMCal
533 Double_t fScaleFactor; // Scale Factor obtained from Megan/Rosi
534 Double_t fNColl; // Used for partial rejection of signal from RC. Obtained via Glauber Calculations
535 Double_t fTrackMinPt;
536 Double_t fClusterMinPt;
537 Double_t fNEFSignalJetCut;
539 const char *fCentralityTag; //!
540 Int_t fCentralityBins;
541 Double_t fCentralityLow;
542 Double_t fCentralityUp;
543 Double_t fEventCentrality;
545 Double_t fRhoFull; // From Full Rho 0
546 Double_t fRhoCharged; // From Charged Rho 0
548 // General Global variables
551 Int_t fnCaloClusters;
553 Int_t fnAKTChargedJets;
555 Int_t fnKTChargedJets;
556 Int_t fnBckgClusters;
558 Double_t fTPCJetThreshold;
559 Double_t fEMCalJetThreshold;
562 Double_t fVertexWindow;
563 Double_t fVertexMaxR;
565 // Tracks and Clusters string names
569 // Jet Finder string names
570 TString fkTChargedName;
571 TString fAkTChargedName;
573 TString fAkTFullName;
575 // Dynamic Array variables
576 TClonesArray *fOrgTracks; //!
577 TClonesArray *fOrgClusters; //!
578 TClonesArray *fmyAKTFullJets; //!
579 TClonesArray *fmyAKTChargedJets; //!
580 TClonesArray *fmyKTFullJets; //!
581 TClonesArray *fmyKTChargedJets; //!
583 TObjArray *fmyTracks; //!
584 TObjArray *fmyClusters; //!
586 Double_t *fEMCalRCBckgFluc; //! Stores the pT of RC Background clusters in EMCal at least 2R away from Leading Signal
587 Double_t *fTPCRCBckgFluc; //! Stores the pT of RC Background clusters in TPC at least 2R away from Leading Signal
588 Double_t *fEMCalRCBckgFlucSignal; //! Stores the pT of RC Background clusters in EMCal with no spatial restrictions
589 Double_t *fTPCRCBckgFlucSignal; //! Stores the pT of RC Background clusters in TPC with no spatial restrictions
590 Double_t *fEMCalRCBckgFlucNColl; //! Stores the pT of RC Background clusters in EMCal with no spatial restrictions
591 Double_t *fTPCRCBckgFlucNColl; //! Stores the pT of RC Background clusters in TPC with no spatial restrictions
593 AliAnalysisTaskFullpAJets(const AliAnalysisTaskFullpAJets&); // not implemented
594 AliAnalysisTaskFullpAJets& operator=(const AliAnalysisTaskFullpAJets&); // not implemented
596 ClassDef(AliAnalysisTaskFullpAJets, 1); // example of analysis