]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis/AliFMDAnaParameters.h
Fixed references from PWG2 -> PWGLF - very efficiently done using ETags.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / 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
26 // #include "TFile.h"
27 // #include "TObjArray.h"
28 #include "TH2F.h"
29 #include "TAxis.h"
30 #include "TH1F.h"
31 #include "TH3F.h"
32 #include "AliPhysicsSelection.h"
33 #include <TVector2.h>
34 #include <TString.h>
35 //#include "AliPWG0Helper.h"
36 // #include "AliESDEvent.h"
37 #include "AliInputEventHandler.h"
38 #include "AliAnalysisManager.h"
39 class AliESDEvent;
40 class TObjArray;
41 class AliFMDAnaCalibBackgroundCorrection;
42 class AliFMDAnaCalibEnergyDistribution;
43 class AliFMDAnaCalibEventSelectionEfficiency;
44 class AliFMDAnaCalibSharingEfficiency;
45
46 /**
47  * @ingroup FMD_ana
48  */
49 class AliFMDAnaParameters : public TNamed
50 {
51 public:
52   /** Enumeration of things to initialize */ 
53   enum What { 
54     /** Pulser gain */ 
55     kBackgroundCorrection         = 0x1, // Background Correction 
56     kEnergyDistributions          = 0x2, // Energy Distributions
57     kEventSelectionEfficiency     = 0x4, // Event Selection Efficiency
58     kSharingEfficiency            = 0x8  // Sharing algorithm efficiency
59   };
60   
61   enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR, kNOCTP, kEMPTY , kNSD};
62   
63   enum Energy { k900 , k10000, k14000 , k7000, k2400, k5500, k2750};
64   
65   enum MagField {k0G, k5G, k5Gnegative};
66   
67   enum Species {kPP, kPbPb};
68
69   /** DO NOT USE THIS - ONLY FOR IO */
70   AliFMDAnaParameters();
71   
72   /** Singleton access
73       @return  single to */
74   static AliFMDAnaParameters* Instance();
75   
76   void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions|kEventSelectionEfficiency|kSharingEfficiency);
77   Float_t GetVtxCutZ();
78   Int_t GetNvtxBins();
79   Int_t GetNetaBins();
80   Float_t GetEtaMin();  
81   Float_t GetEtaMax();
82   Int_t GetEtaBin(Float_t eta);
83   Float_t GetMPV(Int_t det, Char_t ring, Float_t eta);
84   Float_t GetConstant(Int_t det, Char_t ring, Float_t eta);
85   Float_t GetSigma(Int_t det, Char_t ring, Float_t eta);
86   Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta);
87   Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta);
88   //static const char* GetBackgroundPath() { return fgkBackgroundCorrection;}
89   // static const char* GetEdistPath()      { return fgkEnergyDists;}
90   static const char* GetBackgroundID() { return fgkBackgroundID;}
91   static const char* GetEdistID()      { return fgkEnergyDistributionID;}
92   static const char* GetEventSelectionEffID()      { return fgkEventSelectionEffID;}
93   static const char* GetSharingEffID()      { return fgkSharingEffID;}
94   TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
95   TH2F* GetBackgroundCorrectionNSD(Int_t det, Char_t ring, Int_t vtxbin);
96   TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
97   TH1F* GetSPDDeadCorrection(Int_t vtxbin);
98   TH1F* GetFMDDeadCorrection(Int_t vtxbin);
99   
100   TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin);
101   TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
102   
103   void     SetParametersFromESD(AliESDEvent* esd);
104   Float_t  GetEventSelectionEfficiency(Int_t vtxbin);
105   TH2F*    GetEventSelectionEfficiency(TString trig, Int_t vtxbin, Char_t ring);
106   Float_t  GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
107   Float_t  GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
108   Float_t  GetStripLength(Char_t ring, UShort_t strip)  ;
109   Float_t  GetBaseStripLength(Char_t ring, UShort_t strip) const  ;
110   Float_t  GetMaxR(Char_t ring) const;
111   Float_t  GetMinR(Char_t ring) const;
112   void     SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath = bgpath;}
113   void     SetEnergyPath(const Char_t* epath) {fEnergyPath = epath;}
114   void     SetEventSelectionPath(const Char_t* evpath) {fEventSelectionEffPath = evpath;}
115   void     SetSharingEfficiencyPath(const Char_t* sharpath) {fSharingEffPath = sharpath;}
116   void     SetInelGtZero(Bool_t InelGtZero) {fInelGtZero = InelGtZero;}
117   void     SetProcessPrimary(Bool_t prim=kTRUE) {fProcessPrimary = prim;}
118   void     SetProcessHits(Bool_t hits=kTRUE) {fProcessHits = hits;}
119   Bool_t   GetProcessPrimary() const {return fProcessPrimary;} 
120   Bool_t   GetProcessHits() const {return fProcessHits;}
121   Bool_t   GetVertex(const AliESDEvent* esd, Double_t* vertexXYZ);
122   void     SetTriggerDefinition(Trigger trigger) {fTrigger = trigger;}
123   Trigger  GetTriggerDefinition() const {return fTrigger;}
124   void     SetRunDndeta(Bool_t rundndeta) { fRunDndeta = rundndeta;  }
125   void     SetRunBFCorrelation(Bool_t runBFcor) { fRunBFCorrelation = runBFcor;  }
126   void     SetRunMultiplicity(Bool_t runMultiplicity) { fRunMultiplicity = runMultiplicity;  }
127   
128   Bool_t   GetRunDndeta() const        {return fRunDndeta;}
129   Bool_t   GetRunBFCorrelation() const {return fRunBFCorrelation;}
130   Bool_t   GetRunMultiplicity() const {return fRunMultiplicity;}
131
132   //Bool_t   IsEventTriggered(const AliESDEvent *esd) ;
133   Bool_t   IsEventTriggered(Trigger trigger) ;
134   void     SetTriggerStatus(const AliESDEvent *esd) ;
135   void     SetEnergy(Energy energy) {fEnergy = energy;}
136   void     SetEnergy(Float_t cmsNNGeV);
137   Energy   GetEnergy() const {return fEnergy;}
138   void     SetMagField(MagField magfield) {fMagField = magfield;}
139   void     SetMagField(Float_t bkG);
140   const char*    GetPath(const char* species) const;
141   void     SetCollisionSystem(Species collsystem) {fSpecies = collsystem;}
142   void     SetCollisionSystem(const TString& collsystem);
143   Species  GetCollisionSystem() const {return fSpecies;}
144   void     PrintStatus(Bool_t showPaths=true)  const;
145   void     Print(Option_t* /* option */) const { PrintStatus(); }
146   const Char_t*  GetDndetaAnalysisName() const {return "PWGLFforwardDnDeta";}
147   TH1F*    GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
148   TH1F*    GetEmptyEnergyDistribution(Int_t det, Char_t ring);
149   TH1F*    GetRingEnergyDistribution(Int_t det, Char_t ring);
150   AliPhysicsSelection* GetPhysicsSelection() const { return fPhysicsSelection ? fPhysicsSelection : (AliPhysicsSelection*)((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetEventSelection();  /*return fPhysicsSelection;*/ }
151   Bool_t   IsRealData() const {return fRealData; }
152   void     SetRealData(Bool_t realdata) {fRealData = realdata;}
153   Float_t  GetLowSPDLimit() const {return fSPDlowLimit;}
154   Float_t  GetHighSPDLimit() const {return fSPDhighLimit;}
155   void     SetLowSPDLimit(Float_t cut) {fSPDlowLimit = cut;}
156   void     SetHighSPDLimit(Float_t cut) {fSPDhighLimit = cut;}
157   void     SetCentralTriggerSelection(Bool_t selection) {fCentralSelection = selection;}
158   Bool_t   SharingEffPresent() const {return fSharingObjectPresent;}
159   Int_t    GetFirstEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ;
160   Int_t    GetLastEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ;
161   void     SetUseInternalNSDTrigger(Bool_t internalNSD) {fUseBuiltInNSD = internalNSD;}
162
163   void     SetNumberOfEtaBinsToCut(Int_t nbins) {fNumberOfEtaBinsToCut = nbins;}
164   Int_t    GetNumberOfEtaBinsToCut() const {return fNumberOfEtaBinsToCut;}
165   Float_t  GetVtxSelectionEffFromMC() ;
166   
167 protected:
168   
169   AliFMDAnaParameters(const AliFMDAnaParameters& o) 
170     : TNamed(o),
171       fIsInit(o.fIsInit),
172       fBackground(o.fBackground),
173       fEnergyDistribution(o.fEnergyDistribution),
174       fEventSelectionEfficiency(o.fEventSelectionEfficiency),
175       fSharingEfficiency(o.fSharingEfficiency),
176       fCorner1(o.fCorner1),
177       fCorner2(o.fCorner2),
178       fEnergyPath(o.fEnergyPath),
179       fBackgroundPath(o.fBackgroundPath),
180       fEventSelectionEffPath(o.fEventSelectionEffPath),
181       fSharingEffPath(o.fSharingEffPath),
182       fProcessPrimary(o.fProcessPrimary),
183       fProcessHits(o.fProcessHits),
184       fTrigger(o.fTrigger),
185       fEnergy(o.fEnergy),
186       fMagField(o.fMagField),
187       fSpecies(o.fSpecies),
188       fPhysicsSelection(o.fPhysicsSelection), 
189       fRealData(o.fRealData),
190       fSPDlowLimit(o.fSPDlowLimit),
191       fSPDhighLimit(o.fSPDhighLimit),   
192       fCentralSelection(o.fCentralSelection),
193       fSharingObjectPresent(o.fSharingObjectPresent),
194       fNumberOfEtaBinsToCut(o.fNumberOfEtaBinsToCut),
195       fEtaLowBinLimits(o.fEtaLowBinLimits),
196       fEtaHighBinLimits(o.fEtaHighBinLimits),
197       fTriggerInel(o.fTriggerInel),
198       fTriggerNSD(o.fTriggerNSD),
199       fTriggerEmpty(o.fTriggerEmpty),
200       fUseBuiltInNSD(o.fUseBuiltInNSD),
201       fInelGtZero(o.fInelGtZero),
202       fRunDndeta(o.fRunDndeta),
203       fRunBFCorrelation(o.fRunBFCorrelation),
204       fRunMultiplicity(o.fRunMultiplicity)
205   {}
206   AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
207   virtual ~AliFMDAnaParameters() {}
208   
209   static AliFMDAnaParameters* fgInstance;   // Static singleton instance
210   
211   //  AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
212   void InitBackground();
213   void InitEnergyDists();
214   void InitEventSelectionEff();
215   void InitSharingEff();
216   
217   void     FindEtaLimits();
218   Int_t    GetFirstEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring) ;
219   Int_t    GetLastEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring) ;
220
221   TObjArray* GetBackgroundArray();
222   
223   TAxis* GetRefAxis();
224   void SetCorners(Char_t ring) ;
225   
226   Bool_t fIsInit;                      //Have we been init ?
227   //TObjArray*  fBackgroundArray;
228   // TObjArray*  fEdistArray;
229   AliFMDAnaCalibBackgroundCorrection*         fBackground;  //BG correction object 
230   AliFMDAnaCalibEnergyDistribution*           fEnergyDistribution; //Energy dist object
231   AliFMDAnaCalibEventSelectionEfficiency*     fEventSelectionEfficiency; //Event selection correction object
232   AliFMDAnaCalibSharingEfficiency*            fSharingEfficiency; //Sharing efficiency correction object
233   //static const char* fgkBackgroundCorrection;
234   //static const char* fgkEnergyDists;
235   static const char* fgkBackgroundID;           // BG cor ID
236   static const char* fgkEnergyDistributionID ;  // Energy dist ID
237   static const char* fgkEventSelectionEffID ;   // Event selection ID
238   static const char* fgkSharingEffID ;          // Sharing efficiency ID  
239   
240   TVector2 fCorner1;                  //First corner of hybrid
241   TVector2 fCorner2;                  //Second corner of hybrid
242   TString  fEnergyPath;               //Path of energy calib
243   TString  fBackgroundPath;           //Path of BG correction
244   TString  fEventSelectionEffPath;    //Path of event selection eff
245   TString  fSharingEffPath;           //Path of sharing eff
246   Bool_t   fProcessPrimary;           //Do we process primary ?
247   Bool_t   fProcessHits;              //Do we process hits ?
248   Trigger  fTrigger;                  //Which trigger are we using ?
249   Energy   fEnergy;                   // CM energy
250   MagField fMagField;                 //Magnetic field
251   Species  fSpecies;                  //PbPb or pp ?
252   AliPhysicsSelection* fPhysicsSelection;  //Physics selection
253   Bool_t   fRealData;                 // real or simulated
254   Float_t  fSPDlowLimit ;             // low limit of SPD tracklets
255   Float_t  fSPDhighLimit ;             // high limit of SPD tracklets
256   Bool_t   fCentralSelection;         //if event selection is done centrally
257   Bool_t   fSharingObjectPresent ;    //Do we have a sharing object ? 
258   Int_t    fNumberOfEtaBinsToCut;     //Number of eta bins to remove from edge effects
259   TH3F     fEtaLowBinLimits;          //Histogram of low eta bin limits
260   TH3F     fEtaHighBinLimits;         //Histogram of high eta bin limits
261   Bool_t   fTriggerInel;              //If the selected INEL trigger fired
262   Bool_t   fTriggerNSD;               //If the NSD trigger fired
263   Bool_t   fTriggerEmpty;             //Event should be empty (empty bunches)
264   Bool_t   fUseBuiltInNSD;            //Should we use the internal NSD trigger by A. Hansen
265   Bool_t   fInelGtZero;               //Should INEL be INEL>0
266   Bool_t   fRunDndeta;                //Run the Dndeta analysis ?
267   Bool_t   fRunBFCorrelation;         //Run the BF correlation analysis ?
268   Bool_t   fRunMultiplicity;          //Run the multiplicity analysis ?
269   
270   ClassDef(AliFMDAnaParameters,1)     // Manager of parameters
271   
272 };
273
274 #endif
275 //____________________________________________________________________
276 //
277 // Local Variables:
278 //   mode: C++
279 // End:
280 //
281 // EOF
282 //
283