CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/SimCalorimetry/HcalSimAlgos/src/HcalHitFilter.cc

Go to the documentation of this file.
00001 #include "SimCalorimetry/HcalSimAlgos/interface/HcalHitFilter.h"
00002 
00003 
00004 HcalHitFilter::HcalHitFilter(HcalSubdetector subdet) 
00005 : theSubdet(subdet) 
00006 {
00007 }
00008 
00009 
00010 void HcalHitFilter::setDetIds(const std::vector<DetId> & detIds) 
00011 {
00012   theDetIds = detIds;
00013 }
00014 
00015 
00016 bool HcalHitFilter::accepts(const PCaloHit & hit) const {
00017   bool result = false;
00018   HcalDetId hcalDetId(hit.id());
00019   if(hcalDetId.subdet() == theSubdet)
00020   {
00021     if(theDetIds.empty() || std::find(theDetIds.begin(), theDetIds.end(), DetId(hit.id())) != theDetIds.end())
00022     {
00023       result = true;
00024     }
00025   }
00026   return result;
00027 }
00028