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)
 

Private Attributes

double cut_to_avoid_signal_
 
uint32_t noise_cache_id
 
edm::ESHandle< SiStripNoisesnoiseHandle
 
uint32_t quality_cache_id
 
edm::ESHandle< SiStripQualityqualityHandle
 

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

Constructor & Destructor Documentation

◆ TT6CMNSubtractor()

TT6CMNSubtractor::TT6CMNSubtractor ( double  in)
inlineprivate

Definition at line 21 of file TT6CMNSubtractor.h.

Member Function Documentation

◆ init()

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

Reimplemented from SiStripCommonModeNoiseSubtractor.

Definition at line 9 of file TT6CMNSubtractor.cc.

9  {
10  uint32_t n_cache_id = es.get<SiStripNoisesRcd>().cacheIdentifier();
11  uint32_t q_cache_id = es.get<SiStripQualityRcd>().cacheIdentifier();
12 
13  if (n_cache_id != noise_cache_id) {
15  noise_cache_id = n_cache_id;
16  }
17  if (q_cache_id != quality_cache_id) {
19  quality_cache_id = q_cache_id;
20  }
21 }

References edm::EventSetup::get(), get, noise_cache_id, noiseHandle, quality_cache_id, and qualityHandle.

◆ subtract() [1/2]

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

Implements SiStripCommonModeNoiseSubtractor.

Definition at line 26 of file TT6CMNSubtractor.cc.

26  {
27  subtract_(detId, firstAPV, digis);
28 }

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 23 of file TT6CMNSubtractor.cc.

23  {
24  subtract_(detId, firstAPV, digis);
25 }

References subtract_().

◆ subtract_()

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

Definition at line 31 of file TT6CMNSubtractor.cc.

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

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

Member Data Documentation

◆ cut_to_avoid_signal_

double TT6CMNSubtractor::cut_to_avoid_signal_
private

Definition at line 21 of file TT6CMNSubtractor.h.

Referenced by subtract_().

◆ noise_cache_id

uint32_t TT6CMNSubtractor::noise_cache_id
private

Definition at line 25 of file TT6CMNSubtractor.h.

Referenced by init().

◆ noiseHandle

edm::ESHandle<SiStripNoises> TT6CMNSubtractor::noiseHandle
private

Definition at line 23 of file TT6CMNSubtractor.h.

Referenced by init(), and subtract_().

◆ quality_cache_id

uint32_t TT6CMNSubtractor::quality_cache_id
private

Definition at line 25 of file TT6CMNSubtractor.h.

Referenced by init().

◆ qualityHandle

edm::ESHandle<SiStripQuality> TT6CMNSubtractor::qualityHandle
private

Definition at line 24 of file TT6CMNSubtractor.h.

Referenced by init(), and subtract_().

eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
SiStripNoises::getNoiseFast
static float getNoiseFast(const uint16_t &strip, const Range &range)
Definition: SiStripNoises.h:66
SiStripBadStrip::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripBadStrip.cc:27
SiStripNoises::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripNoises.cc:34
SiStripNoisesRcd
Definition: SiStripCondDataRecords.h:40
TT6CMNSubtractor::quality_cache_id
uint32_t quality_cache_id
Definition: TT6CMNSubtractor.h:25
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiStripNoises::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
SiStripQualityRcd
Definition: SiStripDependentRecords.h:56
SiStripQuality::IsStripBad
bool IsStripBad(const uint32_t &detid, const short &strip) const
Definition: SiStripQuality.cc:628
recoMuon::in
Definition: RecoMuonEnumerators.h:6
TT6CMNSubtractor::cut_to_avoid_signal_
double cut_to_avoid_signal_
Definition: TT6CMNSubtractor.h:21
TT6CMNSubtractor::subtract_
void subtract_(uint32_t detId, uint16_t firstAPV, std::vector< T > &digis)
Definition: TT6CMNSubtractor.cc:31
get
#define get
TT6CMNSubtractor::noiseHandle
edm::ESHandle< SiStripNoises > noiseHandle
Definition: TT6CMNSubtractor.h:23
TT6CMNSubtractor::noise_cache_id
uint32_t noise_cache_id
Definition: TT6CMNSubtractor.h:25
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TT6CMNSubtractor::qualityHandle
edm::ESHandle< SiStripQuality > qualityHandle
Definition: TT6CMNSubtractor.h:24