00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "StSsdHitCollection.h"
00021 #include "StSsdLadderHitCollection.h"
00022 #include "StSsdHit.h"
00023
00024 static const char rcsid[] = "$Id: StSsdHitCollection.cxx,v 2.2 2001/04/05 04:00:54 ullrich Exp $";
00025
00026 ClassImp(StSsdHitCollection)
00027
00028 StSsdHitCollection::StSsdHitCollection() { }
00029
00030 StSsdHitCollection::~StSsdHitCollection() { }
00031
00032 unsigned int
00033 StSsdHitCollection::numberOfLadders() const { return mNumberOfLadders; }
00034
00035 bool
00036 StSsdHitCollection::addHit(StSsdHit* hit)
00037 {
00038 unsigned int l, w;
00039 if (hit &&
00040 (l = hit->ladder()-1) < mNumberOfLadders &&
00041 (w = hit->wafer()-1) < mLadders[l].numberOfWafers()) {
00042 mLadders[l].wafer(w)->hits().push_back(hit);
00043 return kTRUE;
00044 }
00045 else {
00046 return kFALSE;
00047 }
00048 }
00049
00050 unsigned int
00051 StSsdHitCollection::numberOfHits() const
00052 {
00053 unsigned int sum = 0;
00054 for (int i=0; i<mNumberOfLadders; i++)
00055 for (unsigned int j=0; j<mLadders[i].numberOfWafers(); j++)
00056 sum += mLadders[i].wafer(j)->hits().size();
00057 return sum;
00058 }
00059
00060 StSsdLadderHitCollection*
00061 StSsdHitCollection::ladder(unsigned int i)
00062 {
00063 if (i < mNumberOfLadders)
00064 return &(mLadders[i]);
00065 else
00066 return 0;
00067 }
00068
00069 const StSsdLadderHitCollection*
00070 StSsdHitCollection::ladder(unsigned int i) const
00071 {
00072 if (i < mNumberOfLadders)
00073 return &(mLadders[i]);
00074 else
00075 return 0;
00076 }
00077