CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoJets/JetProducers/src/AnomalousTower.cc

Go to the documentation of this file.
00001 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00002 #include "RecoJets/JetProducers/interface/AnomalousTower.h"
00003 #include "DataFormats/CaloTowers/interface/CaloTower.h"
00004 
00005 #define init_param(type, varname) varname (ps.getParameter< type >( #varname ))
00006 
00007 AnomalousTower::AnomalousTower(const edm::ParameterSet& ps)
00008     : init_param(unsigned, maxBadEcalCells),
00009       init_param(unsigned, maxRecoveredEcalCells),
00010       init_param(unsigned, maxProblematicEcalCells),
00011       init_param(unsigned, maxBadHcalCells),
00012       init_param(unsigned, maxRecoveredHcalCells),
00013       init_param(unsigned, maxProblematicHcalCells)
00014 {
00015 }
00016 
00017 bool AnomalousTower::operator()(const reco::Candidate& input) const
00018 {
00019     const CaloTower* tower = dynamic_cast<const CaloTower*>(&input);
00020     if (tower)
00021         return tower->numBadEcalCells()         > maxBadEcalCells         ||
00022                tower->numRecoveredEcalCells()   > maxRecoveredEcalCells   ||
00023                tower->numProblematicEcalCells() > maxProblematicEcalCells ||
00024                tower->numBadHcalCells()         > maxBadHcalCells         ||
00025                tower->numRecoveredHcalCells()   > maxRecoveredHcalCells   ||
00026                tower->numProblematicHcalCells() > maxProblematicHcalCells;
00027     else
00028         return false;
00029 }