CMS 3D CMS Logo

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

#include <CastorSimParameters.h>

Inheritance diagram for CastorSimParameters:
CaloSimParameters

Public Member Functions

 CastorSimParameters (const edm::ParameterSet &p)
 
 CastorSimParameters (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, bool syncPhase)
 
double fCtoGeV (const DetId &detId) const
 
double getNominalfCperPE () const
 
double photoelectronsToAnalog (const DetId &detId) const override
 
void setDbService (const CastorDbService *service)
 
 ~CastorSimParameters () 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

double nominalfCperPE
 
const CastorDbServicetheDbService
 
double theSamplingFactor
 

Detailed Description

Definition at line 8 of file CastorSimParameters.h.

Constructor & Destructor Documentation

◆ CastorSimParameters() [1/2]

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

◆ CastorSimParameters() [2/2]

CastorSimParameters::CastorSimParameters ( const edm::ParameterSet p)

Definition at line 21 of file CastorSimParameters.cc.

23  theDbService(nullptr),
24  theSamplingFactor(p.getParameter<double>("samplingFactor")),
25  nominalfCperPE(p.getParameter<double>("photoelectronsToAnalog")) {}

◆ ~CastorSimParameters()

CastorSimParameters::~CastorSimParameters ( )
inlineoverride

Definition at line 17 of file CastorSimParameters.h.

17 {}

Member Function Documentation

◆ fCtoGeV()

double CastorSimParameters::fCtoGeV ( const DetId detId) const

Definition at line 38 of file CastorSimParameters.cc.

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

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

Referenced by photoelectronsToAnalog().

◆ getNominalfCperPE()

double CastorSimParameters::getNominalfCperPE ( ) const

Definition at line 27 of file CastorSimParameters.cc.

27  {
28  // return the nominal PMT gain value of CASTOR from the config file.
29  return nominalfCperPE;
30 }

References nominalfCperPE.

◆ photoelectronsToAnalog()

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

Reimplemented from CaloSimParameters.

Definition at line 32 of file CastorSimParameters.cc.

32  {
33  // calculate factor (PMT gain) using sampling factor value & available
34  // electron gain
35  return theSamplingFactor / fCtoGeV(detId);
36 }

References fCtoGeV(), and theSamplingFactor.

◆ setDbService()

void CastorSimParameters::setDbService ( const CastorDbService service)
inline

Definition at line 19 of file CastorSimParameters.h.

19 { theDbService = service; }

References theDbService.

Referenced by CastorSimParameterMap::setDbService().

Member Data Documentation

◆ nominalfCperPE

double CastorSimParameters::nominalfCperPE
private

Definition at line 30 of file CastorSimParameters.h.

Referenced by getNominalfCperPE().

◆ theDbService

const CastorDbService* CastorSimParameters::theDbService
private

Definition at line 28 of file CastorSimParameters.h.

Referenced by fCtoGeV(), and setDbService().

◆ theSamplingFactor

double CastorSimParameters::theSamplingFactor
private

Definition at line 29 of file CastorSimParameters.h.

Referenced by photoelectronsToAnalog().

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
service
Definition: service.py:1
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
ecalSimParameterMap_cff.samplingFactor
samplingFactor
Definition: ecalSimParameterMap_cff.py:7
CastorSimParameters::theSamplingFactor
double theSamplingFactor
Definition: CastorSimParameters.h:29
cms::cuda::assert
assert(be >=bs)
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
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
CastorSimParameters::nominalfCperPE
double nominalfCperPE
Definition: CastorSimParameters.h:30
CastorGain
Definition: CastorGain.h:13
CastorDbService::getGain
const CastorGain * getGain(const HcalGenericDetId &fId) const
Definition: CastorDbService.cc:155
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CaloSimParameters::syncPhase
bool syncPhase() const
Definition: CaloSimParameters.h:58
mps_fire.result
result
Definition: mps_fire.py:311