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()
44 //____________________________________________________________________
45 AliAODForwardMult::AliAODForwardMult(Bool_t isMC)
47 fHist("forwardMult", "d^{2}N_{ch}/d#etad#varphi in the forward regions",
48 200, -4, 6, 20, 0, 2*TMath::Pi()),
57 // isMC If set to true this is for MC data (effects branch name)
59 fHist.SetXTitle("#eta");
60 fHist.SetYTitle("#varphi [radians]");
61 fHist.SetZTitle("#frac{d^{2}N_{ch}}{d#etad#varphi}");
62 fHist.SetDirectory(0);
66 //____________________________________________________________________
68 AliAODForwardMult::Init(const TAxis& etaAxis)
70 // Initialize the histogram with an eta axis
73 // etaAxis Eta axis to use
75 fHist.SetBins(etaAxis.GetNbins(), etaAxis.GetXmin(), etaAxis.GetXmax(),
76 20, 0, 2*TMath::Pi());
79 //____________________________________________________________________
81 AliAODForwardMult::Clear(Option_t* option)
83 // Clear (or reset) internal values
86 // option Passed to TH1::Reset
92 //____________________________________________________________________
94 AliAODForwardMult::SetSNN(UShort_t snn)
96 // set the center of mass energy per nucleon pair (GeV).
97 // This is stored in bin (0,0) of the histogram
100 // sNN Center of mass energy per nuclean
101 fHist.SetBinContent(0,0,snn);
103 //____________________________________________________________________
105 AliAODForwardMult::SetSystem(UShort_t sys)
107 // set the center of mass energy per nucleon pair (GeV).
108 // This is stored in bin (N+1,0) of the histogram
111 // sys Collision system number
112 fHist.SetBinContent(fHist.GetNbinsX()+1,0,sys);
115 //____________________________________________________________________
117 AliAODForwardMult::HasIpZ() const
119 // Check if we have valid z coordinate of the interaction point
122 // true if the z coordinate of the interaction point is valid
124 return TMath::Abs(fIpZ - fgkInvalidIpZ) > 1;
127 //____________________________________________________________________
129 AliAODForwardMult::GetSNN() const
131 // set the center of mass energy per nucleon pair (GeV).
132 // This is stored in bin (0,0) of the histogram
135 // sNN Center of mass energy per nuclean
136 return UShort_t(fHist.GetBinContent(0,0));
139 //____________________________________________________________________
141 AliAODForwardMult::GetSystem() const
143 // set the center of mass energy per nucleon pair (GeV).
144 // This is stored in bin (N+1,0) of the histogram
147 // sNN Center of mass energy per nuclean
148 return UShort_t(fHist.GetBinContent(fHist.GetNbinsX()+1,0));
151 //____________________________________________________________________
153 AliAODForwardMult::Browse(TBrowser* b)
155 // Browse this object
159 static TObjString ipz;
160 static TObjString trg;
161 static TObjString cnt;
162 ipz = Form("ip_z=%fcm", fIpZ);
163 trg = GetTriggerString(fTriggers);
164 cnt = Form("%+6.1f%%", fCentrality);
171 //____________________________________________________________________
173 AliAODForwardMult::GetTriggerString(UInt_t mask)
175 // Get a string that describes the triggers
178 // mask Bit pattern of triggers
180 // Character string representation of mask
183 if ((mask & kInel) != 0x0) trg.Append("INEL ");
184 if ((mask & kInelGt0) != 0x0) trg.Append("INEL>0 ");
185 if ((mask & kNSD) != 0x0) trg.Append("NSD ");
186 if ((mask & kA) != 0x0) trg.Append("A ");
187 if ((mask & kB) != 0x0) trg.Append("B ");
188 if ((mask & kC) != 0x0) trg.Append("C ");
189 if ((mask & kE) != 0x0) trg.Append("E ");
190 if ((mask & kMCNSD) != 0x0) trg.Append("MCNSD ");
194 //____________________________________________________________________
196 AliAODForwardMult::Print(Option_t* option) const
201 // option Passed to TH1::Print
203 UShort_t sys = GetSystem();
204 TString str = "unknown";
206 case 1: str = "pp"; break;
207 case 2: str = "PbPb"; break;
209 std::cout << "Ipz: " << fIpZ << "cm " << (HasIpZ() ? "" : "in")
211 << "Triggers: " << GetTriggerString(fTriggers)
212 << "sNN: " << GetSNN() << "GeV\n"
214 << "Centrality: " << fCentrality << "%"
218 //____________________________________________________________________