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