]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis/AliFMDAnaParameters.h
Fixes for the IO problem in the FMD analysis (cholm)
[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
d8dec33d 64 enum Energy { k900 , k10000, k14000 , k7000};
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;}
b64db9b1 113 void 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(); }
d7346eed 123protected:
124
d7346eed 125 AliFMDAnaParameters(const AliFMDAnaParameters& o)
126 : TNamed(o),
127 fIsInit(o.fIsInit),
46807b30 128 fBackground(o.fBackground),
41bad769 129 fEnergyDistribution(o.fEnergyDistribution),
b64db9b1 130 fEventSelectionEfficiency(o.fEventSelectionEfficiency),
7e2bf482 131 fSharingEfficiency(o.fSharingEfficiency),
41bad769 132 fCorner1(o.fCorner1),
133 fCorner2(o.fCorner2),
134 fEnergyPath(o.fEnergyPath),
b64db9b1 135 fBackgroundPath(o.fBackgroundPath),
9f55be54 136 fEventSelectionEffPath(o.fEventSelectionEffPath),
7e2bf482 137 fSharingEffPath(o.fSharingEffPath),
b64db9b1 138 fProcessPrimary(o.fProcessPrimary),
139 fProcessHits(o.fProcessHits),
0b0a4ae5 140 fTrigger(o.fTrigger),
67a2b706 141 fEnergy(o.fEnergy),
01622a51 142 fMagField(o.fMagField),
143 fSpecies(o.fSpecies)
d7346eed 144 {}
145 AliFMDAnaParameters& operator=(const AliFMDAnaParameters&) { return *this; }
146 virtual ~AliFMDAnaParameters() {}
147
148 static AliFMDAnaParameters* fgInstance; // Static singleton instance
149
78f6f750 150 // AliCDBEntry* GetEntry(const char* path, Bool_t fatal=kTRUE) const ;
d7346eed 151 void InitBackground();
152 void InitEnergyDists();
b64db9b1 153 void InitEventSelectionEff();
7e2bf482 154 void InitSharingEff();
b64db9b1 155
5754671c 156 TH1F* GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta);
d7346eed 157 TObjArray* GetBackgroundArray();
158
8dc823cc 159 TAxis* GetRefAxis();
78f6f750 160 void SetCorners(Char_t ring) ;
8dc823cc 161
50a0adf8 162 Bool_t fIsInit; //Have we been init ?
46807b30 163 //TObjArray* fBackgroundArray;
164 // TObjArray* fEdistArray;
50a0adf8 165 AliFMDAnaCalibBackgroundCorrection* fBackground;
b64db9b1 166 AliFMDAnaCalibEnergyDistribution* fEnergyDistribution;
167 AliFMDAnaCalibEventSelectionEfficiency* fEventSelectionEfficiency;
7e2bf482 168 AliFMDAnaCalibSharingEfficiency* fSharingEfficiency;
d05586f1 169 //static const char* fgkBackgroundCorrection;
170 //static const char* fgkEnergyDists;
171 static const char* fgkBackgroundID;
172 static const char* fgkEnergyDistributionID ;
b64db9b1 173 static const char* fgkEventSelectionEffID ;
7e2bf482 174 static const char* fgkSharingEffID ;
b64db9b1 175
50a0adf8 176 TVector2 fCorner1; //First corner of hybrid
177 TVector2 fCorner2; //Second corner of hybrid
178 TString fEnergyPath; //Path of energy calib
179 TString fBackgroundPath; //Path of BG correction
180 TString fEventSelectionEffPath; //Path of event selection eff
181 TString fSharingEffPath; //Path of sharing eff
182 Bool_t fProcessPrimary; //Do we process primary ?
183 Bool_t fProcessHits; //Do we process hits ?
184 Trigger fTrigger; //Which trigger are we using ?
185 Energy fEnergy; // CM energy
186 MagField fMagField; //Magnetic field
187 Species fSpecies; //PbPb or pp ?
9f55be54 188
d8e9ec25 189 ClassDef(AliFMDAnaParameters,1) // Manager of parameters
d7346eed 190};
191
192#endif
193//____________________________________________________________________
194//
195// Local Variables:
196// mode: C++
197// End:
198//
199// EOF
200//
201