CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
CaloVNoiseSignalGenerator Class Referenceabstract

#include <CaloVNoiseSignalGenerator.h>

Inheritance diagram for CaloVNoiseSignalGenerator:
EcalBaseSignalGenerator edm::EcalNoiseStorage edm::HcalNoiseStorage HcalBaseSignalGenerator EcalSignalGenerator< ECALDIGITIZERTRAITS > EcalSignalGenerator< EBDigitizerTraits > EcalSignalGenerator< EEDigitizerTraits > EcalSignalGenerator< ESDigitizerTraits > HcalSignalGenerator< Traits > HcalSignalGenerator< HBHEDigitizerTraits > HcalSignalGenerator< HcalQIE10DigitizerTraits > HcalSignalGenerator< HcalQIE11DigitizerTraits > HcalSignalGenerator< HFDigitizerTraits > HcalSignalGenerator< HODigitizerTraits > HcalSignalGenerator< ZDCDigitizerTraits >

Public Member Functions

 CaloVNoiseSignalGenerator ()
 
bool contains (const DetId &detId) const
 
void fillEvent (CLHEP::HepRandomEngine *)
 fill theNoiseSignals with one event's worth of noise, in units of pe More...
 
void fillEvent ()
 
void getNoiseSignals (std::vector< CaloSamples > &noiseSignals)
 
void setNoiseSignals (const std::vector< CaloSamples > &noiseSignals)
 
virtual ~CaloVNoiseSignalGenerator ()
 

Protected Member Functions

virtual void fillNoiseSignals (CLHEP::HepRandomEngine *)=0
 
virtual void fillNoiseSignals ()=0
 

Protected Attributes

std::vector< CaloSamplestheNoiseSignals
 

Private Member Functions

void fillDetIds ()
 

Private Attributes

std::vector< unsigned int > theDetIds
 

Detailed Description

Definition at line 11 of file CaloVNoiseSignalGenerator.h.

Constructor & Destructor Documentation

◆ CaloVNoiseSignalGenerator()

CaloVNoiseSignalGenerator::CaloVNoiseSignalGenerator ( )

Definition at line 5 of file CaloVNoiseSignalGenerator.cc.

std::vector< CaloSamples > theNoiseSignals
std::vector< unsigned int > theDetIds

◆ ~CaloVNoiseSignalGenerator()

virtual CaloVNoiseSignalGenerator::~CaloVNoiseSignalGenerator ( )
inlinevirtual

Definition at line 14 of file CaloVNoiseSignalGenerator.h.

14 {}

Member Function Documentation

◆ contains()

bool CaloVNoiseSignalGenerator::contains ( const DetId detId) const

Definition at line 23 of file CaloVNoiseSignalGenerator.cc.

References edm::binary_search_all(), hcalRecHitTable_cff::detId, and theDetIds.

Referenced by HcalAmplifier::amplify().

23  {
24  return edm::binary_search_all(theDetIds, detId.rawId());
25 }
std::vector< unsigned int > theDetIds
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:58

◆ fillDetIds()

void CaloVNoiseSignalGenerator::fillDetIds ( )
private

Definition at line 27 of file CaloVNoiseSignalGenerator.cc.

References edm::sort_all(), theDetIds, and theNoiseSignals.

Referenced by fillEvent().

27  {
28  theDetIds.reserve(theNoiseSignals.size());
29  for (std::vector<CaloSamples>::const_iterator sampleItr = theNoiseSignals.begin(); sampleItr != theNoiseSignals.end();
30  ++sampleItr) {
31  theDetIds.push_back(sampleItr->id().rawId());
32  }
34 }
std::vector< CaloSamples > theNoiseSignals
std::vector< unsigned int > theDetIds
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92

◆ fillEvent() [1/2]

void CaloVNoiseSignalGenerator::fillEvent ( CLHEP::HepRandomEngine *  engine)

fill theNoiseSignals with one event's worth of noise, in units of pe

Definition at line 7 of file CaloVNoiseSignalGenerator.cc.

References fillDetIds(), fillNoiseSignals(), and theDetIds.

Referenced by CaloTDigitizer< Traits, runHelper >::addNoiseSignals().

7  {
8  theDetIds.clear();
9  fillNoiseSignals(engine);
10  fillDetIds();
11 }
virtual void fillNoiseSignals()=0
std::vector< unsigned int > theDetIds

◆ fillEvent() [2/2]

void CaloVNoiseSignalGenerator::fillEvent ( )

Definition at line 13 of file CaloVNoiseSignalGenerator.cc.

References fillDetIds(), fillNoiseSignals(), and theDetIds.

13  {
14  theDetIds.clear();
16  fillDetIds();
17 }
virtual void fillNoiseSignals()=0
std::vector< unsigned int > theDetIds

◆ fillNoiseSignals() [1/2]

virtual void CaloVNoiseSignalGenerator::fillNoiseSignals ( CLHEP::HepRandomEngine *  )
protectedpure virtual

◆ fillNoiseSignals() [2/2]

virtual void CaloVNoiseSignalGenerator::fillNoiseSignals ( )
protectedpure virtual

◆ getNoiseSignals()

void CaloVNoiseSignalGenerator::getNoiseSignals ( std::vector< CaloSamples > &  noiseSignals)
inline

Definition at line 21 of file CaloVNoiseSignalGenerator.h.

References theNoiseSignals.

Referenced by CaloTDigitizer< Traits, runHelper >::addNoiseSignals().

21 { noiseSignals = theNoiseSignals; }
std::vector< CaloSamples > theNoiseSignals

◆ setNoiseSignals()

void CaloVNoiseSignalGenerator::setNoiseSignals ( const std::vector< CaloSamples > &  noiseSignals)

if you want to externally fill signals for the event, call this before fillEvent gets called.

Definition at line 19 of file CaloVNoiseSignalGenerator.cc.

References theNoiseSignals.

19  {
20  theNoiseSignals = noiseSignals;
21 }
std::vector< CaloSamples > theNoiseSignals

Member Data Documentation

◆ theDetIds

std::vector<unsigned int> CaloVNoiseSignalGenerator::theDetIds
private

Definition at line 38 of file CaloVNoiseSignalGenerator.h.

Referenced by contains(), fillDetIds(), and fillEvent().

◆ theNoiseSignals

std::vector<CaloSamples> CaloVNoiseSignalGenerator::theNoiseSignals
protected