#include <TT6CMNSubtractor.h>
Public Member Functions | |
void | init (const edm::EventSetup &es) |
void | subtract (const uint32_t &, const uint16_t &, std::vector< float > &) |
void | subtract (const uint32_t &, const uint16_t &, std::vector< int16_t > &) |
Private Member Functions | |
template<typename T > | |
void | subtract_ (const uint32_t &, const uint16_t &, std::vector< T > &) |
TT6CMNSubtractor (double in) | |
Private Attributes | |
double | cut_to_avoid_signal_ |
uint32_t | noise_cache_id |
edm::ESHandle< SiStripNoises > | noiseHandle |
uint32_t | quality_cache_id |
edm::ESHandle< SiStripQuality > | qualityHandle |
Friends | |
class | SiStripRawProcessingFactory |
Definition at line 9 of file TT6CMNSubtractor.h.
TT6CMNSubtractor::TT6CMNSubtractor | ( | double | in | ) | [inline, private] |
Definition at line 23 of file TT6CMNSubtractor.h.
: cut_to_avoid_signal_(in), noise_cache_id(0), quality_cache_id(0) {};
void TT6CMNSubtractor::init | ( | const edm::EventSetup & | es | ) | [virtual] |
Reimplemented from SiStripCommonModeNoiseSubtractor.
Definition at line 9 of file TT6CMNSubtractor.cc.
References edm::EventSetup::get(), noise_cache_id, noiseHandle, quality_cache_id, and qualityHandle.
{ uint32_t n_cache_id = es.get<SiStripNoisesRcd>().cacheIdentifier(); uint32_t q_cache_id = es.get<SiStripQualityRcd>().cacheIdentifier(); if(n_cache_id != noise_cache_id) { es.get<SiStripNoisesRcd>().get( noiseHandle ); noise_cache_id = n_cache_id; } if(q_cache_id != quality_cache_id) { es.get<SiStripQualityRcd>().get( qualityHandle ); quality_cache_id = q_cache_id; } }
void TT6CMNSubtractor::subtract | ( | const uint32_t & | detId, |
const uint16_t & | firstAPV, | ||
std::vector< int16_t > & | digis | ||
) | [virtual] |
Implements SiStripCommonModeNoiseSubtractor.
Definition at line 23 of file TT6CMNSubtractor.cc.
References subtract_().
{ subtract_(detId, firstAPV, digis);}
void TT6CMNSubtractor::subtract | ( | const uint32_t & | detId, |
const uint16_t & | firstAPV, | ||
std::vector< float > & | digis | ||
) | [virtual] |
Implements SiStripCommonModeNoiseSubtractor.
Definition at line 24 of file TT6CMNSubtractor.cc.
References subtract_().
{ subtract_(detId,firstAPV, digis);}
void TT6CMNSubtractor::subtract_ | ( | const uint32_t & | detId, |
const uint16_t & | firstAPV, | ||
std::vector< T > & | digis | ||
) | [inline, private] |
Definition at line 29 of file TT6CMNSubtractor.cc.
References cut_to_avoid_signal_, python::rootplot::utilities::ls(), noiseHandle, and qualityHandle.
Referenced by subtract().
{ short FixedBias=128; SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detId); SiStripQuality::Range detQualityRange = qualityHandle->getRange(detId); typename std::vector<T>::iterator fs,ls; double sumVal = 0.0; double sumWt = 0.0; for (uint16_t istrip=0; istrip<digis.size(); ++istrip){ if ( !qualityHandle->IsStripBad(detQualityRange,istrip+firstAPV*128) ) { float stripNoise=noiseHandle->getNoiseFast(istrip+firstAPV*128,detNoiseRange); if( fabs(digis[istrip]-FixedBias) < cut_to_avoid_signal_*stripNoise ) { double nWeight = 1/(stripNoise*stripNoise); sumVal += (digis[istrip]-FixedBias)*nWeight; sumWt += nWeight; } } if (istrip%128 == 127){ double CM = (sumWt) ? sumVal/sumWt :0.0; fs = digis.begin()+istrip-127; ls = digis.begin()+istrip+1; while (fs < ls) { *fs = static_cast<T>(*fs-FixedBias-CM); fs++; } sumVal = 0.0; sumWt = 0.0; } } }
friend class SiStripRawProcessingFactory [friend] |
Reimplemented from SiStripCommonModeNoiseSubtractor.
Definition at line 11 of file TT6CMNSubtractor.h.
double TT6CMNSubtractor::cut_to_avoid_signal_ [private] |
Definition at line 26 of file TT6CMNSubtractor.h.
Referenced by subtract_().
uint32_t TT6CMNSubtractor::noise_cache_id [private] |
Definition at line 30 of file TT6CMNSubtractor.h.
Referenced by init().
Definition at line 28 of file TT6CMNSubtractor.h.
Referenced by init(), and subtract_().
uint32_t TT6CMNSubtractor::quality_cache_id [private] |
Definition at line 30 of file TT6CMNSubtractor.h.
Referenced by init().
Definition at line 29 of file TT6CMNSubtractor.h.
Referenced by init(), and subtract_().