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)
 

Protected Member Functions

virtual bool shouldKeep (const HBHEDataFrame &digi) const
 
virtual bool shouldKeep (const HODataFrame &digi) const
 
virtual bool shouldKeep (const HFDataFrame &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
 

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.

Date:
2012/10/31 15:34:25
Revision:
1.1
Author
S. Sengupta - Minnesota

Definition at line 16 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)

Member Function Documentation

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

Definition at line 37 of file HcalZSAlgoRealistic.cc.

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

Referenced by shouldKeep().

37  {
38 
39  bool keepIt=false;
40  //int mask = 999;
41  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
42  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
43  }
44 
45  //determine the sum of 2 timeslices
46  for (int i = start; i < finish && !keepIt; i++) {
47  int sum=0;
48 
49  for (int j = i; j < (i+2); j++){
50  sum+=inp[j].adc();
51  //pedsum+=pedave;
52  }
53  if ((hbhezsmask&(1<<i)) !=0) continue;
54  else if (sum>=threshold) keepIt=true;
55  }
56  return keepIt;
57 }
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 60 of file HcalZSAlgoRealistic.cc.

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

60  {
61 
62  bool keepIt=false;
63  // int mask = 999;
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 && !keepIt; i++) {
70  int sum=0;
71 
72  for (int j = i; j < (i+2); j++){
73  sum+=inp[j].adc();
74  //pedsum+=pedave;
75  }
76  if ((hozsmask&(1<<i)) !=0) continue;
77  else if (sum>=threshold) keepIt=true;
78  }
79  return keepIt;
80 }
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 83 of file HcalZSAlgoRealistic.cc.

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

83  {
84 
85  bool keepIt=false;
86  // int mask = 999;
87  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
88  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
89  }
90 
91  //determine the sum of 2 timeslices
92  for (int i = start; i < finish && !keepIt; i++) {
93  int sum=0;
94 
95  for (int j = i; j < (i+2); j++){
96  sum+=inp[j].adc();
97  //pedsum+=pedave;
98  }
99  if ((hfzsmask&(1<<i)) !=0) continue;
100  else if (sum>=threshold) keepIt=true;
101  }
102  return keepIt;
103 }
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::shouldKeep ( const HBHEDataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 106 of file HcalZSAlgoRealistic.cc.

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

106  {
107  // uint32_t hbhezsmask = digi.zsCrossingMask();
108  if (digi.id().subdet()==HcalBarrel) {
109 
110  int start = std::max(0,HBsearchTS_.first);
111  int finish = std::min(digi.size()-1,HBsearchTS_.second);
112 
113  /*
114  std::cout << " HBsearchTS_ : " << HBsearchTS_.first
115  << ", " << HBsearchTS_.second << std::endl;
116  std::cout << " HB start, finish = " << start << ", "
117  << finish << std::endl;
118  */
119 
120  return keepMe(digi,start,finish,thresholdHB_,digi.zsCrossingMask());
121 
122 
123  }
124  else {
125 
126  int start = std::max(0,HEsearchTS_.first);
127  int finish = std::min(digi.size()-1,HEsearchTS_.second);
128  return keepMe(digi,start,finish,thresholdHE_,digi.zsCrossingMask());
129 
130  }
131 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
std::pair< int, int > HEsearchTS_
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 133 of file HcalZSAlgoRealistic.cc.

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

133  {
134 
135  int start = std::max(0,HOsearchTS_.first);
136  int finish = std::min(digi.size()-1,HOsearchTS_.second);
137  return keepMe(digi,start,finish,thresholdHO_,digi.zsCrossingMask());
138 }
std::pair< int, int > HOsearchTS_
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
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 140 of file HcalZSAlgoRealistic.cc.

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

140  {
141 
142  int start = std::max(0,HFsearchTS_.first);
143  int finish = std::min(digi.size()-1,HFsearchTS_.second);
144  return keepMe(digi,start,finish,thresholdHF_,digi.zsCrossingMask());
145 }
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
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
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

Member Data Documentation

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

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

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

Definition at line 28 of file HcalZSAlgoRealistic.h.

Referenced by shouldKeep().

int HcalZSAlgoRealistic::thresholdHB_
private

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHE_
private

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHF_
private

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

int HcalZSAlgoRealistic::thresholdHO_
private

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

bool HcalZSAlgoRealistic::usingDBvalues
private

Definition at line 26 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and keepMe().