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 (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, bool syncPhase)
 
 HFSimParameters (const edm::ParameterSet &p)
 
double photoelectronsToAnalog (const DetId &detId) const override
 
double samplingFactor () const
 
void setDbService (const HcalDbService *service)
 
double threshold_currentTDC () const
 
 ~HFSimParameters () override
 
- Public Member Functions inherited from CaloSimParameters
int binOfMaximum () const
 
 CaloSimParameters (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
 
 CaloSimParameters (const edm::ParameterSet &p, bool skipPe2Fc=false)
 
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
 
double threshold_currentTDC_
 

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 
)

Definition at line 10 of file HFSimParameters.cc.

17  theDbService(nullptr),
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs
double simHitToPhotoelectrons() const
double timePhase() const
the adjustment you need to apply to get the signal where you want it
double samplingFactor() const
bool syncPhase() const
const HcalDbService * theDbService
double theSamplingFactor

◆ HFSimParameters() [2/2]

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

Definition at line 20 of file HFSimParameters.cc.

22  theDbService(nullptr),
23  theSamplingFactor(p.getParameter<double>("samplingFactor")),
24  threshold_currentTDC_(p.getParameter<double>("threshold_currentTDC")) {}
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
const HcalDbService * theDbService
double theSamplingFactor
double threshold_currentTDC_

◆ ~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 31 of file HFSimParameters.cc.

References cms::cuda::assert(), hcalRecHitTable_cff::detId, ecalph2::gains, HcalDbService::getGain(), HcalDbService::getGainWidth(), mps_fire::result, and theDbService.

Referenced by photoelectronsToAnalog().

31  {
32  assert(theDbService != nullptr);
33  HcalGenericDetId hcalGenDetId(detId);
34  const HcalGain* gains = theDbService->getGain(hcalGenDetId);
35  const HcalGainWidth* gwidths = theDbService->getGainWidth(hcalGenDetId);
36  double result = 0.0;
37  if (!gains || !gwidths) {
38  edm::LogError("HcalAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
39  } else {
40  // only one gain will be recorded per channel, so just use capID 0 for now
41  result = gains->getValue(0);
42  // if(doNoise_)
44  // result += CLHEP::RandGaussQ::shoot(0., gwidths->getValue(0));
45  // }
46  }
47  return result;
48 }
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
Log< level::Error, false > LogError
assert(be >=bs)
constexpr float gains[NGAINS]
Definition: EcalConstants.h:20
const HcalDbService * theDbService
const HcalGain * getGain(const HcalGenericDetId &fId) const

◆ photoelectronsToAnalog()

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

Reimplemented from CaloSimParameters.

Definition at line 26 of file HFSimParameters.cc.

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

26  {
27  // pe/fC = pe/GeV * GeV/fC = (0.24 pe/GeV * 6 for photomult * 0.2146GeV/fC)
29 }
double simHitToPhotoelectrons() const
double theSamplingFactor
double fCtoGeV(const DetId &detId) const

◆ samplingFactor()

double HFSimParameters::samplingFactor ( ) const

Definition at line 50 of file HFSimParameters.cc.

References theSamplingFactor.

50 { return theSamplingFactor; }
double theSamplingFactor

◆ setDbService()

void HFSimParameters::setDbService ( const HcalDbService service)
inline

Definition at line 19 of file HFSimParameters.h.

References theDbService.

Referenced by HcalSimParameterMap::setDbService().

19 { theDbService = service; }
const HcalDbService * theDbService

◆ threshold_currentTDC()

double HFSimParameters::threshold_currentTDC ( ) const
inline

Definition at line 26 of file HFSimParameters.h.

References threshold_currentTDC_.

Referenced by HcalElectronicsSim::analogToDigital().

26 { return threshold_currentTDC_; }
double threshold_currentTDC_

Member Data Documentation

◆ theDbService

const HcalDbService* HFSimParameters::theDbService
private

Definition at line 29 of file HFSimParameters.h.

Referenced by fCtoGeV(), and setDbService().

◆ theSamplingFactor

double HFSimParameters::theSamplingFactor
private

Definition at line 30 of file HFSimParameters.h.

Referenced by photoelectronsToAnalog(), and samplingFactor().

◆ threshold_currentTDC_

double HFSimParameters::threshold_currentTDC_
private

Definition at line 31 of file HFSimParameters.h.

Referenced by threshold_currentTDC().