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