CMS 3D CMS Logo

HcalTBTriggerData.cc
Go to the documentation of this file.
2 #include <cstdio>
3 #include <cstdint>
4 
5 using namespace std;
6 
7 const uint32_t HcalTBTriggerData::bit_BeamTrigger = 1;
10 const uint32_t HcalTBTriggerData::bit_LaserTrigger = 4;
12 const uint32_t HcalTBTriggerData::bit_LEDTrigger = 6;
13 
14 const uint32_t HcalTBTriggerData::bit_FakeTrigger = 15;
15 
16 const uint32_t HcalTBTriggerData::bit_InSpill = 0x10;
17 
19  : runNumberSequenceId_(""),
20  runNumber_(0),
21  triggerWord_(0),
22  triggerTimeUsec_(0),
23  triggerTimeBase_(0),
24  spillNumber_(0),
25  orbitNumber_(0),
26  bunchNumber_(0),
27  eventNumber_(0),
28  flagsDaqTtype_(0),
29  algoBits3_(0),
30  algoBits2_(0),
31  algoBits1_(0),
32  algoBits0_(0),
33  techBits_(0),
34  gps1234_(0),
35  gps5678_(0) {}
36 
37 void HcalTBTriggerData::setStandardData(uint32_t orbitNumber,
38  uint32_t eventNumber,
39  uint16_t bunchNumber,
40  uint32_t flags_daq_ttype,
41  uint32_t algo_bits_3,
42  uint32_t algo_bits_2,
43  uint32_t algo_bits_1,
44  uint32_t algo_bits_0,
45  uint32_t tech_bits,
46  uint32_t gps_1234,
47  uint32_t gps_5678) {
49  eventNumber_ = eventNumber & 0x00ffffff; // only lower 24 bits active
51  flagsDaqTtype_ = flags_daq_ttype;
52  algoBits3_ = algo_bits_3;
53  algoBits2_ = algo_bits_2;
54  algoBits1_ = algo_bits_1;
55  algoBits0_ = algo_bits_0;
56  techBits_ = tech_bits;
57  gps1234_ = gps_1234;
58  gps5678_ = gps_5678;
59 }
60 
61 void HcalTBTriggerData::setExtendedData(uint32_t triggerWord,
62  uint32_t triggerTime_usec,
63  uint32_t triggerTime_base,
64  uint32_t spillNumber,
65  uint32_t runNumber,
66  const char* runNumberSequenceId) {
68  triggerTimeUsec_ = triggerTime_usec;
69  triggerTimeBase_ = triggerTime_base;
73 }
74 
75 ostream& operator<<(ostream& s, const HcalTBTriggerData& htbtd) {
76  char str[50];
77  s << htbtd.runNumberSequenceId() << ":";
78  s << htbtd.runNumber() << ":";
79  s << htbtd.eventNumber() << endl;
80 
81  s << " Spill# =" << htbtd.spillNumber() << endl;
82  s << " Bunch# =" << htbtd.bunchNumber() << endl;
83  s << " Orbit# =" << htbtd.orbitNumber() << endl;
84 
85  sprintf(str, " Trigger word = %08x\n", htbtd.triggerWord());
86  s << str;
87 
88  int32_t trigtimebase = (int32_t)htbtd.triggerTimeBase();
89  uint32_t trigtimeusec = htbtd.triggerTimeUsec();
90 
91  // trim seconds off of usec and add to base
92  trigtimebase += trigtimeusec / 1000000;
93  trigtimeusec %= 1000000;
94 
95  sprintf(str, " Trigger time: %s", ctime((time_t*)&trigtimebase));
96  s << str;
97  sprintf(str, " %d us\n", trigtimeusec);
98  s << str;
99 
100  return s;
101 }
HcalTBTriggerData::bit_LaserTrigger
static const uint32_t bit_LaserTrigger
Definition: HcalTBTriggerData.h:101
HcalTBTriggerData::flagsDaqTtype_
uint32_t flagsDaqTtype_
Definition: HcalTBTriggerData.h:119
HcalTBTriggerData::spillNumber
uint32_t spillNumber() const
Returns the spill number of this trigger.
Definition: HcalTBTriggerData.h:34
HcalTBTriggerData::triggerWord_
uint32_t triggerWord_
Definition: HcalTBTriggerData.h:112
HcalTBTriggerData::orbitNumber_
uint32_t orbitNumber_
Definition: HcalTBTriggerData.h:116
HcalTBTriggerData::HcalTBTriggerData
HcalTBTriggerData()
Definition: HcalTBTriggerData.cc:18
HcalTBTriggerData::eventNumber
uint16_t eventNumber() const
Returns the event number of this trigger.
Definition: HcalTBTriggerData.h:40
HcalTBTriggerData::setExtendedData
void setExtendedData(uint32_t triggerWord, uint32_t triggerTime_usec, uint32_t triggerTime_base, uint32_t spillNumber, uint32_t runNumber, const char *runNumberSequenceId)
Definition: HcalTBTriggerData.cc:61
HcalTBTriggerData.h
HcalTBTriggerData::gps5678_
uint32_t gps5678_
Definition: HcalTBTriggerData.h:126
operator<<
ostream & operator<<(ostream &s, const HcalTBTriggerData &htbtd)
Definition: HcalTBTriggerData.cc:75
HcalTBTriggerData::bit_LEDTrigger
static const uint32_t bit_LEDTrigger
Definition: HcalTBTriggerData.h:103
HcalTBTriggerData::runNumber
uint32_t runNumber() const
Returns the current run number.
Definition: HcalTBTriggerData.h:26
HcalTBTriggerData::bit_InSpill
static const uint32_t bit_InSpill
Definition: HcalTBTriggerData.h:107
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
HcalTBTriggerData::techBits_
uint32_t techBits_
Definition: HcalTBTriggerData.h:124
HcalTBTriggerData::bit_InSpillPedestalTrigger
static const uint32_t bit_InSpillPedestalTrigger
Definition: HcalTBTriggerData.h:99
HcalTBTriggerData::runNumberSequenceId_
std::string runNumberSequenceId_
Definition: HcalTBTriggerData.h:110
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HcalTBTriggerData::triggerTimeUsec
uint32_t triggerTimeUsec() const
Returns the relative time of this trigger in microseconds.
Definition: HcalTBTriggerData.h:30
HcalTBTriggerData::bunchNumber
uint16_t bunchNumber() const
Returns the bunch number of this trigger.
Definition: HcalTBTriggerData.h:38
HcalTBTriggerData::eventNumber_
uint32_t eventNumber_
Definition: HcalTBTriggerData.h:118
HcalTBTriggerData::algoBits3_
uint32_t algoBits3_
<extended type="31:28,extended" size="27:24,zeros=23:7,daq#=6:4,type=3:0">
Definition: HcalTBTriggerData.h:120
str
#define str(s)
Definition: TestProcessor.cc:53
HcalTBTriggerData::algoBits2_
uint32_t algoBits2_
Definition: HcalTBTriggerData.h:121
HcalTBTriggerData::algoBits0_
uint32_t algoBits0_
Definition: HcalTBTriggerData.h:123
HcalTBTriggerData::triggerTimeBase_
uint32_t triggerTimeBase_
Definition: HcalTBTriggerData.h:114
HcalTBTriggerData::setStandardData
void setStandardData(uint32_t orbitNumber, uint32_t eventNumber, uint16_t bunchNumber, uint32_t flags_daq_ttype, uint32_t algo_bits_3, uint32_t algo_bits_2, uint32_t algo_bits_1, uint32_t algo_bits_0, uint32_t tech_bits, uint32_t gps_1234, uint32_t gps_5678)
Definition: HcalTBTriggerData.cc:37
HcalTBTriggerData
Definition: HcalTBTriggerData.h:17
HcalTBTriggerData::runNumber_
uint32_t runNumber_
Definition: HcalTBTriggerData.h:111
HcalTBTriggerData::bunchNumber_
uint16_t bunchNumber_
Definition: HcalTBTriggerData.h:117
HcalTBTriggerData::runNumberSequenceId
const std::string & runNumberSequenceId() const
Definition: HcalTBTriggerData.h:23
HcalTBTriggerData::triggerTimeBase
uint32_t triggerTimeBase() const
Returns the base time of the run (in seconds, from a time() call)
Definition: HcalTBTriggerData.h:32
HcalTBTriggerData::triggerTimeUsec_
uint32_t triggerTimeUsec_
Definition: HcalTBTriggerData.h:113
HcalTBTriggerData::algoBits1_
uint32_t algoBits1_
Definition: HcalTBTriggerData.h:122
std
Definition: JetResolutionObject.h:76
HcalTBTriggerData::bit_BeamTrigger
static const uint32_t bit_BeamTrigger
Definition: HcalTBTriggerData.h:98
HcalTBTriggerData::bit_spillIgnorantPedestalTrigger
static const uint32_t bit_spillIgnorantPedestalTrigger
Definition: HcalTBTriggerData.h:102
HcalTBTriggerData::orbitNumber
uint32_t orbitNumber() const
Returns the orbit number of this trigger.
Definition: HcalTBTriggerData.h:36
HcalTBTriggerData::bit_FakeTrigger
static const uint32_t bit_FakeTrigger
Definition: HcalTBTriggerData.h:105
HcalTBTriggerData::triggerWord
uint32_t triggerWord() const
Returns the entire packed trigger word.
Definition: HcalTBTriggerData.h:28
HcalTBTriggerData::gps1234_
uint32_t gps1234_
Definition: HcalTBTriggerData.h:125
HcalTBTriggerData::bit_OutSpillPedestalTrigger
static const uint32_t bit_OutSpillPedestalTrigger
Definition: HcalTBTriggerData.h:100
sistrip::runNumber_
static const char runNumber_[]
Definition: ConstantsForDqm.h:33
HcalTBTriggerData::spillNumber_
uint32_t spillNumber_
Definition: HcalTBTriggerData.h:115