]>
Commit | Line | Data |
---|---|---|
8628b70c | 1 | #ifndef ALIANALYSISTASKCHARGEDJETSPA_H |
2 | #define ALIANALYSISTASKCHARGEDJETSPA_H | |
3 | ||
12eb4ac1 | 4 | //#define DEBUGMODE |
8628b70c | 5 | |
6 | class TH1F; | |
7 | class TH2F; | |
8 | class TList; | |
8628b70c | 9 | class TClonesArray; |
10 | class TString; | |
11 | class AliEmcalJet; | |
12 | class AliRhoParameter; | |
13 | class AliVParticle; | |
14 | class AliLog; | |
3fa9cde0 | 15 | class AliAnalysisUtils; |
b95d0245 | 16 | class TRandom3; |
8628b70c | 17 | |
8628b70c | 18 | class AliAnalysisTaskChargedJetsPA : public AliAnalysisTaskSE { |
19 | public: | |
12eb4ac1 | 20 | // ######### CONTRUCTORS/DESTRUCTORS AND STD FUNCTIONS |
2a82f637 | 21 | AliAnalysisTaskChargedJetsPA() : AliAnalysisTaskSE(), fOutputList(0), fAnalyzeJets(1), fAnalyzeJetProfile(1), fAnalyzeQA(1), fAnalyzeBackground(1), fAnalyzeDeprecatedBackgrounds(1), fAnalyzePythia(0), fAnalyzeMassCorrelation(0), fHasTracks(0), fHasJets(0), fHasBackgroundJets(0), fIsKinematics(0), fUseDefaultVertexCut(1), fUsePileUpCut(1), fSetCentralityToOne(0), fPartialAnalysisNParts(1), fPartialAnalysisIndex(0), fJetArray(0), fTrackArray(0), fBackgroundJetArray(0), fJetArrayName(0), fTrackArrayName(0), fBackgroundJetArrayName(0), fNumPtHardBins(11), fUsePtHardBin(-1), fRhoTaskName(), fNcoll(6.88348), fRandConeRadius(0.4), fSignalJetRadius(0.4), fBackgroundJetRadius(0.4), fTRBackgroundConeRadius(0.6), fNumberRandCones(8), fNumberExcludedJets(-1), fDijetMaxAngleDeviation(10.0), fPhysicalJetRadius(0.6), fSignalJetEtaWindow(0.5), fBackgroundJetEtaWindow(0.5), fTrackEtaWindow(0.9), fMinTrackPt(0.150), fMinJetPt(0.15), fMinJetArea(0.5), fMinBackgroundJetPt(0.0), fMinDijetLeadingPt(10.0), fNumberOfCentralityBins(20), fCentralityType("V0A"), fFirstLeadingJet(0), fSecondLeadingJet(0), fNumberSignalJets(0), fCrossSection(0.0), fTrials(0.0), fRandom(0), fHelperClass(0), fInitialized(0), fTaskInstanceCounter(0), fHistList(0), fHistCount(0), fIsDEBUG(0), fEventCounter(0) |
b95d0245 | 22 | { |
23 | for(Int_t i=0;i<1024;i++) | |
24 | fSignalJets[i] = NULL; | |
25 | } | |
0983dd5b | 26 | |
12eb4ac1 | 27 | AliAnalysisTaskChargedJetsPA(const char *name, const char* trackArrayName, const char* jetArrayName, const char* backgroundJetArrayName); |
8628b70c | 28 | virtual ~AliAnalysisTaskChargedJetsPA(); |
29 | virtual void UserCreateOutputObjects(); | |
30 | virtual void UserExec(Option_t *option); | |
392aa819 | 31 | virtual Bool_t UserNotify(); |
8628b70c | 32 | virtual void Terminate(Option_t *); |
efb9b161 | 33 | |
12eb4ac1 | 34 | // ######### SETTERS/GETTERS |
35 | void SetAnalyzeJets(Bool_t val) {fAnalyzeJets = val;} | |
2a82f637 | 36 | void SetAnalyzeJetProfile(Bool_t val) {fAnalyzeJetProfile = val;} |
b95d0245 | 37 | void SetAnalyzeQA(Bool_t val) {fAnalyzeQA = val;} |
12eb4ac1 | 38 | void SetAnalyzeBackground(Bool_t val) {fAnalyzeBackground = val;} |
b95d0245 | 39 | void SetAnalyzeDeprecatedBackgrounds(Bool_t val) {fAnalyzeDeprecatedBackgrounds = val;} |
12eb4ac1 | 40 | void SetAnalyzePythia(Bool_t val) {fAnalyzePythia = val;} |
2a82f637 | 41 | void SetAnalyzeMassCorrelation(Bool_t val) {fAnalyzeMassCorrelation = val;} |
c2b0976c | 42 | void SetAnalyzePartialEvents(Int_t nParts, Int_t index) {fPartialAnalysisNParts = nParts; fPartialAnalysisIndex = index;} |
2a82f637 | 43 | void SetUseDefaultVertexCut (Bool_t val) {fUseDefaultVertexCut = val;} |
392aa819 | 44 | void SetUsePileUpCut (Bool_t val) {fUsePileUpCut = val;} |
9f1e4f53 | 45 | void SetCentralityToOne (Bool_t val) {fSetCentralityToOne = val;} |
fa866fc8 | 46 | void SetNumberOfCentralityBins(Int_t val) {fNumberOfCentralityBins = val;} |
12eb4ac1 | 47 | void SetTrackMinPt(Double_t minPt) {fMinJetPt = minPt;} |
48 | void SetSignalJetMinPt(Double_t minPt) {fMinJetPt = minPt;} | |
49 | void SetSignalJetMinArea(Double_t minArea) {fMinJetArea = minArea;} | |
50 | void SetBackgroundJetMinPt(Double_t minPt) {fMinBackgroundJetPt = minPt;} | |
51 | void SetDijetLeadingMinPt(Double_t minPt) {fMinDijetLeadingPt = minPt;} | |
52 | void SetNumberOfPtHardBins(Int_t count) {fNumPtHardBins = count;} | |
b95d0245 | 53 | void SetUsePtHardBin(Int_t number) {fUsePtHardBin = number;} |
12eb4ac1 | 54 | void SetNumberOfRandConesPerEvent(Int_t count) {fNumberRandCones = count;} |
55 | void SetRandConeRadius(Double_t radius) {fRandConeRadius = radius;} | |
56 | void SetSignalJetRadius(Double_t radius) {fSignalJetRadius = radius;} | |
57 | void SetBackgroundJetRadius(Double_t radius) {fBackgroundJetRadius = radius;} | |
58 | void SetTRBackgroundConeRadius(Double_t radius) {fTRBackgroundConeRadius = radius;} | |
59 | void SetCentralityType(const char* type) {fCentralityType = type;} | |
06b41974 | 60 | void SetExternalRhoTaskName(const char* name) {fRhoTaskName = name;} |
12eb4ac1 | 61 | void SetDijetMaxAngleDeviation(Double_t degrees) {fDijetMaxAngleDeviation = degrees/360.0 * TMath::TwoPi();} // degrees are more comfortable |
06b41974 | 62 | void SetAcceptanceWindows(Double_t trackEta, Double_t signalJetRadius, Double_t bgrdJetRadius){fTrackEtaWindow = trackEta; fSignalJetRadius = signalJetRadius; fBackgroundJetRadius = bgrdJetRadius; fSignalJetEtaWindow = fTrackEtaWindow-fSignalJetRadius; fBackgroundJetEtaWindow = fTrackEtaWindow-fBackgroundJetRadius;} |
12eb4ac1 | 63 | Int_t GetInstanceCounter() {return fTaskInstanceCounter;} |
8628b70c | 64 | |
65 | private: | |
12eb4ac1 | 66 | |
67 | // ######### MAIN CALCULATION FUNCTIONS | |
68 | void GetSignalJets(); | |
69 | Int_t GetLeadingJets(TClonesArray* jetArray, Int_t* jetIDArray, Bool_t isSignalJets); | |
e8df4140 | 70 | Double_t GetCorrectedJetPt(AliEmcalJet* jet, Double_t background); |
c2b0976c | 71 | Double_t GetDeltaPt(Double_t rho, Double_t leadingJetExclusionProbability = 0); |
0cb49d99 | 72 | |
73 | void GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike); | |
74 | void GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS); | |
12eb4ac1 | 75 | |
b95d0245 | 76 | void GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion); |
12eb4ac1 | 77 | void GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular); |
ac9c07e9 | 78 | void GetPPBackgroundDensity(Double_t& background, AliEmcalJet* jet); |
12eb4ac1 | 79 | Double_t GetConePt(Double_t eta, Double_t phi, Double_t radius); |
271cbc5d | 80 | Double_t GetCorrectedConePt(Double_t eta, Double_t phi, Double_t radius, Double_t background); |
12eb4ac1 | 81 | Double_t GetPtHard(); |
392aa819 | 82 | Double_t GetPythiaTrials(); |
12eb4ac1 | 83 | Int_t GetPtHardBin(); |
06b41974 | 84 | Double_t GetExternalRho(); |
85 | ||
12eb4ac1 | 86 | void GetPerpendicularCone(Double_t vecPhi, Double_t vecTheta, Double_t& conePt); |
87 | ||
88 | // ######### CHECK FUNCTIONS | |
89 | Bool_t IsTrackInAcceptance(AliVParticle* track); | |
90 | Bool_t IsTrackInCone(AliVTrack* track, Double_t eta, Double_t phi, Double_t radius); | |
b95d0245 | 91 | Bool_t IsTrackInJet(AliEmcalJet* jet, Int_t trackIndex); |
92 | Bool_t IsJetOverlapping(AliEmcalJet* jet1, AliEmcalJet* jet2); | |
12eb4ac1 | 93 | |
0cb49d99 | 94 | Bool_t IsEventInAcceptance(AliVEvent* event); |
12eb4ac1 | 95 | Bool_t IsBackgroundJetInAcceptance(AliEmcalJet* jet); |
96 | Bool_t IsSignalJetInAcceptance(AliEmcalJet* jet); | |
97 | Bool_t IsDijet(AliEmcalJet* jet1, AliEmcalJet* jet2); | |
8628b70c | 98 | |
12eb4ac1 | 99 | // ######### HELPER FUNCTIONS |
100 | Double_t EtaToTheta(Double_t arg); | |
101 | Double_t ThetaToEta(Double_t arg); | |
102 | Double_t GetDeltaPhi(Double_t phi1, Double_t phi2); | |
103 | Double_t MCGetOverlapCircleRectancle(Double_t cPosX, Double_t cPosY, Double_t cRadius, Double_t rPosXmin, Double_t rPosXmax, Double_t rPosYmin, Double_t rPosYmax); | |
b95d0245 | 104 | Double_t MCGetOverlapMultipleCirclesRectancle(Int_t numCircles, std::vector<Double_t> cPosX, std::vector<Double_t> cPosY, Double_t cRadius, Double_t rPosXmin, Double_t rPosXmax, Double_t rPosYmin, Double_t rPosYmax); |
105 | ||
12eb4ac1 | 106 | |
107 | // ######### HISTOGRAM FUNCTIONS | |
108 | void FillHistogram(const char * key, Double_t x); | |
109 | void FillHistogram(const char * key, Double_t x, Double_t y); | |
110 | void FillHistogram(const char * key, Double_t x, Double_t y, Double_t add); | |
8628b70c | 111 | const char* GetHistoName(const char* name) |
112 | { | |
06b41974 | 113 | if (fIsKinematics) |
7e413f22 | 114 | return Form("%s_MC", name); |
115 | return Form("%s", name); | |
8628b70c | 116 | } |
8628b70c | 117 | template <class T> T* AddHistogram1D(const char* name = "CustomHistogram", const char* title = "NO_TITLE", const char* options = "", Int_t xBins = 100, Double_t xMin = 0.0, Double_t xMax = 20.0, const char* xTitle = "x axis", const char* yTitle = "y axis"); |
8628b70c | 118 | template <class T> T* AddHistogram2D(const char* name = "CustomHistogram", const char* title = "NO_TITLE", const char* options = "", Int_t xBins = 100, Double_t xMin = 0.0, Double_t xMax = 20.0, Int_t yBins = 100, Double_t yMin = 0.0, Double_t yMax = 20.0, const char* xTitle = "x axis", const char* yTitle = "y axis", const char* zTitle = "z axis"); |
119 | ||
12eb4ac1 | 120 | // ######### STANDARD FUNCTIONS |
8628b70c | 121 | void Calculate(AliVEvent* event); |
122 | void ExecOnce(); | |
123 | void Init (); | |
124 | ||
125 | TList* fOutputList; //! Output list | |
12eb4ac1 | 126 | // ########## USAGE TRIGGERS |
8628b70c | 127 | Bool_t fAnalyzeJets; // trigger if jets should be processed |
2a82f637 | 128 | Bool_t fAnalyzeJetProfile; // trigger if jet profile should be analyzed |
b95d0245 | 129 | Bool_t fAnalyzeQA; // trigger if QA should be done |
8628b70c | 130 | Bool_t fAnalyzeBackground; // trigger if background should be processed |
b95d0245 | 131 | Bool_t fAnalyzeDeprecatedBackgrounds; // trigger if old background estimates should be processed |
8628b70c | 132 | Bool_t fAnalyzePythia; // trigger if pythia properties should be processed |
2a82f637 | 133 | Bool_t fAnalyzeMassCorrelation;// trigger if jet pt/constituent mass should be compared |
8628b70c | 134 | Bool_t fHasTracks; // trigger if tracks are actually valid |
8628b70c | 135 | Bool_t fHasJets; // trigger if jets are actually valid |
136 | Bool_t fHasBackgroundJets; // trigger if background is actually valid | |
06b41974 | 137 | Bool_t fIsKinematics; // trigger if data is kinematics only (for naming reasons) |
2a82f637 | 138 | Bool_t fUseDefaultVertexCut; // trigger if automatic vertex cut from helper class should be done |
392aa819 | 139 | Bool_t fUsePileUpCut; // trigger if pileup cut should be done |
9f1e4f53 | 140 | Bool_t fSetCentralityToOne; // trigger if centrality val. should be set to one for every event (failsafe) |
c2b0976c | 141 | Int_t fPartialAnalysisNParts; // take only every Nth event |
142 | Int_t fPartialAnalysisIndex; // using e.g. only every 5th event, this specifies which one | |
143 | ||
12eb4ac1 | 144 | |
8628b70c | 145 | // ########## SOURCE INFORMATION |
146 | TClonesArray* fJetArray; //! object containing the jets | |
147 | TClonesArray* fTrackArray; //! object containing the tracks | |
8628b70c | 148 | TClonesArray* fBackgroundJetArray; //! object containing background jets |
149 | TString* fJetArrayName; // name of object containing the jets | |
150 | TString* fTrackArrayName; // name of object containing the tracks | |
8628b70c | 151 | TString* fBackgroundJetArrayName;// name of object containing event wise bckgrds |
152 | Int_t fNumPtHardBins; // Number of used pt hard bins | |
b95d0245 | 153 | Int_t fUsePtHardBin; // That pt hard bin will be analyzed when not -1 |
06b41974 | 154 | TString fRhoTaskName; // name of rho task for this analysis |
8628b70c | 155 | // ########## JET/DIJET/RC PROPERTIES |
06b41974 | 156 | Double_t fNcoll; // Variable for Ncoll |
8628b70c | 157 | Double_t fRandConeRadius; // Radius for the random cones |
158 | Double_t fSignalJetRadius; // Radius for the signal jets | |
159 | Double_t fBackgroundJetRadius; // Radius for the KT background jets | |
12eb4ac1 | 160 | Double_t fTRBackgroundConeRadius;// Radius for the jets excluded in track background |
8628b70c | 161 | Int_t fNumberRandCones; // Number of random cones to be put into one event |
162 | Int_t fNumberExcludedJets; // Number of jets to be excluded from backgrounds | |
163 | Double_t fDijetMaxAngleDeviation;// Max angle deviation from pi between two jets to be accept. as dijet | |
b95d0245 | 164 | Double_t fPhysicalJetRadius; // Rough size considered for the real jet |
8628b70c | 165 | // ########## CUTS |
166 | Double_t fSignalJetEtaWindow; // +- window in eta for signal jets | |
167 | Double_t fBackgroundJetEtaWindow;// +- window in eta for background jets | |
168 | Double_t fTrackEtaWindow; // +- window in eta for tracks | |
8628b70c | 169 | Double_t fMinTrackPt; // Min track pt to be accepted |
8628b70c | 170 | Double_t fMinJetPt; // Min jet pt to be accepted |
171 | Double_t fMinJetArea; // Min jet area to be accepted | |
172 | Double_t fMinBackgroundJetPt; // Min jet pt to be accepted as background jet | |
173 | Double_t fMinDijetLeadingPt; // Min jet pt to be accepted as constituent of dijet | |
b95d0245 | 174 | Int_t fNumberOfCentralityBins;// Number of centrality bins used for histograms |
12eb4ac1 | 175 | TString fCentralityType; // Used centrality estimate (V0A, V0C, V0M, ...) |
8628b70c | 176 | |
177 | // ########## EVENT PROPERTIES | |
178 | AliEmcalJet* fFirstLeadingJet; //! leading jet in event | |
179 | AliEmcalJet* fSecondLeadingJet; //! next to leading jet in event | |
180 | Int_t fNumberSignalJets; //! Number of signal jets in event | |
181 | AliEmcalJet* fSignalJets[1024]; //! memory for signal jet pointers | |
182 | Double_t fCrossSection; //! value is filled, if pythia header is accessible | |
183 | Double_t fTrials; //! value is filled, if pythia header is accessible | |
184 | ||
185 | // ########## GENERAL VARS | |
186 | TRandom3* fRandom; //! A random number | |
3fa9cde0 | 187 | AliAnalysisUtils* fHelperClass; //! Vertex selection helper |
8628b70c | 188 | Bool_t fInitialized; //! trigger if tracks/jets are loaded |
189 | Int_t fTaskInstanceCounter; // for naming reasons | |
190 | TList* fHistList; // Histogram list | |
191 | Int_t fHistCount; // Histogram count | |
b95d0245 | 192 | Bool_t fIsDEBUG; // Debug trigger |
c2b0976c | 193 | ULong_t fEventCounter; // Internal event counter |
12eb4ac1 | 194 | AliAnalysisTaskChargedJetsPA(const AliAnalysisTaskChargedJetsPA&); |
195 | AliAnalysisTaskChargedJetsPA& operator=(const AliAnalysisTaskChargedJetsPA&); | |
8628b70c | 196 | |
12eb4ac1 | 197 | ClassDef(AliAnalysisTaskChargedJetsPA, 2); // Charged jet analysis for pA |
8628b70c | 198 | |
199 | }; | |
200 | #endif |