Coding rules
[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
cfe59e45 49/**
50 * @ingroup FMD_ana
51 */
d7346eed 52class AliFMDAnaParameters : public TNamed
53{
54public:
55 /** Enumeration of things to initialize */
56 enum What {
57 /** Pulser gain */
58 kBackgroundCorrection = 0x1, // Background Correction
59 kEnergyDistributions = 0x2 // Energy Distributions
60 };
61
62 /** Singleton access
63 @return single to */
64 static AliFMDAnaParameters* Instance();
65
66 void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions);
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;}
d7346eed 80 TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
4fb49e43 81 TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
d05586f1 82 Float_t GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
83 Float_t GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
78f6f750 84 Float_t GetStripLength(Char_t ring, UShort_t strip) ;
85 Float_t GetBaseStripLength(Char_t ring, UShort_t strip) ;
d05586f1 86 Float_t GetMaxR(Char_t ring) const;
87 Float_t GetMinR(Char_t ring) const;
78f6f750 88 void SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath.Form(bgpath);}
89 void SetEnergyPath(const Char_t* epath) {fEnergyPath.Form(epath);}
90
d05586f1 91
d7346eed 92protected:
93
94 AliFMDAnaParameters();
95
96 AliFMDAnaParameters(const AliFMDAnaParameters& o)
97 : TNamed(o),
98 fIsInit(o.fIsInit),
46807b30 99 fBackground(o.fBackground),
41bad769 100 fEnergyDistribution(o.fEnergyDistribution),
101 fCorner1(o.fCorner1),
102 fCorner2(o.fCorner2),
103 fEnergyPath(o.fEnergyPath),
104 fBackgroundPath(o.fBackgroundPath)
d7346eed 105 {}
106 AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
107 virtual ~AliFMDAnaParameters() {}
108
109 static AliFMDAnaParameters* fgInstance; // Static singleton instance
110
78f6f750 111 // AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
d7346eed 112 void InitBackground();
113 void InitEnergyDists();
5754671c 114 TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
d7346eed 115 TObjArray* GetBackgroundArray();
116
8dc823cc 117 TAxis* GetRefAxis();
78f6f750 118 void SetCorners(Char_t ring) ;
8dc823cc 119
d7346eed 120 Bool_t fIsInit;
46807b30 121 //TObjArray* fBackgroundArray;
122 // TObjArray* fEdistArray;
b82e76e0 123 AliFMDAnaCalibBackgroundCorrection* fBackground;
124 AliFMDAnaCalibEnergyDistribution* fEnergyDistribution;
d05586f1 125 //static const char* fgkBackgroundCorrection;
126 //static const char* fgkEnergyDists;
127 static const char* fgkBackgroundID;
128 static const char* fgkEnergyDistributionID ;
78f6f750 129 TVector2 fCorner1;
130 TVector2 fCorner2;
131 TString fEnergyPath;
132 TString fBackgroundPath;
133
d7346eed 134 ClassDef(AliFMDAnaParameters,0) // Manager of parameters
135};
136
137#endif
138//____________________________________________________________________
139//
140// Local Variables:
141// mode: C++
142// End:
143//
144// EOF
145//
146