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.

23 { reset(); }

References 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.

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 }

References signal_.

Referenced by counter.Counter::register().

◆ getSignal()

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

Definition at line 34 of file SiPileUpSignals.h.

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

References signal_.

◆ reset()

void SiPileUpSignals::reset ( void  )
inline

Definition at line 32 of file SiPileUpSignals.h.

32 { resetSignals(); }

References resetSignals().

Referenced by SiPileUpSignals().

◆ resetSignals()

void SiPileUpSignals::resetSignals ( )
private

Definition at line 4 of file SiPileUpSignals.cc.

4 { signal_.clear(); }

References signal_.

Referenced by reset().

Member Data Documentation

◆ signal_

signalMaps SiPileUpSignals::signal_
private

Definition at line 44 of file SiPileUpSignals.h.

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

SiPileUpSignals::reset
void reset()
Definition: SiPileUpSignals.h:32
SiPileUpSignals::resetSignals
void resetSignals()
Definition: SiPileUpSignals.cc:4
SiPileUpSignals::SignalMapType
std::map< int, Amplitude > SignalMapType
Definition: SiPileUpSignals.h:20
SiPileUpSignals::signal_
signalMaps signal_
Definition: SiPileUpSignals.h:44