Main Page
Namespaces
Classes
Package Documentation
CVS Directory
WorkBook
Offline Guide
Release schedule
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
* $Date: 2012/03/02 19:47:32 $
5
* $Revision: 1.1 $
6
* \author A. Vilela Pereira
7
*/
8
9
#include "
DTT0FillDefaultFromDB.h
"
10
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
11
#include "
FWCore/Framework/interface/EventSetup.h
"
12
#include "
FWCore/Framework/interface/ESHandle.h
"
13
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
14
15
#include "
DataFormats/MuonDetId/interface/DTWireId.h
"
16
#include "
CondFormats/DTObjects/interface/DTT0.h
"
17
#include "
CondFormats/DataRecord/interface/DTT0Rcd.h
"
18
19
#include <string>
20
21
using namespace
std;
22
using namespace
edm;
23
24
namespace
dtCalibration {
25
26
DTT0FillDefaultFromDB::DTT0FillDefaultFromDB(
const
ParameterSet
& pset):
27
dbLabelRef_( pset.getParameter<
string
>(
"dbLabelRef"
) ) {
28
}
29
30
DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB
() {
31
}
32
33
void
DTT0FillDefaultFromDB::setES
(
const
EventSetup
&
setup
) {
34
// Get t0 record from DB
35
ESHandle<DTT0>
t0H;
36
setup.
get
<
DTT0Rcd
>().
get
(t0H);
37
t0Map_
= &*t0H;
38
LogVerbatim
(
"Calibration"
) <<
"[DTT0FillDefaultFromDB] T0 version: "
<< t0H->version();
39
40
// Get reference t0 DB
41
ESHandle<DTT0>
t0RefH;
42
setup.
get
<
DTT0Rcd
>().
get
(
dbLabelRef_
,t0RefH);
43
t0MapRef_
= &*t0RefH;
44
LogVerbatim
(
"Calibration"
) <<
"[DTT0FillDefaultFromDB] Reference T0 version: "
<< t0RefH->version();
45
46
}
47
48
DTT0Data
DTT0FillDefaultFromDB::correction
(
const
DTWireId
& wireId) {
49
// Try to access value in default DB
50
// If it does not exist return value from reference DB
51
// If it does not exist in reference DB, throw exception
52
// Could also set to default zero value
53
float
t0Mean,t0RMS;
54
int
status
=
t0Map_
->
get
(wireId,t0Mean,t0RMS,
DTTimeUnits::counts
);
55
if
(!status){
56
return
DTT0Data
(t0Mean,t0RMS);
57
}
else
{
58
// Now access reference DB
59
float
t0MeanRef,t0RMSRef;
60
int
statusRef =
t0MapRef_
->
get
(wireId,t0MeanRef,t0RMSRef,
DTTimeUnits::counts
);
61
if
(!statusRef){
62
return
DTT0Data
(t0MeanRef,t0RMSRef);
63
}
else
{
64
//...
65
throw
cms::Exception
(
"[DTT0FillDefaultFromDB]"
) <<
"Could not find t0 entry in reference DB for"
66
<< wireId << endl;
67
}
68
}
69
}
70
71
}
// namespace
dtCalibration::DTT0Data
Definition:
DTT0BaseCorrection.h:21
MessageLogger.h
dtCalibration::DTT0FillDefaultFromDB::dbLabelRef_
std::string dbLabelRef_
Definition:
DTT0FillDefaultFromDB.h:36
EventSetup.h
DTT0Rcd.h
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:69
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
dtCalibration::DTT0FillDefaultFromDB::t0MapRef_
const DTT0 * t0MapRef_
Definition:
DTT0FillDefaultFromDB.h:38
ParameterSet.h
dtCalibration::DTT0FillDefaultFromDB::correction
virtual DTT0Data correction(const DTWireId &)
Definition:
DTT0FillDefaultFromDB.cc:48
edm::ESHandle< DTT0 >
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:44
edm::LogVerbatim
Definition:
MessageLogger.h:240
DTT0FillDefaultFromDB.h
DTT0.h
dtCalibration::DTT0FillDefaultFromDB::setES
virtual void setES(const edm::EventSetup &setup)
Definition:
DTT0FillDefaultFromDB.cc:33
edm::hlt::Exception
error
Definition:
HLTenums.h:24
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
DTTimeUnits::counts
Definition:
DTTimeUnits.h:37
dtCalibration::DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB
virtual ~DTT0FillDefaultFromDB()
Definition:
DTT0FillDefaultFromDB.cc:30
DTT0Rcd
Definition:
DTT0Rcd.h:9
DTWireId.h
dtCalibration::DTT0FillDefaultFromDB::t0Map_
const DTT0 * t0Map_
Definition:
DTT0FillDefaultFromDB.h:39
DTWireId
Definition:
DTWireId.h:15
edm::ParameterSet
Definition:
ParameterSet.h:35
ntuplemaker.status
tuple status
Definition:
ntuplemaker.py:245
HcalObjRepresent::setup
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Definition:
HcalObjRepresent.h:628
Generated for CMSSW Reference Manual by
1.8.5