CMS 3D CMS Logo

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

#include <TT6CMNSubtractor.h>

Inheritance diagram for TT6CMNSubtractor:
SiStripCommonModeNoiseSubtractor

Public Member Functions

void init (const edm::EventSetup &es) override
 
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 ~SiStripCommonModeNoiseSubtractor ()
 

Private Member Functions

template<typename T >
void subtract_ (uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)
 
 TT6CMNSubtractor (double in, edm::ConsumesCollector iC)
 

Private Attributes

double cut_to_avoid_signal_
 
const SiStripNoisesnoiseHandle
 
edm::ESGetToken< SiStripNoises, SiStripNoisesRcdnoiseToken_
 
edm::ESWatcher< SiStripNoisesRcdnoiseWatcher_
 
const SiStripQualityqualityHandle
 
edm::ESGetToken< SiStripQuality, SiStripQualityRcdqualityToken_
 
edm::ESWatcher< SiStripQualityRcdqualityWatcher_
 

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 12 of file TT6CMNSubtractor.h.

Constructor & Destructor Documentation

◆ TT6CMNSubtractor()

TT6CMNSubtractor::TT6CMNSubtractor ( double  in,
edm::ConsumesCollector  iC 
)
inlineprivate

Member Function Documentation

◆ init()

void TT6CMNSubtractor::init ( const edm::EventSetup es)
overridevirtual

◆ subtract() [1/2]

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 19 of file TT6CMNSubtractor.cc.

19  {
20  subtract_(detId, firstAPV, digis);
21 }

References subtract_().

◆ subtract() [2/2]

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 16 of file TT6CMNSubtractor.cc.

16  {
17  subtract_(detId, firstAPV, digis);
18 }

References subtract_().

◆ subtract_()

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

Definition at line 24 of file TT6CMNSubtractor.cc.

24  {
25  short FixedBias = 128;
26  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detId);
27  SiStripQuality::Range detQualityRange = qualityHandle->getRange(detId);
28 
29  typename std::vector<T>::iterator fs, ls;
30  double sumVal = 0.0;
31  double sumWt = 0.0;
32 
33  for (uint16_t istrip = 0; istrip < digis.size(); ++istrip) {
34  if (!qualityHandle->IsStripBad(detQualityRange, istrip + firstAPV * 128)) {
35  float stripNoise = noiseHandle->getNoiseFast(istrip + firstAPV * 128, detNoiseRange);
36 
37  if (std::abs(digis[istrip] - FixedBias) < cut_to_avoid_signal_ * stripNoise) {
38  double nWeight = 1 / (stripNoise * stripNoise);
39  sumVal += (digis[istrip] - FixedBias) * nWeight;
40  sumWt += nWeight;
41  }
42  }
43 
44  if (istrip % 128 == 127) {
45  double CM = (sumWt) ? sumVal / sumWt : 0.0;
46 
47  fs = digis.begin() + istrip - 127;
48  ls = digis.begin() + istrip + 1;
49 
50  while (fs < ls) {
51  *fs = static_cast<T>(*fs - FixedBias - CM);
52  fs++;
53  }
54 
55  sumVal = 0.0;
56  sumWt = 0.0;
57  }
58  }
59 }

References funct::abs(), cut_to_avoid_signal_, SiStripNoises::getNoiseFast(), SiStripNoises::getRange(), SiStripBadStrip::getRange(), SiStripQuality::IsStripBad(), eostools::ls(), noiseHandle, and qualityHandle.

Referenced by subtract().

Friends And Related Function Documentation

◆ SiStripRawProcessingFactory

friend class SiStripRawProcessingFactory
friend

Definition at line 13 of file TT6CMNSubtractor.h.

Member Data Documentation

◆ cut_to_avoid_signal_

double TT6CMNSubtractor::cut_to_avoid_signal_
private

Definition at line 28 of file TT6CMNSubtractor.h.

Referenced by subtract_().

◆ noiseHandle

const SiStripNoises* TT6CMNSubtractor::noiseHandle
private

Definition at line 31 of file TT6CMNSubtractor.h.

Referenced by init(), and subtract_().

◆ noiseToken_

edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> TT6CMNSubtractor::noiseToken_
private

Definition at line 29 of file TT6CMNSubtractor.h.

Referenced by init().

◆ noiseWatcher_

edm::ESWatcher<SiStripNoisesRcd> TT6CMNSubtractor::noiseWatcher_
private

Definition at line 33 of file TT6CMNSubtractor.h.

Referenced by init().

◆ qualityHandle

const SiStripQuality* TT6CMNSubtractor::qualityHandle
private

Definition at line 32 of file TT6CMNSubtractor.h.

Referenced by init(), and subtract_().

◆ qualityToken_

edm::ESGetToken<SiStripQuality, SiStripQualityRcd> TT6CMNSubtractor::qualityToken_
private

Definition at line 30 of file TT6CMNSubtractor.h.

Referenced by init().

◆ qualityWatcher_

edm::ESWatcher<SiStripQualityRcd> TT6CMNSubtractor::qualityWatcher_
private

Definition at line 34 of file TT6CMNSubtractor.h.

Referenced by init().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
TT6CMNSubtractor::noiseToken_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
Definition: TT6CMNSubtractor.h:29
TT6CMNSubtractor::qualityHandle
const SiStripQuality * qualityHandle
Definition: TT6CMNSubtractor.h:32
SiStripNoises::getNoiseFast
static float getNoiseFast(const uint16_t &strip, const Range &range)
Definition: SiStripNoises.h:68
SiStripBadStrip::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripBadStrip.cc:27
SiStripNoises
Definition: SiStripNoises.h:25
TT6CMNSubtractor::qualityToken_
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
Definition: TT6CMNSubtractor.h:30
SiStripNoises::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripNoises.cc:34
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
SiStripNoisesRcd
Definition: SiStripCondDataRecords.h:40
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
SiStripNoises::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
SiStripQualityRcd
Definition: SiStripDependentRecords.h:55
SiStripQuality::IsStripBad
bool IsStripBad(const uint32_t &detid, const short &strip) const
Definition: SiStripQuality.cc:623
recoMuon::in
Definition: RecoMuonEnumerators.h:6
TT6CMNSubtractor::cut_to_avoid_signal_
double cut_to_avoid_signal_
Definition: TT6CMNSubtractor.h:28
TT6CMNSubtractor::subtract_
void subtract_(uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)
Definition: TT6CMNSubtractor.cc:24
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
TT6CMNSubtractor::qualityWatcher_
edm::ESWatcher< SiStripQualityRcd > qualityWatcher_
Definition: TT6CMNSubtractor.h:34
TT6CMNSubtractor::noiseWatcher_
edm::ESWatcher< SiStripNoisesRcd > noiseWatcher_
Definition: TT6CMNSubtractor.h:33
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TT6CMNSubtractor::noiseHandle
const SiStripNoises * noiseHandle
Definition: TT6CMNSubtractor.h:31
SiStripQuality
Definition: SiStripQuality.h:32