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 (double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, bool syncPhase)
 
 CastorSimParameters (const edm::ParameterSet &p)
 
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 (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

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 
)

Definition at line 11 of file CastorSimParameters.cc.

18  theDbService(nullptr),
20  nominalfCperPE(1) {}
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
const CastorDbService * theDbService
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
bool syncPhase() const

◆ CastorSimParameters() [2/2]

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

Definition at line 22 of file CastorSimParameters.cc.

24  theDbService(nullptr),
25  theSamplingFactor(p.getParameter<double>("samplingFactor")),
26  nominalfCperPE(p.getParameter<double>("photoelectronsToAnalog")) {}
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
const CastorDbService * theDbService

◆ ~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 39 of file CastorSimParameters.cc.

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

Referenced by photoelectronsToAnalog().

39  {
40  assert(theDbService != nullptr);
41  HcalGenericDetId hcalGenDetId(detId);
42  const CastorGain *gains = theDbService->getGain(hcalGenDetId);
43  const CastorGainWidth *gwidths = theDbService->getGainWidth(hcalGenDetId);
44  double result = 0.0;
45  if (!gains || !gwidths) {
46  edm::LogError("CastorAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
47  } else {
48  // only one gain will be recorded per channel, so just use capID 0 for now
49  result = gains->getValue(0);
50  }
51  return result;
52 }
const CastorDbService * theDbService
const CastorGainWidth * getGainWidth(const HcalGenericDetId &fId) const
Log< level::Error, false > LogError
assert(be >=bs)
const CastorGain * getGain(const HcalGenericDetId &fId) const
constexpr float gains[NGAINS]
Definition: EcalConstants.h:20

◆ getNominalfCperPE()

double CastorSimParameters::getNominalfCperPE ( ) const

Definition at line 28 of file CastorSimParameters.cc.

References nominalfCperPE.

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

◆ photoelectronsToAnalog()

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

Reimplemented from CaloSimParameters.

Definition at line 33 of file CastorSimParameters.cc.

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

33  {
34  // calculate factor (PMT gain) using sampling factor value & available
35  // electron gain
37 }
double fCtoGeV(const DetId &detId) const

◆ setDbService()

void CastorSimParameters::setDbService ( const CastorDbService service)
inline

Definition at line 19 of file CastorSimParameters.h.

References theDbService.

Referenced by CastorSimParameterMap::setDbService().

19 { theDbService = service; }
const CastorDbService * theDbService

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().