]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/analysis/AliFMDAnaParameters.h
8b646d32005f371c24136cb6a1bda262a1c3263d
[u/mrichter/AliRoot.git] / FMD / analysis / AliFMDAnaParameters.h
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"
38 #include "AliFMDAnaCalibBackgroundCorrection.h"
39 #include "AliFMDAnaCalibEnergyDistribution.h"
40 #include <TVector2.h>
41 #include <TString.h>
42 //____________________________________________________________________
43 //
44 //  Singleton class to handle various parameters (not geometry) of the
45 //  FMD
46 //  Should get ata fromm Conditions DB.
47 //
48
49 /**
50  * @ingroup FMD_ana
51  */
52 class AliFMDAnaParameters : public TNamed
53 {
54 public:
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();
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);
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;}
80   TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
81   TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
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;
84   Float_t  GetStripLength(Char_t ring, UShort_t strip)  ;
85   Float_t  GetBaseStripLength(Char_t ring, UShort_t strip)  ;
86   Float_t  GetMaxR(Char_t ring) const;
87   Float_t  GetMinR(Char_t ring) const;
88   void     SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath.Form(bgpath);}
89   void     SetEnergyPath(const Char_t* epath) {fEnergyPath.Form(epath);}
90   
91   
92 protected:
93   
94   AliFMDAnaParameters();
95   
96   AliFMDAnaParameters(const AliFMDAnaParameters& o) 
97     : TNamed(o),
98       fIsInit(o.fIsInit),
99       fBackground(o.fBackground),
100       fEnergyDistribution(o.fEnergyDistribution),
101       fCorner1(o.fCorner1),
102       fCorner2(o.fCorner2),
103       fEnergyPath(o.fEnergyPath),
104       fBackgroundPath(o.fBackgroundPath)
105   {}
106   AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
107   virtual ~AliFMDAnaParameters() {}
108   
109   static AliFMDAnaParameters* fgInstance;   // Static singleton instance
110   
111   //  AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
112   void InitBackground();
113   void InitEnergyDists();
114   TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
115   TObjArray* GetBackgroundArray();
116   
117   TAxis* GetRefAxis();
118   void SetCorners(Char_t ring) ;
119   
120   Bool_t fIsInit;
121   //TObjArray*  fBackgroundArray;
122   // TObjArray*  fEdistArray;
123   AliFMDAnaCalibBackgroundCorrection* fBackground;
124   AliFMDAnaCalibEnergyDistribution* fEnergyDistribution;
125   //static const char* fgkBackgroundCorrection;
126   //static const char* fgkEnergyDists;
127   static const char* fgkBackgroundID;
128   static const char* fgkEnergyDistributionID ;
129   TVector2 fCorner1;
130   TVector2 fCorner2;
131   TString fEnergyPath;
132   TString fBackgroundPath;
133
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