SimCalorimetry
HcalSimAlgos
src
HFSimParameters.cc
Go to the documentation of this file.
1
#include "
SimCalorimetry/HcalSimAlgos/interface/HFSimParameters.h
"
2
#include "
DataFormats/HcalDetId/interface/HcalSubdetector.h
"
3
#include "
DataFormats/HcalDetId/interface/HcalGenericDetId.h
"
4
#include "
DataFormats/HcalDetId/interface/HcalDetId.h
"
5
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
6
#include "
CondFormats/HcalObjects/interface/HcalGain.h
"
7
#include "
CondFormats/HcalObjects/interface/HcalGainWidth.h
"
8
#include "CLHEP/Random/RandGaussQ.h"
9
10
HFSimParameters::HFSimParameters
(
double
simHitToPhotoelectrons
,
11
double
photoelectronsToAnalog
,
12
double
samplingFactor
,
13
double
timePhase
,
14
bool
syncPhase
)
15
:
CaloSimParameters
(
16
simHitToPhotoelectrons
,
photoelectronsToAnalog
,
samplingFactor
,
timePhase
, 6, 4,
false
,
syncPhase
),
17
theDbService(nullptr),
18
theSamplingFactor(
samplingFactor
) {}
19
20
HFSimParameters::HFSimParameters
(
const
edm::ParameterSet
&
p
)
21
:
CaloSimParameters
(
p
), theDbService(nullptr), theSamplingFactor(
p
.getParameter<double>(
"samplingFactor"
)) {}
22
23
double
HFSimParameters::photoelectronsToAnalog
(
const
DetId
& detId)
const
{
24
// pe/fC = pe/GeV * GeV/fC = (0.24 pe/GeV * 6 for photomult * 0.2146GeV/fC)
25
return
1. / (
theSamplingFactor
*
simHitToPhotoelectrons
(detId) *
fCtoGeV
(detId));
26
}
27
28
double
HFSimParameters::fCtoGeV
(
const
DetId
& detId)
const
{
29
assert
(
theDbService
!=
nullptr
);
30
HcalGenericDetId
hcalGenDetId(detId);
31
const
HcalGain
* gains =
theDbService
->
getGain
(hcalGenDetId);
32
const
HcalGainWidth
* gwidths =
theDbService
->
getGainWidth
(hcalGenDetId);
33
double
result
= 0.0;
34
if
(!gains || !gwidths) {
35
edm::LogError
(
"HcalAmplifier"
) <<
"Could not fetch HCAL conditions for channel "
<< hcalGenDetId;
36
}
else
{
37
// only one gain will be recorded per channel, so just use capID 0 for now
38
result
= gains->
getValue
(0);
39
// if(doNoise_)
41
// result += CLHEP::RandGaussQ::shoot(0., gwidths->getValue(0));
42
// }
43
}
44
return
result
;
45
}
46
47
double
HFSimParameters::samplingFactor
()
const
{
return
theSamplingFactor
; }
HFSimParameters::fCtoGeV
double fCtoGeV(const DetId &detId) const
Definition:
HFSimParameters.cc:28
MessageLogger.h
ecalSimParameterMap_cff.syncPhase
syncPhase
Definition:
ecalSimParameterMap_cff.py:10
funct::false
false
Definition:
Factorize.h:29
HcalDbService::getGainWidth
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
Definition:
HcalDbService.cc:312
HcalGain::getValue
float getValue(int fCapId) const
get value for capId = 0..3
Definition:
HcalGain.h:21
HcalGenericDetId
Definition:
HcalGenericDetId.h:15
CaloSimParameters::photoelectronsToAnalog
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs
Definition:
CaloSimParameters.h:38
hcalSimParameters_cfi.simHitToPhotoelectrons
simHitToPhotoelectrons
Definition:
hcalSimParameters_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
ecalSimParameterMap_cff.samplingFactor
samplingFactor
Definition:
ecalSimParameterMap_cff.py:7
cms::cuda::assert
assert(be >=bs)
HcalDbService::getGain
const HcalGain * getGain(const HcalGenericDetId &fId) const
Definition:
HcalDbService.cc:305
HcalGenericDetId.h
CaloSimParameters::simHitToPhotoelectrons
double simHitToPhotoelectrons() const
Definition:
CaloSimParameters.h:34
HFSimParameters::samplingFactor
double samplingFactor() const
Definition:
HFSimParameters.cc:47
HFSimParameters::HFSimParameters
HFSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, bool syncPhase)
Definition:
HFSimParameters.cc:10
DetId
Definition:
DetId.h:17
HcalGain.h
CaloSimParameters
Main class for Parameters in different subdetectors.
Definition:
CaloSimParameters.h:14
HcalGain
Definition:
HcalGain.h:16
edm::ParameterSet
Definition:
ParameterSet.h:47
HcalDetId.h
HFSimParameters::theSamplingFactor
double theSamplingFactor
Definition:
HFSimParameters.h:29
ecalSimParameterMap_cff.timePhase
timePhase
Definition:
ecalSimParameterMap_cff.py:8
HcalSubdetector.h
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
HFSimParameters::theDbService
const HcalDbService * theDbService
Definition:
HFSimParameters.h:28
HFSimParameters.h
hcalSimParameters_cfi.photoelectronsToAnalog
photoelectronsToAnalog
Definition:
hcalSimParameters_cfi.py:18
mps_fire.result
result
Definition:
mps_fire.py:311
HcalGainWidth.h
HcalGainWidth
Definition:
HcalGainWidth.h:15
Generated for CMSSW Reference Manual by
1.8.16