CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SiPileUpSignals Class Reference

#include <SiPileUpSignals.h>

Public Types

typedef float Amplitude
 
typedef std::map< uint32_t, SignalMapTypesignalMaps
 
typedef std::map< int, AmplitudeSignalMapType
 

Public Member Functions

virtual void add (uint32_t detID, const std::vector< float > &locAmpl, const size_t &firstChannelWithSignal, const size_t &lastChannelWithSignal)
 
const SignalMapTypegetSignal (uint32_t detID) const
 
void reset ()
 
 SiPileUpSignals ()
 
virtual ~SiPileUpSignals ()
 

Private Member Functions

void resetSignals ()
 

Private Attributes

signalMaps signal_
 

Detailed Description

Class which takes the responses from each SimHit and piles-up them, within a given module. More precisely, it keeps for each strip the link to each individual measurement.

Definition at line 14 of file SiPileUpSignals.h.

Member Typedef Documentation

Definition at line 17 of file SiPileUpSignals.h.

typedef std::map<uint32_t, SignalMapType> SiPileUpSignals::signalMaps

Definition at line 21 of file SiPileUpSignals.h.

typedef std::map<int, Amplitude> SiPileUpSignals::SignalMapType

Definition at line 20 of file SiPileUpSignals.h.

Constructor & Destructor Documentation

SiPileUpSignals::SiPileUpSignals ( )
inline

Definition at line 23 of file SiPileUpSignals.h.

References reset().

23 { reset(); }
virtual SiPileUpSignals::~SiPileUpSignals ( )
inlinevirtual

Definition at line 25 of file SiPileUpSignals.h.

References add().

25 {}

Member Function Documentation

void SiPileUpSignals::add ( uint32_t  detID,
const std::vector< float > &  locAmpl,
const size_t &  firstChannelWithSignal,
const size_t &  lastChannelWithSignal 
)
virtual

Definition at line 6 of file SiPileUpSignals.cc.

References signal_.

Referenced by counter.Counter::register(), and ~SiPileUpSignals().

9  {
10  SignalMapType& theSignal = signal_[detID];
11  for (size_t iChannel = firstChannelWithSignal; iChannel < lastChannelWithSignal; ++iChannel) {
12  if (locAmpl[iChannel] != 0.0) {
13  if (theSignal.find(iChannel) == theSignal.end()) {
14  theSignal.insert(std::make_pair(iChannel, locAmpl[iChannel]));
15  } else {
16  theSignal[iChannel] += locAmpl[iChannel];
17  }
18  }
19  }
20 }
std::map< int, Amplitude > SignalMapType
signalMaps signal_
const SignalMapType* SiPileUpSignals::getSignal ( uint32_t  detID) const
inline

Definition at line 34 of file SiPileUpSignals.h.

References resetSignals(), and signal_.

34  {
35  auto where = signal_.find(detID);
36  if (where == signal_.end()) {
37  return nullptr;
38  }
39  return &where->second;
40  }
signalMaps signal_
void SiPileUpSignals::reset ( void  )
inline

Definition at line 32 of file SiPileUpSignals.h.

References resetSignals().

Referenced by SiPileUpSignals().

32 { resetSignals(); }
void SiPileUpSignals::resetSignals ( )
private

Definition at line 4 of file SiPileUpSignals.cc.

References signal_.

Referenced by getSignal(), and reset().

4 { signal_.clear(); }
signalMaps signal_

Member Data Documentation

signalMaps SiPileUpSignals::signal_
private

Definition at line 44 of file SiPileUpSignals.h.

Referenced by add(), getSignal(), and resetSignals().