]>
Commit | Line | Data |
---|---|---|
d7346eed | 1 | #ifndef ALIFMDANAPARAMETERS_H |
2 | #define ALIFMDANAPARAMETERS_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
4 | * reserved. | |
5 | * | |
6 | * Latest changes by Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch | |
7 | * | |
8 | * See cxx source for full Copyright notice | |
9 | */ | |
10 | // | |
11 | //The design of this class is based on the AliFMDParameters class. Its purpose | |
12 | //is to hold parameters for the analysis such as background correction and | |
13 | //fit functions. | |
14 | // | |
15 | //Author: Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch | |
16 | // | |
17 | //____________________________________________________________________ | |
18 | ||
19 | #ifndef ROOT_TNamed | |
20 | # include <TNamed.h> | |
21 | #endif | |
22 | #ifndef ROOT_TArrayI | |
23 | # include <TArrayI.h> | |
24 | #endif | |
25 | #ifndef ALIFMDUSHORTMAP_H | |
26 | # include <AliFMDUShortMap.h> | |
27 | #endif | |
28 | #ifndef ALIFMDBOOLMAP_H | |
29 | # include <AliFMDBoolMap.h> | |
30 | #endif | |
31 | #include "AliCDBEntry.h" | |
32 | ||
33 | #include "TFile.h" | |
34 | #include "TObjArray.h" | |
35 | #include "TH2F.h" | |
36 | #include "TAxis.h" | |
37 | #include "TH1F.h" | |
ff293341 | 38 | #include "TH3F.h" |
b82e76e0 | 39 | #include "AliFMDAnaCalibBackgroundCorrection.h" |
40 | #include "AliFMDAnaCalibEnergyDistribution.h" | |
b64db9b1 | 41 | #include "AliFMDAnaCalibEventSelectionEfficiency.h" |
7e2bf482 | 42 | #include "AliFMDAnaCalibSharingEfficiency.h" |
5a79fd59 | 43 | #include "AliPhysicsSelection.h" |
78f6f750 | 44 | #include <TVector2.h> |
45 | #include <TString.h> | |
9f55be54 | 46 | //#include "AliPWG0Helper.h" |
5a79fd59 | 47 | #include "AliESDEvent.h" |
507687cd | 48 | #include "AliInputEventHandler.h" |
49 | #include "AliAnalysisManager.h" | |
5a79fd59 | 50 | //class AliESDEvent; |
d7346eed | 51 | |
cfe59e45 | 52 | /** |
53 | * @ingroup FMD_ana | |
54 | */ | |
d7346eed | 55 | class AliFMDAnaParameters : public TNamed |
56 | { | |
57 | public: | |
58 | /** Enumeration of things to initialize */ | |
59 | enum What { | |
60 | /** Pulser gain */ | |
b64db9b1 | 61 | kBackgroundCorrection = 0x1, // Background Correction |
62 | kEnergyDistributions = 0x2, // Energy Distributions | |
7e2bf482 | 63 | kEventSelectionEfficiency = 0x4, // Event Selection Efficiency |
64 | kSharingEfficiency = 0x8 // Sharing algorithm efficiency | |
d7346eed | 65 | }; |
66 | ||
059c7c6b | 67 | enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR, kNOCTP, kEMPTY , kNSD}; |
9f55be54 | 68 | |
70d74659 | 69 | enum Energy { k900 , k10000, k14000 , k7000, k2400, k5500}; |
0b0a4ae5 | 70 | |
67a2b706 | 71 | enum MagField {k0G, k5G}; |
72 | ||
01622a51 | 73 | enum Species {kPP, kPbPb}; |
85da855f | 74 | |
75 | /** DO NOT USE THIS - ONLY FOR IO */ | |
76 | AliFMDAnaParameters(); | |
01622a51 | 77 | |
d7346eed | 78 | /** Singleton access |
79 | @return single to */ | |
80 | static AliFMDAnaParameters* Instance(); | |
81 | ||
7e2bf482 | 82 | void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions|kEventSelectionEfficiency|kSharingEfficiency); |
d7346eed | 83 | Float_t GetVtxCutZ(); |
84 | Int_t GetNvtxBins(); | |
5754671c | 85 | Int_t GetNetaBins(); |
86 | Float_t GetEtaMin(); | |
87 | Float_t GetEtaMax(); | |
5a79fd59 | 88 | Int_t GetEtaBin(Float_t eta); |
5754671c | 89 | Float_t GetMPV(Int_t det, Char_t ring, Float_t eta); |
5a79fd59 | 90 | Float_t GetConstant(Int_t det, Char_t ring, Float_t eta); |
5754671c | 91 | Float_t GetSigma(Int_t det, Char_t ring, Float_t eta); |
92 | Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta); | |
93 | Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta); | |
d05586f1 | 94 | //static const char* GetBackgroundPath() { return fgkBackgroundCorrection;} |
95 | // static const char* GetEdistPath() { return fgkEnergyDists;} | |
96 | static const char* GetBackgroundID() { return fgkBackgroundID;} | |
97 | static const char* GetEdistID() { return fgkEnergyDistributionID;} | |
b64db9b1 | 98 | static const char* GetEventSelectionEffID() { return fgkEventSelectionEffID;} |
7e2bf482 | 99 | static const char* GetSharingEffID() { return fgkSharingEffID;} |
d7346eed | 100 | TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin); |
507687cd | 101 | TH2F* GetBackgroundCorrectionNSD(Int_t det, Char_t ring, Int_t vtxbin); |
4fb49e43 | 102 | TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring); |
04f1ff3d | 103 | TH1F* GetSPDDeadCorrection(Int_t vtxbin); |
b64db9b1 | 104 | |
7e2bf482 | 105 | TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin); |
25f47050 | 106 | TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin); |
7e2bf482 | 107 | Float_t GetEventSelectionEfficiency(Int_t vtxbin); |
059c7c6b | 108 | TH2F* GetEventSelectionEfficiency(Char_t* trig, Int_t vtxbin, Char_t ring); |
7e2bf482 | 109 | Float_t GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const; |
110 | Float_t GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const; | |
78f6f750 | 111 | Float_t GetStripLength(Char_t ring, UShort_t strip) ; |
112 | Float_t GetBaseStripLength(Char_t ring, UShort_t strip) ; | |
d05586f1 | 113 | Float_t GetMaxR(Char_t ring) const; |
114 | Float_t GetMinR(Char_t ring) const; | |
541c19ed | 115 | void SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath = bgpath;} |
116 | void SetEnergyPath(const Char_t* epath) {fEnergyPath = epath;} | |
117 | void SetEventSelectionPath(const Char_t* evpath) {fEventSelectionEffPath = evpath;} | |
118 | void SetSharingEfficiencyPath(const Char_t* sharpath) {fSharingEffPath = sharpath;} | |
507687cd | 119 | void SetInelGtZero(Bool_t InelGtZero) {fInelGtZero = InelGtZero;} |
b64db9b1 | 120 | void SetProcessPrimary(Bool_t prim=kTRUE) {fProcessPrimary = prim;} |
121 | void SetProcessHits(Bool_t hits=kTRUE) {fProcessHits = hits;} | |
50a0adf8 | 122 | Bool_t GetProcessPrimary() const {return fProcessPrimary;} |
123 | Bool_t GetProcessHits() const {return fProcessHits;} | |
a91555b9 | 124 | Bool_t GetVertex(const AliESDEvent* esd, Double_t* vertexXYZ); |
9f55be54 | 125 | void SetTriggerDefinition(Trigger trigger) {fTrigger = trigger;} |
50a0adf8 | 126 | Trigger GetTriggerDefinition() const {return fTrigger;} |
059c7c6b | 127 | //Bool_t IsEventTriggered(const AliESDEvent *esd) ; |
128 | Bool_t IsEventTriggered(Trigger trigger) ; | |
129 | void SetTriggerStatus(const AliESDEvent *esd) ; | |
0b0a4ae5 | 130 | void SetEnergy(Energy energy) {fEnergy = energy;} |
04f1ff3d | 131 | Energy GetEnergy() {return fEnergy;} |
67a2b706 | 132 | void SetMagField(MagField magfield) {fMagField = magfield;} |
0b0a4ae5 | 133 | char* GetPath(const char* species); |
f6b21230 | 134 | void SetCollisionSystem(Species collsystem) {fSpecies = collsystem;} |
70d74659 | 135 | Species GetCollisionSystem() const {return fSpecies;} |
85da855f | 136 | void PrintStatus() const; |
137 | void Print(Option_t* /* option */) const { PrintStatus(); } | |
507687cd | 138 | const Char_t* GetDndetaAnalysisName() const {return "PWG2forwardDnDeta";} |
5a79fd59 | 139 | TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta); |
140 | TH1F* GetEmptyEnergyDistribution(Int_t det, Char_t ring); | |
141 | TH1F* GetRingEnergyDistribution(Int_t det, Char_t ring); | |
507687cd | 142 | AliPhysicsSelection* GetPhysicsSelection() const { return fPhysicsSelection ? fPhysicsSelection : (AliPhysicsSelection*)((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetEventSelection(); /*return fPhysicsSelection;*/ } |
aa303f0c | 143 | Bool_t IsRealData() const {return fRealData; } |
5a79fd59 | 144 | void SetRealData(Bool_t realdata) {fRealData = realdata;} |
aa303f0c | 145 | Float_t GetLowSPDLimit() const {return fSPDlowLimit;} |
146 | Float_t GetHighSPDLimit() const {return fSPDhighLimit;} | |
5a79fd59 | 147 | void SetLowSPDLimit(Float_t cut) {fSPDlowLimit = cut;} |
148 | void SetHighSPDLimit(Float_t cut) {fSPDhighLimit = cut;} | |
02a4ce29 | 149 | void SetCentralTriggerSelection(Bool_t selection) {fCentralSelection = selection;} |
70d74659 | 150 | Bool_t SharingEffPresent() {return fSharingObjectPresent;} |
ff293341 | 151 | Int_t GetFirstEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ; |
152 | Int_t GetLastEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ; | |
541c19ed | 153 | void SetUseInternalNSDTrigger(Bool_t internalNSD) {fUseBuiltInNSD = internalNSD;} |
ff293341 | 154 | |
155 | void SetNumberOfEtaBinsToCut(Int_t nbins) {fNumberOfEtaBinsToCut = nbins;} | |
156 | Int_t GetNumberOfEtaBinsToCut() const {return fNumberOfEtaBinsToCut;} | |
daedf077 | 157 | Float_t GetVtxSelectionEffFromMC() ; |
ff293341 | 158 | |
d7346eed | 159 | protected: |
160 | ||
d7346eed | 161 | AliFMDAnaParameters(const AliFMDAnaParameters& o) |
162 | : TNamed(o), | |
163 | fIsInit(o.fIsInit), | |
46807b30 | 164 | fBackground(o.fBackground), |
41bad769 | 165 | fEnergyDistribution(o.fEnergyDistribution), |
b64db9b1 | 166 | fEventSelectionEfficiency(o.fEventSelectionEfficiency), |
7e2bf482 | 167 | fSharingEfficiency(o.fSharingEfficiency), |
41bad769 | 168 | fCorner1(o.fCorner1), |
169 | fCorner2(o.fCorner2), | |
170 | fEnergyPath(o.fEnergyPath), | |
b64db9b1 | 171 | fBackgroundPath(o.fBackgroundPath), |
9f55be54 | 172 | fEventSelectionEffPath(o.fEventSelectionEffPath), |
7e2bf482 | 173 | fSharingEffPath(o.fSharingEffPath), |
b64db9b1 | 174 | fProcessPrimary(o.fProcessPrimary), |
175 | fProcessHits(o.fProcessHits), | |
0b0a4ae5 | 176 | fTrigger(o.fTrigger), |
67a2b706 | 177 | fEnergy(o.fEnergy), |
01622a51 | 178 | fMagField(o.fMagField), |
02a4ce29 | 179 | fSpecies(o.fSpecies), |
5a79fd59 | 180 | fPhysicsSelection(o.fPhysicsSelection), |
181 | fRealData(o.fRealData), | |
182 | fSPDlowLimit(o.fSPDlowLimit), | |
183 | fSPDhighLimit(o.fSPDhighLimit), | |
70d74659 | 184 | fCentralSelection(o.fCentralSelection), |
ff293341 | 185 | fSharingObjectPresent(o.fSharingObjectPresent), |
1a7dad8a | 186 | fNumberOfEtaBinsToCut(o.fNumberOfEtaBinsToCut), |
187 | fEtaLowBinLimits(o.fEtaLowBinLimits), | |
059c7c6b | 188 | fEtaHighBinLimits(o.fEtaHighBinLimits), |
189 | fTriggerInel(o.fTriggerInel), | |
190 | fTriggerNSD(o.fTriggerNSD), | |
507687cd | 191 | fTriggerEmpty(o.fTriggerEmpty), |
192 | fUseBuiltInNSD(o.fUseBuiltInNSD), | |
193 | fInelGtZero(o.fInelGtZero) | |
d7346eed | 194 | {} |
195 | AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; } | |
196 | virtual ~AliFMDAnaParameters() {} | |
197 | ||
198 | static AliFMDAnaParameters* fgInstance; // Static singleton instance | |
199 | ||
78f6f750 | 200 | // AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ; |
d7346eed | 201 | void InitBackground(); |
202 | void InitEnergyDists(); | |
b64db9b1 | 203 | void InitEventSelectionEff(); |
7e2bf482 | 204 | void InitSharingEff(); |
b64db9b1 | 205 | |
ff293341 | 206 | void FindEtaLimits(); |
207 | Int_t GetFirstEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring) ; | |
208 | Int_t GetLastEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring) ; | |
5a79fd59 | 209 | |
d7346eed | 210 | TObjArray* GetBackgroundArray(); |
211 | ||
8dc823cc | 212 | TAxis* GetRefAxis(); |
78f6f750 | 213 | void SetCorners(Char_t ring) ; |
8dc823cc | 214 | |
50a0adf8 | 215 | Bool_t fIsInit; //Have we been init ? |
46807b30 | 216 | //TObjArray* fBackgroundArray; |
217 | // TObjArray* fEdistArray; | |
aa303f0c | 218 | AliFMDAnaCalibBackgroundCorrection* fBackground; //BG correction object |
219 | AliFMDAnaCalibEnergyDistribution* fEnergyDistribution; //Energy dist object | |
220 | AliFMDAnaCalibEventSelectionEfficiency* fEventSelectionEfficiency; //Event selection correction object | |
221 | AliFMDAnaCalibSharingEfficiency* fSharingEfficiency; //Sharing efficiency correction object | |
d05586f1 | 222 | //static const char* fgkBackgroundCorrection; |
223 | //static const char* fgkEnergyDists; | |
aa303f0c | 224 | static const char* fgkBackgroundID; // BG cor ID |
225 | static const char* fgkEnergyDistributionID ; // Energy dist ID | |
226 | static const char* fgkEventSelectionEffID ; // Event selection ID | |
227 | static const char* fgkSharingEffID ; // Sharing efficiency ID | |
b64db9b1 | 228 | |
50a0adf8 | 229 | TVector2 fCorner1; //First corner of hybrid |
230 | TVector2 fCorner2; //Second corner of hybrid | |
231 | TString fEnergyPath; //Path of energy calib | |
232 | TString fBackgroundPath; //Path of BG correction | |
233 | TString fEventSelectionEffPath; //Path of event selection eff | |
234 | TString fSharingEffPath; //Path of sharing eff | |
235 | Bool_t fProcessPrimary; //Do we process primary ? | |
236 | Bool_t fProcessHits; //Do we process hits ? | |
237 | Trigger fTrigger; //Which trigger are we using ? | |
238 | Energy fEnergy; // CM energy | |
239 | MagField fMagField; //Magnetic field | |
240 | Species fSpecies; //PbPb or pp ? | |
aa303f0c | 241 | AliPhysicsSelection* fPhysicsSelection; //Physics selection |
5a79fd59 | 242 | Bool_t fRealData; // real or simulated |
243 | Float_t fSPDlowLimit ; // low limit of SPD tracklets | |
244 | Float_t fSPDhighLimit ; // high limit of SPD tracklets | |
275a26aa | 245 | Bool_t fCentralSelection; //if event selection is done centrally |
70d74659 | 246 | Bool_t fSharingObjectPresent ; //Do we have a sharing object ? |
ff293341 | 247 | Int_t fNumberOfEtaBinsToCut; //Number of eta bins to remove from edge effects |
059c7c6b | 248 | TH3F fEtaLowBinLimits; //Histogram of low eta bin limits |
249 | TH3F fEtaHighBinLimits; //Histogram of high eta bin limits | |
250 | Bool_t fTriggerInel; //If the selected INEL trigger fired | |
251 | Bool_t fTriggerNSD; //If the NSD trigger fired | |
252 | Bool_t fTriggerEmpty; //Event should be empty (empty bunches) | |
541c19ed | 253 | Bool_t fUseBuiltInNSD; //Should we use the internal NSD trigger by A. Hansen |
507687cd | 254 | Bool_t fInelGtZero; //Should INEL be INEL>0 |
d8e9ec25 | 255 | ClassDef(AliFMDAnaParameters,1) // Manager of parameters |
d7346eed | 256 | }; |
257 | ||
258 | #endif | |
259 | //____________________________________________________________________ | |
260 | // | |
261 | // Local Variables: | |
262 | // mode: C++ | |
263 | // End: | |
264 | // | |
265 | // EOF | |
266 | // | |
267 |