CMS 3D CMS Logo

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

#include <CaloVNoiseSignalGenerator.h>

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

Public Member Functions

 CaloVNoiseSignalGenerator ()
 
bool contains (const DetId &detId) const
 
void fillEvent ()
 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 ()
 

Protected Attributes

std::vector< CaloSamplestheNoiseSignals
 

Private Member Functions

void fillDetIds ()
 

Private Attributes

std::vector< unsigned int > theDetIds
 

Detailed Description

Definition at line 7 of file CaloVNoiseSignalGenerator.h.

Constructor & Destructor Documentation

CaloVNoiseSignalGenerator::CaloVNoiseSignalGenerator ( )

Definition at line 5 of file CaloVNoiseSignalGenerator.cc.

7  theDetIds()
8 {
9 }
std::vector< CaloSamples > theNoiseSignals
std::vector< unsigned int > theDetIds
virtual CaloVNoiseSignalGenerator::~CaloVNoiseSignalGenerator ( )
inlinevirtual

Definition at line 11 of file CaloVNoiseSignalGenerator.h.

11 {}

Member Function Documentation

bool CaloVNoiseSignalGenerator::contains ( const DetId detId) const

Definition at line 25 of file CaloVNoiseSignalGenerator.cc.

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

Referenced by HcalAmplifier::amplify().

26 {
27  return edm::binary_search_all(theDetIds, detId.rawId());
28 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< unsigned int > theDetIds
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:76
void CaloVNoiseSignalGenerator::fillDetIds ( )
private

Definition at line 31 of file CaloVNoiseSignalGenerator.cc.

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

Referenced by fillEvent().

32 {
33  theDetIds.reserve(theNoiseSignals.size());
34  for(std::vector<CaloSamples>::const_iterator sampleItr = theNoiseSignals.begin();
35  sampleItr != theNoiseSignals.end(); ++sampleItr)
36  {
37 
38  theDetIds.push_back(sampleItr->id().rawId());
39 
40  // std::cout << "Noise DetId " << sampleItr->id().rawId() << std::endl;
41 
42  }
44 }
std::vector< CaloSamples > theNoiseSignals
std::vector< unsigned int > theDetIds
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
void CaloVNoiseSignalGenerator::fillEvent ( )

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

Definition at line 12 of file CaloVNoiseSignalGenerator.cc.

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

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

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

if you want to fill signals on demand, override this subclass is responsible for clearing theNoiseSignals before adding

Reimplemented in edm::EcalNoiseStorage, edm::HcalNoiseStorage, and HPDNoiseGenerator.

Definition at line 27 of file CaloVNoiseSignalGenerator.h.

Referenced by fillEvent().

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

Definition at line 16 of file CaloVNoiseSignalGenerator.h.

References theNoiseSignals.

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

16 { 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.

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

Member Data Documentation

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

Definition at line 32 of file CaloVNoiseSignalGenerator.h.

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

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