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, 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 (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 () 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 HFDigiCollection &input, HFDigiCollection &output)
 
void suppress (const HODigiCollection &input, HODigiCollection &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 HFDataFrame &digi) const override
 
bool shouldKeep (const HODataFrame &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.

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 }

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

◆ 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.

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 }

References usingDBvalues.

◆ ~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.

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 }

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

Referenced by shouldKeep().

◆ 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.

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 }

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

◆ 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.

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 }

References HcalDbService::getHcalZSThreshold(), mps_fire::i, QIE11DataFrame::id(), HcalZeroSuppressionAlgo::m_dbService, remoteMonitoring_LED_IterMethod_cfg::threshold, use1ts_, and usingDBvalues.

◆ shouldKeep() [1/5]

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

Implements HcalZeroSuppressionAlgo.

Definition at line 97 of file HcalZSAlgoRealistic.cc.

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 }

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

◆ shouldKeep() [2/5]

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

Implements HcalZeroSuppressionAlgo.

Definition at line 115 of file HcalZSAlgoRealistic.cc.

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 }

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

◆ shouldKeep() [3/5]

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

Implements HcalZeroSuppressionAlgo.

Definition at line 109 of file HcalZSAlgoRealistic.cc.

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 }

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

◆ shouldKeep() [4/5]

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

Implements HcalZeroSuppressionAlgo.

Definition at line 121 of file HcalZSAlgoRealistic.cc.

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 }

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

◆ shouldKeep() [5/5]

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

Implements HcalZeroSuppressionAlgo.

Definition at line 127 of file HcalZSAlgoRealistic.cc.

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 }

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

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.

Referenced by keepMe().

◆ usingDBvalues

bool HcalZSAlgoRealistic::usingDBvalues
private

Definition at line 47 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and keepMe().

HFDataFrame::zsCrossingMask
constexpr uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HFDataFrame.h:35
HcalZSAlgoRealistic::HFsearchTS_
std::pair< int, int > HFsearchTS_
Definition: HcalZSAlgoRealistic.h:49
mps_fire.i
i
Definition: mps_fire.py:428
start
Definition: start.py:1
HcalZSAlgoRealistic::thresholdHO_
int thresholdHO_
Definition: HcalZSAlgoRealistic.h:48
QIE10DataFrame::samples
constexpr int samples() const
total number of samples in the digi
Definition: QIE10DataFrame.h:86
min
T min(T a, T b)
Definition: MathUtil.h:58
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
HcalZSAlgoRealistic::HOsearchTS_
std::pair< int, int > HOsearchTS_
Definition: HcalZSAlgoRealistic.h:49
HcalBarrel
Definition: HcalAssistant.h:33
HcalZSAlgoRealistic::keepMe
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
Definition: HcalZSAlgoRealistic.cc:47
HODataFrame::zsCrossingMask
constexpr uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HODataFrame.h:35
HcalDbService::getHcalZSThreshold
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
Definition: HcalDbService.cc:355
HcalZSAlgoRealistic::usingDBvalues
bool usingDBvalues
Definition: HcalZSAlgoRealistic.h:47
QIE11DataFrame::samples
constexpr int samples() const
total number of samples in the digi
Definition: QIE11DataFrame.h:77
HFDataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HFDataFrame.h:27
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
QIE11DataFrame::id
constexpr edm::DataFrame::id_type id() const
Definition: QIE11DataFrame.h:68
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HcalDetId
Definition: HcalDetId.h:12
HODataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
HcalZSAlgoRealistic::thresholdHE_
int thresholdHE_
Definition: HcalZSAlgoRealistic.h:48
HcalZSAlgoRealistic::HEsearchTS_
std::pair< int, int > HEsearchTS_
Definition: HcalZSAlgoRealistic.h:49
HcalZSAlgoRealistic::thresholdHB_
int thresholdHB_
Definition: HcalZSAlgoRealistic.h:48
HBHEDataFrame::zsCrossingMask
constexpr uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HBHEDataFrame.h:35
HcalZeroSuppressionAlgo::HcalZeroSuppressionAlgo
HcalZeroSuppressionAlgo(bool markAndPass)
Definition: HcalZeroSuppressionAlgo.cc:3
HBHEDataFrame::id
constexpr const HcalDetId & id() const
Definition: HBHEDataFrame.h:23
HcalZSAlgoRealistic::thresholdHF_
int thresholdHF_
Definition: HcalZSAlgoRealistic.h:48
HBHEDataFrame::size
constexpr int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:27
HcalZSAlgoRealistic::use1ts_
bool use1ts_
Definition: HcalZSAlgoRealistic.h:47
HcalZSAlgoRealistic::HBsearchTS_
std::pair< int, int > HBsearchTS_
Definition: HcalZSAlgoRealistic.h:49
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
QIE10DataFrame::id
constexpr edm::DataFrame::id_type id() const
Definition: QIE10DataFrame.h:77
HcalZeroSuppressionAlgo::m_dbService
const HcalDbService * m_dbService
Definition: HcalZeroSuppressionAlgo.h:34
hcalDigisNoSuppression_cfi.use1ts
use1ts
Definition: hcalDigisNoSuppression_cfi.py:15