Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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:155
i
int i
Definition:
DBlmapReader.cc:9
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:48
EcalTBEventHeader::triggerMask_
int triggerMask_
The trigger mask.
Definition:
EcalTBEventHeader.h:254
EcalTBEventHeader::runNumber
int runNumber() const
Definition:
EcalTBEventHeader.h:43
EcalTBEventHeader::LInfrared
709 nm
Definition:
EcalTBEventHeader.h:144
EcalTBEventHeader::LaserType
LaserType
Definition:
EcalTBEventHeader.h:140
EcalTBEventHeader::dbEventType
int dbEventType() const
Returns the event type as in the H4ROOTDB.
Definition:
EcalTBEventHeader.cc:49
EcalTBEventHeader
Definition:
EcalTBEventHeader.h:16
m
int m
Definition:
DTDataIntegrityTask.cc:33
EcalTBEventHeader.h
alignCSCRings.s
list s
Definition:
alignCSCRings.py:91
evf::utils::num
long long int num
Definition:
procUtils.cc:71
EcalTBEventHeader::eventNumber
int eventNumber() const
Returns the event number.
Definition:
EcalTBEventHeader.h:39
EcalTBEventHeader::LGreen
440 nm
Definition:
EcalTBEventHeader.h:142
EcalTBEventHeader::LRed
495 nm
Definition:
EcalTBEventHeader.h:143
w
T w() const
Definition:
newBasic3DVector.h:234
Generated for CMSSW Reference Manual by
1.8.5