CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalHitFilter.cc
Go to the documentation of this file.
2 
3 
5 : theSubdet(subdet)
6 {
7 }
8 
9 
10 void HcalHitFilter::setDetIds(const std::vector<DetId> & detIds)
11 {
12  theDetIds = detIds;
13 }
14 
15 
16 bool HcalHitFilter::accepts(const PCaloHit & hit) const {
17  bool result = false;
18  HcalDetId hcalDetId(hit.id());
19  if(hcalDetId.subdet() == theSubdet)
20  {
21  if(theDetIds.empty() || std::find(theDetIds.begin(), theDetIds.end(), DetId(hit.id())) != theDetIds.end())
22  {
23  result = true;
24  }
25  }
26  return result;
27 }
28 
virtual bool accepts(const PCaloHit &hit) const
void setDetIds(const std::vector< DetId > &detIds)
HcalSubdetector theSubdet
Definition: HcalHitFilter.h:20
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
tuple result
Definition: query.py:137
HcalSubdetector
Definition: HcalAssistant.h:32
unsigned int id() const
Definition: PCaloHit.h:40
Definition: DetId.h:20
std::vector< DetId > theDetIds
Definition: HcalHitFilter.h:22
HcalHitFilter(HcalSubdetector subdet)
Definition: HcalHitFilter.cc:4