26 #include "StPhmdDetector.h"
27 #include "StPhmdHit.h"
28 #include "StPhmdModule.h"
29 #include "StPhmdClusterCollection.h"
36 mDetectorId = kUnknownId;
37 memset(mModulesNHit,0,
sizeof(mModulesNHit));
38 memset(mModules ,0,
sizeof(mModules ));
42 StPhmdDetector::StPhmdDetector(StDetectorId
id)
45 memset(mModulesNHit,0,
sizeof(mModulesNHit));
46 memset(mModules ,0,
sizeof(mModules ));
48 for (
int i=0; i<mMaxModules; i++)
52 StPhmdDetector::~StPhmdDetector()
54 for (
int i=0; i<mMaxModules; i++)
delete mModules[i];
55 memset(mModules ,0,
sizeof(mModules ));
56 delete mClusters; mClusters = 0;
63 unsigned int m =
static_cast<unsigned int>(hit->module());
64 if (m <= mMaxModules) {
65 mModules[m]->hits().push_back(hit);
74 StPhmdDetector::moduleHits(
unsigned int i)
77 return mModulesNHit[i];
83 StPhmdDetector::numberOfModules()
const {
return mMaxModules; }
86 StPhmdDetector::numberOfHits()
const
93 StPhmdDetector::module(
unsigned int i)
102 StPhmdDetector::module(
unsigned int i)
const
105 return (mModules[i]);
111 StPhmdDetector::setModule(
StPhmdModule* val,
unsigned int IdMod)
114 if (IdMod < mMaxModules) {
115 if (mModules[IdMod])
delete mModules[IdMod];
116 mModules[IdMod] = val;
122 StPhmdDetector::cluster() {
return mClusters;}
125 StPhmdDetector::cluster()
const {
return mClusters;}
130 if (mClusters)
delete mClusters;
134 ostream& operator<<(ostream& os,
const StPhmdHit& h)
136 os <<
"super=" << h.superModule();
137 os <<
"\tsubDetector=" << h.subDetector();
138 os <<
"\trow=" << h.row();
139 os <<
"\tcolumn=" << h.column();
140 os <<
"\tedep=" << h.energy();