StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuMtdCollection.cxx
1 #include "StMuMtdCollection.h"
2 #include "StMuMtdRawHit.h"
3 #include "StMuMtdHit.h"
4 #include "StMuMtdHeader.h"
5 
6 #include "StEvent/StEvent.h"
7 #include "StEvent/StMtdCollection.h"
8 #include "StEvent/StMtdHeader.h"
9 #include "StEvent/StMtdHit.h"
10 #include "StEvent/StMtdRawHit.h"
11 
12 ClassImp(StMuMtdCollection)
13 
15 StMuMtdCollection::~StMuMtdCollection() {;}
16 
17 StMuMtdCollection::StMuMtdCollection(const StMtdCollection & mtd){
18 
19  const StMtdCollection *mtdp = &mtd;
20 
21  //Fill Header
22  mMtdHeader.push_back(StMuMtdHeader(mtdp->mtdHeader()));
23 
24  //Fill Hits
25  const StSPtrVecMtdHit& VecHit = mtdp->mtdHits();
26  for(uint32_t i=0; i< VecHit.size(); i++){
27  StMtdHit *pHit = (StMtdHit*)VecHit.at(i);
28  mMtdHits.push_back(StMuMtdHit(pHit));
29  }
30 
31  //Fill Raw Hits
32  const StSPtrVecMtdRawHit& VecRawHit = mtdp->mtdRawHits();
33  for(uint32_t i=0; i< VecRawHit.size(); i++){
34  StMtdRawHit *pRawHit = (StMtdRawHit*)VecRawHit.at(i);
35  mMtdRawHits.push_back(StMuMtdRawHit(pRawHit));
36  }
37 
38 }
39 
40 StMuMtdHeader* StMuMtdCollection::mtdHeader() { return &mMtdHeader[0]; }
41 const StMuMtdHeader* StMuMtdCollection::mtdHeader() const { return &mMtdHeader[0]; }
42 
43 int StMuMtdCollection::hitsPresent() { return mMtdHits.size(); }
44 int StMuMtdCollection::rawHitsPresent() { return mMtdRawHits.size(); }
45 
46 StMuMtdRawHit* StMuMtdCollection::RawMtdHit(int i) { return &mMtdRawHits[i]; }
47 StMuMtdHit* StMuMtdCollection::MtdHit(int i) { return &mMtdHits[i]; }