CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HFSimParameters Class Reference

#include <HFSimParameters.h>

Inheritance diagram for HFSimParameters:
CaloSimParameters

Public Member Functions

double fCtoGeV (const DetId &detId) const
 
 HFSimParameters (const edm::ParameterSet &p)
 
 HFSimParameters (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, bool syncPhase)
 
double photoelectronsToAnalog (const DetId &detId) const override
 
double samplingFactor () const
 
void setDbService (const HcalDbService *service)
 
 ~HFSimParameters () override
 
- Public Member Functions inherited from CaloSimParameters
int binOfMaximum () const
 
 CaloSimParameters (const edm::ParameterSet &p, bool skipPe2Fc=false)
 
 CaloSimParameters (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
 
bool doPhotostatistics () const
 whether or not to apply Poisson statistics to photoelectrons More...
 
double photoelectronsToAnalog () const
 the factor which goes from photoelectrons to whatever gets read by ADCs More...
 
int readoutFrameSize () const
 for now, the LinearFrames and trhe digis will be one-to-one. More...
 
void setBinOfMaximum (int binOfMax)
 
void setReadoutFrameSize (int frameSize)
 some datamixing apps need this to be set dynamically More...
 
double simHitToPhotoelectrons () const
 
virtual double simHitToPhotoelectrons (const DetId &) const
 
bool syncPhase () const
 
double timePhase () const
 the adjustment you need to apply to get the signal where you want it More...
 
virtual ~CaloSimParameters ()
 

Private Attributes

const HcalDbServicetheDbService
 
double theSamplingFactor
 

Detailed Description

Definition at line 8 of file HFSimParameters.h.

Constructor & Destructor Documentation

◆ HFSimParameters() [1/2]

HFSimParameters::HFSimParameters ( double  simHitToPhotoelectrons,
double  photoelectronsToAnalog,
double  samplingFactor,
double  timePhase,
bool  syncPhase 
)

◆ HFSimParameters() [2/2]

HFSimParameters::HFSimParameters ( const edm::ParameterSet p)

Definition at line 20 of file HFSimParameters.cc.

21  : CaloSimParameters(p), theDbService(nullptr), theSamplingFactor(p.getParameter<double>("samplingFactor")) {}

◆ ~HFSimParameters()

HFSimParameters::~HFSimParameters ( )
inlineoverride

Definition at line 17 of file HFSimParameters.h.

17 {}

Member Function Documentation

◆ fCtoGeV()

double HFSimParameters::fCtoGeV ( const DetId detId) const

{

Definition at line 28 of file HFSimParameters.cc.

28  {
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 }

References cms::cuda::assert(), HcalDbService::getGain(), HcalDbService::getGainWidth(), HcalGain::getValue(), mps_fire::result, and theDbService.

Referenced by photoelectronsToAnalog().

◆ photoelectronsToAnalog()

double HFSimParameters::photoelectronsToAnalog ( const DetId detId) const
overridevirtual

Reimplemented from CaloSimParameters.

Definition at line 23 of file HFSimParameters.cc.

23  {
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 }

References fCtoGeV(), CaloSimParameters::simHitToPhotoelectrons(), and theSamplingFactor.

◆ samplingFactor()

double HFSimParameters::samplingFactor ( ) const

Definition at line 47 of file HFSimParameters.cc.

47 { return theSamplingFactor; }

References theSamplingFactor.

◆ setDbService()

void HFSimParameters::setDbService ( const HcalDbService service)
inline

Definition at line 19 of file HFSimParameters.h.

19 { theDbService = service; }

References theDbService.

Referenced by HcalSimParameterMap::setDbService().

Member Data Documentation

◆ theDbService

const HcalDbService* HFSimParameters::theDbService
private

Definition at line 28 of file HFSimParameters.h.

Referenced by fCtoGeV(), and setDbService().

◆ theSamplingFactor

double HFSimParameters::theSamplingFactor
private

Definition at line 29 of file HFSimParameters.h.

Referenced by photoelectronsToAnalog(), and samplingFactor().

service
Definition: service.py:1
HFSimParameters::fCtoGeV
double fCtoGeV(const DetId &detId) const
Definition: HFSimParameters.cc:28
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
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
cms::cuda::assert
assert(be >=bs)
HcalDbService::getGain
const HcalGain * getGain(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:305
CaloSimParameters::simHitToPhotoelectrons
double simHitToPhotoelectrons() const
Definition: CaloSimParameters.h:34
CaloSimParameters::CaloSimParameters
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
Definition: CaloSimParameters.cc:5
CaloSimParameters::timePhase
double timePhase() const
the adjustment you need to apply to get the signal where you want it
Definition: CaloSimParameters.h:42
HFSimParameters::samplingFactor
double samplingFactor() const
Definition: HFSimParameters.cc:47
HcalGain
Definition: HcalGain.h:16
HFSimParameters::theSamplingFactor
double theSamplingFactor
Definition: HFSimParameters.h:29
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CaloSimParameters::syncPhase
bool syncPhase() const
Definition: CaloSimParameters.h:58
HFSimParameters::theDbService
const HcalDbService * theDbService
Definition: HFSimParameters.h:28
mps_fire.result
result
Definition: mps_fire.py:311
HcalGainWidth
Definition: HcalGainWidth.h:15