StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuMtdHeader.cxx
1 #include "StMuMtdHeader.h"
2 #include "StEvent/StEvent.h"
3 #include "StEvent/StMtdHeader.h"
4 
5 ClassImp(StMuMtdHeader)
6 
7 StMuMtdHeader::StMuMtdHeader() : mFiberHeader1(0), mFiberHeader2(0), mFiberTriggerWord1(0), mFiberTriggerWord2(0),
8  mTriggerTime1(0), mTriggerTime2(0), mShouldHaveRejectEvent(-1), mTpcSectorMask(0)
9 {
10  // default constructor
11 }
12 
13 StMuMtdHeader::StMuMtdHeader(const StMtdHeader *header) : StMuMtdHeader()
14 {
15  if (header){
16  for(int i=0; i<header->MAXFIBER; i++){
17  if(i==0) {
18  mFiberHeader1 = header->fiberHeader(i);
19  mFiberTriggerWord1 = header->fiberTriggerWord(i);
20  mTriggerTime1 = header->triggerTime(i);
21  }
22  else if(i==1){
23  mFiberHeader2 = header->fiberHeader(i);
24  mFiberTriggerWord2 = header->fiberTriggerWord(i);
25  mTriggerTime2 = header->triggerTime(i);
26  }
27  }
28  mShouldHaveRejectEvent = header->shouldHaveRejectEvent();
29  mTpcSectorMask = header->tpcSectorMask();
30  }
31 }
32 
33 short StMuMtdHeader::fiberHeader(int fiberId) const {
34  if (fiberId==1) return mFiberHeader1;
35  else if (fiberId==2) return mFiberHeader2;
36  else return 0;
37 }
38 
39 unsigned int StMuMtdHeader::fiberTriggerWord(int fiberId) const {
40  if (fiberId==1) return mFiberTriggerWord1;
41  else if (fiberId==2) return mFiberTriggerWord2;
42  else return 0;
43 }
44 
45 unsigned int StMuMtdHeader::triggerTime(int fiberId) const {
46  if (fiberId==1) return mTriggerTime1;
47  else if (fiberId==2) return mTriggerTime2;
48  else return 0;
49 }
50 
51 int StMuMtdHeader::shouldHaveRejectEvent() const {
52  return mShouldHaveRejectEvent;
53 }
54 
55 unsigned int StMuMtdHeader::tpcSectorMask() const {
56  return mTpcSectorMask;
57 }