CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
EcalHitResponse Class Referenceabstract

#include <EcalHitResponse.h>

Inheritance diagram for EcalHitResponse:
EBHitResponse EEHitResponse ESHitResponse

Public Types

enum  { BUNCHSPACE = 25 }
 
typedef CaloTSamplesBase< float > EcalSamples
 
typedef std::vector< unsigned int > VecInd
 

Public Member Functions

void add (const EcalSamples *pSam)
 
 EcalHitResponse (const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
 
const EcalSamplesfindDetId (const DetId &detId) const
 
virtual EcalSamplesoperator[] (unsigned int i)=0
 
virtual const EcalSamplesoperator[] (unsigned int i) const =0
 
virtual void run (MixCollection< PCaloHit > &hits)
 
virtual unsigned int samplesSize () const =0
 
void setBunchRange (int minBunch, int maxBunch)
 
void setEventTime (const edm::TimeValue_t &iTime)
 
void setGeometry (const CaloSubdetectorGeometry *geometry)
 
void setHitCorrection (const CaloVHitCorrection *hitCorrection)
 
void setHitFilter (const CaloVHitFilter *filter)
 
void setLaserConstants (const EcalLaserDbService *laser, bool &useLCcorrection)
 
void setPECorrection (const CaloVPECorrection *peCorrection)
 
void setPhaseShift (double phaseShift)
 
virtual ~EcalHitResponse ()
 

Protected Member Functions

double analogSignalAmplitude (const PCaloHit &hit) const
 
void blankOutUsedSamples ()
 
double findLaserConstant (const DetId &detId) const
 
EcalSamplesfindSignal (const DetId &detId)
 
const CaloSubdetectorGeometrygeometry () const
 
const CaloVHitFilterhitFilter () const
 
VecIndindex ()
 
const VecIndindex () const
 
int maxBunch () const
 
int minBunch () const
 
const CaloSimParametersparams (const DetId &detId) const
 
double phaseShift () const
 
virtual void putAnalogSignal (const PCaloHit &inputHit)
 
CLHEP::RandGaussQ * ranGauss () const
 
CLHEP::RandPoissonQ * ranPois () const
 
virtual unsigned int samplesSizeAll () const =0
 
const CaloVShapeshape () const
 
double timeOfFlight (const DetId &detId) const
 
virtual EcalSamplesvSam (unsigned int i)=0
 
virtual EcalSamplesvSamAll (unsigned int i)=0
 
virtual const EcalSamplesvSamAll (unsigned int i) const =0
 

Private Attributes

const CaloSubdetectorGeometrym_geometry
 
const CaloVHitCorrectionm_hitCorrection
 
const CaloVHitFilterm_hitFilter
 
VecInd m_index
 
edm::TimeValue_t m_iTime
 
const EcalLaserDbServicem_lasercals
 
int m_maxBunch
 
int m_minBunch
 
const CaloVSimParameterMapm_parameterMap
 
const CaloVPECorrectionm_PECorrection
 
double m_phaseShift
 
CLHEP::RandGaussQ * m_RandGauss
 
CLHEP::RandPoissonQ * m_RandPoisson
 
const CaloVShapem_shape
 
bool m_useLCcorrection
 

Detailed Description

Definition at line 29 of file EcalHitResponse.h.

Member Typedef Documentation

Definition at line 33 of file EcalHitResponse.h.

typedef std::vector< unsigned int > EcalHitResponse::VecInd

Definition at line 35 of file EcalHitResponse.h.

Member Enumeration Documentation

anonymous enum
Enumerator
BUNCHSPACE 

Definition at line 37 of file EcalHitResponse.h.

Constructor & Destructor Documentation

EcalHitResponse::EcalHitResponse ( const CaloVSimParameterMap parameterMap,
const CaloVShape shape 
)

Definition at line 25 of file EcalHitResponse.cc.

References edm::hlt::Exception, edm::RandomNumberGenerator::getEngine(), edm::Service< T >::isAvailable(), m_RandGauss, and m_RandPoisson.

26  :
27  m_parameterMap ( parameterMap ) ,
28  m_shape ( shape ) ,
29  m_hitCorrection ( 0 ) ,
30  m_PECorrection ( 0 ) ,
31  m_hitFilter ( 0 ) ,
32  m_geometry ( 0 ) ,
33  m_lasercals ( 0 ) ,
34  m_RandPoisson ( 0 ) ,
35  m_RandGauss ( 0 ) ,
36  m_minBunch ( -10 ) ,
37  m_maxBunch ( 10 ) ,
38  m_phaseShift ( 1 ) ,
39  m_iTime ( 0 ) ,
40  m_useLCcorrection ( 0 )
41 {
43  if ( !rng.isAvailable() )
44  {
45  throw cms::Exception("Configuration")
46  << "EcalHitResponse requires the RandomNumberGeneratorService\n"
47  "which is not present in the configuration file. You must add the service\n"
48  "in the configuration file or remove the modules that require it.";
49  }
50  m_RandPoisson = new CLHEP::RandPoissonQ( rng->getEngine() ) ;
51  m_RandGauss = new CLHEP::RandGaussQ( rng->getEngine() ) ;
52 }
const CaloVShape * m_shape
CLHEP::RandGaussQ * m_RandGauss
edm::TimeValue_t m_iTime
const CaloVHitCorrection * m_hitCorrection
bool isAvailable() const
Definition: Service.h:47
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
const EcalLaserDbService * m_lasercals
const CaloSubdetectorGeometry * m_geometry
const CaloVSimParameterMap * m_parameterMap
const CaloVPECorrection * m_PECorrection
CLHEP::RandPoissonQ * m_RandPoisson
const CaloVHitFilter * m_hitFilter
EcalHitResponse::~EcalHitResponse ( )
virtual

Definition at line 54 of file EcalHitResponse.cc.

References m_RandGauss, and m_RandPoisson.

55 {
56  delete m_RandPoisson ;
57  delete m_RandGauss ;
58 }
CLHEP::RandGaussQ * m_RandGauss
CLHEP::RandPoissonQ * m_RandPoisson

Member Function Documentation

void EcalHitResponse::add ( const EcalSamples pSam)

Definition at line 265 of file EcalHitResponse.cc.

References findSignal(), and CaloTSamplesBase< Ttype >::id().

266 {
267  EcalSamples& sam ( *findSignal( pSam->id() ) ) ;
268  sam += (*pSam) ;
269 }
CaloTSamplesBase< float > EcalSamples
EcalSamples * findSignal(const DetId &detId)
double EcalHitResponse::analogSignalAmplitude ( const PCaloHit hit) const
protected

Definition at line 232 of file EcalHitResponse.cc.

References CaloVPECorrection::correctPE(), PCaloHit::energy(), findLaserConstant(), PCaloHit::id(), m_PECorrection, m_useLCcorrection, Parameters::parameters, params(), and ranPois().

Referenced by putAnalogSignal().

233 {
234  const DetId& detId ( hit.id() ) ;
235 
236  const CaloSimParameters& parameters ( *params( detId ) ) ;
237 
238  // OK, the "energy" in the hit could be a real energy, deposited energy,
239  // or pe count. This factor converts to photoelectrons
240 
241  float lasercalib = 1.;
242  if(m_useLCcorrection == true && detId.subdetId() != 3) {
243  lasercalib = findLaserConstant(detId);
244  }
245 
246  double npe ( hit.energy()/lasercalib*parameters.simHitToPhotoelectrons( detId ) ) ;
247 
248  // do we need to doPoisson statistics for the photoelectrons?
249  if( parameters.doPhotostatistics() ) npe = ranPois()->fire( npe ) ;
250 
251  if( 0 != m_PECorrection ) npe = m_PECorrection->correctPE( detId, npe ) ;
252 
253  return npe ;
254 }
dictionary parameters
Definition: Parameters.py:2
double findLaserConstant(const DetId &detId) const
double energy() const
Definition: PCaloHit.h:29
Main class for Parameters in different subdetectors.
const CaloSimParameters * params(const DetId &detId) const
unsigned int id() const
Definition: PCaloHit.h:40
Definition: DetId.h:20
const CaloVPECorrection * m_PECorrection
CLHEP::RandPoissonQ * ranPois() const
virtual double correctPE(const DetId &detId, double npe) const =0
void EcalHitResponse::blankOutUsedSamples ( )
protected

Definition at line 151 of file EcalHitResponse.cc.

References i, m_index, CaloTSamplesBase< Ttype >::setZero(), findQualityFiles::size, and vSamAll().

Referenced by EBHitResponse::run(), and run().

152 {
153  const unsigned int size ( m_index.size() ) ;
154 
155  for( unsigned int i ( 0 ) ; i != size ; ++i )
156  {
157  vSamAll( m_index[i] )->setZero() ;
158  }
159  m_index.erase( m_index.begin() , // done and make ready to start over
160  m_index.end() ) ;
161 }
int i
Definition: DBlmapReader.cc:9
virtual EcalSamples * vSamAll(unsigned int i)=0
tuple size
Write out results.
const EcalHitResponse::EcalSamples * EcalHitResponse::findDetId ( const DetId detId) const

Definition at line 302 of file EcalHitResponse.cc.

References vSamAll().

Referenced by ESDigitizer::run().

303 {
304  const unsigned int di ( CaloGenericDetId( detId ).denseIndex() ) ;
305  return vSamAll( di ) ;
306 }
virtual EcalSamples * vSamAll(unsigned int i)=0
double EcalHitResponse::findLaserConstant ( const DetId detId) const
protected

Definition at line 215 of file EcalHitResponse.cc.

References EcalLaserDbService::getLaserCorrection(), m_iTime, and m_lasercals.

Referenced by analogSignalAmplitude().

216 {
217  const edm::Timestamp& evtTimeStamp = edm::Timestamp(m_iTime);
218  return (m_lasercals->getLaserCorrection(detId, evtTimeStamp));
219 }
edm::TimeValue_t m_iTime
float getLaserCorrection(DetId const &xid, edm::Timestamp const &iTime) const
const EcalLaserDbService * m_lasercals
EcalHitResponse::EcalSamples * EcalHitResponse::findSignal ( const DetId detId)
protected

Definition at line 223 of file EcalHitResponse.cc.

References m_index, query::result, vSamAll(), and CaloTSamplesBase< Ttype >::zero().

Referenced by add(), putAnalogSignal(), and EBHitResponse::putAPDSignal().

224 {
225  const unsigned int di ( CaloGenericDetId( detId ).denseIndex() ) ;
226  EcalSamples* result ( vSamAll( di ) ) ;
227  if( result->zero() ) m_index.push_back( di ) ;
228  return result ;
229 }
tuple result
Definition: query.py:137
CaloTSamplesBase< float > EcalSamples
virtual EcalSamples * vSamAll(unsigned int i)=0
const CaloSubdetectorGeometry * EcalHitResponse::geometry ( ) const
protected

Definition at line 87 of file EcalHitResponse.cc.

References m_geometry.

Referenced by Vispa.Gui.ConnectableWidget.ConnectableWidget::leaveEvent(), setGeometry(), and timeOfFlight().

88 {
89  assert( 0 != m_geometry ) ;
90  return m_geometry ;
91 }
const CaloSubdetectorGeometry * m_geometry
const CaloVHitFilter * EcalHitResponse::hitFilter ( ) const
protected

Definition at line 296 of file EcalHitResponse.cc.

References m_hitFilter.

Referenced by EBHitResponse::run().

297 {
298  return m_hitFilter ;
299 }
const CaloVHitFilter * m_hitFilter
EcalHitResponse::VecInd & EcalHitResponse::index ( )
protected
const EcalHitResponse::VecInd & EcalHitResponse::index ( ) const
protected

Definition at line 290 of file EcalHitResponse.cc.

References m_index.

Referenced by BeautifulSoup.PageElement::_invert().

291 {
292  return m_index ;
293 }
int EcalHitResponse::maxBunch ( ) const
protected

Definition at line 278 of file EcalHitResponse.cc.

References m_maxBunch.

Referenced by EBHitResponse::run(), and setBunchRange().

279 {
280  return m_maxBunch ;
281 }
int EcalHitResponse::minBunch ( ) const
protected

Definition at line 272 of file EcalHitResponse.cc.

References m_minBunch.

Referenced by EBHitResponse::run(), and setBunchRange().

273 {
274  return m_minBunch ;
275 }
virtual EcalSamples* EcalHitResponse::operator[] ( unsigned int  i)
pure virtual

Implemented in EBHitResponse, EEHitResponse, and ESHitResponse.

virtual const EcalSamples* EcalHitResponse::operator[] ( unsigned int  i) const
pure virtual

Implemented in EBHitResponse, EEHitResponse, and ESHitResponse.

const CaloSimParameters * EcalHitResponse::params ( const DetId detId) const
protected

Definition at line 73 of file EcalHitResponse.cc.

References m_parameterMap, and CaloVSimParameterMap::simParameters().

Referenced by analogSignalAmplitude(), putAnalogSignal(), and EBHitResponse::putAPDSignal().

74 {
75  assert( 0 != m_parameterMap ) ;
76  return &m_parameterMap->simParameters( detId ) ;
77 }
virtual const CaloSimParameters & simParameters(const DetId &id) const =0
const CaloVSimParameterMap * m_parameterMap
double EcalHitResponse::phaseShift ( ) const
protected

Definition at line 114 of file EcalHitResponse.cc.

References m_phaseShift.

Referenced by EBHitResponse::putAPDSignal(), and setPhaseShift().

115 {
116  return m_phaseShift ;
117 }
void EcalHitResponse::putAnalogSignal ( const PCaloHit inputHit)
protectedvirtual

Definition at line 182 of file EcalHitResponse.cc.

References analogSignalAmplitude(), newFWLiteAna::bin, BUNCHSPACE, CaloVHitCorrection::correct(), findSignal(), PCaloHit::id(), m_hitCorrection, m_phaseShift, Parameters::parameters, params(), query::result, shape(), CaloTSamplesBase< Ttype >::size(), PCaloHit::time(), timeOfFlight(), CaloVShape::timeToRise(), and tzero.

Referenced by EBHitResponse::run(), and run().

183 {
184  PCaloHit hit ( inputHit ) ;
185 
186  if( 0 != m_hitCorrection ) m_hitCorrection->correct( hit ) ;
187 
188  const DetId detId ( hit.id() ) ;
189 
190  const CaloSimParameters* parameters ( params( detId ) ) ;
191 
192  const double signal ( analogSignalAmplitude( hit ) ) ;
193 
194  const double jitter ( hit.time() - timeOfFlight( detId ) ) ;
195 
196  const double tzero = ( shape()->timeToRise()
197  + parameters->timePhase()
198  - jitter
199  - BUNCHSPACE*( parameters->binOfMaximum()
200  - m_phaseShift ) ) ;
201  double binTime ( tzero ) ;
202 
203  EcalSamples& result ( *findSignal( detId ) ) ;
204 
205  const unsigned int rsize ( result.size() ) ;
206 
207  for( unsigned int bin ( 0 ) ; bin != rsize ; ++bin )
208  {
209  result[ bin ] += (*shape())( binTime )*signal ;
210  binTime += BUNCHSPACE ;
211  }
212 }
dictionary parameters
Definition: Parameters.py:2
const CaloVShape * shape() const
double timeOfFlight(const DetId &detId) const
Main class for Parameters in different subdetectors.
const CaloSimParameters * params(const DetId &detId) const
double analogSignalAmplitude(const PCaloHit &hit) const
virtual void correct(PCaloHit &hit) const =0
tuple result
Definition: query.py:137
const CaloVHitCorrection * m_hitCorrection
virtual double timeToRise() const =0
CaloTSamplesBase< float > EcalSamples
unsigned int id
Definition: DetId.h:20
static const double tzero[3]
EcalSamples * findSignal(const DetId &detId)
CLHEP::RandGaussQ * EcalHitResponse::ranGauss ( ) const
protected

Definition at line 67 of file EcalHitResponse.cc.

References m_RandGauss.

Referenced by EBHitResponse::EBHitResponse().

68 {
69  return m_RandGauss ;
70 }
CLHEP::RandGaussQ * m_RandGauss
CLHEP::RandPoissonQ * EcalHitResponse::ranPois ( ) const
protected

Definition at line 61 of file EcalHitResponse.cc.

References m_RandPoisson.

Referenced by analogSignalAmplitude(), and EBHitResponse::apdSignalAmplitude().

62 {
63  return m_RandPoisson ;
64 }
CLHEP::RandPoissonQ * m_RandPoisson
void EcalHitResponse::run ( MixCollection< PCaloHit > &  hits)
virtual

Reimplemented in EBHitResponse.

Definition at line 164 of file EcalHitResponse.cc.

References CaloVHitFilter::accepts(), MixCollection< T >::begin(), blankOutUsedSamples(), MixCollection< T >::end(), edm::detail::isnan(), m_hitFilter, m_maxBunch, m_minBunch, putAnalogSignal(), and PCaloHit::time().

165 {
167 
168  for( MixCollection<PCaloHit>::MixItr hitItr ( hits.begin() ) ;
169  hitItr != hits.end() ; ++hitItr )
170  {
171  const PCaloHit& hit ( *hitItr ) ;
172  const int bunch ( hitItr.bunch() ) ;
173  if( m_minBunch <= bunch &&
174  m_maxBunch >= bunch &&
175  !isnan( hit.time() ) &&
176  ( 0 == m_hitFilter ||
178  }
179 }
iterator end()
bool isnan(float x)
Definition: math.h:13
virtual bool accepts(const PCaloHit &hit) const =0
virtual void putAnalogSignal(const PCaloHit &inputHit)
iterator begin()
const CaloVHitFilter * m_hitFilter
virtual unsigned int EcalHitResponse::samplesSize ( ) const
pure virtual

Implemented in EBHitResponse, EEHitResponse, and ESHitResponse.

virtual unsigned int EcalHitResponse::samplesSizeAll ( ) const
protectedpure virtual

Implemented in EBHitResponse, EEHitResponse, and ESHitResponse.

void EcalHitResponse::setBunchRange ( int  minBunch,
int  maxBunch 
)

Definition at line 94 of file EcalHitResponse.cc.

References m_maxBunch, m_minBunch, maxBunch(), and minBunch().

96 {
99 }
int maxBunch() const
int minBunch() const
void EcalHitResponse::setEventTime ( const edm::TimeValue_t iTime)

Definition at line 138 of file EcalHitResponse.cc.

References m_iTime.

Referenced by EcalDigiProducer::checkCalibrations().

139 {
140  m_iTime = iTime;
141 }
edm::TimeValue_t m_iTime
void EcalHitResponse::setGeometry ( const CaloSubdetectorGeometry geometry)

Definition at line 102 of file EcalHitResponse.cc.

References geometry(), and m_geometry.

Referenced by EcalDigiProducer::updateGeometry().

103 {
104  m_geometry = geometry ;
105 }
const CaloSubdetectorGeometry * m_geometry
const CaloSubdetectorGeometry * geometry() const
void EcalHitResponse::setHitCorrection ( const CaloVHitCorrection hitCorrection)

Definition at line 126 of file EcalHitResponse.cc.

References m_hitCorrection.

127 {
128  m_hitCorrection = hitCorrection ;
129 }
const CaloVHitCorrection * m_hitCorrection
void EcalHitResponse::setHitFilter ( const CaloVHitFilter filter)

Definition at line 120 of file EcalHitResponse.cc.

References alcazmumu_cfi::filter, and m_hitFilter.

121 {
122  m_hitFilter = filter ;
123 }
const CaloVHitFilter * m_hitFilter
void EcalHitResponse::setLaserConstants ( const EcalLaserDbService laser,
bool &  useLCcorrection 
)

Definition at line 144 of file EcalHitResponse.cc.

References m_lasercals, and m_useLCcorrection.

Referenced by EcalDigiProducer::checkCalibrations().

145 {
146  m_lasercals = laser;
147  m_useLCcorrection = useLCcorrection;
148 }
const EcalLaserDbService * m_lasercals
void EcalHitResponse::setPECorrection ( const CaloVPECorrection peCorrection)

Definition at line 132 of file EcalHitResponse.cc.

References m_PECorrection.

133 {
134  m_PECorrection = peCorrection ;
135 }
const CaloVPECorrection * m_PECorrection
void EcalHitResponse::setPhaseShift ( double  phaseShift)

Definition at line 108 of file EcalHitResponse.cc.

References m_phaseShift, and phaseShift().

Referenced by EcalDigiProducer::EcalDigiProducer(), and EcalTBDigiProducer::setPhaseShift().

109 {
111 }
double phaseShift() const
const CaloVShape * EcalHitResponse::shape ( void  ) const
protected

Definition at line 80 of file EcalHitResponse.cc.

References m_shape.

Referenced by putAnalogSignal().

81 {
82  assert( 0 != m_shape ) ;
83  return m_shape ;
84 }
const CaloVShape * m_shape
double EcalHitResponse::timeOfFlight ( const DetId detId) const
protected

Definition at line 257 of file EcalHitResponse.cc.

References geometry(), CaloCellGeometry::getPosition(), and PV3DBase< T, PVType, FrameType >::mag().

Referenced by putAnalogSignal(), and EBHitResponse::putAPDSignal().

258 {
259  const CaloCellGeometry* cellGeometry ( geometry()->getGeometry( detId ) ) ;
260  assert( 0 != cellGeometry ) ;
261  return cellGeometry->getPosition().mag()*cm/c_light ; // Units of c_light: mm/ns
262 }
const CaloSubdetectorGeometry * geometry() const
virtual EcalSamples* EcalHitResponse::vSam ( unsigned int  i)
protectedpure virtual

Implemented in EBHitResponse, EEHitResponse, and ESHitResponse.

virtual EcalSamples* EcalHitResponse::vSamAll ( unsigned int  i)
protectedpure virtual
virtual const EcalSamples* EcalHitResponse::vSamAll ( unsigned int  i) const
protectedpure virtual

Implemented in EBHitResponse, EEHitResponse, and ESHitResponse.

Member Data Documentation

const CaloSubdetectorGeometry* EcalHitResponse::m_geometry
private

Definition at line 124 of file EcalHitResponse.h.

Referenced by geometry(), and setGeometry().

const CaloVHitCorrection* EcalHitResponse::m_hitCorrection
private

Definition at line 121 of file EcalHitResponse.h.

Referenced by putAnalogSignal(), and setHitCorrection().

const CaloVHitFilter* EcalHitResponse::m_hitFilter
private

Definition at line 123 of file EcalHitResponse.h.

Referenced by hitFilter(), run(), and setHitFilter().

VecInd EcalHitResponse::m_index
private

Definition at line 137 of file EcalHitResponse.h.

Referenced by blankOutUsedSamples(), findSignal(), and index().

edm::TimeValue_t EcalHitResponse::m_iTime
private

Definition at line 134 of file EcalHitResponse.h.

Referenced by findLaserConstant(), and setEventTime().

const EcalLaserDbService* EcalHitResponse::m_lasercals
private

Definition at line 125 of file EcalHitResponse.h.

Referenced by findLaserConstant(), and setLaserConstants().

int EcalHitResponse::m_maxBunch
private

Definition at line 131 of file EcalHitResponse.h.

Referenced by maxBunch(), run(), and setBunchRange().

int EcalHitResponse::m_minBunch
private

Definition at line 130 of file EcalHitResponse.h.

Referenced by minBunch(), run(), and setBunchRange().

const CaloVSimParameterMap* EcalHitResponse::m_parameterMap
private

Definition at line 119 of file EcalHitResponse.h.

Referenced by params().

const CaloVPECorrection* EcalHitResponse::m_PECorrection
private

Definition at line 122 of file EcalHitResponse.h.

Referenced by analogSignalAmplitude(), and setPECorrection().

double EcalHitResponse::m_phaseShift
private

Definition at line 132 of file EcalHitResponse.h.

Referenced by phaseShift(), putAnalogSignal(), and setPhaseShift().

CLHEP::RandGaussQ* EcalHitResponse::m_RandGauss
mutableprivate

Definition at line 128 of file EcalHitResponse.h.

Referenced by EcalHitResponse(), ranGauss(), and ~EcalHitResponse().

CLHEP::RandPoissonQ* EcalHitResponse::m_RandPoisson
mutableprivate

Definition at line 127 of file EcalHitResponse.h.

Referenced by EcalHitResponse(), ranPois(), and ~EcalHitResponse().

const CaloVShape* EcalHitResponse::m_shape
private

Definition at line 120 of file EcalHitResponse.h.

Referenced by shape().

bool EcalHitResponse::m_useLCcorrection
private

Definition at line 135 of file EcalHitResponse.h.

Referenced by analogSignalAmplitude(), and setLaserConstants().