CalibCalorimetry
HcalAlgos
src
HcalPulseContainmentManager.cc
Go to the documentation of this file.
1
#include "
CalibCalorimetry/HcalAlgos/interface/HcalPulseContainmentManager.h
"
2
#include "
FWCore/Framework/interface/ESHandle.h
"
3
#include "
FWCore/Framework/interface/EventSetup.h
"
4
#include "
CondFormats/DataRecord/interface/HcalTimeSlewRecord.h
"
5
#include <iostream>
6
7
HcalPulseContainmentManager::HcalPulseContainmentManager
(
float
max_fracerror)
8
: entries_(), shapes_(), max_fracerror_(max_fracerror) {
9
hcalTimeSlew_delay_
=
nullptr
;
10
}
11
12
void
HcalPulseContainmentManager::beginRun
(
edm::EventSetup
const
& es) {
13
edm::ESHandle<HcalTimeSlew>
delay
;
14
es.
get
<
HcalTimeSlewRecord
>().
get
(
"HBHE"
,
delay
);
15
hcalTimeSlew_delay_
= &*
delay
;
16
17
shapes_
.
beginRun
(es);
18
}
19
20
void
HcalPulseContainmentManager::beginRun
(
const
HcalDbService
* conditions,
const
HcalTimeSlew
*
delay
) {
21
hcalTimeSlew_delay_
=
delay
;
22
23
shapes_
.
beginRun
(conditions);
24
}
25
26
double
HcalPulseContainmentManager::correction
(
const
HcalDetId
& detId,
int
toAdd
,
float
fixedphase_ns,
double
fc_ampl) {
27
/*
28
int sub = detId.subdet();
29
int depth = detId.depth();
30
int inteta = detId.ieta();
31
int intphi = detId.iphi();
32
33
std::cout << "* HcalPulseContainmentManager::correction, cell:"
34
<< " sub, ieta, iphi, depth = "
35
<< sub << " " << inteta << " " << intphi
36
<< " " << depth << " toAaa= " << toAdd
37
<<" phase = " << fixedphase_ns << " ampl = "
38
<< fc_ampl
39
<< std::endl;
40
*/
41
42
return
get
(detId,
toAdd
, fixedphase_ns)->
getCorrection
(fc_ampl);
43
}
44
45
const
HcalPulseContainmentCorrection
*
HcalPulseContainmentManager::get
(
const
HcalDetId
& detId,
46
int
toAdd
,
47
float
fixedphase_ns) {
48
// const HcalPulseShape * shape = &(shapes_.shape(detId));
49
const
HcalPulseShape
* shape = &(
shapes_
.
shapeForReco
(detId));
50
for
(std::vector<HcalPulseContainmentEntry>::const_iterator entryItr =
entries_
.begin(); entryItr !=
entries_
.end();
51
++entryItr) {
52
if
(entryItr->shape_ == shape && entryItr->toAdd_ ==
toAdd
&& entryItr->fixedphase_ns_ == fixedphase_ns) {
53
return
&entryItr->correction_;
54
}
55
}
56
57
/*
58
int sub = detId.subdet();
59
int depth = detId.depth();
60
int inteta = detId.ieta();
61
int intphi = detId.iphi();
62
63
std::cout << "* HcalPulseContainmentManager::get new entry, cell:"
64
<< " sub, ieta, iphi, depth = "
65
<< sub << " " << inteta << " " << intphi
66
<< " " << depth
67
<< std::endl;
68
*/
69
70
// didn't find it. Make one.
71
HcalPulseContainmentEntry
entry
(
72
toAdd
,
73
fixedphase_ns,
74
shape,
75
HcalPulseContainmentCorrection
(shape,
toAdd
, fixedphase_ns,
max_fracerror_
,
hcalTimeSlew_delay_
));
76
entries_
.push_back(
entry
);
77
return
&(
entries_
.back().correction_);
78
}
HcalPulseContainmentManager::shapes_
HcalPulseShapes shapes_
Definition:
HcalPulseContainmentManager.h:35
HcalPulseContainmentManager::entries_
std::vector< HcalPulseContainmentEntry > entries_
Definition:
HcalPulseContainmentManager.h:34
ESHandle.h
HcalPulseContainmentManager.h
HcalPulseContainmentManager::max_fracerror_
float max_fracerror_
Definition:
HcalPulseContainmentManager.h:37
mps_splice.entry
entry
Definition:
mps_splice.py:68
HcalPulseShapes::shapeForReco
const Shape & shapeForReco(const HcalDetId &detId) const
Definition:
HcalPulseShapes.cc:472
HcalPulseContainmentCorrection
Definition:
HcalPulseContainmentCorrection.h:15
HcalPulseContainmentManager::get
const HcalPulseContainmentCorrection * get(const HcalDetId &detId, int toAdd, float fixedphase_ns)
Definition:
HcalPulseContainmentManager.cc:45
HcalTimeSlew
Definition:
HcalTimeSlew.h:19
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
edm::ESHandle
Definition:
DTSurvey.h:22
HcalPulseContainmentManager::HcalPulseContainmentEntry
Definition:
HcalPulseContainmentManager.h:22
HcalTimeSlewRecord
Definition:
HcalTimeSlewRecord.h:4
HcalPulseContainmentManager::HcalPulseContainmentManager
HcalPulseContainmentManager(float max_fracerror)
Definition:
HcalPulseContainmentManager.cc:7
HcalDetId
Definition:
HcalDetId.h:12
HcalPulseShapes::beginRun
void beginRun(edm::EventSetup const &es)
Definition:
HcalPulseShapes.cc:140
HcalPulseContainmentManager::hcalTimeSlew_delay_
const HcalTimeSlew * hcalTimeSlew_delay_
Definition:
HcalPulseContainmentManager.h:39
edm::EventSetup
Definition:
EventSetup.h:57
HcalPulseContainmentCorrection::getCorrection
double getCorrection(double fc_ampl) const
Definition:
HcalPulseContainmentCorrection.cc:51
HcalPulseShape
Definition:
HcalPulseShape.h:6
HcalDbService
Definition:
HcalDbService.h:26
EventSetup.h
phase2TrackerDigitizer_cfi.delay
delay
Definition:
phase2TrackerDigitizer_cfi.py:67
HLT_2018_cff.toAdd
toAdd
Definition:
HLT_2018_cff.py:50595
HcalTimeSlewRecord.h
HcalPulseContainmentManager::correction
double correction(const HcalDetId &detId, int toAdd, float fixedphase_ns, double fc_ampl)
Definition:
HcalPulseContainmentManager.cc:26
HcalPulseContainmentManager::beginRun
void beginRun(edm::EventSetup const &es)
Definition:
HcalPulseContainmentManager.cc:12
Generated for CMSSW Reference Manual by
1.8.16