23 #include "StEvent/StEvent.h"
24 #include "St_base/StMessMgr.h"
30 #include "TCollection.h"
31 #include "TRefArray.h"
44 template<
class StPtrVec,
class Element>
45 int findElementIndex(
const StPtrVec& array,
const Element* element) {
50 typedef Element*
const * ElementConstIter;
52 ElementConstIter location = std::find(array.begin(), array.end(), element);
56 if (location == array.end()) {
59 return std::distance(array.begin(), location);
73 if(!fmscol)
return NULL;
81 if(!muFms)
return NULL;
119 StSPtrVecFmsHit vecHit = fmscol->
hits();
121 unsigned short detId = vecHit[i]->detectorId();
122 unsigned short ch = vecHit[i]->channel();
123 unsigned short crate = vecHit[i]->qtCrate();
124 unsigned short slot = vecHit[i]->qtSlot();
125 unsigned short qtch = vecHit[i]->qtChannel();
126 unsigned short adc = vecHit[i]->adc();
127 unsigned short tdc = vecHit[i]->tdc();
128 float ene = vecHit[i]->energy();
152 muCluster->
setX(cluster->
x());
153 muCluster->
setY(cluster->
y());
159 StPtrVecFmsHitConstIterator hit;
160 for (hit = cluster->
hits().begin(); hit != cluster->
hits().end(); ++hit) {
161 const int index = findElementIndex(fmscol->
hits(), *hit);
167 StPtrVecFmsPointConstIterator p;
168 for (p = cluster->
points().begin(); p != cluster->
points().end(); ++p) {
169 const int index = findElementIndex(fmscol->
points(), *p);
182 if (point && muPoint) {
183 muPoint->
set(*point);
198 const int index = findElementIndex(fmscol->
clusters(), point->
cluster());
215 while ((muHit = static_cast<StMuFmsHit*>(next()))) {
216 fmscol->
addHit(
new StFmsHit);
217 StFmsHit* hit = fmscol->
hits().back();
218 hit->setDetectorId(muHit->detectorId());
219 hit->setChannel(muHit->channel());
220 hit->setQtCrate(muHit->qtCrate());
221 hit->setQtSlot(muHit->qtSlot());
222 hit->setQtChannel(muHit->qtChannel());
223 hit->setAdc(muHit->adc());
224 hit->setTdc(muHit->tdc());
225 hit->setEnergy(muHit->energy());
234 while ((muCluster = static_cast<StMuFmsCluster*>(next()))) {
240 cluster->
setNTowers(muCluster->hits()->GetEntries());
241 cluster->
setNPhotons(muCluster->photons()->GetEntries());
243 cluster->
setX(muCluster->x());
244 cluster->
setY(muCluster->y());
258 while ((muPoint = static_cast<StMuFmsPoint*>(next()))) {
264 point->
setX(muPoint->x());
265 point->
setY(muPoint->y());
TClonesArray * getHitArray()
void setCluster(StMuFmsCluster *cluster)
void fillFmsPoints(StFmsCollection *, StMuFmsCollection *)
Declaration of StMuFmsPoint, the MuDST FMS "point" class.
StFmsCollection * getFms(StMuFmsCollection *)
void setEnergy(float energy)
void setMuFmsPointParentClusters(StMuFmsCollection *, StFmsCollection *)
unsigned int numberOfPoints() const
void fillFms(StFmsCollection *, StMuFmsCollection *)
StMuFmsCluster * cluster()
unsigned int numberOfClusters() const
void fillFmsClusters(StFmsCollection *, StMuFmsCollection *)
void setCluster(StFmsCluster *cluster)
void addPoint(StFmsPoint *)
unsigned int numberOfHits() const
void setAdc(unsigned short)
Declaration of StFmsCluster, a group of adjacent FMS hits.
unsigned int numberOfClusters() const
UShort_t detectorId() const
void setQtChannel(unsigned short)
void setQtCrate(unsigned short)
void fillMuFmsClusters(StMuFmsCollection *, StFmsCollection *)
void setTdc(unsigned short)
void setCategory(UShort_t category)
StMuFmsPoint * addPoint()
StMuFmsCluster * getCluster(int index)
void fillMuFmsHits(StMuFmsCollection *, StFmsCollection *)
void setDetectorId(UShort_t detector)
StMuFmsCollection * getMuFms(StFmsCollection *)
StSPtrVecFmsPoint & points()
Bool_t setNPhotons(Int_t nPhoton)
void addCluster(StFmsCluster *)
StPtrVecFmsPoint & points()
void set(const StFmsPoint &)
void setEnergy(Float_t energy)
void setQtSlot(unsigned short)
void setDetectorId(UShort_t detector)
Declaration of StMuFmsCluster, the MuDST FMS cluster class.
void setEnergy(Float_t energy)
void setDetectorId(UShort_t detector)
void fillFmsHits(StFmsCollection *, StMuFmsCollection *)
void setNTowers(Int_t numbTower)
void setChannel(unsigned short)
ClassImp(StMuFmsUtil) namespace
unsigned int numberOfPoints() const
void fillMuFmsPoints(StMuFmsCollection *, StFmsCollection *)
void setDetectorId(unsigned short)
void setFmsPointParentClusters(StFmsCollection *, StMuFmsCollection *)
StMuFmsPoint * getPoint(int index)
StSPtrVecFmsCluster & clusters()
TClonesArray * getClusterArray()
void fillMuFms(StMuFmsCollection *, StFmsCollection *)
StMuFmsHit * getHit(int hitId)
TClonesArray * getPointArray()
void setCategory(Int_t catag)