test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoTBCalo
EcalTBTDCReconstructor
src
EcalTBTDCRecInfoAlgo.cc
Go to the documentation of this file.
1
#include "
RecoTBCalo/EcalTBTDCReconstructor/interface/EcalTBTDCRecInfoAlgo.h
"
2
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
3
4
#include <list>
5
#include <iostream>
6
7
EcalTBTDCRecInfoAlgo::EcalTBTDCRecInfoAlgo
(
const
std::vector<EcalTBTDCRanges>&
tdcRanges
) :
8
tdcRanges_(tdcRanges), tdcRangeErrorMessageAlreadyDisplayed_(
false
), actualRun_(-1) , actualRange_(-1)
9
{
10
11
}
12
13
EcalTBTDCRecInfo
EcalTBTDCRecInfoAlgo::reconstruct
(
const
EcalTBTDCRawInfo
& TDCRawInfo,
const
EcalTBEventHeader
& eventHeader,
bool
use2004OffsetConvention)
const
14
{
15
if
(
actualRun_
!= eventHeader.
runNumber
() )
16
{
17
actualRun_
= eventHeader.
runNumber
();
18
actualRange_
= -1;
19
for
(
unsigned
int
i
=0;
i
<
tdcRanges_
.size();
i
++)
20
if
( eventHeader.
runNumber
() <=
tdcRanges_
[
i
].runRanges.second && eventHeader.
runNumber
() >=
tdcRanges_
[
i
].runRanges.first )
21
actualRange_
=
i
;
22
23
if
(
actualRange_
== -1)
24
{
25
edm::LogError
(
"TDCRange not found"
) <<
"TDC range not found"
;
26
return
EcalTBTDCRecInfo
(-1);
27
}
28
}
29
30
int
eventType
;
31
eventType=( (eventHeader.
dbEventType
() == 0) ? 0 : (eventHeader.
dbEventType
()-1));
32
33
int
tdcd = TDCRawInfo[0].tdcValue();
34
35
if
( !
tdcRangeErrorMessageAlreadyDisplayed_
36
&& (tdcd <
tdcRanges_
[
actualRange_
].
tdcMin
[eventType] || tdcd >
tdcRanges_
[
actualRange_
].
tdcMax
[eventType]) ){
37
std::cout
<<
" ============================"
<<std::endl;
38
std::cout
<<
" Event type: "
<< eventType << std::endl;
39
std::cout
<<
" TDC values not correctly set Raw TDC = "
<< tdcd
40
<<
" (Min/Max = "
<<
tdcRanges_
[
actualRange_
].tdcMin[
eventType
] <<
"/"
<<
tdcRanges_
[
actualRange_
].tdcMax[
eventType
]
41
<< std::endl;
42
std::cout
<<
" ============================"
<<std::endl;
43
tdcRangeErrorMessageAlreadyDisplayed_
=
true
;
44
}
45
46
double
offset
= ( (double)tdcd - (
double
)
tdcRanges_
[
actualRange_
].tdcMin[
eventType
] )
47
/ ((
double
)
tdcRanges_
[
actualRange_
].tdcMax[
eventType
]-(double)
tdcRanges_
[
actualRange_
].
tdcMin
[eventType]);
48
if
(use2004OffsetConvention)
49
offset = (1. -
offset
) ;
50
return
EcalTBTDCRecInfo
(offset);
51
}
52
i
int i
Definition:
DBlmapReader.cc:9
MessageLogger.h
Ecal2004TBTDCRanges_cff.tdcMin
tuple tdcMin
Definition:
Ecal2004TBTDCRanges_cff.py:3
EcalTBTDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_
bool tdcRangeErrorMessageAlreadyDisplayed_
Definition:
EcalTBTDCRecInfoAlgo.h:37
stage2BMTFBufferRaw_cfi.eventType
tuple eventType
Definition:
stage2BMTFBufferRaw_cfi.py:61
EcalTBTDCRecInfoAlgo::reconstruct
EcalTBTDCRecInfo reconstruct(const EcalTBTDCRawInfo &TDCRawInfo, const EcalTBEventHeader &eventHeader, bool use2004OffsetConvention) const
Definition:
EcalTBTDCRecInfoAlgo.cc:13
EcalTBTDCRecInfoAlgo::tdcRanges_
std::vector< EcalTBTDCRanges > tdcRanges_
Definition:
EcalTBTDCRecInfoAlgo.h:36
EcalTBTDCRecInfo
Definition:
EcalTBTDCRecInfo.h:13
EcalTBTDCRawInfo
Definition:
EcalTBTDCRawInfo.h:13
edm::LogError
Definition:
MessageLogger.h:164
EcalTBEventHeader::runNumber
int runNumber() const
Definition:
EcalTBEventHeader.h:42
Ecal2004TBTDCRanges_cff.tdcMax
tuple tdcMax
Definition:
Ecal2004TBTDCRanges_cff.py:4
EcalTBEventHeader::dbEventType
int dbEventType() const
Returns the event type as in the H4ROOTDB.
Definition:
EcalTBEventHeader.cc:49
EcalTBEventHeader
Definition:
EcalTBEventHeader.h:15
hltrates_dqm_sourceclient-live_cfg.offset
tuple offset
Definition:
hltrates_dqm_sourceclient-live_cfg.py:81
EcalTBTDCRecInfoAlgo::actualRange_
int actualRange_
Definition:
EcalTBTDCRecInfoAlgo.h:39
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:145
EcalTBTDCRecInfoAlgo.h
edm::false
volatile std::atomic< bool > shutdown_flag false
Definition:
UnixSignalHandlers.cc:22
Ecal2004TBTDCRanges_v1_cff.tdcRanges
tuple tdcRanges
Definition:
Ecal2004TBTDCRanges_v1_cff.py:3
EcalTBTDCRecInfoAlgo::actualRun_
int actualRun_
Definition:
EcalTBTDCRecInfoAlgo.h:38
EcalTBTDCRecInfoAlgo::EcalTBTDCRecInfoAlgo
EcalTBTDCRecInfoAlgo()
Definition:
EcalTBTDCRecInfoAlgo.h:17
Generated for CMSSW Reference Manual by
1.8.5