SimCalorimetry
CastorSim
src
CastorSimParameters.cc
Go to the documentation of this file.
1
#include "CLHEP/Random/RandGaussQ.h"
2
#include "
CondFormats/CastorObjects/interface/CastorGain.h
"
3
#include "
CondFormats/CastorObjects/interface/CastorGainWidth.h
"
4
#include "
DataFormats/HcalDetId/interface/HcalDetId.h
"
5
#include "
DataFormats/HcalDetId/interface/HcalGenericDetId.h
"
6
#include "
DataFormats/HcalDetId/interface/HcalSubdetector.h
"
7
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
8
#include "
SimCalorimetry/CastorSim/src/CastorSimParameters.h
"
9
#include <cassert>
10
11
CastorSimParameters::CastorSimParameters
(
double
simHitToPhotoelectrons
,
12
double
photoelectronsToAnalog
,
13
double
samplingFactor
,
14
double
timePhase
,
15
bool
syncPhase
)
16
:
CaloSimParameters
(
17
simHitToPhotoelectrons
,
photoelectronsToAnalog
,
samplingFactor
,
timePhase
, 6, 4,
false
,
syncPhase
),
18
theDbService(nullptr),
19
theSamplingFactor(
samplingFactor
),
20
nominalfCperPE(1) {}
21
22
CastorSimParameters::CastorSimParameters
(
const
edm::ParameterSet
&
p
)
23
:
CaloSimParameters
(
p
),
24
theDbService(nullptr),
25
theSamplingFactor(
p
.getParameter<double>(
"samplingFactor"
)),
26
nominalfCperPE(
p
.getParameter<double>(
"photoelectronsToAnalog"
)) {}
27
28
double
CastorSimParameters::getNominalfCperPE
()
const
{
29
// return the nominal PMT gain value of CASTOR from the config file.
30
return
nominalfCperPE
;
31
}
32
33
double
CastorSimParameters::photoelectronsToAnalog
(
const
DetId
&detId)
const
{
34
// calculate factor (PMT gain) using sampling factor value & available
35
// electron gain
36
return
theSamplingFactor
/
fCtoGeV
(detId);
37
}
38
39
double
CastorSimParameters::fCtoGeV
(
const
DetId
&detId)
const
{
40
assert
(
theDbService
!=
nullptr
);
41
HcalGenericDetId
hcalGenDetId(detId);
42
const
CastorGain
*gains =
theDbService
->
getGain
(hcalGenDetId);
43
const
CastorGainWidth
*gwidths =
theDbService
->
getGainWidth
(hcalGenDetId);
44
double
result
= 0.0;
45
if
(!gains || !gwidths) {
46
edm::LogError
(
"CastorAmplifier"
) <<
"Could not fetch HCAL conditions for channel "
<< hcalGenDetId;
47
}
else
{
48
// only one gain will be recorded per channel, so just use capID 0 for now
49
result
= gains->
getValue
(0);
50
}
51
return
result
;
52
}
CastorSimParameters::fCtoGeV
double fCtoGeV(const DetId &detId) const
Definition:
CastorSimParameters.cc:39
CastorGain::getValue
float getValue(int fCapId) const
get value for capId = 0..3
Definition:
CastorGain.h:18
MessageLogger.h
ecalSimParameterMap_cff.syncPhase
syncPhase
Definition:
ecalSimParameterMap_cff.py:10
funct::false
false
Definition:
Factorize.h:29
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
ecalSimParameterMap_cff.samplingFactor
samplingFactor
Definition:
ecalSimParameterMap_cff.py:7
CastorSimParameters::theSamplingFactor
double theSamplingFactor
Definition:
CastorSimParameters.h:29
cms::cuda::assert
assert(be >=bs)
HcalGenericDetId.h
CastorGain.h
DetId
Definition:
DetId.h:17
CaloSimParameters
Main class for Parameters in different subdetectors.
Definition:
CaloSimParameters.h:14
CastorDbService::getGainWidth
const CastorGainWidth * getGainWidth(const HcalGenericDetId &fId) const
Definition:
CastorDbService.cc:162
CastorSimParameters::theDbService
const CastorDbService * theDbService
Definition:
CastorSimParameters.h:28
CastorGainWidth
Definition:
CastorGainWidth.h:12
edm::ParameterSet
Definition:
ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
HcalDetId.h
CastorSimParameters::nominalfCperPE
double nominalfCperPE
Definition:
CastorSimParameters.h:30
ecalSimParameterMap_cff.timePhase
timePhase
Definition:
ecalSimParameterMap_cff.py:8
CastorGain
Definition:
CastorGain.h:13
CastorDbService::getGain
const CastorGain * getGain(const HcalGenericDetId &fId) const
Definition:
CastorDbService.cc:155
HcalSubdetector.h
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
hcalSimParameters_cfi.photoelectronsToAnalog
photoelectronsToAnalog
Definition:
hcalSimParameters_cfi.py:18
CastorSimParameters::CastorSimParameters
CastorSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, bool syncPhase)
Definition:
CastorSimParameters.cc:11
mps_fire.result
result
Definition:
mps_fire.py:311
CastorSimParameters.h
CastorSimParameters::getNominalfCperPE
double getNominalfCperPE() const
Definition:
CastorSimParameters.cc:28
CastorGainWidth.h
Generated for CMSSW Reference Manual by
1.8.16