CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
- 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 HcalUpgradeDigiCollection &input, HcalUpgradeDigiCollection &output)
 

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 HcalUpgradeDataFrame &digi) const
 
- Protected Member Functions inherited from HcalZeroSuppressionAlgo
 HcalZeroSuppressionAlgo (bool markAndPass)
 

Private Member Functions

bool keepMe (const HBHEDataFrame &inp, int start, int finish, int threshold, uint32_t hbhezsmask) const
 
bool keepMe (const HODataFrame &inp, int start, int finish, int threshold, uint32_t hozsmask) const
 
bool keepMe (const HFDataFrame &inp, int start, int finish, int threshold, uint32_t hfzsmask) const
 
bool keepMe (const HcalUpgradeDataFrame &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 19 of file HcalZSAlgoRealistic.cc.

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

19  :
21  HBsearchTS_(HBsearchTS),
22  HEsearchTS_(HEsearchTS),
23  HOsearchTS_(HOsearchTS),
24  HFsearchTS_(HFsearchTS)
25 {
26  thresholdHB_ = -1;
27  thresholdHE_ = -1;
28  thresholdHO_ = -1;
29  thresholdHF_ = -1;
30  usingDBvalues = true;
31 
32 }
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 5 of file HcalZSAlgoRealistic.cc.

References usingDBvalues.

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

Member Function Documentation

bool HcalZSAlgoRealistic::keepMe ( const HBHEDataFrame inp,
int  start,
int  finish,
int  threshold,
uint32_t  hbhezsmask 
) const
private

Definition at line 38 of file HcalZSAlgoRealistic.cc.

References HcalDbService::getHcalZSThreshold(), i, HBHEDataFrame::id(), j, HcalZeroSuppressionAlgo::m_dbService, and usingDBvalues.

Referenced by shouldKeep().

38  {
39 
40  bool keepIt=false;
41  //int mask = 999;
42  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
43  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
44  }
45 
46  //determine the sum of 2 timeslices
47  for (int i = start; i < finish && !keepIt; i++) {
48  int sum=0;
49 
50  for (int j = i; j < (i+2); j++){
51  sum+=inp[j].adc();
52  //pedsum+=pedave;
53  }
54  if ((hbhezsmask&(1<<i)) !=0) continue;
55  else if (sum>=threshold) keepIt=true;
56  }
57  return keepIt;
58 }
const HcalDbService * m_dbService
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
int j
Definition: DBlmapReader.cc:9
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
bool HcalZSAlgoRealistic::keepMe ( const HODataFrame inp,
int  start,
int  finish,
int  threshold,
uint32_t  hozsmask 
) const
private

Definition at line 61 of file HcalZSAlgoRealistic.cc.

References HcalDbService::getHcalZSThreshold(), i, HODataFrame::id(), j, HcalZeroSuppressionAlgo::m_dbService, and usingDBvalues.

61  {
62 
63  bool keepIt=false;
64  // int mask = 999;
65  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
66  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
67  }
68 
69  //determine the sum of 2 timeslices
70  for (int i = start; i < finish && !keepIt; i++) {
71  int sum=0;
72 
73  for (int j = i; j < (i+2); j++){
74  sum+=inp[j].adc();
75  //pedsum+=pedave;
76  }
77  if ((hozsmask&(1<<i)) !=0) continue;
78  else if (sum>=threshold) keepIt=true;
79  }
80  return keepIt;
81 }
const HcalDbService * m_dbService
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
const HcalDetId & id() const
Definition: HODataFrame.h:23
int j
Definition: DBlmapReader.cc:9
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
bool HcalZSAlgoRealistic::keepMe ( const HFDataFrame inp,
int  start,
int  finish,
int  threshold,
uint32_t  hfzsmask 
) const
private

Definition at line 84 of file HcalZSAlgoRealistic.cc.

References HcalDbService::getHcalZSThreshold(), i, HFDataFrame::id(), j, HcalZeroSuppressionAlgo::m_dbService, and usingDBvalues.

84  {
85 
86  bool keepIt=false;
87  // int mask = 999;
88  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
89  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
90  }
91 
92  //determine the sum of 2 timeslices
93  for (int i = start; i < finish && !keepIt; i++) {
94  int sum=0;
95 
96  for (int j = i; j < (i+2); j++){
97  sum+=inp[j].adc();
98  //pedsum+=pedave;
99  }
100  if ((hfzsmask&(1<<i)) !=0) continue;
101  else if (sum>=threshold) keepIt=true;
102  }
103  return keepIt;
104 }
const HcalDbService * m_dbService
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
int j
Definition: DBlmapReader.cc:9
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
const HcalDetId & id() const
Definition: HFDataFrame.h:22
bool HcalZSAlgoRealistic::keepMe ( const HcalUpgradeDataFrame inp,
int  start,
int  finish,
int  threshold,
uint32_t  zsmask 
) const
private

Definition at line 106 of file HcalZSAlgoRealistic.cc.

References HcalUpgradeDataFrame::adc(), HcalDbService::getHcalZSThreshold(), i, HcalUpgradeDataFrame::id(), j, HcalZeroSuppressionAlgo::m_dbService, and usingDBvalues.

106  {
107 
108  bool keepIt=false;
109  //int mask = 999;
110  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
111  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
112  }
113 
114  //determine the sum of 2 timeslices
115  for (int i = start; i < finish && !keepIt; i++) {
116  int sum=0;
117  for (int j = i; j < (i+2); j++){
118  sum+=inp[j].adc();
119  }
120  if ((zsmask&(1<<i)) !=0) continue;
121  else if (sum>=threshold) keepIt=true;
122  }
123  return keepIt;
124 }
const HcalDbService * m_dbService
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
int j
Definition: DBlmapReader.cc:9
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
const HcalDetId & id() const
uint16_t adc(int iSample=0) const
bool HcalZSAlgoRealistic::shouldKeep ( const HBHEDataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 126 of file HcalZSAlgoRealistic.cc.

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

126  {
127 
128  if (digi.id().subdet()==HcalBarrel) {
129  int start = std::max(0,HBsearchTS_.first);
130  int finish = std::min(digi.size()-1,HBsearchTS_.second);
131  /*
132  std::cout << " HBsearchTS_ : " << HBsearchTS_.first
133  << ", " << HBsearchTS_.second << std::endl;
134  std::cout << " HB start, finish = " << start << ", "
135  << finish << std::endl;
136  */
137  return keepMe(digi,start,finish,thresholdHB_,digi.zsCrossingMask());
138  } else {
139  int start = std::max(0,HEsearchTS_.first);
140  int finish = std::min(digi.size()-1,HEsearchTS_.second);
141  return keepMe(digi,start,finish,thresholdHE_,digi.zsCrossingMask());
142 
143  }
144 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
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 keepMe(const HBHEDataFrame &inp, int start, int finish, int threshold, uint32_t hbhezsmask) const
bool HcalZSAlgoRealistic::shouldKeep ( const HODataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 146 of file HcalZSAlgoRealistic.cc.

References HOsearchTS_, keepMe(), bookConverter::max, min(), HODataFrame::size(), dqm_diff::start, thresholdHO_, and HODataFrame::zsCrossingMask().

146  {
147 
148  int start = std::max(0,HOsearchTS_.first);
149  int finish = std::min(digi.size()-1,HOsearchTS_.second);
150  return keepMe(digi,start,finish,thresholdHO_,digi.zsCrossingMask());
151 }
std::pair< int, int > HOsearchTS_
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
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 keepMe(const HBHEDataFrame &inp, int start, int finish, int threshold, uint32_t hbhezsmask) const
bool HcalZSAlgoRealistic::shouldKeep ( const HFDataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 153 of file HcalZSAlgoRealistic.cc.

References HFsearchTS_, keepMe(), bookConverter::max, min(), HFDataFrame::size(), dqm_diff::start, thresholdHF_, and HFDataFrame::zsCrossingMask().

153  {
154 
155  int start = std::max(0,HFsearchTS_.first);
156  int finish = std::min(digi.size()-1,HFsearchTS_.second);
157  return keepMe(digi,start,finish,thresholdHF_,digi.zsCrossingMask());
158 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
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 keepMe(const HBHEDataFrame &inp, int start, int finish, int threshold, uint32_t hbhezsmask) const
bool HcalZSAlgoRealistic::shouldKeep ( const HcalUpgradeDataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 160 of file HcalZSAlgoRealistic.cc.

References HBsearchTS_, HcalBarrel, HcalForward, HEsearchTS_, HFsearchTS_, HcalUpgradeDataFrame::id(), keepMe(), bookConverter::max, min(), HcalUpgradeDataFrame::size(), dqm_diff::start, HcalDetId::subdet(), thresholdHB_, thresholdHE_, thresholdHF_, and HcalUpgradeDataFrame::zsCrossingMask().

160  {
161 
162  if (digi.id().subdet()==HcalForward) {
163  int start = std::max(0,HFsearchTS_.first);
164  int finish = std::min(digi.size()-1,HFsearchTS_.second);
165  return keepMe(digi,start,finish,thresholdHF_,digi.zsCrossingMask());
166  } else if (digi.id().subdet()==HcalBarrel) {
167  int start = std::max(0,HBsearchTS_.first);
168  int finish = std::min(digi.size()-1,HBsearchTS_.second);
169  return keepMe(digi,start,finish,thresholdHB_,digi.zsCrossingMask());
170  } else {
171  int start = std::max(0,HEsearchTS_.first);
172  int finish = std::min(digi.size()-1,HEsearchTS_.second);
173  return keepMe(digi,start,finish,thresholdHE_,digi.zsCrossingMask());
174  }
175 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
uint32_t zsCrossingMask() const
std::pair< int, int > HEsearchTS_
T min(T a, T b)
Definition: MathUtil.h:58
std::pair< int, int > HFsearchTS_
const HcalDetId & id() const
std::pair< int, int > HBsearchTS_
bool keepMe(const HBHEDataFrame &inp, int start, int finish, int threshold, uint32_t hbhezsmask) const

Member Data Documentation

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

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

int HcalZSAlgoRealistic::thresholdHB_
private

Definition at line 26 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHE_
private

Definition at line 26 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHF_
private

Definition at line 26 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHO_
private

Definition at line 26 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

bool HcalZSAlgoRealistic::usingDBvalues
private

Definition at line 25 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and keepMe().