]>
Commit | Line | Data |
---|---|---|
f1354962 | 1 | #ifndef AliAnalysisTaskJetMatching_H |
2 | #define AliAnalysisTaskJetMatching_H | |
3 | ||
e9c2d4f3 | 4 | #include <AliAnalysisTaskEmcalJetDev.h> |
f1354962 | 5 | #include <AliEmcalJet.h> |
6 | #include <AliVTrack.h> | |
7 | #include <TClonesArray.h> | |
8 | #include <TMath.h> | |
9 | #include <TRandom3.h> | |
10 | ||
11 | class TF1; | |
12 | class THF1; | |
13 | class THF2; | |
14 | class TProfile; | |
15 | class AliRhoParameter; | |
16 | class AliLocalRhoParameter; | |
17 | class TClonesArray; | |
18 | ||
e9c2d4f3 | 19 | class AliAnalysisTaskJetMatching : public AliAnalysisTaskEmcalJetDev |
f1354962 | 20 | { |
21 | public: | |
22 | // enumerators | |
23 | enum matchingSceme {kGeoEtaPhi, kGeoR, kGeoEtaPhiArea, kGeoRArea, kDeepMatching}; | |
24 | enum duplicateRecovery {kDoNothing, kTraceDuplicates, kRemoveDuplicates}; | |
25 | enum sourceBKG {kNoSourceBKG, kSourceRho, kSourceLocalRho}; | |
26 | enum targetBKG {kNoTargetBKG, kTargetRho, kTargetLocalRho}; | |
27 | // constructors, destructor | |
28 | AliAnalysisTaskJetMatching(); | |
29 | AliAnalysisTaskJetMatching(const char *name); | |
30 | virtual ~AliAnalysisTaskJetMatching(); | |
31 | // setting up the task and technical aspects | |
32 | void ExecOnce(); | |
33 | virtual void UserCreateOutputObjects(); | |
34 | TH1F* BookTH1F(const char* name, const char* x, Int_t bins, Double_t min, Double_t max, Bool_t append = kTRUE); | |
35 | TH2F* BookTH2F(const char* name, const char* x, const char* y, Int_t binsx, Double_t minx, Double_t maxx, Int_t binsy, Double_t miny, Double_t maxy, Bool_t append = kTRUE); | |
36 | virtual Bool_t Run(); | |
37 | /* inline */ Double_t PhaseShift(Double_t x) const { | |
38 | while (x>=TMath::TwoPi())x-=TMath::TwoPi(); | |
39 | while (x<0.)x+=TMath::TwoPi(); | |
40 | return x; } | |
41 | /* inline */ Double_t PhaseShift(Double_t x, Double_t n) const { | |
42 | x = PhaseShift(x); | |
43 | if(TMath::Nint(n)==2) while (x>TMath::Pi()) x-=TMath::Pi(); | |
44 | if(TMath::Nint(n)==3) { | |
45 | if(x>2.*TMath::TwoPi()/n) x = TMath::TwoPi() - x; | |
46 | if(x>TMath::TwoPi()/n) x = TMath::TwoPi()-(x+TMath::TwoPi()/n); | |
47 | } | |
48 | return x; } | |
49 | /* inline */ Bool_t CompareTracks(AliVParticle* a, AliVParticle* b) const { | |
50 | // printf("dEta %.2f \t dPhi %.2f \n", a->Eta()-b->Eta(), a->Phi()-b->Phi()); | |
51 | return (TMath::AreEqualAbs(a->Pt(), b->Pt(), 1e-2) && TMath::AreEqualAbs(a->Eta(), b->Eta(), 1e-2) && TMath::AreEqualAbs(a->Phi(), b->Phi(), 1e-2)) ? kTRUE : kFALSE; } | |
52 | ||
53 | // setters - setup how to run | |
54 | void SetDebugMode(Int_t d) {fDebug = d;} | |
55 | void SetMatchingScheme(matchingSceme m) {fMatchingScheme = m;} | |
56 | void SetDuplicateRecoveryScheme(duplicateRecovery d) {fDuplicateJetRecoveryMode = d;} | |
0aaf31ab | 57 | void SetUseEmcalBaseJetCuts(Bool_t b) {fUseEmcalBaseJetCuts = b;} |
f1354962 | 58 | void SetSourceBKG(sourceBKG b) {fSourceBKG = b;} |
59 | void SetTargetBKG(targetBKG b) {fTargetBKG = b;} | |
60 | void SetSourceJetsName(const char* n) {fSourceJetsName = n;} | |
61 | void SetTargetJetsName(const char* n) {fTargetJetsName = n; } | |
62 | void SetMatchedJetsName(const char* n) {fMatchedJetsName = n;} | |
63 | void SetMatchEta(Float_t f) {fMatchEta = f;} | |
64 | void SetMatchPhi(Float_t f) {fMatchPhi = f;} | |
65 | void SetMatchR(Float_t f) {fMatchR = f;} | |
66 | void SetMatchRelArea(Float_t f) {fMatchArea = f;} | |
67 | void SetMaxRelEnergyDiff(Float_t f) {fMaxRelEnergyDiff = f;} | |
68 | void SetMaxAbsEnergyDiff(Float_t f) {fMaxAbsEnergyDiff = f;} | |
69 | // methods | |
70 | void DoGeometricMatchingEtaPhi(Bool_t pairCuts = kFALSE); | |
71 | void DoGeometricMatchingR(Bool_t pairCuts = kFALSE); | |
72 | void DoDeepMatching(); | |
73 | void DuplicateJetRecovery(); | |
74 | void PostMatchedJets(); | |
75 | // fill histogrmas | |
76 | void FillAnalysisSummaryHistogram() const; | |
77 | void FillMatchedJetHistograms() const; | |
78 | // setters - analysis details | |
79 | /* inline */ Bool_t PassesCuts(const AliVTrack* track) const { | |
e9c2d4f3 | 80 | return (!track || TMath::Abs(track->Eta()) > 0.9 || track->Phi() < 0 || track->Phi() > TMath::TwoPi()) ? kFALSE : kTRUE; } |
81 | /* inline */ Bool_t PassesCuts(AliEmcalJet* jet) const { return (jet) ? kTRUE : kFALSE; } | |
f1354962 | 82 | /* inline */ Bool_t PassesCuts(AliEmcalJet* a, AliEmcalJet* b) const { |
83 | if (fMatchArea > 0) { return (TMath::Abs(a->Area()/b->Area()) < fMatchArea) ? kTRUE : kFALSE; } | |
84 | if (fMaxRelEnergyDiff > 0) { return (TMath::Abs(a->E()/b->E()) > fMaxRelEnergyDiff) ? kTRUE : kFALSE; } | |
85 | if (fMaxAbsEnergyDiff > 0) { return (TMath::Abs(a->E()-b->E()) > fMaxAbsEnergyDiff) ? kTRUE : kFALSE; } | |
86 | return kTRUE; } | |
87 | /* inline */ void ClearMatchedJetsCache() { | |
88 | for (Int_t i(0); i < fNoMatchedJets; i++) { | |
89 | fMatchedJetContainer[i][0] = 0x0; fMatchedJetContainer[i][1] = 0x0; } | |
90 | fNoMatchedJets = 0; | |
91 | } | |
92 | void PrintInfo() const; | |
93 | virtual void Terminate(Option_t* option); | |
94 | ||
95 | private: | |
96 | Int_t fDebug; // debug level (0 none, 1 fcn calls, 2 verbose) | |
97 | TClonesArray* fSourceJets; //! array with source jets | |
98 | TString fSourceJetsName; // name of array with source jets | |
99 | TClonesArray* fTargetJets; //! array with target jets | |
100 | TString fTargetJetsName; // name of array with target jets | |
101 | TClonesArray* fMatchedJets; //! final list of matched jets which is added to event | |
102 | TString fMatchedJetsName; // name of list of matched jets | |
103 | Bool_t fUseScaledRho; // use scaled rho | |
104 | matchingSceme fMatchingScheme; // select your favorite matching algorithm | |
105 | duplicateRecovery fDuplicateJetRecoveryMode; // what to do with duplicate matches | |
0aaf31ab | 106 | Bool_t fUseEmcalBaseJetCuts; // use the emcal jet base class for jet cuts |
f1354962 | 107 | sourceBKG fSourceBKG; // subtracted background of source jets |
108 | targetBKG fTargetBKG; // subtracted background of target jets | |
109 | // additional jet cuts (most are inherited) | |
110 | Float_t fLocalJetMinEta; // local eta cut for jets | |
111 | Float_t fLocalJetMaxEta; // local eta cut for jets | |
112 | Float_t fLocalJetMinPhi; // local phi cut for jets | |
113 | Float_t fLocalJetMaxPhi; // local phi cut for jets | |
114 | // transient object pointers | |
115 | TList* fOutputList; //! output list | |
116 | TH1F* fHistUnsortedCorrelation; //! dphi correlation of unsorted jets | |
117 | TH1F* fHistMatchedCorrelation; //! dphi correlation of matched jets | |
118 | TH1F* fHistSourceJetPt; //! pt of source jets | |
119 | TH1F* fHistTargetJetPt; //! pt of target jets | |
120 | TH1F* fHistMatchedJetPt; //! pt of matched jets | |
121 | TH1F* fHistNoConstSourceJet; //! number of constituents of source jet | |
122 | TH1F* fHistNoConstTargetJet; //! number of constituents of target jet | |
123 | TH1F* fHistNoConstMatchJet; //! number of constituents of matched jets | |
0aaf31ab | 124 | TProfile* fProfFracPtMatched; //! sum pt fraction for matched tracks / jet |
125 | TProfile* fProfFracPtJets; //! sum pt fraction for matched jets | |
126 | TProfile* fProfFracNoMatched; //! no of constituents fraction found / jet | |
127 | TProfile* fProfFracNoJets; //! no of consstituents fraction jet / jet | |
f1354962 | 128 | TH1F* fHistAnalysisSummary; //! flags |
129 | TProfile* fProfQAMatched; //! QA spreads of matched jets | |
130 | TProfile* fProfQA; //! QA spreads of source and target jets | |
131 | Int_t fNoMatchedJets; //! number of matched jets | |
132 | AliEmcalJet* fMatchedJetContainer[100][2]; //! pointers to matched jets | |
133 | // geometric matching parameters | |
134 | Float_t fMatchEta; // max eta distance between centers of matched jets | |
135 | Float_t fMatchPhi; // max phi distance between centers of matched jets | |
136 | Float_t fMatchR; // max distance between matched jets | |
137 | Float_t fMatchArea; // max relative area mismatch between matched jets | |
138 | Float_t fMaxRelEnergyDiff; // max relative energy difference between matched jets | |
139 | Float_t fMaxAbsEnergyDiff; // max absolute energy difference between matched jets | |
140 | ||
141 | AliAnalysisTaskJetMatching(const AliAnalysisTaskJetMatching&); // not implemented | |
142 | AliAnalysisTaskJetMatching& operator=(const AliAnalysisTaskJetMatching&); // not implemented | |
143 | ||
e9c2d4f3 | 144 | ClassDef(AliAnalysisTaskJetMatching, 3); |
f1354962 | 145 | }; |
146 | ||
147 | #endif |