CMS 3D CMS Logo

CastorSimParameters.cc
Go to the documentation of this file.
1 #include "CLHEP/Random/RandGaussQ.h"
9 
12  double samplingFactor,
13  double timePhase,
14  bool syncPhase)
17  theDbService(nullptr),
18  theSamplingFactor(samplingFactor),
19  nominalfCperPE(1) {}
20 
23  theDbService(nullptr),
24  theSamplingFactor(p.getParameter<double>("samplingFactor")),
25  nominalfCperPE(p.getParameter<double>("photoelectronsToAnalog")) {}
26 
28  // return the nominal PMT gain value of CASTOR from the config file.
29  return nominalfCperPE;
30 }
31 
33  // calculate factor (PMT gain) using sampling factor value & available
34  // electron gain
35  return theSamplingFactor / fCtoGeV(detId);
36 }
37 
38 double CastorSimParameters::fCtoGeV(const DetId &detId) const {
39  assert(theDbService != nullptr);
40  HcalGenericDetId hcalGenDetId(detId);
41  const CastorGain *gains = theDbService->getGain(hcalGenDetId);
42  const CastorGainWidth *gwidths = theDbService->getGainWidth(hcalGenDetId);
43  double result = 0.0;
44  if (!gains || !gwidths) {
45  edm::LogError("CastorAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
46  } else {
47  // only one gain will be recorded per channel, so just use capID 0 for now
48  result = gains->getValue(0);
49  }
50  return result;
51 }
CastorSimParameters::fCtoGeV
double fCtoGeV(const DetId &detId) const
Definition: CastorSimParameters.cc:38
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
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
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
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:10
mps_fire.result
result
Definition: mps_fire.py:311
CastorSimParameters.h
CastorSimParameters::getNominalfCperPE
double getNominalfCperPE() const
Definition: CastorSimParameters.cc:27
CastorGainWidth.h