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