]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis/AliFMDAnaParameters.h
Fix from Yves, if fitting is not good, recalculate from parabola; reject bad channels...
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / 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"
7e2bf482 41#include "AliFMDAnaCalibSharingEfficiency.h"
78f6f750 42#include <TVector2.h>
43#include <TString.h>
9f55be54 44//#include "AliPWG0Helper.h"
b64db9b1 45class AliESDEvent;
d7346eed 46
cfe59e45 47/**
48 * @ingroup FMD_ana
49 */
d7346eed 50class AliFMDAnaParameters : public TNamed
51{
52public:
53 /** Enumeration of things to initialize */
54 enum What {
55 /** Pulser gain */
b64db9b1 56 kBackgroundCorrection = 0x1, // Background Correction
57 kEnergyDistributions = 0x2, // Energy Distributions
7e2bf482 58 kEventSelectionEfficiency = 0x4, // Event Selection Efficiency
59 kSharingEfficiency = 0x8 // Sharing algorithm efficiency
d7346eed 60 };
61
50a0adf8 62 enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR, kNOCTP };
9f55be54 63
09507589 64 enum Energy { k900 , k10000, k14000 , k7000, k2400};
0b0a4ae5 65
67a2b706 66 enum MagField {k0G, k5G};
67
01622a51 68 enum Species {kPP, kPbPb};
85da855f 69
70 /** DO NOT USE THIS - ONLY FOR IO */
71 AliFMDAnaParameters();
01622a51 72
d7346eed 73 /** Singleton access
74 @return single to */
75 static AliFMDAnaParameters* Instance();
76
7e2bf482 77 void Init(Bool_t forceReInit=kTRUE, UInt_t what=kBackgroundCorrection|kEnergyDistributions|kEventSelectionEfficiency|kSharingEfficiency);
d7346eed 78 Float_t GetVtxCutZ();
79 Int_t GetNvtxBins();
5754671c 80 Int_t GetNetaBins();
81 Float_t GetEtaMin();
82 Float_t GetEtaMax();
83 Float_t GetMPV(Int_t det, Char_t ring, Float_t eta);
84 Float_t GetSigma(Int_t det, Char_t ring, Float_t eta);
85 Float_t Get2MIPWeight(Int_t det, Char_t ring, Float_t eta);
86 Float_t Get3MIPWeight(Int_t det, Char_t ring, Float_t eta);
d05586f1 87 //static const char* GetBackgroundPath() { return fgkBackgroundCorrection;}
88 // static const char* GetEdistPath() { return fgkEnergyDists;}
89 static const char* GetBackgroundID() { return fgkBackgroundID;}
90 static const char* GetEdistID() { return fgkEnergyDistributionID;}
b64db9b1 91 static const char* GetEventSelectionEffID() { return fgkEventSelectionEffID;}
7e2bf482 92 static const char* GetSharingEffID() { return fgkSharingEffID;}
d7346eed 93 TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
4fb49e43 94 TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
b64db9b1 95
7e2bf482 96 TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin);
25f47050 97 TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
7e2bf482 98 Float_t GetEventSelectionEfficiency(Int_t vtxbin);
99 Float_t GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
100 Float_t GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
78f6f750 101 Float_t GetStripLength(Char_t ring, UShort_t strip) ;
102 Float_t GetBaseStripLength(Char_t ring, UShort_t strip) ;
d05586f1 103 Float_t GetMaxR(Char_t ring) const;
104 Float_t GetMinR(Char_t ring) const;
78f6f750 105 void SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath.Form(bgpath);}
106 void SetEnergyPath(const Char_t* epath) {fEnergyPath.Form(epath);}
b033f0b1 107 void SetEventSelectionPath(const Char_t* evpath) {fEventSelectionEffPath.Form(evpath);}
7e2bf482 108 void SetSharingEfficiencyPath(const Char_t* sharpath) {fSharingEffPath.Form(sharpath);}
b64db9b1 109 void SetProcessPrimary(Bool_t prim=kTRUE) {fProcessPrimary = prim;}
110 void SetProcessHits(Bool_t hits=kTRUE) {fProcessHits = hits;}
50a0adf8 111 Bool_t GetProcessPrimary() const {return fProcessPrimary;}
112 Bool_t GetProcessHits() const {return fProcessHits;}
f55d559b 113 Bool_t GetVertex(AliESDEvent* esd, Double_t* vertexXYZ);
9f55be54 114 void SetTriggerDefinition(Trigger trigger) {fTrigger = trigger;}
50a0adf8 115 Trigger GetTriggerDefinition() const {return fTrigger;}
116 Bool_t IsEventTriggered(AliESDEvent* esd) const;
0b0a4ae5 117 void SetEnergy(Energy energy) {fEnergy = energy;}
67a2b706 118 void SetMagField(MagField magfield) {fMagField = magfield;}
0b0a4ae5 119 char* GetPath(const char* species);
f6b21230 120 void SetCollisionSystem(Species collsystem) {fSpecies = collsystem;}
85da855f 121 void PrintStatus() const;
122 void Print(Option_t* /* option */) const { PrintStatus(); }
12065523 123 char* GetDndetaAnalysisName() {return "PWG2forwardDnDeta";}
707ec2bd 124
d7346eed 125protected:
126
d7346eed 127 AliFMDAnaParameters(const AliFMDAnaParameters& o)
128 : TNamed(o),
129 fIsInit(o.fIsInit),
46807b30 130 fBackground(o.fBackground),
41bad769 131 fEnergyDistribution(o.fEnergyDistribution),
b64db9b1 132 fEventSelectionEfficiency(o.fEventSelectionEfficiency),
7e2bf482 133 fSharingEfficiency(o.fSharingEfficiency),
41bad769 134 fCorner1(o.fCorner1),
135 fCorner2(o.fCorner2),
136 fEnergyPath(o.fEnergyPath),
b64db9b1 137 fBackgroundPath(o.fBackgroundPath),
9f55be54 138 fEventSelectionEffPath(o.fEventSelectionEffPath),
7e2bf482 139 fSharingEffPath(o.fSharingEffPath),
b64db9b1 140 fProcessPrimary(o.fProcessPrimary),
141 fProcessHits(o.fProcessHits),
0b0a4ae5 142 fTrigger(o.fTrigger),
67a2b706 143 fEnergy(o.fEnergy),
01622a51 144 fMagField(o.fMagField),
145 fSpecies(o.fSpecies)
d7346eed 146 {}
147 AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
148 virtual ~AliFMDAnaParameters() {}
149
150 static AliFMDAnaParameters* fgInstance; // Static singleton instance
151
78f6f750 152 // AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
d7346eed 153 void InitBackground();
154 void InitEnergyDists();
b64db9b1 155 void InitEventSelectionEff();
7e2bf482 156 void InitSharingEff();
b64db9b1 157
5754671c 158 TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
d7346eed 159 TObjArray* GetBackgroundArray();
160
8dc823cc 161 TAxis* GetRefAxis();
78f6f750 162 void SetCorners(Char_t ring) ;
8dc823cc 163
50a0adf8 164 Bool_t fIsInit; //Have we been init ?
46807b30 165 //TObjArray* fBackgroundArray;
166 // TObjArray* fEdistArray;
50a0adf8 167 AliFMDAnaCalibBackgroundCorrection* fBackground;
b64db9b1 168 AliFMDAnaCalibEnergyDistribution* fEnergyDistribution;
169 AliFMDAnaCalibEventSelectionEfficiency* fEventSelectionEfficiency;
7e2bf482 170 AliFMDAnaCalibSharingEfficiency* fSharingEfficiency;
d05586f1 171 //static const char* fgkBackgroundCorrection;
172 //static const char* fgkEnergyDists;
173 static const char* fgkBackgroundID;
174 static const char* fgkEnergyDistributionID ;
b64db9b1 175 static const char* fgkEventSelectionEffID ;
7e2bf482 176 static const char* fgkSharingEffID ;
b64db9b1 177
50a0adf8 178 TVector2 fCorner1; //First corner of hybrid
179 TVector2 fCorner2; //Second corner of hybrid
180 TString fEnergyPath; //Path of energy calib
181 TString fBackgroundPath; //Path of BG correction
182 TString fEventSelectionEffPath; //Path of event selection eff
183 TString fSharingEffPath; //Path of sharing eff
184 Bool_t fProcessPrimary; //Do we process primary ?
185 Bool_t fProcessHits; //Do we process hits ?
186 Trigger fTrigger; //Which trigger are we using ?
187 Energy fEnergy; // CM energy
188 MagField fMagField; //Magnetic field
189 Species fSpecies; //PbPb or pp ?
9f55be54 190
d8e9ec25 191 ClassDef(AliFMDAnaParameters,1) // Manager of parameters
d7346eed 192};
193
194#endif
195//____________________________________________________________________
196//
197// Local Variables:
198// mode: C++
199// End:
200//
201// EOF
202//
203