Protection against division by zero.
[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"
78f6f750 40#include <TVector2.h>
41#include <TString.h>
d7346eed 42//____________________________________________________________________
43//
44// Singleton class to handle various parameters (not geometry) of the
45// FMD
46// Should get ata fromm Conditions DB.
47//
48
49class AliFMDAnaParameters : public TNamed
50{
51public:
52 /** Enumeration of things to initialize */
53 enum What {
54 /** Pulser gain */
55 kBackgroundCorrection = 0x1, // Background Correction
56 kEnergyDistributions = 0x2 // Energy Distributions
57 };
58
59 /** Singleton access
60 @return single to */
61 static AliFMDAnaParameters* Instance();
62
63 void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions);
64 Float_t GetVtxCutZ();
65 Int_t GetNvtxBins();
5754671c 66 Int_t GetNetaBins();
67 Float_t GetEtaMin();
68 Float_t GetEtaMax();
69 Float_t GetMPV(Int_t det, Char_t ring, Float_t eta);
70 Float_t GetSigma(Int_t det, Char_t ring, Float_t eta);
71 Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta);
72 Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta);
d7346eed 73 static const char* GetBackgroundPath() { return fgkBackgroundCorrection;}
74 static const char* GetEdistPath() { return fgkEnergyDists;}
75 TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
4fb49e43 76 TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
f58a4769 77 Float_t GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec);
78 Float_t GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx);
78f6f750 79 Float_t GetStripLength(Char_t ring, UShort_t strip) ;
80 Float_t GetBaseStripLength(Char_t ring, UShort_t strip) ;
81 Float_t GetMaxR(Char_t ring) ;
82 Float_t GetMinR(Char_t ring) ;
83 void SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath.Form(bgpath);}
84 void SetEnergyPath(const Char_t* epath) {fEnergyPath.Form(epath);}
85
86 static const char* fkBackgroundID;
87 static const char* fkEnergyDistributionID ;
d7346eed 88protected:
89
90 AliFMDAnaParameters();
91
92 AliFMDAnaParameters(const AliFMDAnaParameters& o)
93 : TNamed(o),
94 fIsInit(o.fIsInit),
46807b30 95 fBackground(o.fBackground),
41bad769 96 fEnergyDistribution(o.fEnergyDistribution),
97 fCorner1(o.fCorner1),
98 fCorner2(o.fCorner2),
99 fEnergyPath(o.fEnergyPath),
100 fBackgroundPath(o.fBackgroundPath)
d7346eed 101 {}
102 AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
103 virtual ~AliFMDAnaParameters() {}
104
105 static AliFMDAnaParameters* fgInstance; // Static singleton instance
106
78f6f750 107 // AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
d7346eed 108 void InitBackground();
109 void InitEnergyDists();
5754671c 110 TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
d7346eed 111 TObjArray* GetBackgroundArray();
112
8dc823cc 113 TAxis* GetRefAxis();
78f6f750 114 void SetCorners(Char_t ring) ;
8dc823cc 115
d7346eed 116 Bool_t fIsInit;
46807b30 117 //TObjArray* fBackgroundArray;
118 // TObjArray* fEdistArray;
b82e76e0 119 AliFMDAnaCalibBackgroundCorrection* fBackground;
120 AliFMDAnaCalibEnergyDistribution* fEnergyDistribution;
d7346eed 121 static const char* fgkBackgroundCorrection;
122 static const char* fgkEnergyDists;
78f6f750 123
124 TVector2 fCorner1;
125 TVector2 fCorner2;
126 TString fEnergyPath;
127 TString fBackgroundPath;
128
d7346eed 129 ClassDef(AliFMDAnaParameters,0) // Manager of parameters
130};
131
132#endif
133//____________________________________________________________________
134//
135// Local Variables:
136// mode: C++
137// End:
138//
139// EOF
140//
141