CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
bool doDynamicNoise () const
 
double fCtoGeV (const DetId &detId) const
 
double getNominalfCperPE () const
 
virtual double photoelectronsToAnalog (const DetId &detId) const
 
void setDbService (const CastorDbService *service)
 
virtual ~CastorSimParameters ()
 
- 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 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

bool dynamicNoise
 
double nominalfCperPE
 
const CastorDbServicetheDbService
 
double theSamplingFactor
 

Detailed Description

Definition at line 8 of file CastorSimParameters.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file CastorSimParameters.cc.

13  theDbService(0),
14  theSamplingFactor( samplingFactor ),
15  nominalfCperPE( 1),
16  dynamicNoise(false)
17 {
18 }
CaloSimParameters(double simHitToPhotoelectrons, double photoelectronsToAnalog, double samplingFactor, double timePhase, int readoutFrameSize, int binOfMaximum, bool doPhotostatistics, bool syncPhase=true)
const CastorDbService * theDbService
double timePhase() const
the adjustment you need to apply to get the signal where you want it
double simHitToPhotoelectrons() 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) ...
CastorSimParameters::CastorSimParameters ( const edm::ParameterSet p)

Definition at line 21 of file CastorSimParameters.cc.

23  theDbService(0),
24  theSamplingFactor( p.getParameter<double>("samplingFactor") ),
25  nominalfCperPE( p.getParameter<double>("photoelectronsToAnalog") ),
26  dynamicNoise(p.getParameter<bool>("doDynamicNoise") )
27 {
28 }
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 CastorDbService * theDbService
virtual CastorSimParameters::~CastorSimParameters ( )
inlinevirtual

Definition at line 15 of file CastorSimParameters.h.

15 {}

Member Function Documentation

bool CastorSimParameters::doDynamicNoise ( ) const

Definition at line 36 of file CastorSimParameters.cc.

References dynamicNoise.

Referenced by CastorAmplifier::amplify().

37 {
38  // activate proper noise treatment depending on used gain values.
39  return dynamicNoise;
40 }
double CastorSimParameters::fCtoGeV ( const DetId detId) const

Definition at line 50 of file CastorSimParameters.cc.

References assert(), CastorDbService::getGain(), CastorDbService::getGainWidth(), CastorGain::getValue(), query::result, and theDbService.

Referenced by photoelectronsToAnalog().

51 {
52  assert(theDbService != nullptr);
53  HcalGenericDetId hcalGenDetId(detId);
54  const CastorGain* gains = theDbService->getGain(hcalGenDetId);
55  const CastorGainWidth* gwidths = theDbService->getGainWidth(hcalGenDetId);
56  double result = 0.0;
57  if (!gains || !gwidths )
58  {
59  edm::LogError("CastorAmplifier") << "Could not fetch HCAL conditions for channel " << hcalGenDetId;
60  }
61  else
62  {
63  // only one gain will be recorded per channel, so just use capID 0 for now
64  result = gains->getValue(0);
65  }
66  return result;
67 }
const CastorDbService * theDbService
assert(m_qm.get())
tuple result
Definition: query.py:137
const CastorGain * getGain(const HcalGenericDetId &fId) const
const CastorGainWidth * getGainWidth(const HcalGenericDetId &fId) const
float getValue(int fCapId) const
get value for capId = 0..3
Definition: CastorGain.h:19
double CastorSimParameters::getNominalfCperPE ( ) const

Definition at line 30 of file CastorSimParameters.cc.

References nominalfCperPE.

Referenced by CastorAmplifier::amplify().

31 {
32  // return the nominal PMT gain value of CASTOR from the config file.
33  return nominalfCperPE;
34 }
double CastorSimParameters::photoelectronsToAnalog ( const DetId detId) const
virtual

Reimplemented from CaloSimParameters.

Definition at line 42 of file CastorSimParameters.cc.

References fCtoGeV(), and theSamplingFactor.

Referenced by CastorAmplifier::amplify().

43 {
44  // calculate factor (PMT gain) using sampling factor value & available electron gain
45  return theSamplingFactor/fCtoGeV(detId);
46 }
double fCtoGeV(const DetId &detId) const
void CastorSimParameters::setDbService ( const CastorDbService service)
inline

Definition at line 17 of file CastorSimParameters.h.

References theDbService.

Referenced by CastorSimParameterMap::setDbService().

17 {theDbService = service;}
const CastorDbService * theDbService

Member Data Documentation

bool CastorSimParameters::dynamicNoise
private

Definition at line 31 of file CastorSimParameters.h.

Referenced by doDynamicNoise().

double CastorSimParameters::nominalfCperPE
private

Definition at line 30 of file CastorSimParameters.h.

Referenced by getNominalfCperPE().

const CastorDbService* CastorSimParameters::theDbService
private

Definition at line 28 of file CastorSimParameters.h.

Referenced by fCtoGeV(), and setDbService().

double CastorSimParameters::theSamplingFactor
private

Definition at line 29 of file CastorSimParameters.h.

Referenced by photoelectronsToAnalog().