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

◆ Amplitude

Definition at line 17 of file SiPileUpSignals.h.

◆ signalMaps

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

Definition at line 21 of file SiPileUpSignals.h.

◆ SignalMapType

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

Definition at line 20 of file SiPileUpSignals.h.

Constructor & Destructor Documentation

◆ SiPileUpSignals()

SiPileUpSignals::SiPileUpSignals ( )
inline

Definition at line 23 of file SiPileUpSignals.h.

References reset().

23 { reset(); }

◆ ~SiPileUpSignals()

virtual SiPileUpSignals::~SiPileUpSignals ( )
inlinevirtual

Definition at line 25 of file SiPileUpSignals.h.

25 {}

Member Function Documentation

◆ add()

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

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_

◆ getSignal()

const SignalMapType* SiPileUpSignals::getSignal ( uint32_t  detID) const
inline

Definition at line 34 of file SiPileUpSignals.h.

References signal_.

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

◆ reset()

void SiPileUpSignals::reset ( void  )
inline

Definition at line 32 of file SiPileUpSignals.h.

References resetSignals().

Referenced by SiPileUpSignals().

32 { resetSignals(); }

◆ resetSignals()

void SiPileUpSignals::resetSignals ( )
private

Definition at line 4 of file SiPileUpSignals.cc.

References signal_.

Referenced by reset().

4 { signal_.clear(); }
signalMaps signal_

Member Data Documentation

◆ signal_

signalMaps SiPileUpSignals::signal_
private

Definition at line 44 of file SiPileUpSignals.h.

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