CMS 3D CMS Logo

EcalTBEventHeader.cc
Go to the documentation of this file.
2 #include <cstdio>
3 
8  // this piece of code was in TPilot (ievtype)
9  int m = triggerMask_ & 0x00FFFF01; // bits 0, 8..23
10 
11  // this piece of code was in TPilot (numbit)
12  int w = m;
13  int num = 0;
14  if (w < 0) { //
15  w &= 0x7FFFFFFF; // CINT Error
16  num++; //
17  }
18  do {
19  num += (w & 0x1);
20  } while ((w >>= 1) != 0);
21  // end of numbit
22 
23  if (num != 1)
24  return std::string("error");
25 
26  char chEvtype[80];
27  if (m == 1)
28  return std::string("beam"); // Physics triggers
29  for (int i = 0; i < 24; i++) {
30  if ((m & 0x1) == 1) {
31  sprintf(chEvtype, "%d", i);
32  if (i == 11)
33  return std::string("pedestal");
34  if (i == 13)
35  return std::string("laser");
36  return std::string(chEvtype);
37  }
38  m >>= 1;
39  }
40  return std::string("error");
41 
42  // // FIXME: to be uncommented with new rawroot
43  // int evtype = rawHeader->GetEventType() ;
44  // if (evtype == 0) return std::string("error") ;
45  // if (evtype == 1) return std::string("beam") ;
46  // if (evtype == 11) return std::string("pedestal") ;
47  // if (evtype == 13) return std::string("laser") ;
48  // char chEvtype[80] ;
49  // sprintf(chEvtype, "%d", evtype) ;
50  // return std::string(chEvtype) ;
51 }
52 
54  std::string evtType = eventType();
55  int ievtType = 0;
56  if (evtType == "beam")
57  ievtType = 1;
58  if (evtType == "laser")
59  ievtType = 2;
60  if (evtType == "pedestal")
61  ievtType = 1; // same as beam
62  if (ievtType == 2) {
63  LaserType laser_type = laserTypeName();
64  //if (laser_type == EcalTBEventHeader::LBlue) ievtType += 0 ;
65  if (laser_type == EcalTBEventHeader::LGreen)
66  ievtType += 1;
67  if (laser_type == EcalTBEventHeader::LInfrared)
68  ievtType += 2;
69  if (laser_type == EcalTBEventHeader::LRed)
70  ievtType += 3;
71  }
72  return ievtType;
73 }
74 
75 std::ostream& operator<<(std::ostream& s, const EcalTBEventHeader& eventHeader) {
76  s << "Run Number " << eventHeader.runNumber() << " Event Number " << eventHeader.eventNumber() << " Burst Number "
77  << eventHeader.burstNumber();
78  return s;
79 }
mps_fire.i
i
Definition: mps_fire.py:355
EcalTBEventHeader::laserTypeName
LaserType laserTypeName() const
Definition: EcalTBEventHeader.h:118
EcalTBEventHeader::triggerMask_
int triggerMask_
The trigger mask.
Definition: EcalTBEventHeader.h:225
EcalTBEventHeader
Definition: EcalTBEventHeader.h:14
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
EcalTBEventHeader::runNumber
int runNumber() const
Definition: EcalTBEventHeader.h:37
EcalTBEventHeader::LaserType
LaserType
Definition: EcalTBEventHeader.h:105
w
const double w
Definition: UKUtility.cc:23
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
EcalTBEventHeader::eventNumber
int eventNumber() const
Returns the event number.
Definition: EcalTBEventHeader.h:35
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTBEventHeader::burstNumber
short burstNumber() const
Returns the burst number.
Definition: EcalTBEventHeader.h:40
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
EcalTBEventHeader::dbEventType
int dbEventType() const
Returns the event type as in the H4ROOTDB.
Definition: EcalTBEventHeader.cc:53
EcalTBEventHeader::LInfrared
709 nm
Definition: EcalTBEventHeader.h:109
EcalTBEventHeader.h
operator<<
std::ostream & operator<<(std::ostream &s, const EcalTBEventHeader &eventHeader)
Definition: EcalTBEventHeader.cc:75
EcalTBEventHeader::eventType
std::string eventType() const
Definition: EcalTBEventHeader.cc:7
EcalTBEventHeader::LGreen
440 nm
Definition: EcalTBEventHeader.h:107
EcalTBEventHeader::LRed
495 nm
Definition: EcalTBEventHeader.h:108