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

Definition at line 5 of file CaloVNoiseSignalGenerator.cc.

std::vector< CaloSamples > theNoiseSignals
std::vector< unsigned int > theDetIds
virtual CaloVNoiseSignalGenerator::~CaloVNoiseSignalGenerator ( )
inlinevirtual

Definition at line 14 of file CaloVNoiseSignalGenerator.h.

References ntuple::fillEvent().

14 {}

Member Function Documentation

bool CaloVNoiseSignalGenerator::contains ( const DetId detId) const

Definition at line 23 of file CaloVNoiseSignalGenerator.cc.

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

Referenced by HcalAmplifier::amplify().

23  {
24  return edm::binary_search_all(theDetIds, detId.rawId());
25 }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< unsigned int > theDetIds
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:58
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
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.

7  {
8  theDetIds.clear();
9  fillNoiseSignals(engine);
10  fillDetIds();
11 }
virtual void fillNoiseSignals()=0
std::vector< unsigned int > theDetIds
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
virtual void CaloVNoiseSignalGenerator::fillNoiseSignals ( CLHEP::HepRandomEngine *  )
protectedpure virtual
virtual void CaloVNoiseSignalGenerator::fillNoiseSignals ( )
protectedpure virtual
void CaloVNoiseSignalGenerator::getNoiseSignals ( std::vector< CaloSamples > &  noiseSignals)
inline

Definition at line 21 of file CaloVNoiseSignalGenerator.h.

References edm::contains().

21 { noiseSignals = theNoiseSignals; }
std::vector< CaloSamples > theNoiseSignals
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

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

Definition at line 38 of file CaloVNoiseSignalGenerator.h.

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

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

Definition at line 34 of file CaloVNoiseSignalGenerator.h.

Referenced by fillDetIds(), and setNoiseSignals().