49 #include "StEventSummary.h"
50 #include "SystemOfUnits.h"
51 #ifndef ST_NO_NAMESPACES
56 static const char rcsid[] =
"$Id: StEventSummary.cxx,v 2.11 2009/11/23 16:34:06 fisyak Exp $";
65 mNumberOfGoodTracks = 0;
66 mNumberOfGoodPrimaryTracks = 0;
67 mNumberOfPositiveTracks = 0;
68 mNumberOfNegativeTracks = 0;
69 mNumberOfExoticTracks = 0;
70 mNumberOfVertices = 0;
71 mNumberOfVertexTypes.Set(mVertexTypeArraySize);
72 mNumberOfPileupVertices = 0;
78 mEtaBins.Set(mPtAndEtaBinsSize);
79 mPtBins.Set(mPtAndEtaBinsSize);
80 mPhiBins.Set(mPhiBinsSize);
82 mEtaOfTracksHisto.Set(mHistogramSize);
83 mPtOfTracksHisto.Set(mHistogramSize);
84 mPhiOfTracksHisto.Set(mHistogramSize);
85 mEneryVsEtaHisto.Set(mHistogramSize);
86 mEnergyVsPhiHisto.Set(mHistogramSize);
91 StEventSummary::~StEventSummary() { }
93 void StEventSummary::Clear( Option_t * opt ){
94 mNumberOfVertexTypes.Set(0);
98 mEtaOfTracksHisto.Set(0);
99 mPtOfTracksHisto.Set(0);
100 mPhiOfTracksHisto.Set(0);
101 mEneryVsEtaHisto.Set(0);
102 mEnergyVsPhiHisto.Set(0);
106 StEventSummary::initBinRanges()
108 mVertexTypeArraySize = 5;
110 mPtAndEtaBinsSize = 9;
113 mEtaBins.Set(mPtAndEtaBinsSize);
114 mPtBins.Set(mPtAndEtaBinsSize);
115 mPhiBins.Set(mPhiBinsSize);
137 mPhiBins[0] = 0*degree;
138 mPhiBins[1] = 36*degree;
139 mPhiBins[2] = 72*degree;
140 mPhiBins[3] = 108*degree;
141 mPhiBins[4] = 144*degree;
142 mPhiBins[5] = 180*degree;
143 mPhiBins[6] = 216*degree;
144 mPhiBins[7] = 252*degree;
145 mPhiBins[8] = 288*degree;
146 mPhiBins[9] = 324*degree;
149 int StEventSummary::numberOfTracks()
const {
return mNumberOfTracks; }
151 int StEventSummary::numberOfGoodTracks()
const {
return mNumberOfGoodTracks; }
153 int StEventSummary::numberOfGoodTracks(StChargeSign s)
const
155 return s == negative ? mNumberOfNegativeTracks : mNumberOfPositiveTracks;
159 StEventSummary::numberOfGoodPrimaryTracks()
const {
return mNumberOfGoodPrimaryTracks; }
162 StEventSummary::numberOfExoticTracks()
const {
return mNumberOfExoticTracks; }
165 StEventSummary::numberOfVertices()
const {
return mNumberOfVertices; }
168 StEventSummary::numberOfVerticesOfType(StVertexId
id)
const
170 unsigned int i =
id-1;
171 if (i < mVertexTypeArraySize)
172 return const_cast<TArrayL&
>(mNumberOfVertexTypes)[i];
178 StEventSummary::numberOfPileupVertices()
const {
return mNumberOfPileupVertices; }
181 StEventSummary::meanPt()
const {
return mMeanPt; }
184 StEventSummary::meanPt2()
const {
return mMeanPt2; }
187 StEventSummary::meanEta()
const {
return mMeanEta; }
190 StEventSummary::rmsEta()
const {
return mRmsEta; }
193 StEventSummary::primaryVertexPosition()
const {
return mPrimaryVertexPos; }
196 StEventSummary::numberOfBins()
const {
return mHistogramSize; }
199 StEventSummary::tracksInEtaBin(
unsigned int i)
const
201 return i < mHistogramSize ? const_cast<TArrayL&>(mEtaOfTracksHisto)[i] : 0;
205 StEventSummary::tracksInPhiBin(
unsigned int i)
const
207 return i < mHistogramSize ? const_cast<TArrayL&>(mPhiOfTracksHisto)[i] : 0;
211 StEventSummary::tracksInPtBin(
unsigned int i)
const
213 return i < mHistogramSize ? const_cast<TArrayL&>(mPtOfTracksHisto)[i] : 0;
217 StEventSummary::energyInEtaBin(
unsigned int i)
const
219 return i < mHistogramSize ? const_cast<TArrayF&>(mEneryVsEtaHisto)[i] : 0;
223 StEventSummary::energyInPhiBin(
unsigned int i)
const
225 return i < mHistogramSize ? const_cast<TArrayF&>(mEnergyVsPhiHisto)[i] : 0;
229 StEventSummary::lowerEdgeEtaBin(
unsigned int i)
const
231 if (i <= mPtAndEtaBinsSize) {
235 return const_cast<TArrayF&
>(mEtaBins)[i-1];
242 StEventSummary::upperEdgeEtaBin(
unsigned int i)
const
244 if (i <= mPtAndEtaBinsSize) {
245 if (i == mPtAndEtaBinsSize)
248 return const_cast<TArrayF&
>(mEtaBins)[i];
255 StEventSummary::lowerEdgePtBin(
unsigned int i)
const
257 if (i <= mPtAndEtaBinsSize) {
261 return const_cast<TArrayF&
>(mPtBins)[i-1];
268 StEventSummary::upperEdgePtBin(
unsigned int i)
const
270 if (i <= mPtAndEtaBinsSize) {
271 if (i == mPtAndEtaBinsSize)
274 return const_cast<TArrayF&
>(mPtBins)[i];
281 StEventSummary::lowerEdgePhiBin(
unsigned int i)
const
283 if (i < mPhiBinsSize)
284 return const_cast<TArrayF&
>(mPhiBins)[i];
290 StEventSummary::upperEdgePhiBin(
unsigned int i)
const
292 if (i < mPhiBinsSize) {
293 if ((
int)i == mPhiBinsSize-1)
294 return const_cast<TArrayF&
>(mPhiBins)[0];
296 return const_cast<TArrayF&
>(mPhiBins)[i+1];
303 StEventSummary::setNumberOfTracks(
int val) { mNumberOfTracks = val; }
306 StEventSummary::setNumberOfGoodTracks(
int val) { mNumberOfGoodTracks = val; }
309 StEventSummary::setNumberOfGoodTracks(StChargeSign s,
int val)
312 mNumberOfNegativeTracks = val;
314 mNumberOfPositiveTracks = val;
318 StEventSummary::setNumberOfGoodPrimaryTracks(
int val) { mNumberOfGoodPrimaryTracks = val; }
321 StEventSummary::setNumberOfExoticTracks(
int val) { mNumberOfExoticTracks = val; }
324 StEventSummary::setNumberOfVertices(
int val) { mNumberOfVertices = val; }
327 StEventSummary::setNumberOfVerticesForType(StVertexId
id,
int val)
330 if (i < mVertexTypeArraySize)
331 mNumberOfVertexTypes[i] = val;
335 StEventSummary::setNumberOfPileupVertices(
int val) { mNumberOfPileupVertices = val; }
338 StEventSummary::setMeanPt(
float val) { mMeanPt = val; }
341 StEventSummary::setMeanPt2(
float val) { mMeanPt2 = val; }
344 StEventSummary::setMeanEta(
float val) { mMeanEta = val; }
347 StEventSummary::setRmsEta(
float val) { mRmsEta = val; }
350 StEventSummary::setPrimaryVertexPosition(
const StThreeVectorF& val) { mPrimaryVertexPos = val; }
353 StEventSummary::magneticField()
const {
return mMagneticFieldZ; }
356 StEventSummary::setMagneticField(
double val) { mMagneticFieldZ = val; }