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, bool use1ts, std::pair< int, int > HBsearchTS, std::pair< int, int > HEsearchTS, std::pair< int, int > HOsearchTS, std::pair< int, int > HFsearchTS)
 
 HcalZSAlgoRealistic (bool markAndPass, bool use1ts, 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 use1ts_
 
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.

For Run3 and Run4 HB and HE only 1TS is used

Definition at line 17 of file HcalZSAlgoRealistic.h.

Constructor & Destructor Documentation

◆ HcalZSAlgoRealistic() [1/2]

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

Definition at line 27 of file HcalZSAlgoRealistic.cc.

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

34  use1ts_(use1ts),
35  HBsearchTS_(HBsearchTS),
36  HEsearchTS_(HEsearchTS),
37  HOsearchTS_(HOsearchTS),
38  HFsearchTS_(HFsearchTS) {
39  thresholdHB_ = -1;
40  thresholdHE_ = -1;
41  thresholdHO_ = -1;
42  thresholdHF_ = -1;
43  usingDBvalues = true;
44 }
std::pair< int, int > HOsearchTS_
std::pair< int, int > HBsearchTS_
std::pair< int, int > HFsearchTS_
std::pair< int, int > HEsearchTS_
HcalZeroSuppressionAlgo(bool markAndPass)

◆ HcalZSAlgoRealistic() [2/2]

HcalZSAlgoRealistic::HcalZSAlgoRealistic ( bool  markAndPass,
bool  use1ts,
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.

15  use1ts_(use1ts),
16  thresholdHB_(levelHB),
17  thresholdHE_(levelHE),
18  thresholdHO_(levelHO),
19  thresholdHF_(levelHF),
20  HBsearchTS_(HBsearchTS),
21  HEsearchTS_(HEsearchTS),
22  HOsearchTS_(HOsearchTS),
23  HFsearchTS_(HFsearchTS) {
24  usingDBvalues = false;
25 }
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::~HcalZSAlgoRealistic ( )
overridedefault

Member Function Documentation

◆ keepMe() [1/3]

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

Definition at line 47 of file HcalZSAlgoRealistic.cc.

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

Referenced by shouldKeep().

47  {
48  if ((usingDBvalues) && (threshold < 0) && (m_dbService != nullptr)) {
49  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
50  }
51 
52  // determine the sum of 2 timeslices
53  for (int i = start; i < finish; i++) {
54  if ((zsmask & (1 << i)) != 0)
55  continue;
56  if ((inp[i].adc() + inp[i + 1].adc()) >= threshold)
57  return true;
58  }
59  return false;
60 }
const HcalDbService * m_dbService
Definition: start.py:1
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ keepMe() [2/3]

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

Definition at line 65 of file HcalZSAlgoRealistic.cc.

References gpuClustering::adc, mps_fire::i, and DiMuonV_cfg::threshold.

66  {
67  if ((usingDBvalues) && (threshold < 0) && (m_dbService != nullptr)) {
68  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
69  }
70 
71  // determine the sum of 2 timeslices
72  for (int i = start; i < finish; i++) {
73  if ((inp[i].adc() + inp[i + 1].adc()) >= threshold)
74  return true;
75  }
76  return false;
77 }
const HcalDbService * m_dbService
Definition: start.py:1
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
constexpr edm::DataFrame::id_type id() const
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ keepMe() [3/3]

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

Definition at line 80 of file HcalZSAlgoRealistic.cc.

References mps_fire::i, and DiMuonV_cfg::threshold.

81  {
82  if ((usingDBvalues) && (threshold < 0) && (m_dbService != nullptr)) {
83  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
84  }
85 
86  // sum of 2 timeslices or just single one
87  for (int i = start; i < finish; i++) {
88  int sum = inp[i].adc();
89  if (!use1ts_)
90  sum += inp[i + 1].adc();
91  if (sum >= threshold)
92  return true;
93  }
94  return false;
95 }
const HcalDbService * m_dbService
Definition: start.py:1
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
constexpr edm::DataFrame::id_type id() const

◆ shouldKeep() [1/5]

bool HcalZSAlgoRealistic::shouldKeep ( const HBHEDataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 97 of file HcalZSAlgoRealistic.cc.

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

97  {
98  if (digi.id().subdet() == HcalBarrel) {
99  int start = std::max(0, HBsearchTS_.first);
100  int finish = std::min(digi.size() - 1, HBsearchTS_.second);
101  return keepMe(digi, start, finish, thresholdHB_, digi.zsCrossingMask());
102  } else {
103  int start = std::max(0, HEsearchTS_.first);
104  int finish = std::min(digi.size() - 1, HEsearchTS_.second);
105  return keepMe(digi, start, finish, thresholdHE_, digi.zsCrossingMask());
106  }
107 }
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
Definition: start.py:1
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
std::pair< int, int > HBsearchTS_
constexpr uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HBHEDataFrame.h:35
constexpr const HcalDetId & id() const
Definition: HBHEDataFrame.h:23
std::pair< int, int > HEsearchTS_
constexpr int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:27

◆ shouldKeep() [2/5]

bool HcalZSAlgoRealistic::shouldKeep ( const HODataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 109 of file HcalZSAlgoRealistic.cc.

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

109  {
110  int start = std::max(0, HOsearchTS_.first);
111  int finish = std::min(digi.size() - 1, HOsearchTS_.second);
112  return keepMe(digi, start, finish, thresholdHO_, digi.zsCrossingMask());
113 }
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
Definition: start.py:1
constexpr uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HODataFrame.h:35
std::pair< int, int > HOsearchTS_
constexpr int size() const
total number of samples in the digi
Definition: HODataFrame.h:27

◆ shouldKeep() [3/5]

bool HcalZSAlgoRealistic::shouldKeep ( const HFDataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 115 of file HcalZSAlgoRealistic.cc.

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

115  {
116  int start = std::max(0, HFsearchTS_.first);
117  int finish = std::min(digi.size() - 1, HFsearchTS_.second);
118  return keepMe(digi, start, finish, thresholdHF_, digi.zsCrossingMask());
119 }
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
Definition: start.py:1
constexpr uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HFDataFrame.h:35
constexpr int size() const
total number of samples in the digi
Definition: HFDataFrame.h:27
std::pair< int, int > HFsearchTS_

◆ shouldKeep() [4/5]

bool HcalZSAlgoRealistic::shouldKeep ( const QIE10DataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 121 of file HcalZSAlgoRealistic.cc.

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

121  {
122  int start = std::max(0, HFsearchTS_.first);
123  int finish = std::min((int)digi.samples() - 1, HFsearchTS_.second);
124  return keepMe(digi, start, finish, thresholdHF_, 0);
125 }
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
Definition: start.py:1
std::pair< int, int > HFsearchTS_
constexpr int samples() const
total number of samples in the digi

◆ shouldKeep() [5/5]

bool HcalZSAlgoRealistic::shouldKeep ( const QIE11DataFrame digi) const
overrideprotectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 127 of file HcalZSAlgoRealistic.cc.

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

127  {
128  HcalDetId hid(digi.id());
129  if (hid.subdet() == HcalBarrel) {
130  int start = std::max(0, HBsearchTS_.first);
131  int finish = std::min(digi.samples() - 1, HBsearchTS_.second);
132  return keepMe(digi, start, finish, thresholdHB_, 0);
133  } else {
134  int start = std::max(0, HEsearchTS_.first);
135  int finish = std::min(digi.samples() - 1, HEsearchTS_.second);
136  return keepMe(digi, start, finish, thresholdHE_, 0);
137  }
138 }
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
Definition: start.py:1
constexpr edm::DataFrame::id_type id() const
std::pair< int, int > HBsearchTS_
constexpr int samples() const
total number of samples in the digi
std::pair< int, int > HEsearchTS_

Member Data Documentation

◆ HBsearchTS_

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

Definition at line 49 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

◆ HEsearchTS_

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

Definition at line 49 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

◆ HFsearchTS_

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

Definition at line 49 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

◆ HOsearchTS_

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

Definition at line 49 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

◆ thresholdHB_

int HcalZSAlgoRealistic::thresholdHB_
private

Definition at line 48 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

◆ thresholdHE_

int HcalZSAlgoRealistic::thresholdHE_
private

Definition at line 48 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

◆ thresholdHF_

int HcalZSAlgoRealistic::thresholdHF_
private

Definition at line 48 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

◆ thresholdHO_

int HcalZSAlgoRealistic::thresholdHO_
private

Definition at line 48 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

◆ use1ts_

bool HcalZSAlgoRealistic::use1ts_
private

Definition at line 47 of file HcalZSAlgoRealistic.h.

◆ usingDBvalues

bool HcalZSAlgoRealistic::usingDBvalues
private

Definition at line 47 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and keepMe().