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, 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)

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 start, int finish, int threshold, uint32_t hbhezsmask) const
bool keepMe (const HFDataFrame &inp, int start, int finish, int threshold, uint32_t hfzsmask) const
bool keepMe (const HODataFrame &inp, int start, int finish, int threshold, uint32_t hozsmask) 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

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:
2011/07/01 05:51:53
Revision:
1.7
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.

                                                                                                                                                                    : 
  HcalZeroSuppressionAlgo(mp),
  HBsearchTS_(HBsearchTS),
  HEsearchTS_(HEsearchTS),
  HOsearchTS_(HOsearchTS),
  HFsearchTS_(HFsearchTS)
{
  thresholdHB_ = -1;
  thresholdHE_ = -1;
  thresholdHO_ = -1;
  thresholdHF_ = -1;
  usingDBvalues = true;

}
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.

                                                                                                                                                                                                                        : 
  HcalZeroSuppressionAlgo(mp),
  thresholdHB_(levelHB),
  thresholdHE_(levelHE),
  thresholdHO_(levelHO),
  thresholdHF_(levelHF),
  HBsearchTS_(HBsearchTS),
  HEsearchTS_(HEsearchTS),
  HOsearchTS_(HOsearchTS),
  HFsearchTS_(HFsearchTS)
{
  usingDBvalues = false;
}

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

                                                                                                                         {
  
  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 = start; i < finish && !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  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.

                                                                                                                     {
  
  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 = start; i < finish && !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  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.

                                                                                                                     {
  
  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 = start; i < finish && !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 133 of file HcalZSAlgoRealistic.cc.

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

                                                                 {

  int start  = std::max(0,HOsearchTS_.first);
  int finish = std::min(digi.size()-1,HOsearchTS_.second);
  return keepMe(digi,start,finish,thresholdHO_,digi.zsCrossingMask());
}
bool HcalZSAlgoRealistic::shouldKeep ( const HBHEDataFrame digi) const [protected, virtual]

Implements HcalZeroSuppressionAlgo.

Definition at line 106 of file HcalZSAlgoRealistic.cc.

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

                                                                   {
  // uint32_t hbhezsmask = digi.zsCrossingMask();
  if (digi.id().subdet()==HcalBarrel) {
    
    int start  = std::max(0,HBsearchTS_.first);
    int finish = std::min(digi.size()-1,HBsearchTS_.second);

    /*
    std::cout << " HBsearchTS_ : " <<  HBsearchTS_.first 
              << ", " << HBsearchTS_.second << std::endl;
    std::cout << " HB start, finish = " << start << ", "
              << finish << std::endl;
    */

    return keepMe(digi,start,finish,thresholdHB_,digi.zsCrossingMask());


  }
  else {

    int start  = std::max(0,HEsearchTS_.first);
    int finish = std::min(digi.size()-1,HEsearchTS_.second);
    return keepMe(digi,start,finish,thresholdHE_,digi.zsCrossingMask());

  }
}  
bool HcalZSAlgoRealistic::shouldKeep ( const HFDataFrame digi) const [protected, virtual]

Implements HcalZeroSuppressionAlgo.

Definition at line 140 of file HcalZSAlgoRealistic.cc.

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

                                                                 {

  int start  = std::max(0,HFsearchTS_.first);
  int finish = std::min(digi.size()-1,HFsearchTS_.second);
  return keepMe(digi,start,finish,thresholdHF_,digi.zsCrossingMask());
}

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

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