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 (const uint32_t &, const uint16_t &, std::vector< int16_t > &)
 
void subtract (const uint32_t &, const uint16_t &, std::vector< float > &)
 
- Public Member Functions inherited from SiStripCommonModeNoiseSubtractor
const std::vector< std::pair< short, float > > & getAPVsCM ()
 
virtual void init (const edm::EventSetup &es)
 
virtual ~SiStripCommonModeNoiseSubtractor ()
 

Private Member Functions

 FastLinearCMNSubtractor ()
 
template<typename T >
void subtract_ (const uint32_t &, const uint16_t &, std::vector< T > &)
 

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

Definition at line 17 of file FastLinearCMNSubtractor.h.

17 {};

Member Function Documentation

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 3 of file FastLinearCMNSubtractor.cc.

References subtract_().

3 { subtract_(detId, firstAPV, digis);}
void subtract_(const uint32_t &, const uint16_t &, std::vector< T > &)
void FastLinearCMNSubtractor::subtract ( const uint32_t &  detId,
const uint16_t &  firstAPV,
std::vector< float > &  digis 
)
virtual

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 4 of file FastLinearCMNSubtractor.cc.

References subtract_().

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

Definition at line 9 of file FastLinearCMNSubtractor.cc.

References end, SiStripCommonModeNoiseSubtractor::median(), PFRecoTauDiscriminationByIsolation_cfi::offset, slope, digi_MixPreMix_cfi::strip, and tmp.

Referenced by subtract().

9  {
10 
11  std::vector<T> tmp; tmp.reserve(128);
12  typename std::vector<T>::iterator
13  strip( digis.begin() ),
14  end( digis.end() ),
15  endAPV, high, low;
16 
17  while( strip < end ) {
18  endAPV = strip+128; tmp.clear();
19  tmp.insert(tmp.end(),strip,endAPV);
20  const float offset = median(tmp);
21 
22  low = strip; high = strip+64; tmp.clear();
23  while( high < endAPV) tmp.push_back( *high++ - *low++ );
24  const float slope = median(tmp)/64.;
25 
26  while (strip < endAPV) {
27  *strip = static_cast<T>( *strip - (offset + slope*(65 - (endAPV-strip) ) ) );
28  strip++;
29  }
30 
31  }
32 }
static const double slope[3]
#define end
Definition: vmac.h:37
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
long double T

Friends And Related Function Documentation

friend class SiStripRawProcessingFactory
friend

Definition at line 7 of file FastLinearCMNSubtractor.h.