StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRHICfCollection.cxx
1 #include "StRHICfCollection.h"
2 
3 ClassImp(StRHICfCollection)
4 
6 {
7  clear();
8 }
9 
10 StRHICfCollection::~StRHICfCollection()
11 {
12  if(mRHICfRawHitColl){
13  delete mRHICfRawHitColl;
14  mRHICfRawHitColl = nullptr;
15  }
16  if(mRHICfHitColl){
17  delete mRHICfHitColl;
18  mRHICfHitColl = nullptr;
19  }
20  if(mRHICfPointColl.size() != 0){
21  for(unsigned int i=0; i<mRHICfPointColl.size(); i++){
22  delete mRHICfPointColl[i];
23  mRHICfPointColl[i] = nullptr;
24  }
25  }
26 }
27 
28 void StRHICfCollection::clear()
29 {
30  mRHICfRawHitColl = new StRHICfRawHit();
31  mRHICfHitColl = 0;
32 
33  mRHICfRunNumber = 0;
34  mRHICfEventNumber = 0;
35  mBunchNumber = 0;
36  mRHICfTrigger = 0;
37  mRunTime[0] = 0;
38  mRunTime[1] = 0;
39  mRunTRGM = 0;
40  mRunType = 999;
41 }
42 
43 StRHICfRawHit* StRHICfCollection::rawHitCollection(){return mRHICfRawHitColl;}
44 StRHICfHit* StRHICfCollection::hitCollection(){return mRHICfHitColl;}
45 
46 void StRHICfCollection::addPoint(StRHICfPoint* pointColl){mRHICfPointColl.push_back(pointColl);}
47 void StRHICfCollection::addPointCollection(std::vector<StRHICfPoint*> coll){mRHICfPointColl = coll;}
48 
49 std::vector<StRHICfPoint*>& StRHICfCollection::pointCollection(){return mRHICfPointColl;}
50 const std::vector<StRHICfPoint*>& StRHICfCollection::pointCollection() const {return mRHICfPointColl;}
51 
52 void StRHICfCollection::isAllSave(){mRHICfHitColl = new StRHICfHit();}
53 
54 //=========== Set ===========//
55 void StRHICfCollection::setRHICfRunNumber(UInt_t run){mRHICfRunNumber = run;}
56 void StRHICfCollection::setRHICfEventNumber(UInt_t event){mRHICfEventNumber = event;}
57 void StRHICfCollection::setBunchNumber(UInt_t bunch){mBunchNumber = bunch;}
58 void StRHICfCollection::setRunType(UInt_t type){mRunType = type;}
59 void StRHICfCollection::setTriggerNumber(UInt_t trigger){mRHICfTrigger = trigger;}
60 void StRHICfCollection::setRunTime(Int_t idx, UInt_t time){mRunTime[idx] = time;}
61 void StRHICfCollection::setRunTRGM(UInt_t trgm){mRunTRGM = trgm;}
62 
63 //=========== Get ===========//
64 UInt_t StRHICfCollection::numberOfPoints() const {return mRHICfPointColl.size();}
65 UInt_t StRHICfCollection::getRHICfRunNumber() const { return mRHICfRunNumber; }
66 UInt_t StRHICfCollection::getRHICfEventNumber() const { return mRHICfEventNumber; }
67 UInt_t StRHICfCollection::getBunchNumber(){return mBunchNumber;}
68 UInt_t StRHICfCollection::getRunType(){return mRunType;}
69 UInt_t StRHICfCollection::getTriggerNumber(){return mRHICfTrigger;}
70 UInt_t StRHICfCollection::getRunTime(Int_t idx){return mRunTime[idx];}
71 UInt_t StRHICfCollection::getRunTRGM(){return mRunTRGM;}