CbmRoot
TTrbHeader.cxx
Go to the documentation of this file.
1 #include "TTrbHeader.h"
2 
3 #include <TNamed.h> // for TNamed
4 
5 #include <algorithm> // for fill
6 
8  : TNamed()
9  , fuTriggerPattern(0)
10  , fuTriggerType(0)
11  , fdTimeInSpill(0.)
12  , fdTimeInRun(0.)
13  , fiSpillIndex(-1)
14  , fuEventDAQDate(0)
15  , fuEventDAQTime(0)
16  , fiTriggerIndex(-1)
17  , fdCTSBusyTime(0.)
18  , fdCTSIdleTime(0.)
19  , fuSubeventSizes() {}
20 
21 void TTrbHeader::Clear(Option_t*) {
22  fuTriggerPattern = 0;
23  fuTriggerType = 0;
24  fdTimeInSpill = 0.;
25  fdTimeInRun = 0.;
26  fiSpillIndex = -1;
27  fuEventDAQDate = 0;
28  fuEventDAQTime = 0;
29  fiTriggerIndex = -1;
30  fdCTSBusyTime = 0.;
31  fdCTSIdleTime = 0.;
32  std::fill(fuSubeventSizes.begin(), fuSubeventSizes.end(), 0);
33 }
34 
35 void TTrbHeader::SetSubeventSizes(const std::vector<UShort_t>& vuVal) {
36  fuSubeventSizes = vuVal;
37 }
38 
39 UShort_t TTrbHeader::GetSubeventSize(Int_t iSubevent) const {
40  // throws an out_of_range exception if iSubevent is out of bounds
41  // should not happen if properly used
42  return fuSubeventSizes.at(iSubevent);
43 }
44 
45 Int_t TTrbHeader::GetNSubevents() const { return fuSubeventSizes.size(); }
46 
47 Bool_t TTrbHeader::TriggerFired(Int_t iTrg) {
48  // check whether Trigger Pattern matches iTrg in any bit
49  if (fuTriggerPattern & (0x1 << iTrg)) {
50  return kTRUE;
51  } else {
52  return kFALSE;
53  }
54  return kFALSE;
55 }
56 
TTrbHeader::TriggerFired
Bool_t TriggerFired(Int_t iTrg)
Definition: TTrbHeader.cxx:47
TTrbHeader::GetNSubevents
Int_t GetNSubevents() const
Definition: TTrbHeader.cxx:45
TTrbHeader::fuEventDAQTime
UInt_t fuEventDAQTime
Definition: TTrbHeader.h:52
TTrbHeader::fuTriggerType
UInt_t fuTriggerType
Definition: TTrbHeader.h:47
TTrbHeader::fdCTSBusyTime
Double_t fdCTSBusyTime
Definition: TTrbHeader.h:54
TTrbHeader::SetSubeventSizes
void SetSubeventSizes(const std::vector< UShort_t > &vuVal)
Definition: TTrbHeader.cxx:35
TTrbHeader::GetSubeventSize
UShort_t GetSubeventSize(Int_t iSubevent) const
Definition: TTrbHeader.cxx:39
TTrbHeader::fiTriggerIndex
Int_t fiTriggerIndex
Definition: TTrbHeader.h:53
TTrbHeader::fiSpillIndex
Int_t fiSpillIndex
Definition: TTrbHeader.h:50
TTrbHeader::fuTriggerPattern
UInt_t fuTriggerPattern
Definition: TTrbHeader.h:46
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
TTrbHeader::TTrbHeader
TTrbHeader()
Definition: TTrbHeader.cxx:7
TTrbHeader::fdTimeInSpill
Double_t fdTimeInSpill
Definition: TTrbHeader.h:48
TTrbHeader::fdCTSIdleTime
Double_t fdCTSIdleTime
Definition: TTrbHeader.h:55
TTrbHeader.h
TTrbHeader::fuEventDAQDate
UInt_t fuEventDAQDate
Definition: TTrbHeader.h:51
TTrbHeader::Clear
virtual void Clear(Option_t *option="")
Definition: TTrbHeader.cxx:21
TTrbHeader::fdTimeInRun
Double_t fdTimeInRun
Definition: TTrbHeader.h:49
TTrbHeader
Definition: TTrbHeader.h:10
TTrbHeader::fuSubeventSizes
std::vector< UShort_t > fuSubeventSizes
Definition: TTrbHeader.h:57