Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
TBDataFormats
EcalTBObjects
src
EcalTBEventHeader.cc
Go to the documentation of this file.
1
#include "
TBDataFormats/EcalTBObjects/interface/EcalTBEventHeader.h
"
2
#include <cstdio>
3
7
std::string
EcalTBEventHeader::eventType
()
const
8
{
9
// this piece of code was in TPilot (ievtype)
10
int
m
=
triggerMask_
& 0x00FFFF01;
// bits 0, 8..23
11
12
// this piece of code was in TPilot (numbit)
13
int
w
=
m
;
14
int
num
= 0;
15
if
( w < 0 ) {
//
16
w &= 0x7FFFFFFF;
// CINT Error
17
num++;
//
18
}
19
do
{ num += ( w & 0x1 ); }
while
( (w >>= 1) != 0 );
20
// end of numbit
21
22
if
(num != 1)
return
std::string
(
"error"
) ;
23
24
char
chEvtype[80] ;
25
if
( m == 1 )
return
std::string
(
"beam"
) ;
// Physics triggers
26
for
(
int
i
=0;
i
<24;
i
++) {
27
if
( ( m & 0x1 ) == 1 ) {
28
sprintf(chEvtype,
"%d"
,
i
) ;
29
if
(
i
==11)
return
std::string
(
"pedestal"
) ;
30
if
(
i
==13)
return
std::string
(
"laser"
) ;
31
return
std::string
(chEvtype) ;
32
}
33
m >>= 1;
34
}
35
return
std::string
(
"error"
);
36
37
// // FIXME: to be uncommented with new rawroot
38
// int evtype = rawHeader->GetEventType() ;
39
// if (evtype == 0) return std::string("error") ;
40
// if (evtype == 1) return std::string("beam") ;
41
// if (evtype == 11) return std::string("pedestal") ;
42
// if (evtype == 13) return std::string("laser") ;
43
// char chEvtype[80] ;
44
// sprintf(chEvtype, "%d", evtype) ;
45
// return std::string(chEvtype) ;
46
}
47
48
49
int
EcalTBEventHeader::dbEventType
()
const
{
50
std::string
evtType =
eventType
();
51
int
ievtType = 0;
52
if
(evtType==
"beam"
) ievtType = 1 ;
53
if
(evtType==
"laser"
) ievtType = 2 ;
54
if
(evtType==
"pedestal"
) ievtType = 1 ;
// same as beam
55
if
(ievtType == 2) {
56
LaserType
laser_type =
laserTypeName
();
57
//if (laser_type == EcalTBEventHeader::LBlue) ievtType += 0 ;
58
if
(laser_type ==
EcalTBEventHeader::LGreen
) ievtType += 1 ;
59
if
(laser_type ==
EcalTBEventHeader::LInfrared
) ievtType += 2 ;
60
if
(laser_type ==
EcalTBEventHeader::LRed
) ievtType += 3 ;
61
}
62
return
ievtType;
63
}
64
65
std::ostream&
operator<<
(std::ostream&
s
,
const
EcalTBEventHeader
& eventHeader) {
66
s <<
"Run Number "
<< eventHeader.
runNumber
() <<
" Event Number "
<< eventHeader.
eventNumber
() <<
" Burst Number "
<< eventHeader.
burstNumber
() ;
67
return
s
;
68
}
EcalTBEventHeader::laserTypeName
LaserType laserTypeName() const
Definition:
EcalTBEventHeader.h:154
i
int i
Definition:
DBlmapReader.cc:9
w
const double w
Definition:
UKUtility.cc:23
EcalTBEventHeader::eventType
std::string eventType() const
Definition:
EcalTBEventHeader.cc:7
operator<<
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition:
ALILine.cc:187
EcalTBEventHeader::burstNumber
short burstNumber() const
Returns the burst number.
Definition:
EcalTBEventHeader.h:47
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
visualization-live-secondInstance_cfg.m
tuple m
Definition:
visualization-live-secondInstance_cfg.py:45
EcalTBEventHeader::triggerMask_
int triggerMask_
The trigger mask.
Definition:
EcalTBEventHeader.h:253
EcalTBEventHeader::runNumber
int runNumber() const
Definition:
EcalTBEventHeader.h:42
EcalTBEventHeader::LInfrared
709 nm
Definition:
EcalTBEventHeader.h:143
pileupDistInMC.num
tuple num
Definition:
pileupDistInMC.py:64
EcalTBEventHeader::LaserType
LaserType
Definition:
EcalTBEventHeader.h:139
EcalTBEventHeader::dbEventType
int dbEventType() const
Returns the event type as in the H4ROOTDB.
Definition:
EcalTBEventHeader.cc:49
EcalTBEventHeader
Definition:
EcalTBEventHeader.h:15
EcalTBEventHeader.h
alignCSCRings.s
list s
Definition:
alignCSCRings.py:91
EcalTBEventHeader::eventNumber
int eventNumber() const
Returns the event number.
Definition:
EcalTBEventHeader.h:38
EcalTBEventHeader::LGreen
440 nm
Definition:
EcalTBEventHeader.h:141
EcalTBEventHeader::LRed
495 nm
Definition:
EcalTBEventHeader.h:142
Generated for CMSSW Reference Manual by
1.8.5