CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
HcalZSAlgoRealistic Class Reference

#include <HcalZSAlgoRealistic.h>

Inheritance diagram for HcalZSAlgoRealistic:
HcalZeroSuppressionAlgo

Public Member Functions

 HcalZSAlgoRealistic (bool markAndPass, std::pair< int, int > HBsearchTS, std::pair< int, int > HEsearchTS, std::pair< int, int > HOsearchTS, std::pair< int, int > HFsearchTS)
 
 HcalZSAlgoRealistic (bool markAndPass, int levelHB, int levelHE, int levelHO, int levelHF, std::pair< int, int > HBsearchTS, std::pair< int, int > HEsearchTS, std::pair< int, int > HOsearchTS, std::pair< int, int > HFsearchTS)
 
 ~HcalZSAlgoRealistic () override=default
 
- Public Member Functions inherited from HcalZeroSuppressionAlgo
void clearDbService ()
 
void setDbService (const HcalDbService *db)
 
void suppress (const HBHEDigiCollection &input, HBHEDigiCollection &output)
 
void suppress (const HODigiCollection &input, HODigiCollection &output)
 
void suppress (const HFDigiCollection &input, HFDigiCollection &output)
 
void suppress (const QIE10DigiCollection &input, QIE10DigiCollection &output)
 
void suppress (const QIE11DigiCollection &input, QIE11DigiCollection &output)
 
virtual ~HcalZeroSuppressionAlgo ()=default
 

Protected Member Functions

bool shouldKeep (const HBHEDataFrame &digi) const override
 
bool shouldKeep (const HODataFrame &digi) const override
 
bool shouldKeep (const HFDataFrame &digi) const override
 
bool shouldKeep (const QIE10DataFrame &digi) const override
 
bool shouldKeep (const QIE11DataFrame &digi) const override
 
- Protected Member Functions inherited from HcalZeroSuppressionAlgo
 HcalZeroSuppressionAlgo (bool markAndPass)
 

Private Member Functions

template<class Digi >
bool keepMe (const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
 
template<>
bool keepMe (const QIE10DataFrame &inp, int start, int finish, int threshold, uint32_t zsmask) const
 
template<>
bool keepMe (const QIE11DataFrame &inp, int start, int finish, int threshold, uint32_t zsmask) const
 

Private Attributes

std::pair< int, int > HBsearchTS_
 
std::pair< int, int > HEsearchTS_
 
std::pair< int, int > HFsearchTS_
 
std::pair< int, int > HOsearchTS_
 
int thresholdHB_
 
int thresholdHE_
 
int thresholdHF_
 
int thresholdHO_
 
bool usingDBvalues
 

Additional Inherited Members

- Protected Attributes inherited from HcalZeroSuppressionAlgo
const HcalDbServicem_dbService
 

Detailed Description

Simple amplitude-based zero suppression algorithm. For each digi, add up consecutive 2 samples in a slice of 10 time samples, beginning with (start) sample. If any of the sums are greater then the threshold, keep the event.

Author
S. Sengupta - Minnesota

Definition at line 15 of file HcalZSAlgoRealistic.h.

Constructor & Destructor Documentation

HcalZSAlgoRealistic::HcalZSAlgoRealistic ( bool  markAndPass,
std::pair< int, int >  HBsearchTS,
std::pair< int, int >  HEsearchTS,
std::pair< int, int >  HOsearchTS,
std::pair< int, int >  HFsearchTS 
)

Definition at line 25 of file HcalZSAlgoRealistic.cc.

References thresholdHB_, thresholdHE_, thresholdHF_, thresholdHO_, and usingDBvalues.

31  HBsearchTS_(HBsearchTS),
32  HEsearchTS_(HEsearchTS),
33  HOsearchTS_(HOsearchTS),
34  HFsearchTS_(HFsearchTS) {
35  thresholdHB_ = -1;
36  thresholdHE_ = -1;
37  thresholdHO_ = -1;
38  thresholdHF_ = -1;
39  usingDBvalues = true;
40 }
std::pair< int, int > HOsearchTS_
std::pair< int, int > HBsearchTS_
std::pair< int, int > HFsearchTS_
std::pair< int, int > HEsearchTS_
HcalZeroSuppressionAlgo(bool markAndPass)
HcalZSAlgoRealistic::HcalZSAlgoRealistic ( bool  markAndPass,
int  levelHB,
int  levelHE,
int  levelHO,
int  levelHF,
std::pair< int, int >  HBsearchTS,
std::pair< int, int >  HEsearchTS,
std::pair< int, int >  HOsearchTS,
std::pair< int, int >  HFsearchTS 
)

Definition at line 4 of file HcalZSAlgoRealistic.cc.

References usingDBvalues.

14  thresholdHB_(levelHB),
15  thresholdHE_(levelHE),
16  thresholdHO_(levelHO),
17  thresholdHF_(levelHF),
18  HBsearchTS_(HBsearchTS),
19  HEsearchTS_(HEsearchTS),
20  HOsearchTS_(HOsearchTS),
21  HFsearchTS_(HFsearchTS) {
22  usingDBvalues = false;
23 }
std::pair< int, int > HOsearchTS_
std::pair< int, int > HBsearchTS_
std::pair< int, int > HFsearchTS_
std::pair< int, int > HEsearchTS_
HcalZeroSuppressionAlgo(bool markAndPass)
HcalZSAlgoRealistic::~HcalZSAlgoRealistic ( )
overridedefault

Member Function Documentation

template<class Digi >
bool HcalZSAlgoRealistic::keepMe ( const Digi &  inp,
int  start,
int  finish,
int  threshold,
uint32_t  zsmask 
) const
private

Definition at line 43 of file HcalZSAlgoRealistic.cc.

References ecalMGPA::adc(), HcalDbService::getHcalZSThreshold(), mps_fire::i, HcalZeroSuppressionAlgo::m_dbService, and usingDBvalues.

Referenced by shouldKeep().

43  {
44  if ((usingDBvalues) && (threshold < 0) && (m_dbService != nullptr)) {
45  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
46  }
47 
48  // determine the sum of 2 timeslices
49  for (int i = start; i < finish; i++) {
50  if ((zsmask & (1 << i)) != 0)
51  continue;
52  if ((inp[i].adc() + inp[i + 1].adc()) >= threshold)
53  return true;
54  }
55  return false;
56 }
const HcalDbService * m_dbService
Definition: start.py:1
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
template<>
bool HcalZSAlgoRealistic::keepMe ( const QIE10DataFrame inp,
int  start,
int  finish,
int  threshold,
uint32_t  zsmask 
) const
private

Definition at line 61 of file HcalZSAlgoRealistic.cc.

References ecalMGPA::adc(), HcalDbService::getHcalZSThreshold(), mps_fire::i, HcalZeroSuppressionAlgo::m_dbService, electronIdCutBased_cfi::threshold, and usingDBvalues.

62  {
63  if ((usingDBvalues) && (threshold < 0) && (m_dbService != nullptr)) {
64  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
65  }
66 
67  // determine the sum of 2 timeslices
68  for (int i = start; i < finish; i++) {
69  if ((inp[i].adc() + inp[i + 1].adc()) >= threshold)
70  return true;
71  }
72  return false;
73 }
const HcalDbService * m_dbService
Definition: start.py:1
edm::DataFrame::id_type id() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
template<>
bool HcalZSAlgoRealistic::keepMe ( const QIE11DataFrame inp,
int  start,
int  finish,
int  threshold,
uint32_t  zsmask 
) const
private

Definition at line 76 of file HcalZSAlgoRealistic.cc.

References ecalMGPA::adc(), HcalDbService::getHcalZSThreshold(), mps_fire::i, HcalZeroSuppressionAlgo::m_dbService, electronIdCutBased_cfi::threshold, and usingDBvalues.

77  {
78  if ((usingDBvalues) && (threshold < 0) && (m_dbService != nullptr)) {
79  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
80  }
81 
82  // determine the sum of 2 timeslices
83  for (int i = start; i < finish; i++) {
84  if ((inp[i].adc() + inp[i + 1].adc()) >= threshold)
85  return true;
86  }
87  return false;
88 }
const HcalDbService * m_dbService
Definition: start.py:1
edm::DataFrame::id_type id() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
bool HcalZSAlgoRealistic::shouldKeep ( const HBHEDataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 90 of file HcalZSAlgoRealistic.cc.

References HBsearchTS_, HcalBarrel, HEsearchTS_, HBHEDataFrame::id(), keepMe(), SiStripPI::max, min(), HBHEDataFrame::size(), HcalDetId::subdet(), thresholdHB_, thresholdHE_, and HBHEDataFrame::zsCrossingMask().

90  {
91  if (digi.id().subdet() == HcalBarrel) {
92  int start = std::max(0, HBsearchTS_.first);
93  int finish = std::min(digi.size() - 1, HBsearchTS_.second);
94  return keepMe(digi, start, finish, thresholdHB_, digi.zsCrossingMask());
95  } else {
96  int start = std::max(0, HEsearchTS_.first);
97  int finish = std::min(digi.size() - 1, HEsearchTS_.second);
98  return keepMe(digi, start, finish, thresholdHE_, digi.zsCrossingMask());
99  }
100 }
Definition: start.py:1
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:31
std::pair< int, int > HBsearchTS_
T min(T a, T b)
Definition: MathUtil.h:58
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HBHEDataFrame.h:39
const HcalDetId & id() const
Definition: HBHEDataFrame.h:27
std::pair< int, int > HEsearchTS_
bool HcalZSAlgoRealistic::shouldKeep ( const HODataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 102 of file HcalZSAlgoRealistic.cc.

References HOsearchTS_, keepMe(), SiStripPI::max, min(), HODataFrame::size(), thresholdHO_, and HODataFrame::zsCrossingMask().

102  {
103  int start = std::max(0, HOsearchTS_.first);
104  int finish = std::min(digi.size() - 1, HOsearchTS_.second);
105  return keepMe(digi, start, finish, thresholdHO_, digi.zsCrossingMask());
106 }
Definition: start.py:1
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
std::pair< int, int > HOsearchTS_
int size() const
total number of samples in the digi
Definition: HODataFrame.h:31
T min(T a, T b)
Definition: MathUtil.h:58
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HODataFrame.h:39
bool HcalZSAlgoRealistic::shouldKeep ( const HFDataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 108 of file HcalZSAlgoRealistic.cc.

References HFsearchTS_, keepMe(), SiStripPI::max, min(), HFDataFrame::size(), thresholdHF_, and HFDataFrame::zsCrossingMask().

108  {
109  int start = std::max(0, HFsearchTS_.first);
110  int finish = std::min(digi.size() - 1, HFsearchTS_.second);
111  return keepMe(digi, start, finish, thresholdHF_, digi.zsCrossingMask());
112 }
Definition: start.py:1
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HFDataFrame.h:38
T min(T a, T b)
Definition: MathUtil.h:58
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:30
std::pair< int, int > HFsearchTS_
bool HcalZSAlgoRealistic::shouldKeep ( const QIE10DataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 114 of file HcalZSAlgoRealistic.cc.

References HFsearchTS_, keepMe(), SiStripPI::max, min(), QIE10DataFrame::samples(), and thresholdHF_.

114  {
115  int start = std::max(0, HFsearchTS_.first);
116  int finish = std::min((int)digi.samples() - 1, HFsearchTS_.second);
117  return keepMe(digi, start, finish, thresholdHF_, 0);
118 }
int samples() const
total number of samples in the digi
Definition: start.py:1
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
T min(T a, T b)
Definition: MathUtil.h:58
std::pair< int, int > HFsearchTS_
bool HcalZSAlgoRealistic::shouldKeep ( const QIE11DataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 120 of file HcalZSAlgoRealistic.cc.

References HBsearchTS_, HcalBarrel, HEsearchTS_, QIE11DataFrame::id(), keepMe(), SiStripPI::max, min(), QIE11DataFrame::samples(), thresholdHB_, and thresholdHE_.

120  {
121  HcalDetId hid(digi.id());
122  if (hid.subdet() == HcalBarrel) {
123  int start = std::max(0, HBsearchTS_.first);
124  int finish = std::min(digi.samples() - 1, HBsearchTS_.second);
125  return keepMe(digi, start, finish, thresholdHB_, 0);
126  } else {
127  int start = std::max(0, HEsearchTS_.first);
128  int finish = std::min(digi.samples() - 1, HEsearchTS_.second);
129  return keepMe(digi, start, finish, thresholdHE_, 0);
130  }
131 }
Definition: start.py:1
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
edm::DataFrame::id_type id() const
std::pair< int, int > HBsearchTS_
T min(T a, T b)
Definition: MathUtil.h:58
std::pair< int, int > HEsearchTS_
int samples() const
total number of samples in the digi

Member Data Documentation

std::pair<int, int> HcalZSAlgoRealistic::HBsearchTS_
private

Definition at line 45 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

std::pair<int, int> HcalZSAlgoRealistic::HEsearchTS_
private

Definition at line 45 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

std::pair<int, int> HcalZSAlgoRealistic::HFsearchTS_
private

Definition at line 45 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

std::pair<int, int> HcalZSAlgoRealistic::HOsearchTS_
private

Definition at line 45 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

int HcalZSAlgoRealistic::thresholdHB_
private

Definition at line 44 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHE_
private

Definition at line 44 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHF_
private

Definition at line 44 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHO_
private

Definition at line 44 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

bool HcalZSAlgoRealistic::usingDBvalues
private

Definition at line 43 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and keepMe().