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)
 
virtual ~HcalZSAlgoRealistic ()=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

virtual bool shouldKeep (const HBHEDataFrame &digi) const
 
virtual bool shouldKeep (const HODataFrame &digi) const
 
virtual bool shouldKeep (const HFDataFrame &digi) const
 
virtual bool shouldKeep (const QIE10DataFrame &digi) const
 
virtual bool shouldKeep (const QIE11DataFrame &digi) const
 
- 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 14 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 18 of file HcalZSAlgoRealistic.cc.

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

18  :
20  HBsearchTS_(HBsearchTS),
21  HEsearchTS_(HEsearchTS),
22  HOsearchTS_(HOsearchTS),
23  HFsearchTS_(HFsearchTS)
24 {
25  thresholdHB_ = -1;
26  thresholdHE_ = -1;
27  thresholdHO_ = -1;
28  thresholdHF_ = -1;
29  usingDBvalues = true;
30 
31 }
std::pair< int, int > HOsearchTS_
std::pair< int, int > HEsearchTS_
std::pair< int, int > HFsearchTS_
std::pair< int, int > HBsearchTS_
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.

4  :
6  thresholdHB_(levelHB),
7  thresholdHE_(levelHE),
8  thresholdHO_(levelHO),
9  thresholdHF_(levelHF),
10  HBsearchTS_(HBsearchTS),
11  HEsearchTS_(HEsearchTS),
12  HOsearchTS_(HOsearchTS),
13  HFsearchTS_(HFsearchTS)
14 {
15  usingDBvalues = false;
16 }
std::pair< int, int > HOsearchTS_
std::pair< int, int > HEsearchTS_
std::pair< int, int > HFsearchTS_
std::pair< int, int > HBsearchTS_
HcalZeroSuppressionAlgo(bool markAndPass)
virtual HcalZSAlgoRealistic::~HcalZSAlgoRealistic ( )
virtualdefault

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 34 of file HcalZSAlgoRealistic.cc.

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

Referenced by shouldKeep().

34  {
35  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
36  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
37  }
38 
39  //determine the sum of 2 timeslices
40  for (int i = start; i < finish; i++) {
41  if ((zsmask&(1<<i)) !=0) continue;
42  if ((inp[i].adc()+inp[i+1].adc())>=threshold) return true;
43  }
44  return false;
45 }
int adc(sample_type sample)
get the ADC sample (12 bits)
const HcalDbService * m_dbService
Definition: start.py:1
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 50 of file HcalZSAlgoRealistic.cc.

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

50  {
51  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
52  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
53  }
54 
55  //determine the sum of 2 timeslices
56  for (int i = start; i < finish; i++) {
57  if ((inp[i].adc()+inp[i+1].adc())>=threshold) return true;
58  }
59  return false;
60 }
int adc(sample_type sample)
get the ADC sample (12 bits)
const HcalDbService * m_dbService
Definition: start.py:1
edm::DataFrame::id_type id() const
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 63 of file HcalZSAlgoRealistic.cc.

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

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

Implements HcalZeroSuppressionAlgo.

Definition at line 75 of file HcalZSAlgoRealistic.cc.

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

75  {
76  if (digi.id().subdet()==HcalBarrel) {
77  int start = std::max(0,HBsearchTS_.first);
78  int finish = std::min(digi.size()-1,HBsearchTS_.second);
79  return keepMe(digi,start,finish,thresholdHB_,digi.zsCrossingMask());
80  } else {
81  int start = std::max(0,HEsearchTS_.first);
82  int finish = std::min(digi.size()-1,HEsearchTS_.second);
83  return keepMe(digi,start,finish,thresholdHE_,digi.zsCrossingMask());
84  }
85 }
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:49
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
std::pair< int, int > HEsearchTS_
T min(T a, T b)
Definition: MathUtil.h:58
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HBHEDataFrame.h:34
std::pair< int, int > HBsearchTS_
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
bool HcalZSAlgoRealistic::shouldKeep ( const HODataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 87 of file HcalZSAlgoRealistic.cc.

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

87  {
88  int start = std::max(0,HOsearchTS_.first);
89  int finish = std::min(digi.size()-1,HOsearchTS_.second);
90  return keepMe(digi,start,finish,thresholdHO_,digi.zsCrossingMask());
91 }
Definition: start.py:1
std::pair< int, int > HOsearchTS_
bool keepMe(const Digi &inp, int start, int finish, int threshold, uint32_t zsmask) const
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
T min(T a, T b)
Definition: MathUtil.h:58
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HODataFrame.h:35
bool HcalZSAlgoRealistic::shouldKeep ( const HFDataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 93 of file HcalZSAlgoRealistic.cc.

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

93  {
94  int start = std::max(0,HFsearchTS_.first);
95  int finish = std::min(digi.size()-1,HFsearchTS_.second);
96  return keepMe(digi,start,finish,thresholdHF_,digi.zsCrossingMask());
97 }
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:34
T min(T a, T b)
Definition: MathUtil.h:58
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
std::pair< int, int > HFsearchTS_
bool HcalZSAlgoRealistic::shouldKeep ( const QIE10DataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 99 of file HcalZSAlgoRealistic.cc.

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

99  {
100  int start = std::max(0,HFsearchTS_.first);
101  int finish = std::min((int)digi.samples()-1,HFsearchTS_.second);
102  return keepMe(digi,start,finish,thresholdHF_,0);
103 }
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
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 105 of file HcalZSAlgoRealistic.cc.

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

105  {
106  HcalDetId hid(digi.id());
107  if (hid.subdet()==HcalBarrel) {
108  int start = std::max(0,HBsearchTS_.first);
109  int finish = std::min(digi.samples()-1,HBsearchTS_.second);
110  return keepMe(digi,start,finish,thresholdHB_,0);
111  } else {
112  int start = std::max(0,HEsearchTS_.first);
113  int finish = std::min(digi.samples()-1,HEsearchTS_.second);
114  return keepMe(digi,start,finish,thresholdHE_,0);
115  }
116 }
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 > HEsearchTS_
T min(T a, T b)
Definition: MathUtil.h:58
std::pair< int, int > HBsearchTS_
int samples() const
total number of samples in the digi

Member Data Documentation

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

Definition at line 29 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 29 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 29 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 29 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

int HcalZSAlgoRealistic::thresholdHB_
private

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHE_
private

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHF_
private

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHO_
private

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

bool HcalZSAlgoRealistic::usingDBvalues
private

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and keepMe().