CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Friends
MedianCMNSubtractor Class Reference

#include <MedianCMNSubtractor.h>

Inheritance diagram for MedianCMNSubtractor:
SiStripCommonModeNoiseSubtractor

Public Member Functions

void subtract (uint32_t detId, uint16_t firstAPV, std::vector< int16_t > &digis) override
 
void subtract (uint32_t detId, uint16_t firstAPV, std::vector< float > &digis) override
 
- Public Member Functions inherited from SiStripCommonModeNoiseSubtractor
const std::vector< std::pair< short, float > > & getAPVsCM () const
 
virtual void init (const edm::EventSetup &es)
 
virtual ~SiStripCommonModeNoiseSubtractor ()
 

Private Member Functions

 MedianCMNSubtractor ()
 
template<typename T >
void subtract_ (uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)
 

Friends

class SiStripRawProcessingFactory
 

Additional Inherited Members

- Protected Member Functions inherited from SiStripCommonModeNoiseSubtractor
template<typename T >
float median (std::vector< T > &)
 
 SiStripCommonModeNoiseSubtractor ()
 
- Protected Attributes inherited from SiStripCommonModeNoiseSubtractor
std::vector< std::pair< short, float > > _vmedians
 

Detailed Description

Definition at line 5 of file MedianCMNSubtractor.h.

Constructor & Destructor Documentation

◆ MedianCMNSubtractor()

MedianCMNSubtractor::MedianCMNSubtractor ( )
inlineprivate

Definition at line 15 of file MedianCMNSubtractor.h.

15 {};

Member Function Documentation

◆ subtract() [1/2]

void MedianCMNSubtractor::subtract ( uint32_t  detId,
uint16_t  firstAPV,
std::vector< int16_t > &  digis 
)
overridevirtual

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 3 of file MedianCMNSubtractor.cc.

References subtract_().

3  {
4  subtract_(detId, firstAPV, digis);
5 }
void subtract_(uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)

◆ subtract() [2/2]

void MedianCMNSubtractor::subtract ( uint32_t  detId,
uint16_t  firstAPV,
std::vector< float > &  digis 
)
overridevirtual

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 6 of file MedianCMNSubtractor.cc.

References subtract_().

6  {
7  subtract_(detId, firstAPV, digis);
8 }
void subtract_(uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)

◆ subtract_()

template<typename T >
void MedianCMNSubtractor::subtract_ ( uint32_t  detId,
uint16_t  firstAPV,
std::vector< T > &  digis 
)
inlineprivate

Definition at line 11 of file MedianCMNSubtractor.cc.

References SiStripCommonModeNoiseSubtractor::_vmedians, mps_fire::end, SiStripCommonModeNoiseSubtractor::median(), hltrates_dqm_sourceclient-live_cfg::offset, digitizers_cfi::strip, and createJobs::tmp.

Referenced by subtract().

11  {
12  std::vector<T> tmp;
13  tmp.reserve(128);
14  typename std::vector<T>::iterator strip(digis.begin()), end(digis.end()), endAPV;
15 
16  _vmedians.clear();
17 
18  while (strip < end) {
19  endAPV = strip + 128;
20  tmp.clear();
21  tmp.insert(tmp.end(), strip, endAPV);
22  const float offset = median(tmp);
23 
24  _vmedians.push_back(std::pair<short, float>((strip - digis.begin()) / 128 + firstAPV, offset));
25 
26  while (strip < endAPV) {
27  *strip = static_cast<T>(*strip - offset);
28  strip++;
29  }
30  }
31 }
tmp
align.sh
Definition: createJobs.py:716
long double T
std::vector< std::pair< short, float > > _vmedians

Friends And Related Function Documentation

◆ SiStripRawProcessingFactory

friend class SiStripRawProcessingFactory
friend

Definition at line 6 of file MedianCMNSubtractor.h.