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)
 
 HcalZSAlgoRealistic (bool markAndPass, int levelHB, int levelHE, int levelHO, int levelHF)
 
- 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 threshold, uint32_t hbhezsmask) const
 
bool keepMe (const HODataFrame &inp, int threshold, uint32_t hozsmask) const
 
bool keepMe (const HFDataFrame &inp, int threshold, uint32_t hfzsmask) const
 

Private Attributes

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:
2009/10/29 17:28:49
Revision:
1.5
Author
S. Sengupta - Minnesota

Definition at line 16 of file HcalZSAlgoRealistic.h.

Constructor & Destructor Documentation

HcalZSAlgoRealistic::HcalZSAlgoRealistic ( bool  markAndPass)
HcalZSAlgoRealistic::HcalZSAlgoRealistic ( bool  markAndPass,
int  levelHB,
int  levelHE,
int  levelHO,
int  levelHF 
)

Definition at line 4 of file HcalZSAlgoRealistic.cc.

References usingDBvalues.

4  :
6  thresholdHB_(levelHB),
7  thresholdHE_(levelHE),
8  thresholdHO_(levelHO),
9  thresholdHF_(levelHF)
10 {
11  usingDBvalues = false;
12 }
HcalZeroSuppressionAlgo(bool markAndPass)

Member Function Documentation

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

Definition at line 28 of file HcalZSAlgoRealistic.cc.

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

Referenced by shouldKeep().

28  {
29 
30  bool keepIt=false;
31  //int mask = 999;
32  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
33  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
34  }
35 
36  //determine the sum of 2 timeslices
37  for (int i=0; i< inp.size()-1 && !keepIt; i++) {
38  int sum=0;
39 
40  for (int j=i; j<(i+2); j++){
41  sum+=inp[j].adc();
42  //pedsum+=pedave;
43  }
44  if ((hbhezsmask&(1<<i)) !=0) continue;
45  else if (sum>=threshold) keepIt=true;
46  }
47  return keepIt;
48 }
const HcalDbService * m_dbService
int i
Definition: DBlmapReader.cc:9
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
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  threshold,
uint32_t  hozsmask 
) const
private

Definition at line 51 of file HcalZSAlgoRealistic.cc.

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

51  {
52 
53  bool keepIt=false;
54  // int mask = 999;
55  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
56  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
57  }
58 
59  //determine the sum of 2 timeslices
60  for (int i=0; i< inp.size()-1 && !keepIt; i++) {
61  int sum=0;
62 
63  for (int j=i; j<(i+2); j++){
64  sum+=inp[j].adc();
65  //pedsum+=pedave;
66  }
67  if ((hozsmask&(1<<i)) !=0) continue;
68  else if (sum>=threshold) keepIt=true;
69  }
70  return keepIt;
71 }
const HcalDbService * m_dbService
int i
Definition: DBlmapReader.cc:9
const HcalDetId & id() const
Definition: HODataFrame.h:23
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
int j
Definition: DBlmapReader.cc:9
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
bool HcalZSAlgoRealistic::keepMe ( const HFDataFrame inp,
int  threshold,
uint32_t  hfzsmask 
) const
private

Definition at line 74 of file HcalZSAlgoRealistic.cc.

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

74  {
75 
76  bool keepIt=false;
77  // int mask = 999;
78  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
79  threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
80  }
81 
82  //determine the sum of 2 timeslices
83  for (int i=0; i< inp.size()-1 && !keepIt; i++) {
84  int sum=0;
85 
86  for (int j=i; j<(i+2); j++){
87  sum+=inp[j].adc();
88  //pedsum+=pedave;
89  }
90  if ((hfzsmask&(1<<i)) !=0) continue;
91  else if (sum>=threshold) keepIt=true;
92  }
93  return keepIt;
94 }
const HcalDbService * m_dbService
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
const HcalZSThreshold * getHcalZSThreshold(const HcalGenericDetId &fId) const
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
const HcalDetId & id() const
Definition: HFDataFrame.h:22
bool HcalZSAlgoRealistic::shouldKeep ( const HBHEDataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 97 of file HcalZSAlgoRealistic.cc.

References HcalBarrel, HBHEDataFrame::id(), keepMe(), HcalDetId::subdet(), thresholdHB_, thresholdHE_, and HBHEDataFrame::zsCrossingMask().

97  {
98  // uint32_t hbhezsmask = digi.zsCrossingMask();
99  if (digi.id().subdet()==HcalBarrel)
100  return keepMe(digi,thresholdHB_,digi.zsCrossingMask());
101  else return keepMe(digi,thresholdHE_,digi.zsCrossingMask());
102 }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
bool keepMe(const HBHEDataFrame &inp, int threshold, uint32_t hbhezsmask) const
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HBHEDataFrame.h:34
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
bool HcalZSAlgoRealistic::shouldKeep ( const HODataFrame digi) const
protectedvirtual

Implements HcalZeroSuppressionAlgo.

Definition at line 104 of file HcalZSAlgoRealistic.cc.

References keepMe(), thresholdHO_, and HODataFrame::zsCrossingMask().

104  {
105  return keepMe(digi,thresholdHO_,digi.zsCrossingMask());
106 }
bool keepMe(const HBHEDataFrame &inp, int threshold, uint32_t hbhezsmask) const
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 108 of file HcalZSAlgoRealistic.cc.

References keepMe(), thresholdHF_, and HFDataFrame::zsCrossingMask().

108  {
109  return keepMe(digi,thresholdHF_,digi.zsCrossingMask());
110 }
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HFDataFrame.h:34
bool keepMe(const HBHEDataFrame &inp, int threshold, uint32_t hbhezsmask) const

Member Data Documentation

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().