2 #include "AliFMDAnaCalibBackgroundCorrection.h"
7 ClassImp(AliFMDAnaCalibBackgroundCorrection)
12 //____________________________________________________________________
13 AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection() : TObject(),
17 fListOfDoubleHitCorrection(),
26 //____________________________________________________________________
27 AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection(const AliFMDAnaCalibBackgroundCorrection& o)
28 : TObject(o), fArray(o.fArray), fAxis(o.fAxis), fIsInit(o.fIsInit), fListOfDoubleHitCorrection(), fListOfNSDBgMaps()
32 //____________________________________________________________________
33 AliFMDAnaCalibBackgroundCorrection&
34 AliFMDAnaCalibBackgroundCorrection::operator=(const AliFMDAnaCalibBackgroundCorrection& o)
36 // Assignment operator
43 //____________________________________________________________________
44 TH2F* AliFMDAnaCalibBackgroundCorrection::GetBgCorrection(Int_t det,
47 TObjArray* ringArray = GetRingArray(det,ring);
48 TH2F* hCorrection = (TH2F*)ringArray->At(vtxbin);
51 //____________________________________________________________________
52 void AliFMDAnaCalibBackgroundCorrection::SetNSDBgCorrection(Int_t det,
58 hCorrection->SetName(Form("FMDNSD%d%c_vtxbin_%d_correction",det,ring,vtxbin));
59 fListOfNSDBgMaps.Add(hCorrection);
62 //____________________________________________________________________
63 TH2F* AliFMDAnaCalibBackgroundCorrection::GetNSDBgCorrection(Int_t det,
66 TH2F* hCorrection = (TH2F*)fListOfNSDBgMaps.FindObject(Form("FMDNSD%d%c_vtxbin_%d_correction",det,ring,vtxbin));
69 //____________________________________________________________________
70 void AliFMDAnaCalibBackgroundCorrection::SetBgCorrection(Int_t det,
77 TObjArray* ringArray = GetRingArray(det,ring);
78 ringArray->AddAtAndExpand(hCorrection,vtxbin);
81 //____________________________________________________________________
82 TH1F* AliFMDAnaCalibBackgroundCorrection::GetDoubleHitCorrection(Int_t det,
86 TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hDoubleHitCorrection_FMD%d%c",det,ring));
90 //____________________________________________________________________
91 void AliFMDAnaCalibBackgroundCorrection::SetDoubleHitCorrection(Int_t det,
94 hCorrection->SetName(Form("hDoubleHitCorrection_FMD%d%c",det,ring));
95 fListOfDoubleHitCorrection.Add(hCorrection);
97 //____________________________________________________________________
98 TH1F* AliFMDAnaCalibBackgroundCorrection::GetSPDDeadCorrection(Int_t vtxbin) {
100 TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hSPDDeadCorrection_vtx%d",vtxbin));
104 //____________________________________________________________________
105 void AliFMDAnaCalibBackgroundCorrection::SetSPDDeadCorrection(Int_t vtxbin,
107 hCorrection->SetName(Form("hSPDDeadCorrection_vtx%d",vtxbin));
108 fListOfDoubleHitCorrection.Add(hCorrection);
111 //____________________________________________________________________
112 TH1F* AliFMDAnaCalibBackgroundCorrection::GetFMDDeadCorrection(Int_t vtxbin) {
114 TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hFMDDeadCorrection_vtx%d",vtxbin));
118 //____________________________________________________________________
119 void AliFMDAnaCalibBackgroundCorrection::SetFMDDeadCorrection(Int_t vtxbin,
121 hCorrection->SetName(Form("hFMDDeadCorrection_vtx%d",vtxbin));
122 fListOfDoubleHitCorrection.Add(hCorrection);
125 //____________________________________________________________________
126 void AliFMDAnaCalibBackgroundCorrection::SetRefAxis(TAxis* axis) {
129 fAxis.Set(axis->GetNbins(),axis->GetXmin(),axis->GetXmax());
132 //____________________________________________________________________
133 void AliFMDAnaCalibBackgroundCorrection::Init() {
137 TObjArray* spdArray = new TObjArray();
138 spdArray->SetOwner();
139 fArray.AddAtAndExpand(spdArray,0);
141 for(Int_t det = 1; det<=3;det++) {
142 TObjArray* detArray = new TObjArray();
143 detArray->SetOwner();
144 fArray.AddAtAndExpand(detArray,det);
145 Int_t nRings = (det == 1 ? 1 : 2);
146 for(Int_t ring = 0;ring<nRings;ring++) {
147 TObjArray* ringArray = new TObjArray();
148 ringArray->SetOwner();
149 detArray->AddAtAndExpand(ringArray,ring);
156 //____________________________________________________________________
157 TObjArray* AliFMDAnaCalibBackgroundCorrection::GetRingArray(Int_t det,
160 if(det==0 || det == 4) {
161 TObjArray* spdArray = (TObjArray*)fArray.At(det);
164 Int_t ringNumber = (ring == 'I' ? 0 : 1);
165 TObjArray* detArray = (TObjArray*)fArray.At(det);
166 TObjArray* ringArray = (TObjArray*)detArray->At(ringNumber);
170 //____________________________________________________________________
171 Int_t AliFMDAnaCalibBackgroundCorrection::GetNvtxBins() {
173 return fAxis.GetNbins();
176 //____________________________________________________________________
177 Float_t AliFMDAnaCalibBackgroundCorrection::GetVtxCutZ() {
179 return fAxis.GetXmax();
183 //____________________________________________________________________
185 AliFMDAnaCalibBackgroundCorrection::Browse(TBrowser* b)
187 b->Add(&fAxis, "Vertex bins");
188 b->Add(&fArray, "Array of histograms w/BG corrections");
191 //____________________________________________________________________