StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuBTofUtil.cxx
1 /****************************************************************
2  * $Id: StMuBTofUtil.cxx,v 1.1 2009/02/20 17:05:59 tone421 Exp $
3  *
4  * Author: Xin Dong, Feb 2009
5  *
6  *****************************************************************
7  *
8  * Description:
9  * Convert StBTofHitCollection in StEvent to
10  * StMuBTofHitCollection in MuDst
11  *
12  *****************************************************************
13  *
14  * $Log: StMuBTofUtil.cxx,v $
15  * Revision 1.1 2009/02/20 17:05:59 tone421
16  * *** empty log message ***
17  *
18  *
19  ****************************************************************/
20 #include "StEvent.h"
21 #include "StTrack.h"
22 #include "StBTofCollection.h"
23 #include "StBTofHit.h"
24 #include "StMuBTofUtil.h"
25 #include "StMuBTofHitCollection.h"
26 
27 ClassImp(StMuBTofUtil)
28 
30 { }
31 
32 StMuBTofUtil::~StMuBTofUtil()
33 { }
34 
35 StMuBTofHitCollection* StMuBTofUtil::getMuBTofHit(StBTofCollection *tofcol)
36 {
37  if(!tofcol) return NULL;
39  fillMuBTofHit(muTofHit, tofcol);
40  return muTofHit;
41 }
42 
43 void StMuBTofUtil::fillMuBTofHit(StMuBTofHitCollection* muTofHit, StBTofCollection* tofcol)
44 {
45  if( !tofcol || (!tofcol->rawHitsPresent()) ) return;
46  if(!muTofHit) return;
47 
48  if( tofcol->hitsPresent() ) {
49  StSPtrVecBTofHit &tofHits = tofcol->tofHits();
50 
51  for(size_t i=0; i < tofHits.size(); i++) {
52  StBTofHit *aHit = tofHits[i];
53  if(!aHit) continue;
54  StMuBTofHit* tofMuHit = new StMuBTofHit(aHit);
55  muTofHit->push_back(tofMuHit);
56  }
57  }
58  return;
59 }