CMS 3D CMS Logo

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

#include <FastLinearCMNSubtractor.h>

Inheritance diagram for FastLinearCMNSubtractor:
SiStripCommonModeNoiseSubtractor

Public Member Functions

void subtract (uint32_t detId, uint16_t firstAPV, std::vector< float > &digis) override
 
void subtract (uint32_t detId, uint16_t firstAPV, std::vector< int16_t > &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

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

Constructor & Destructor Documentation

◆ FastLinearCMNSubtractor()

FastLinearCMNSubtractor::FastLinearCMNSubtractor ( )
inlineprivate

Definition at line 15 of file FastLinearCMNSubtractor.h.

15 {};

Member Function Documentation

◆ subtract() [1/2]

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 6 of file FastLinearCMNSubtractor.cc.

6  {
7  subtract_(detId, firstAPV, digis);
8 }

References subtract_().

◆ subtract() [2/2]

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 3 of file FastLinearCMNSubtractor.cc.

3  {
4  subtract_(detId, firstAPV, digis);
5 }

References subtract_().

◆ subtract_()

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

Definition at line 11 of file FastLinearCMNSubtractor.cc.

11  {
12  std::vector<T> tmp;
13  tmp.reserve(128);
14  typename std::vector<T>::iterator strip(digis.begin()), end(digis.end()), endAPV, high, low;
15 
16  while (strip < end) {
17  endAPV = strip + 128;
18  tmp.clear();
19  tmp.insert(tmp.end(), strip, endAPV);
20  const float offset = median(tmp);
21 
22  low = strip;
23  high = strip + 64;
24  tmp.clear();
25  while (high < endAPV)
26  tmp.push_back(*high++ - *low++);
27  const float slope = median(tmp) / 64.;
28 
29  while (strip < endAPV) {
30  *strip = static_cast<T>(*strip - (offset + slope * (65 - (endAPV - strip))));
31  strip++;
32  }
33  }
34 }

References end, LaserClient_cfi::high, LaserClient_cfi::low, SiStripCommonModeNoiseSubtractor::median(), hltrates_dqm_sourceclient-live_cfg::offset, slope, digitizers_cfi::strip, and createJobs::tmp.

Referenced by subtract().

Friends And Related Function Documentation

◆ SiStripRawProcessingFactory

friend class SiStripRawProcessingFactory
friend

Definition at line 6 of file FastLinearCMNSubtractor.h.

SiStripCommonModeNoiseSubtractor::median
float median(std::vector< T > &)
Definition: SiStripCommonModeNoiseSubtractor.h:29
FastLinearCMNSubtractor::subtract_
void subtract_(uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)
Definition: FastLinearCMNSubtractor.cc:11
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
end
#define end
Definition: vmac.h:39
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
slope
static const double slope[3]
Definition: CastorTimeSlew.cc:6
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52