2 #include "AliFMDAnaCalibBackgroundCorrection.h"
7 ClassImp(AliFMDAnaCalibBackgroundCorrection)
12 //____________________________________________________________________
13 AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection() : TObject(),
17 fListOfDoubleHitCorrection()
25 //____________________________________________________________________
26 AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection(const AliFMDAnaCalibBackgroundCorrection& o)
27 : TObject(o), fArray(o.fArray), fAxis(o.fAxis), fIsInit(o.fIsInit), fListOfDoubleHitCorrection()
31 //____________________________________________________________________
32 AliFMDAnaCalibBackgroundCorrection&
33 AliFMDAnaCalibBackgroundCorrection::operator=(const AliFMDAnaCalibBackgroundCorrection& o)
35 // Assignment operator
42 //____________________________________________________________________
43 TH2F* AliFMDAnaCalibBackgroundCorrection::GetBgCorrection(Int_t det,
46 TObjArray* ringArray = GetRingArray(det,ring);
47 TH2F* hCorrection = (TH2F*)ringArray->At(vtxbin);
51 //____________________________________________________________________
52 void AliFMDAnaCalibBackgroundCorrection::SetBgCorrection(Int_t det,
59 TObjArray* ringArray = GetRingArray(det,ring);
60 ringArray->AddAtAndExpand(hCorrection,vtxbin);
63 //____________________________________________________________________
64 TH1F* AliFMDAnaCalibBackgroundCorrection::GetDoubleHitCorrection(Int_t det,
68 TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hDoubleHitCorrection_FMD%d%c",det,ring));
72 //____________________________________________________________________
73 void AliFMDAnaCalibBackgroundCorrection::SetDoubleHitCorrection(Int_t det,
76 hCorrection->SetName(Form("hDoubleHitCorrection_FMD%d%c",det,ring));
77 fListOfDoubleHitCorrection.Add(hCorrection);
79 //____________________________________________________________________
80 TH1F* AliFMDAnaCalibBackgroundCorrection::GetSPDDeadCorrection(Int_t vtxbin) {
82 TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hSPDDeadCorrection_vtx%d",vtxbin));
86 //____________________________________________________________________
87 void AliFMDAnaCalibBackgroundCorrection::SetSPDDeadCorrection(Int_t vtxbin,
89 hCorrection->SetName(Form("hSPDDeadCorrection_vtx%d",vtxbin));
90 fListOfDoubleHitCorrection.Add(hCorrection);
92 //____________________________________________________________________
93 void AliFMDAnaCalibBackgroundCorrection::SetRefAxis(TAxis* axis) {
96 fAxis.Set(axis->GetNbins(),axis->GetXmin(),axis->GetXmax());
99 //____________________________________________________________________
100 void AliFMDAnaCalibBackgroundCorrection::Init() {
104 TObjArray* spdArray = new TObjArray();
105 spdArray->SetOwner();
106 fArray.AddAtAndExpand(spdArray,0);
108 for(Int_t det = 1; det<=3;det++) {
109 TObjArray* detArray = new TObjArray();
110 detArray->SetOwner();
111 fArray.AddAtAndExpand(detArray,det);
112 Int_t nRings = (det == 1 ? 1 : 2);
113 for(Int_t ring = 0;ring<nRings;ring++) {
114 TObjArray* ringArray = new TObjArray();
115 ringArray->SetOwner();
116 detArray->AddAtAndExpand(ringArray,ring);
123 //____________________________________________________________________
124 TObjArray* AliFMDAnaCalibBackgroundCorrection::GetRingArray(Int_t det,
127 if(det==0 || det == 4) {
128 TObjArray* spdArray = (TObjArray*)fArray.At(det);
131 Int_t ringNumber = (ring == 'I' ? 0 : 1);
132 TObjArray* detArray = (TObjArray*)fArray.At(det);
133 TObjArray* ringArray = (TObjArray*)detArray->At(ringNumber);
137 //____________________________________________________________________
138 Int_t AliFMDAnaCalibBackgroundCorrection::GetNvtxBins() {
140 return fAxis.GetNbins();
143 //____________________________________________________________________
144 Float_t AliFMDAnaCalibBackgroundCorrection::GetVtxCutZ() {
146 return fAxis.GetXmax();
150 //____________________________________________________________________
152 AliFMDAnaCalibBackgroundCorrection::Browse(TBrowser* b)
154 b->Add(&fAxis, "Vertex bins");
155 b->Add(&fArray, "Array of histograms w/BG corrections");
158 //____________________________________________________________________