CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Friends

MedianCMNSubtractor Class Reference

#include <MedianCMNSubtractor.h>

Inheritance diagram for MedianCMNSubtractor:
SiStripCommonModeNoiseSubtractor

List of all members.

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 > &)

Private Member Functions

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

Friends

class SiStripRawProcessingFactory

Detailed Description

Definition at line 5 of file MedianCMNSubtractor.h.


Constructor & Destructor Documentation

MedianCMNSubtractor::MedianCMNSubtractor ( ) [inline, private]

Definition at line 17 of file MedianCMNSubtractor.h.

{};

Member Function Documentation

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 3 of file MedianCMNSubtractor.cc.

References subtract_().

{subtract_(detId,firstAPV,digis);}
void MedianCMNSubtractor::subtract ( const uint32_t &  detId,
const uint16_t &  firstAPV,
std::vector< float > &  digis 
) [virtual]

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 4 of file MedianCMNSubtractor.cc.

References subtract_().

{subtract_(detId,firstAPV, digis);}
template<typename T >
void MedianCMNSubtractor::subtract_ ( const uint32_t &  detId,
const uint16_t &  firstAPV,
std::vector< T > &  digis 
) [inline, private]

Definition at line 9 of file MedianCMNSubtractor.cc.

References SiStripCommonModeNoiseSubtractor::_vmedians, end, SiStripCommonModeNoiseSubtractor::median(), evf::evtn::offset(), strip(), and tmp.

Referenced by subtract().

                                                                              {
  
  std::vector<T> tmp;  tmp.reserve(128);  
  typename std::vector<T>::iterator  
    strip( digis.begin() ), 
    end(   digis.end()   ),
    endAPV;
  
  _vmedians.clear();
  
  while( strip < end ) {
    endAPV = strip+128; tmp.clear();
    tmp.insert(tmp.end(),strip,endAPV);
    const float offset = median(tmp);

    _vmedians.push_back(std::pair<short,float>((strip-digis.begin())/128+firstAPV,offset));
    
    while (strip < endAPV) {
      *strip = static_cast<T>(*strip-offset);
      strip++;
    }

  }
}

Friends And Related Function Documentation

friend class SiStripRawProcessingFactory [friend]

Reimplemented from SiStripCommonModeNoiseSubtractor.

Definition at line 7 of file MedianCMNSubtractor.h.