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 ()
 
void fillEvent (CLHEP::HepRandomEngine *)
 fill theNoiseSignals with one event's worth of noise, in units of pe More...
 
void getNoiseSignals (std::vector< CaloSamples > &noiseSignals)
 
void setNoiseSignals (const std::vector< CaloSamples > &noiseSignals)
 
virtual ~CaloVNoiseSignalGenerator ()
 

Protected Member Functions

virtual void fillNoiseSignals ()=0
 
virtual void fillNoiseSignals (CLHEP::HepRandomEngine *)=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.

◆ ~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.

23  {
24  return edm::binary_search_all(theDetIds, detId.rawId());
25 }

References edm::binary_search_all(), DetId::rawId(), and theDetIds.

Referenced by HcalAmplifier::amplify().

◆ fillDetIds()

void CaloVNoiseSignalGenerator::fillDetIds ( )
private

Definition at line 27 of file CaloVNoiseSignalGenerator.cc.

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 }

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

Referenced by fillEvent().

◆ fillEvent() [1/2]

void CaloVNoiseSignalGenerator::fillEvent ( )

Definition at line 13 of file CaloVNoiseSignalGenerator.cc.

13  {
14  theDetIds.clear();
16  fillDetIds();
17 }

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

◆ fillEvent() [2/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.

7  {
8  theDetIds.clear();
9  fillNoiseSignals(engine);
10  fillDetIds();
11 }

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

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

◆ fillNoiseSignals() [1/2]

virtual void CaloVNoiseSignalGenerator::fillNoiseSignals ( )
protectedpure virtual

◆ fillNoiseSignals() [2/2]

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

◆ getNoiseSignals()

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

Definition at line 21 of file CaloVNoiseSignalGenerator.h.

21 { noiseSignals = theNoiseSignals; }

References theNoiseSignals.

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

◆ 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.

19  {
20  theNoiseSignals = noiseSignals;
21 }

References 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
edm::sort_all
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
CaloVNoiseSignalGenerator::fillDetIds
void fillDetIds()
Definition: CaloVNoiseSignalGenerator.cc:27
CaloVNoiseSignalGenerator::fillNoiseSignals
virtual void fillNoiseSignals()=0
CaloVNoiseSignalGenerator::theNoiseSignals
std::vector< CaloSamples > theNoiseSignals
Definition: CaloVNoiseSignalGenerator.h:34
edm::binary_search_all
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:58
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CaloVNoiseSignalGenerator::theDetIds
std::vector< unsigned int > theDetIds
Definition: CaloVNoiseSignalGenerator.h:38