Main Page
Namespaces
Classes
Package Documentation
src
CalibMuon
DTCalibration
plugins
DTT0FillDefaultFromDB.cc
Go to the documentation of this file.
1
/*
2
* See header file for a description of this class.
3
*/
4
5
#include "
DTT0FillDefaultFromDB.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/Framework/interface/ESHandle.h
"
9
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
10
11
#include "
DataFormats/MuonDetId/interface/DTWireId.h
"
12
#include "
CondFormats/DTObjects/interface/DTT0.h
"
13
#include "
CondFormats/DataRecord/interface/DTT0Rcd.h
"
14
15
#include <string>
16
17
using namespace
std
;
18
using namespace
edm
;
19
20
namespace
dtCalibration
{
21
22
DTT0FillDefaultFromDB::DTT0FillDefaultFromDB(
const
ParameterSet
&
pset
):
23
dbLabelRef_( pset.getParameter<
string
>(
"dbLabelRef"
) ) {
24
}
25
26
DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB
() {
27
}
28
29
void
DTT0FillDefaultFromDB::setES
(
const
EventSetup
&
setup
) {
30
// Get t0 record from DB
31
ESHandle<DTT0>
t0H;
32
setup.
get
<
DTT0Rcd
>().
get
(t0H);
33
t0Map_
= &*t0H;
34
LogVerbatim
(
"Calibration"
) <<
"[DTT0FillDefaultFromDB] T0 version: "
<< t0H->
version
();
35
36
// Get reference t0 DB
37
ESHandle<DTT0>
t0RefH;
38
setup.
get
<
DTT0Rcd
>().
get
(
dbLabelRef_
,t0RefH);
39
t0MapRef_
= &*t0RefH;
40
LogVerbatim
(
"Calibration"
) <<
"[DTT0FillDefaultFromDB] Reference T0 version: "
<< t0RefH->
version
();
41
42
}
43
44
DTT0Data
DTT0FillDefaultFromDB::correction
(
const
DTWireId
& wireId) {
45
// Try to access value in default DB
46
// If it does not exist return value from reference DB
47
// If it does not exist in reference DB, throw exception
48
// Could also set to default zero value
49
float
t0Mean,t0RMS;
50
int
status
=
t0Map_
->
get
(wireId,t0Mean,t0RMS,
DTTimeUnits::counts
);
51
if
(!status){
52
return
DTT0Data
(t0Mean,t0RMS);
53
}
else
{
54
// Now access reference DB
55
float
t0MeanRef,t0RMSRef;
56
int
statusRef =
t0MapRef_
->
get
(wireId,t0MeanRef,t0RMSRef,
DTTimeUnits::counts
);
57
if
(!statusRef){
58
return
DTT0Data
(t0MeanRef,t0RMSRef);
59
}
else
{
60
//...
61
throw
cms::Exception
(
"[DTT0FillDefaultFromDB]"
) <<
"Could not find t0 entry in reference DB for"
62
<< wireId << endl;
63
}
64
}
65
}
66
67
}
// namespace
dtCalibration::DTT0Data
Definition:
DTT0BaseCorrection.h:18
MessageLogger.h
Exception
Definition:
hltDiff.cc:292
dtCalibration::DTT0FillDefaultFromDB::dbLabelRef_
std::string dbLabelRef_
Definition:
DTT0FillDefaultFromDB.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
dtCalibration
Definition:
DTT0BaseCorrection.h:16
EventSetup.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
GeneralSetup.setup
def setup(process, global_tag, zero_tesla=False)
Definition:
GeneralSetup.py:2
std
Definition:
JetResolutionObject.h:80
dtCalibration::DTT0FillDefaultFromDB::setES
void setES(const edm::EventSetup &setup) override
Definition:
DTT0FillDefaultFromDB.cc:29
DTT0Rcd.h
mps_update.status
status
Definition:
mps_update.py:69
DTT0::get
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition:
DTT0.cc:67
dtCalibration::DTT0FillDefaultFromDB::t0MapRef_
const DTT0 * t0MapRef_
Definition:
DTT0FillDefaultFromDB.h:38
ParameterSet.h
dtCalibration::DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB
~DTT0FillDefaultFromDB() override
Definition:
DTT0FillDefaultFromDB.cc:26
edm::ESHandle< DTT0 >
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:57
edm::LogVerbatim
Definition:
MessageLogger.h:297
DTT0FillDefaultFromDB.h
DTT0.h
DTTimeUnits::counts
Definition:
DTTimeUnits.h:37
DTT0Rcd
Definition:
DTT0Rcd.h:9
DTWireId.h
edm
HLT enums.
Definition:
AlignableModifier.h:17
dtCalibration::DTT0FillDefaultFromDB::t0Map_
const DTT0 * t0Map_
Definition:
DTT0FillDefaultFromDB.h:39
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:71
DTWireId
Definition:
DTWireId.h:13
edm::ParameterSet
Definition:
ParameterSet.h:36
DTT0::version
const std::string & version() const
access version
Definition:
DTT0.cc:118
dtCalibration::DTT0FillDefaultFromDB::correction
DTT0Data correction(const DTWireId &) override
Definition:
DTT0FillDefaultFromDB.cc:44
Generated for CMSSW Reference Manual by
1.8.11