CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Friends

FastLinearCMNSubtractor Class Reference

#include <FastLinearCMNSubtractor.h>

Inheritance diagram for FastLinearCMNSubtractor:
SiStripCommonModeNoiseSubtractor

List of all members.

Public Member Functions

void subtract (const uint32_t &, std::vector< int16_t > &)
void subtract (const uint32_t &, std::vector< float > &)

Private Member Functions

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

Friends

class SiStripRawProcessingFactory

Detailed Description

Definition at line 5 of file FastLinearCMNSubtractor.h.


Constructor & Destructor Documentation

FastLinearCMNSubtractor::FastLinearCMNSubtractor ( ) [inline, private]

Definition at line 17 of file FastLinearCMNSubtractor.h.

{};

Member Function Documentation

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 3 of file FastLinearCMNSubtractor.cc.

References subtract_().

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 4 of file FastLinearCMNSubtractor.cc.

References subtract_().

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

Definition at line 9 of file FastLinearCMNSubtractor.cc.

References end, SiStripCommonModeNoiseSubtractor::median(), evf::evtn::offset(), slope, 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, high, low;

  while( strip < end ) {
    endAPV = strip+128; tmp.clear();
    tmp.insert(tmp.end(),strip,endAPV);
    const float offset = median(tmp);
    
    low = strip;   high = strip+64;   tmp.clear(); 
    while( high < endAPV) tmp.push_back( *high++ - *low++ );
    const float slope = median(tmp)/64.;

    while (strip < endAPV) {
      *strip = static_cast<T>( *strip - (offset + slope*(65 - (endAPV-strip) ) ) );
      strip++;
    }

  }
}

Friends And Related Function Documentation

friend class SiStripRawProcessingFactory [friend]

Reimplemented from SiStripCommonModeNoiseSubtractor.

Definition at line 7 of file FastLinearCMNSubtractor.h.