2 // Class that contains the forward multiplicity data per event
4 // This class contains a histogram of
6 // \frac{d^2N_{ch}}{d\eta d\phi}\quad,
8 // as well as a trigger mask for each analysed event.
10 // The eta acceptance of the event is stored in the underflow bins of
11 // the histogram. So to build the final histogram, one needs to
12 // correct for this acceptance (properly weighted by the events), and
13 // the vertex efficiency. This simply boils down to defining a 2D
14 // histogram and summing the event histograms in that histogram. One
15 // should of course also do proper book-keeping of the accepted event.
17 #include "AliAODForwardMult.h"
21 #include <TObjString.h>
23 ClassImp(AliAODForwardMult)
28 //____________________________________________________________________
29 const Float_t AliAODForwardMult::fgkInvalidIpZ = 1e6;
31 //____________________________________________________________________
32 AliAODForwardMult::AliAODForwardMult()
43 //____________________________________________________________________
44 AliAODForwardMult::AliAODForwardMult(Bool_t isMC)
46 fHist("forwardMult", "d^{2}N_{ch}/d#etad#varphi in the forward regions",
47 200, -4, 6, 20, 0, 2*TMath::Pi()),
55 // isMC If set to true this is for MC data (effects branch name)
57 fHist.SetXTitle("#eta");
58 fHist.SetYTitle("#varphi [radians]");
59 fHist.SetZTitle("#frac{d^{2}N_{ch}}{d#etad#varphi}");
60 fHist.SetDirectory(0);
64 //____________________________________________________________________
66 AliAODForwardMult::Init(const TAxis& etaAxis)
68 // Initialize the histogram with an eta axis
71 // etaAxis Eta axis to use
73 fHist.SetBins(etaAxis.GetNbins(), etaAxis.GetXmin(), etaAxis.GetXmax(),
74 20, 0, 2*TMath::Pi());
77 //____________________________________________________________________
79 AliAODForwardMult::Clear(Option_t* option)
81 // Clear (or reset) internal values
84 // option Passed to TH1::Reset
90 //____________________________________________________________________
92 AliAODForwardMult::SetSNN(UShort_t snn)
94 // set the center of mass energy per nucleon pair (GeV).
95 // This is stored in bin (0,0) of the histogram
98 // sNN Center of mass energy per nuclean
99 fHist.SetBinContent(0,0,snn);
101 //____________________________________________________________________
103 AliAODForwardMult::SetSystem(UShort_t sys)
105 // set the center of mass energy per nucleon pair (GeV).
106 // This is stored in bin (N+1,0) of the histogram
109 // sys Collision system number
110 fHist.SetBinContent(fHist.GetNbinsX()+1,0,sys);
113 //____________________________________________________________________
115 AliAODForwardMult::HasIpZ() const
117 // Check if we have valid z coordinate of the interaction point
120 // true if the z coordinate of the interaction point is valid
122 return TMath::Abs(fIpZ - fgkInvalidIpZ) > 1;
125 //____________________________________________________________________
127 AliAODForwardMult::GetSNN() const
129 // set the center of mass energy per nucleon pair (GeV).
130 // This is stored in bin (0,0) of the histogram
133 // sNN Center of mass energy per nuclean
134 return UShort_t(fHist.GetBinContent(0,0));
137 //____________________________________________________________________
139 AliAODForwardMult::GetSystem() const
141 // set the center of mass energy per nucleon pair (GeV).
142 // This is stored in bin (N+1,0) of the histogram
145 // sNN Center of mass energy per nuclean
146 return UShort_t(fHist.GetBinContent(fHist.GetNbinsX()+1,0));
149 //____________________________________________________________________
151 AliAODForwardMult::Browse(TBrowser* b)
153 // Browse this object
157 static TObjString ipz;
158 static TObjString trg;
159 ipz = Form("ip_z=%fcm", fIpZ);
160 trg = GetTriggerString(fTriggers);
166 //____________________________________________________________________
168 AliAODForwardMult::GetTriggerString(UInt_t mask)
170 // Get a string that describes the triggers
173 // mask Bit pattern of triggers
175 // Character string representation of mask
178 if ((mask & kInel) != 0x0) trg.Append("INEL ");
179 if ((mask & kInelGt0) != 0x0) trg.Append("INEL>0 ");
180 if ((mask & kNSD) != 0x0) trg.Append("NSD ");
181 if ((mask & kA) != 0x0) trg.Append("A ");
182 if ((mask & kB) != 0x0) trg.Append("B ");
183 if ((mask & kC) != 0x0) trg.Append("C ");
184 if ((mask & kE) != 0x0) trg.Append("E ");
188 //____________________________________________________________________
190 AliAODForwardMult::Print(Option_t* option) const
195 // option Passed to TH1::Print
197 UShort_t sys = GetSystem();
198 TString str = "unknown";
200 case 1: str = "pp"; break;
201 case 2: str = "PbPb"; break;
203 std::cout << "Ipz: " << fIpZ << "cm " << (HasIpZ() ? "" : "in")
205 << "Triggers: " << GetTriggerString(fTriggers)
206 << "sNN: " << GetSNN() << "GeV\n"
211 //____________________________________________________________________