Double initialization of fAODObjects corrected.
[u/mrichter/AliRoot.git] / FMD / 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
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"
b82e76e0 38#include "AliFMDAnaCalibBackgroundCorrection.h"
39#include "AliFMDAnaCalibEnergyDistribution.h"
b64db9b1 40#include "AliFMDAnaCalibEventSelectionEfficiency.h"
78f6f750 41#include <TVector2.h>
42#include <TString.h>
9f55be54 43//#include "AliPWG0Helper.h"
b64db9b1 44class AliESDEvent;
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
57 kEventSelectionEfficiency = 0x4 // Event Selection Efficiency
d7346eed 58 };
59
9f55be54 60 enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR };
61
0b0a4ae5 62 enum Energy { k900 , k10000, k14000 };
63
67a2b706 64 enum MagField {k0G, k5G};
65
d7346eed 66 /** Singleton access
67 @return single to */
68 static AliFMDAnaParameters* Instance();
69
b64db9b1 70 void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions|kEventSelectionEfficiency);
d7346eed 71 Float_t GetVtxCutZ();
72 Int_t GetNvtxBins();
5754671c 73 Int_t GetNetaBins();
74 Float_t GetEtaMin();
75 Float_t GetEtaMax();
76 Float_t GetMPV(Int_t det, Char_t ring, Float_t eta);
77 Float_t GetSigma(Int_t det, Char_t ring, Float_t eta);
78 Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta);
79 Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta);
d05586f1 80 //static const char* GetBackgroundPath() { return fgkBackgroundCorrection;}
81 // static const char* GetEdistPath() { return fgkEnergyDists;}
82 static const char* GetBackgroundID() { return fgkBackgroundID;}
83 static const char* GetEdistID() { return fgkEnergyDistributionID;}
b64db9b1 84 static const char* GetEventSelectionEffID() { return fgkEventSelectionEffID;}
d7346eed 85 TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
4fb49e43 86 TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
b64db9b1 87
88 Float_t GetEventSelectionEfficiency(Int_t vtxbin);
d05586f1 89 Float_t GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
90 Float_t GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
78f6f750 91 Float_t GetStripLength(Char_t ring, UShort_t strip) ;
92 Float_t GetBaseStripLength(Char_t ring, UShort_t strip) ;
d05586f1 93 Float_t GetMaxR(Char_t ring) const;
94 Float_t GetMinR(Char_t ring) const;
78f6f750 95 void SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath.Form(bgpath);}
96 void SetEnergyPath(const Char_t* epath) {fEnergyPath.Form(epath);}
b033f0b1 97 void SetEventSelectionPath(const Char_t* evpath) {fEventSelectionEffPath.Form(evpath);}
b64db9b1 98 void SetProcessPrimary(Bool_t prim=kTRUE) {fProcessPrimary = prim;}
99 void SetProcessHits(Bool_t hits=kTRUE) {fProcessHits = hits;}
100 Bool_t GetProcessPrimary() {return fProcessPrimary;}
101 Bool_t GetProcessHits() {return fProcessHits;}
102 void GetVertex(AliESDEvent* esd, Double_t* vertexXYZ);
9f55be54 103 void SetTriggerDefinition(Trigger trigger) {fTrigger = trigger;}
6f76f8b1 104 Trigger GetTriggerDefinition() {return fTrigger;}
b64db9b1 105 Bool_t IsEventTriggered(AliESDEvent* esd);
0b0a4ae5 106 void SetEnergy(Energy energy) {fEnergy = energy;}
67a2b706 107 void SetMagField(MagField magfield) {fMagField = magfield;}
0b0a4ae5 108 char* GetPath(const char* species);
d7346eed 109protected:
110
111 AliFMDAnaParameters();
112
113 AliFMDAnaParameters(const AliFMDAnaParameters& o)
114 : TNamed(o),
115 fIsInit(o.fIsInit),
46807b30 116 fBackground(o.fBackground),
41bad769 117 fEnergyDistribution(o.fEnergyDistribution),
b64db9b1 118 fEventSelectionEfficiency(o.fEventSelectionEfficiency),
41bad769 119 fCorner1(o.fCorner1),
120 fCorner2(o.fCorner2),
121 fEnergyPath(o.fEnergyPath),
b64db9b1 122 fBackgroundPath(o.fBackgroundPath),
9f55be54 123 fEventSelectionEffPath(o.fEventSelectionEffPath),
b64db9b1 124 fProcessPrimary(o.fProcessPrimary),
125 fProcessHits(o.fProcessHits),
0b0a4ae5 126 fTrigger(o.fTrigger),
67a2b706 127 fEnergy(o.fEnergy),
128 fMagField(o.fMagField)
d7346eed 129 {}
130 AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
131 virtual ~AliFMDAnaParameters() {}
132
133 static AliFMDAnaParameters* fgInstance; // Static singleton instance
134
78f6f750 135 // AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
d7346eed 136 void InitBackground();
137 void InitEnergyDists();
b64db9b1 138 void InitEventSelectionEff();
139
5754671c 140 TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
d7346eed 141 TObjArray* GetBackgroundArray();
142
8dc823cc 143 TAxis* GetRefAxis();
78f6f750 144 void SetCorners(Char_t ring) ;
8dc823cc 145
d7346eed 146 Bool_t fIsInit;
46807b30 147 //TObjArray* fBackgroundArray;
148 // TObjArray* fEdistArray;
b64db9b1 149 AliFMDAnaCalibBackgroundCorrection* fBackground;
150 AliFMDAnaCalibEnergyDistribution* fEnergyDistribution;
151 AliFMDAnaCalibEventSelectionEfficiency* fEventSelectionEfficiency;
152
d05586f1 153 //static const char* fgkBackgroundCorrection;
154 //static const char* fgkEnergyDists;
155 static const char* fgkBackgroundID;
156 static const char* fgkEnergyDistributionID ;
b64db9b1 157 static const char* fgkEventSelectionEffID ;
158
78f6f750 159 TVector2 fCorner1;
160 TVector2 fCorner2;
b64db9b1 161 TString fEnergyPath;
162 TString fBackgroundPath;
163 TString fEventSelectionEffPath;
164 Bool_t fProcessPrimary;
165 Bool_t fProcessHits;
9f55be54 166 Trigger fTrigger;
0b0a4ae5 167 Energy fEnergy;
67a2b706 168 MagField fMagField;
9f55be54 169
d7346eed 170 ClassDef(AliFMDAnaParameters,0) // Manager of parameters
171};
172
173#endif
174//____________________________________________________________________
175//
176// Local Variables:
177// mode: C++
178// End:
179//
180// EOF
181//
182