2 // This class contains the secondary correction and the double hit
3 // correction used in low-flux events.
6 #include "AliFMDCorrDoubleHit.h"
12 //____________________________________________________________________
13 AliFMDCorrDoubleHit::AliFMDCorrDoubleHit()
19 fCorrections.SetOwner(kTRUE);
20 fCorrections.SetName("doubleHit");
22 //____________________________________________________________________
23 AliFMDCorrDoubleHit::AliFMDCorrDoubleHit(const AliFMDCorrDoubleHit& o)
25 fCorrections(o.fCorrections)
30 // o Object to copy from
32 //____________________________________________________________________
33 AliFMDCorrDoubleHit::~AliFMDCorrDoubleHit()
40 //____________________________________________________________________
42 AliFMDCorrDoubleHit::operator=(const AliFMDCorrDoubleHit& o)
44 // Assignment operator
47 // o Object to assign from
48 fCorrections = o.fCorrections;
52 //____________________________________________________________________
54 AliFMDCorrDoubleHit::GetCorrection(UShort_t d, Char_t r) const
57 // Get the double hit correction @f$ h_{r}(\eta)@f$
66 Int_t idx = GetRingIndex(d, r);
67 if (idx < 0) return 0;
69 TObject* o = fCorrections.At(idx);
71 AliWarning(Form("No double hit correction found for FMD%d%c", d, r));
74 return static_cast<TH1D*>(o);
76 //____________________________________________________________________
78 AliFMDCorrDoubleHit::GetRingIndex(UShort_t d, Char_t r) const
81 // Get the index corresponding to the given ring
88 // Index (0 based) or negative in case of errors
93 case 2: return (r == 'I' || r == 'i' ? 1 : 2); break;
94 case 3: return (r == 'I' || r == 'i' ? 3 : 4); break;
96 AliWarning(Form("Index for FMD%d%c not found", d, r));
99 //____________________________________________________________________
101 AliFMDCorrDoubleHit::SetCorrection(UShort_t d, Char_t r, TH1D* h)
104 // Set the double hit correction @f$ h_{r}(\eta)@f$. Note, that the
105 // object takes ownership of the passed pointer.
108 // d Detector number (1-3)
109 // r Ring identifier (I or O)
110 // h @f$ h_{r}(\eta)@f$
113 // true if operation succeeded
115 Int_t idx = GetRingIndex(d, r);
116 if (idx < 0) return kFALSE;
118 h->SetName(Form("FMD%d%c", d, r));
119 h->SetTitle(Form("Double hit correction for FMD%d%c", d,r));
120 h->SetXTitle("#eta");
121 h->SetYTitle("#sum_{i} N_{i,strips hit}(#eta)/"
122 "#sum_{i} N_{i,total hits}(#eta)");
123 // h->SetFillColor(Color(d,r));
124 h->SetFillStyle(3001);
128 fCorrections.AddAtAndExpand(h, idx);
131 //____________________________________________________________________
133 AliFMDCorrDoubleHit::Browse(TBrowser* b)
135 // BRowse this object
139 b->Add(&fCorrections);
141 //____________________________________________________________________
143 AliFMDCorrDoubleHit::Print(Option_t* option) const
148 // option Passed to TH2D::Print
149 std::cout << "Double hit correction" << std::endl;
150 fCorrections.Print(option);
153 //____________________________________________________________________