45 #include "StMcEmcModuleHitCollection.hh"
46 #include "StMcCalorimeterHit.hh"
48 static const char rcsid[] =
"$Id: StMcEmcModuleHitCollection.cc,v 2.8 2012/03/01 16:48:29 perev Exp $";
56 StMcEmcModuleHitCollection::StMcEmcModuleHitCollection()
60 void StMcEmcModuleHitCollection::init(
const unsigned int m)
66 sprintf(name,
"m%3.3i",m);
71 StMcEmcModuleHitCollection::~StMcEmcModuleHitCollection()
74 for (
int i=0; i<n; i++) {
delete mHits[i];}
77 n = mDetectorHits.size();
78 for (
int i=0; i<n; i++) {
delete mDetectorHits[i];}
79 mDetectorHits.clear();
84 StMcEmcModuleHitCollection::numberOfHits()
const
90 unsigned long StMcEmcModuleHitCollection::numberOfDetectorHits()
const
92 return mDetectorHits.size();
96 float StMcEmcModuleHitCollection::sum()
const
99 for(
unsigned int i=0; i<mHits.size(); i++){
100 s += (*mHits[i]).dE();
106 const StSPtrVecMcCalorimeterHit&
107 StMcEmcModuleHitCollection::hits()
const {
return mHits; }
110 StSPtrVecMcCalorimeterHit&
111 StMcEmcModuleHitCollection::hits() {
return mHits; }
114 const StSPtrVecMcCalorimeterHit&
115 StMcEmcModuleHitCollection::detectorHits()
const {
return mDetectorHits; }
118 StSPtrVecMcCalorimeterHit&
119 StMcEmcModuleHitCollection::detectorHits() {
return mDetectorHits; }
122 void StMcEmcModuleHitCollection::Clear(
const char*)
124 for (
int i=0; i<(int)mHits.size(); i++)
126 delete mHits[i]; mHits[i] = 0;
128 for (
int i=0; i<(int)mDetectorHits.size(); i++)
130 delete mDetectorHits[i]; mDetectorHits[i] = 0;
133 mDetectorHits.clear();
141 for (
int i=0; i<(int)mHits.size(); i++) {
142 TObject *obj = mHits[i];
if (!obj)
continue;
143 TString ts(obj->GetName()); ts+=
"#"; ts+=i;
144 b->Add(obj,ts.Data());
virtual void Browse(TBrowser *b)
Browse this dataset (called by TBrowser).