2 // Calibration/Correction object that stores the secondary to primary
3 // correction used in the FMD analysis.
5 #include "AliFMDAnaCalibBackgroundCorrection.h"
10 ClassImp(AliFMDAnaCalibBackgroundCorrection)
15 //____________________________________________________________________
16 AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection()
21 fListOfDoubleHitCorrection(),
27 //____________________________________________________________________
28 AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection(const AliFMDAnaCalibBackgroundCorrection& o)
33 fListOfDoubleHitCorrection(),
38 //____________________________________________________________________
39 AliFMDAnaCalibBackgroundCorrection&
40 AliFMDAnaCalibBackgroundCorrection::operator=(const AliFMDAnaCalibBackgroundCorrection& o)
42 // Assignment operator
49 //____________________________________________________________________
51 AliFMDAnaCalibBackgroundCorrection::SetBgCorrection(Int_t det,
58 TObjArray* ringArray = GetRingArray(det,ring);
59 if (!ringArray) return;
61 ringArray->AddAtAndExpand(hCorrection,vtxbin);
64 //____________________________________________________________________
66 AliFMDAnaCalibBackgroundCorrection::GetBgCorrection(Int_t det,
70 TObjArray* ringArray = GetRingArray(det,ring);
71 if (!ringArray) return 0;
73 TH2F* hCorrection = static_cast<TH2F*>(ringArray->At(vtxbin));
76 //____________________________________________________________________
78 AliFMDAnaCalibBackgroundCorrection::SetNSDBgCorrection(Int_t det,
84 hCorrection->SetName(Form("FMDNSD%d%c_vtxbin_%d_correction",det,ring,vtxbin));
85 fListOfNSDBgMaps.Add(hCorrection);
88 //____________________________________________________________________
90 AliFMDAnaCalibBackgroundCorrection::GetNSDBgCorrection(Int_t det,
95 static_cast<TH2F*>(fListOfNSDBgMaps
96 .FindObject(Form("FMDNSD%d%c_vtxbin_%d_correction",
100 //____________________________________________________________________
102 AliFMDAnaCalibBackgroundCorrection::GetDoubleHitCorrection(Int_t det,
106 static_cast<TH1F*>(fListOfDoubleHitCorrection
107 .FindObject(Form("hDoubleHitCorrection_FMD%d%c",
112 //____________________________________________________________________
114 AliFMDAnaCalibBackgroundCorrection::SetDoubleHitCorrection(Int_t det,
118 hCorrection->SetName(Form("hDoubleHitCorrection_FMD%d%c",det,ring));
119 fListOfDoubleHitCorrection.Add(hCorrection);
121 //____________________________________________________________________
123 AliFMDAnaCalibBackgroundCorrection::GetSPDDeadCorrection(Int_t vtxbin) const
126 static_cast<TH1F*>(fListOfDoubleHitCorrection
127 .FindObject(Form("hSPDDeadCorrection_vtx%d",vtxbin)));
131 //____________________________________________________________________
133 AliFMDAnaCalibBackgroundCorrection::SetSPDDeadCorrection(Int_t vtxbin,
136 hCorrection->SetName(Form("hSPDDeadCorrection_vtx%d",vtxbin));
137 fListOfDoubleHitCorrection.Add(hCorrection);
140 //____________________________________________________________________
142 AliFMDAnaCalibBackgroundCorrection::GetFMDDeadCorrection(Int_t vtxbin)
145 static_cast<TH1F*>(fListOfDoubleHitCorrection
146 .FindObject(Form("hFMDDeadCorrection_vtx%d",vtxbin)));
150 //____________________________________________________________________
152 AliFMDAnaCalibBackgroundCorrection::SetFMDDeadCorrection(Int_t vtxbin,
155 hCorrection->SetName(Form("hFMDDeadCorrection_vtx%d",vtxbin));
156 fListOfDoubleHitCorrection.Add(hCorrection);
159 //____________________________________________________________________
161 AliFMDAnaCalibBackgroundCorrection::SetRefAxis(TAxis* axis)
163 // Set the reference axis
164 fAxis.Set(axis->GetNbins(),axis->GetXmin(),axis->GetXmax());
166 //____________________________________________________________________
167 void AliFMDAnaCalibBackgroundCorrection::Init()
172 TObjArray* spdArray = new TObjArray();
173 spdArray->SetOwner();
174 fArray.AddAtAndExpand(spdArray,0);
176 for(Int_t det = 1; det<=3;det++) {
177 TObjArray* detArray = new TObjArray();
178 detArray->SetOwner();
179 detArray->SetName(Form("FMD%d", det));
180 // detArray->SetTitle(Form("Array of FMD%d corrections", det));
181 fArray.AddAtAndExpand(detArray,det);
182 Int_t nRings = (det == 1 ? 1 : 2);
183 for(Int_t ring = 0;ring<nRings;ring++) {
184 TObjArray* ringArray = new TObjArray();
185 Char_t r = (ring == 0 ? 'I' : 'O');
186 ringArray->SetOwner();
187 ringArray->SetName(Form("FMD%d%c", det, r));
188 // ringArray->SetTitle(Form("Array of FMD%d%c corrections", det, r));
189 detArray->AddAtAndExpand(ringArray,ring);
196 //____________________________________________________________________
197 TObjArray* AliFMDAnaCalibBackgroundCorrection::GetRingArray(Int_t det,
200 // Find array corresponding to det, ring.
201 // Note, 0 and 4 refers to the SPD arrays
202 if(det==0 || det == 4) {
203 TObjArray* spdArray = (TObjArray*)fArray.At(det);
207 if (det < 0 || det >= fArray.GetEntriesFast()) return 0;
209 Int_t ringNumber = (ring == 'I' ? 0 : 1);
210 TObjArray* detArray = static_cast<TObjArray*>(fArray.At(det));
211 TObjArray* ringArray = static_cast<TObjArray*>(detArray->At(ringNumber));
216 //____________________________________________________________________
218 AliFMDAnaCalibBackgroundCorrection::Browse(TBrowser* b)
221 b->Add(&fAxis, "Vertex bins");
222 b->Add(&fArray, "Array of histograms w/BG corrections");
225 //____________________________________________________________________