]>
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 |
c154ba90 | 21 | AliAnalysisTaskChargedJetsPA() : AliAnalysisTaskSE(), fOutputList(0), fAnalyzeJets(1), fAnalyzeQA(1), fAnalyzeBackground(1), fAnalyzeDeprecatedBackgrounds(1), fAnalyzePythia(0), fHasTracks(0), fHasJets(0), fHasBackgroundJets(0), fIsKinematics(0), fUseVertexCut(1), fUsePileUpCut(1), 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(1.0), fMinJetArea(0.5), fMinBackgroundJetPt(0.0), fMinDijetLeadingPt(10.0), fNumberOfCentralityBins(100), 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;} | |
b95d0245 | 36 | void SetAnalyzeQA(Bool_t val) {fAnalyzeQA = val;} |
12eb4ac1 | 37 | void SetAnalyzeBackground(Bool_t val) {fAnalyzeBackground = val;} |
b95d0245 | 38 | void SetAnalyzeDeprecatedBackgrounds(Bool_t val) {fAnalyzeDeprecatedBackgrounds = val;} |
12eb4ac1 | 39 | void SetAnalyzePythia(Bool_t val) {fAnalyzePythia = val;} |
c2b0976c | 40 | void SetAnalyzePartialEvents(Int_t nParts, Int_t index) {fPartialAnalysisNParts = nParts; fPartialAnalysisIndex = index;} |
392aa819 | 41 | void SetUseVertexCut (Bool_t val) {fUseVertexCut = val;} |
42 | void SetUsePileUpCut (Bool_t val) {fUsePileUpCut = val;} | |
12eb4ac1 | 43 | |
44 | void SetTrackMinPt(Double_t minPt) {fMinJetPt = minPt;} | |
45 | void SetSignalJetMinPt(Double_t minPt) {fMinJetPt = minPt;} | |
46 | void SetSignalJetMinArea(Double_t minArea) {fMinJetArea = minArea;} | |
47 | void SetBackgroundJetMinPt(Double_t minPt) {fMinBackgroundJetPt = minPt;} | |
48 | void SetDijetLeadingMinPt(Double_t minPt) {fMinDijetLeadingPt = minPt;} | |
49 | void SetNumberOfPtHardBins(Int_t count) {fNumPtHardBins = count;} | |
b95d0245 | 50 | void SetUsePtHardBin(Int_t number) {fUsePtHardBin = number;} |
12eb4ac1 | 51 | void SetNumberOfRandConesPerEvent(Int_t count) {fNumberRandCones = count;} |
52 | void SetRandConeRadius(Double_t radius) {fRandConeRadius = radius;} | |
53 | void SetSignalJetRadius(Double_t radius) {fSignalJetRadius = radius;} | |
54 | void SetBackgroundJetRadius(Double_t radius) {fBackgroundJetRadius = radius;} | |
55 | void SetTRBackgroundConeRadius(Double_t radius) {fTRBackgroundConeRadius = radius;} | |
56 | void SetCentralityType(const char* type) {fCentralityType = type;} | |
06b41974 | 57 | void SetExternalRhoTaskName(const char* name) {fRhoTaskName = name;} |
12eb4ac1 | 58 | void SetDijetMaxAngleDeviation(Double_t degrees) {fDijetMaxAngleDeviation = degrees/360.0 * TMath::TwoPi();} // degrees are more comfortable |
06b41974 | 59 | void SetAcceptanceWindows(Double_t trackEta, Double_t signalJetRadius, Double_t bgrdJetRadius){fTrackEtaWindow = trackEta; fSignalJetRadius = signalJetRadius; fBackgroundJetRadius = bgrdJetRadius; fSignalJetEtaWindow = fTrackEtaWindow-fSignalJetRadius; fBackgroundJetEtaWindow = fTrackEtaWindow-fBackgroundJetRadius;} |
12eb4ac1 | 60 | Int_t GetInstanceCounter() {return fTaskInstanceCounter;} |
8628b70c | 61 | |
62 | private: | |
12eb4ac1 | 63 | |
64 | // ######### MAIN CALCULATION FUNCTIONS | |
65 | void GetSignalJets(); | |
66 | Int_t GetLeadingJets(TClonesArray* jetArray, Int_t* jetIDArray, Bool_t isSignalJets); | |
e8df4140 | 67 | Double_t GetCorrectedJetPt(AliEmcalJet* jet, Double_t background); |
c2b0976c | 68 | Double_t GetDeltaPt(Double_t rho, Double_t leadingJetExclusionProbability = 0); |
0cb49d99 | 69 | |
70 | void GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike); | |
71 | void GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS); | |
12eb4ac1 | 72 | |
b95d0245 | 73 | void GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion); |
12eb4ac1 | 74 | void GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular); |
75 | Double_t GetConePt(Double_t eta, Double_t phi, Double_t radius); | |
76 | Double_t GetPtHard(); | |
392aa819 | 77 | Double_t GetPythiaTrials(); |
12eb4ac1 | 78 | Int_t GetPtHardBin(); |
06b41974 | 79 | Double_t GetExternalRho(); |
80 | ||
12eb4ac1 | 81 | void GetPerpendicularCone(Double_t vecPhi, Double_t vecTheta, Double_t& conePt); |
82 | ||
83 | // ######### CHECK FUNCTIONS | |
84 | Bool_t IsTrackInAcceptance(AliVParticle* track); | |
85 | Bool_t IsTrackInCone(AliVTrack* track, Double_t eta, Double_t phi, Double_t radius); | |
b95d0245 | 86 | Bool_t IsTrackInJet(AliEmcalJet* jet, Int_t trackIndex); |
87 | Bool_t IsJetOverlapping(AliEmcalJet* jet1, AliEmcalJet* jet2); | |
12eb4ac1 | 88 | |
0cb49d99 | 89 | Bool_t IsEventInAcceptance(AliVEvent* event); |
12eb4ac1 | 90 | Bool_t IsBackgroundJetInAcceptance(AliEmcalJet* jet); |
91 | Bool_t IsSignalJetInAcceptance(AliEmcalJet* jet); | |
92 | Bool_t IsDijet(AliEmcalJet* jet1, AliEmcalJet* jet2); | |
8628b70c | 93 | |
12eb4ac1 | 94 | // ######### HELPER FUNCTIONS |
95 | Double_t EtaToTheta(Double_t arg); | |
96 | Double_t ThetaToEta(Double_t arg); | |
97 | Double_t GetDeltaPhi(Double_t phi1, Double_t phi2); | |
98 | 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 | 99 | 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); |
100 | ||
12eb4ac1 | 101 | |
102 | // ######### HISTOGRAM FUNCTIONS | |
103 | void FillHistogram(const char * key, Double_t x); | |
104 | void FillHistogram(const char * key, Double_t x, Double_t y); | |
105 | void FillHistogram(const char * key, Double_t x, Double_t y, Double_t add); | |
8628b70c | 106 | const char* GetHistoName(const char* name) |
107 | { | |
06b41974 | 108 | if (fIsKinematics) |
8628b70c | 109 | return Form("H%d_%s_MC", fTaskInstanceCounter, name); |
8628b70c | 110 | return Form("H%d_%s", fTaskInstanceCounter, name); |
111 | } | |
8628b70c | 112 | 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 | 113 | 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"); |
114 | ||
12eb4ac1 | 115 | // ######### STANDARD FUNCTIONS |
8628b70c | 116 | void Calculate(AliVEvent* event); |
117 | void ExecOnce(); | |
118 | void Init (); | |
119 | ||
120 | TList* fOutputList; //! Output list | |
12eb4ac1 | 121 | // ########## USAGE TRIGGERS |
8628b70c | 122 | Bool_t fAnalyzeJets; // trigger if jets should be processed |
b95d0245 | 123 | Bool_t fAnalyzeQA; // trigger if QA should be done |
8628b70c | 124 | Bool_t fAnalyzeBackground; // trigger if background should be processed |
b95d0245 | 125 | Bool_t fAnalyzeDeprecatedBackgrounds; // trigger if old background estimates should be processed |
8628b70c | 126 | Bool_t fAnalyzePythia; // trigger if pythia properties should be processed |
127 | Bool_t fHasTracks; // trigger if tracks are actually valid | |
8628b70c | 128 | Bool_t fHasJets; // trigger if jets are actually valid |
129 | Bool_t fHasBackgroundJets; // trigger if background is actually valid | |
06b41974 | 130 | Bool_t fIsKinematics; // trigger if data is kinematics only (for naming reasons) |
392aa819 | 131 | Bool_t fUseVertexCut; // trigger if vertex cut should be done |
132 | Bool_t fUsePileUpCut; // trigger if pileup cut should be done | |
c2b0976c | 133 | Int_t fPartialAnalysisNParts; // take only every Nth event |
134 | Int_t fPartialAnalysisIndex; // using e.g. only every 5th event, this specifies which one | |
135 | ||
12eb4ac1 | 136 | |
8628b70c | 137 | // ########## SOURCE INFORMATION |
138 | TClonesArray* fJetArray; //! object containing the jets | |
139 | TClonesArray* fTrackArray; //! object containing the tracks | |
8628b70c | 140 | TClonesArray* fBackgroundJetArray; //! object containing background jets |
141 | TString* fJetArrayName; // name of object containing the jets | |
142 | TString* fTrackArrayName; // name of object containing the tracks | |
8628b70c | 143 | TString* fBackgroundJetArrayName;// name of object containing event wise bckgrds |
144 | Int_t fNumPtHardBins; // Number of used pt hard bins | |
b95d0245 | 145 | Int_t fUsePtHardBin; // That pt hard bin will be analyzed when not -1 |
06b41974 | 146 | TString fRhoTaskName; // name of rho task for this analysis |
8628b70c | 147 | // ########## JET/DIJET/RC PROPERTIES |
06b41974 | 148 | Double_t fNcoll; // Variable for Ncoll |
8628b70c | 149 | Double_t fRandConeRadius; // Radius for the random cones |
150 | Double_t fSignalJetRadius; // Radius for the signal jets | |
151 | Double_t fBackgroundJetRadius; // Radius for the KT background jets | |
12eb4ac1 | 152 | Double_t fTRBackgroundConeRadius;// Radius for the jets excluded in track background |
8628b70c | 153 | Int_t fNumberRandCones; // Number of random cones to be put into one event |
154 | Int_t fNumberExcludedJets; // Number of jets to be excluded from backgrounds | |
155 | Double_t fDijetMaxAngleDeviation;// Max angle deviation from pi between two jets to be accept. as dijet | |
b95d0245 | 156 | Double_t fPhysicalJetRadius; // Rough size considered for the real jet |
8628b70c | 157 | // ########## CUTS |
158 | Double_t fSignalJetEtaWindow; // +- window in eta for signal jets | |
159 | Double_t fBackgroundJetEtaWindow;// +- window in eta for background jets | |
160 | Double_t fTrackEtaWindow; // +- window in eta for tracks | |
8628b70c | 161 | Double_t fMinTrackPt; // Min track pt to be accepted |
8628b70c | 162 | Double_t fMinJetPt; // Min jet pt to be accepted |
163 | Double_t fMinJetArea; // Min jet area to be accepted | |
164 | Double_t fMinBackgroundJetPt; // Min jet pt to be accepted as background jet | |
165 | Double_t fMinDijetLeadingPt; // Min jet pt to be accepted as constituent of dijet | |
b95d0245 | 166 | Int_t fNumberOfCentralityBins;// Number of centrality bins used for histograms |
12eb4ac1 | 167 | TString fCentralityType; // Used centrality estimate (V0A, V0C, V0M, ...) |
8628b70c | 168 | |
169 | // ########## EVENT PROPERTIES | |
170 | AliEmcalJet* fFirstLeadingJet; //! leading jet in event | |
171 | AliEmcalJet* fSecondLeadingJet; //! next to leading jet in event | |
172 | Int_t fNumberSignalJets; //! Number of signal jets in event | |
173 | AliEmcalJet* fSignalJets[1024]; //! memory for signal jet pointers | |
174 | Double_t fCrossSection; //! value is filled, if pythia header is accessible | |
175 | Double_t fTrials; //! value is filled, if pythia header is accessible | |
176 | ||
177 | // ########## GENERAL VARS | |
178 | TRandom3* fRandom; //! A random number | |
3fa9cde0 | 179 | AliAnalysisUtils* fHelperClass; //! Vertex selection helper |
8628b70c | 180 | Bool_t fInitialized; //! trigger if tracks/jets are loaded |
181 | Int_t fTaskInstanceCounter; // for naming reasons | |
182 | TList* fHistList; // Histogram list | |
183 | Int_t fHistCount; // Histogram count | |
b95d0245 | 184 | Bool_t fIsDEBUG; // Debug trigger |
c2b0976c | 185 | ULong_t fEventCounter; // Internal event counter |
12eb4ac1 | 186 | AliAnalysisTaskChargedJetsPA(const AliAnalysisTaskChargedJetsPA&); |
187 | AliAnalysisTaskChargedJetsPA& operator=(const AliAnalysisTaskChargedJetsPA&); | |
8628b70c | 188 | |
12eb4ac1 | 189 | ClassDef(AliAnalysisTaskChargedJetsPA, 2); // Charged jet analysis for pA |
8628b70c | 190 | |
191 | }; | |
192 | #endif |