test
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 Referenceabstract

#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 (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.

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

Definition at line 15 of file CaloVNoiseSignalGenerator.h.

15 {}

Member Function Documentation

bool CaloVNoiseSignalGenerator::contains ( const DetId detId) const

Definition at line 34 of file CaloVNoiseSignalGenerator.cc.

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

Referenced by HcalAmplifier::amplify().

35 {
36  return edm::binary_search_all(theDetIds, detId.rawId());
37 }
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 40 of file CaloVNoiseSignalGenerator.cc.

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

Referenced by fillEvent().

41 {
42  theDetIds.reserve(theNoiseSignals.size());
43  for(std::vector<CaloSamples>::const_iterator sampleItr = theNoiseSignals.begin();
44  sampleItr != theNoiseSignals.end(); ++sampleItr)
45  {
46 
47  theDetIds.push_back(sampleItr->id().rawId());
48 
49  }
51 }
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 ( CLHEP::HepRandomEngine *  engine)

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, runHelper >::addNoiseSignals().

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

Definition at line 20 of file CaloVNoiseSignalGenerator.cc.

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

21 {
22  theDetIds.clear();
24  fillDetIds();
25 }
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 22 of file CaloVNoiseSignalGenerator.h.

References theNoiseSignals.

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

22 { 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 28 of file CaloVNoiseSignalGenerator.cc.

References theNoiseSignals.

29 {
30  theNoiseSignals = noiseSignals;
31 }
std::vector< CaloSamples > theNoiseSignals

Member Data Documentation

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

Definition at line 39 of file CaloVNoiseSignalGenerator.h.

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

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