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)
 
 ~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
 choice of the ADC time alignment (synchronous for LHC, asynchronous for test beams) More...
 
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::HFSimParameters ( double  simHitToPhotoelectrons,
double  photoelectronsToAnalog,
double  samplingFactor,
double  timePhase,
bool  syncPhase 
)

Definition at line 11 of file HFSimParameters.cc.

14  6, 4, false, syncPhase),
15  theDbService(nullptr),
17 {
18 }
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
double timePhase() const
the adjustment you need to apply to get the signal where you want it
double simHitToPhotoelectrons() const
const HcalDbService * theDbService
double theSamplingFactor
double samplingFactor() const
double photoelectronsToAnalog() const
the factor which goes from photoelectrons to whatever gets read by ADCs
bool syncPhase() const
choice of the ADC time alignment (synchronous for LHC, asynchronous for test beams) ...
HFSimParameters::HFSimParameters ( const edm::ParameterSet p)

Definition at line 20 of file HFSimParameters.cc.

22  theDbService(nullptr),
23  theSamplingFactor( p.getParameter<double>("samplingFactor") )
24 {
25 }
T getParameter(std::string const &) const
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
const HcalDbService * theDbService
double theSamplingFactor
HFSimParameters::~HFSimParameters ( )
inlineoverride

Definition at line 15 of file HFSimParameters.h.

15 {}

Member Function Documentation

double HFSimParameters::fCtoGeV ( const DetId detId) const

{

Definition at line 34 of file HFSimParameters.cc.

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

Referenced by photoelectronsToAnalog(), and setDbService().

35 {
36  assert(theDbService != nullptr);
37  HcalGenericDetId hcalGenDetId(detId);
38  const HcalGain* gains = theDbService->getGain(hcalGenDetId);
39  const HcalGainWidth* gwidths = theDbService->getGainWidth(hcalGenDetId);
40  double result = 0.0;
41  if (!gains || !gwidths )
42  {
43  edm::LogError("HcalAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
44  }
45  else
46  {
47  // only one gain will be recorded per channel, so just use capID 0 for now
48  result = gains->getValue(0);
49  // if(doNoise_)
51  // result += CLHEP::RandGaussQ::shoot(0., gwidths->getValue(0));
52  // }
53  }
54  return result;
55 }
const HcalGainWidth * getGainWidth(const HcalGenericDetId &fId) const
float getValue(int fCapId) const
get value for capId = 0..3
Definition: HcalGain.h:22
const HcalDbService * theDbService
const HcalGain * getGain(const HcalGenericDetId &fId) const
double HFSimParameters::photoelectronsToAnalog ( const DetId detId) const
overridevirtual

Reimplemented from CaloSimParameters.

Definition at line 28 of file HFSimParameters.cc.

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

29 {
30  // pe/fC = pe/GeV * GeV/fC = (0.24 pe/GeV * 6 for photomult * 0.2146GeV/fC)
31  return 1./(theSamplingFactor * simHitToPhotoelectrons(detId) * fCtoGeV(detId));
32 }
double fCtoGeV(const DetId &detId) const
double simHitToPhotoelectrons() const
double theSamplingFactor
double HFSimParameters::samplingFactor ( ) const

Definition at line 58 of file HFSimParameters.cc.

References theSamplingFactor.

Referenced by setDbService().

59 {
60  return theSamplingFactor;
61 }
double theSamplingFactor
void HFSimParameters::setDbService ( const HcalDbService service)
inline

Definition at line 17 of file HFSimParameters.h.

References fCtoGeV(), CaloSimParameters::photoelectronsToAnalog(), samplingFactor(), and theDbService.

Referenced by HcalSimParameterMap::setDbService().

17 {theDbService = service;}
const HcalDbService * theDbService

Member Data Documentation

const HcalDbService* HFSimParameters::theDbService
private

Definition at line 26 of file HFSimParameters.h.

Referenced by fCtoGeV(), and setDbService().

double HFSimParameters::theSamplingFactor
private

Definition at line 27 of file HFSimParameters.h.

Referenced by photoelectronsToAnalog(), and samplingFactor().