CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

HcalZSAlgoRealistic Class Reference

#include <HcalZSAlgoRealistic.h>

Inheritance diagram for HcalZSAlgoRealistic:
HcalZeroSuppressionAlgo

List of all members.

Public Member Functions

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

Protected Member Functions

virtual bool shouldKeep (const HBHEDataFrame &digi) const
virtual bool shouldKeep (const HFDataFrame &digi) const
virtual bool shouldKeep (const HODataFrame &digi) const

Private Member Functions

bool keepMe (const HBHEDataFrame &inp, int threshold, uint32_t hbhezsmask) const
bool keepMe (const HFDataFrame &inp, int threshold, uint32_t hfzsmask) const
bool keepMe (const HODataFrame &inp, int threshold, uint32_t hozsmask) const

Private Attributes

int thresholdHB_
int thresholdHE_
int thresholdHF_
int thresholdHO_
bool usingDBvalues

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/31 00:02:39
Revision:
1.6
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.

                                                                                                    : 
  HcalZeroSuppressionAlgo(mp),
  thresholdHB_(levelHB),
  thresholdHE_(levelHE),
  thresholdHO_(levelHO),
  thresholdHF_(levelHF)
{
  usingDBvalues = false;
}

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

                                                                                                  {
  
  bool keepIt=false;
  //int mask = 999;
  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
    threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
  }
  
  //determine the sum of 2 timeslices
  for (int i=0; i< inp.size()-1 && !keepIt; i++) {
    int sum=0;
    
    for (int j=i; j<(i+2); j++){
      sum+=inp[j].adc();
      //pedsum+=pedave;
    }
    if ((hbhezsmask&(1<<i)) !=0) continue; 
    else if (sum>=threshold) keepIt=true;
  }
  return keepIt;
}
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.

                                                                                              {
  
  bool keepIt=false;
  //  int mask = 999;
  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
    threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
  }
  
  //determine the sum of 2 timeslices
  for (int i=0; i< inp.size()-1 && !keepIt; i++) {
    int sum=0;
    
    for (int j=i; j<(i+2); j++){
      sum+=inp[j].adc();
      //pedsum+=pedave;
    }
    if ((hozsmask&(1<<i)) !=0) continue; 
    else if (sum>=threshold) keepIt=true;
  }
  return keepIt;
}
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.

                                                                                                {
  
  bool keepIt=false;
  //  int mask = 999;
  if ((usingDBvalues) && (threshold < 0) && (m_dbService != 0)){
    threshold = (m_dbService->getHcalZSThreshold(inp.id()))->getValue();
  }
  
  //determine the sum of 2 timeslices
  for (int i=0; i< inp.size()-1 && !keepIt; i++) {
    int sum=0;
    
    for (int j=i; j<(i+2); j++){
      sum+=inp[j].adc();
      //pedsum+=pedave;
    }
    if ((hfzsmask&(1<<i)) !=0) continue; 
    else if (sum>=threshold) keepIt=true;
  }
  return keepIt;
}
bool HcalZSAlgoRealistic::shouldKeep ( const HODataFrame digi) const [protected, virtual]

Implements HcalZeroSuppressionAlgo.

Definition at line 104 of file HcalZSAlgoRealistic.cc.

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

                                                                 {
  return keepMe(digi,thresholdHO_,digi.zsCrossingMask());
}
bool HcalZSAlgoRealistic::shouldKeep ( const HBHEDataFrame digi) const [protected, virtual]

Implements HcalZeroSuppressionAlgo.

Definition at line 97 of file HcalZSAlgoRealistic.cc.

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

                                                                   {
  // uint32_t hbhezsmask = digi.zsCrossingMask();
  if (digi.id().subdet()==HcalBarrel) 
    return keepMe(digi,thresholdHB_,digi.zsCrossingMask());
  else return keepMe(digi,thresholdHE_,digi.zsCrossingMask());
}  
bool HcalZSAlgoRealistic::shouldKeep ( const HFDataFrame digi) const [protected, virtual]

Implements HcalZeroSuppressionAlgo.

Definition at line 108 of file HcalZSAlgoRealistic.cc.

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

                                                                 {
  return keepMe(digi,thresholdHF_,digi.zsCrossingMask());
}

Member Data Documentation

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

Definition at line 27 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and shouldKeep().

Definition at line 26 of file HcalZSAlgoRealistic.h.

Referenced by HcalZSAlgoRealistic(), and keepMe().