CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CaloDualConeSelector< T > Class Template Reference

#include <CaloDualConeSelector.h>

Public Member Functions

 CaloDualConeSelector (double dRmin, double dRmax, const CaloGeometry *geom)
 
 CaloDualConeSelector (double dRmin, double dRmax, const CaloGeometry *geom, DetId::Detector detector, int subdet=0)
 
void selectCallback (double eta, double phi, const edm::SortedCollection< T > &inputCollection, std::function< void(const T &)> callback)
 
void selectCallback (const GlobalPoint &p, const edm::SortedCollection< T > &inputCollection, std::function< void(const T &)> callback)
 

Private Attributes

double deltaRmax_
 
double deltaRmin_
 
DetId::Detector detector_
 
const CaloGeometrygeom_
 
int subdet_
 

Detailed Description

template<class T>
class CaloDualConeSelector< T >

Author
J. Mans - Minnesota

Definition at line 14 of file CaloDualConeSelector.h.

Constructor & Destructor Documentation

template<class T>
CaloDualConeSelector< T >::CaloDualConeSelector ( double  dRmin,
double  dRmax,
const CaloGeometry geom 
)
inline

Definition at line 16 of file CaloDualConeSelector.h.

template<class T>
CaloDualConeSelector< T >::CaloDualConeSelector ( double  dRmin,
double  dRmax,
const CaloGeometry geom,
DetId::Detector  detector,
int  subdet = 0 
)
inline

Definition at line 19 of file CaloDualConeSelector.h.

19  :
20  geom_(geom),deltaRmin_(dRmin),deltaRmax_(dRmax),detector_(detector),subdet_(subdet) {}
const CaloGeometry * geom_

Member Function Documentation

template<class T>
void CaloDualConeSelector< T >::selectCallback ( double  eta,
double  phi,
const edm::SortedCollection< T > &  inputCollection,
std::function< void(const T &)>  callback 
)
inline

Definition at line 22 of file CaloDualConeSelector.h.

Referenced by egammaisolation::EgammaHcalExtractor::deposit(), EgammaHcalIsolation::getHcalSum(), and CaloDualConeSelector< HBHERecHit >::selectCallback().

22  {
24  return selectCallback(p, inputCollection, callback);
25  }
void selectCallback(double eta, double phi, const edm::SortedCollection< T > &inputCollection, std::function< void(const T &)> callback)
template<class T>
void CaloDualConeSelector< T >::selectCallback ( const GlobalPoint p,
const edm::SortedCollection< T > &  inputCollection,
std::function< void(const T &)>  callback 
)
inline

Definition at line 27 of file CaloDualConeSelector.h.

27  {
28  // TODO: handle default setting of detector_ (loops over subdet)
29  // TODO: heuristics of when it is better to loop over inputCollection instead (small # hits)
30  for (int subdet=subdet_; subdet<=7 && (subdet_==0 || subdet_==subdet); subdet++) {
32  if (sdg!=0) {
33  // get the list of detids within range (from geometry)
36  // use set operations to determine detids in annulus
38  std::set_difference(dis_all.begin(),dis_all.end(),
39  dis_excl.begin(),dis_excl.end(),
40  std::inserter(dis,dis.begin()));
41 
42  // loop over detids...
43  typename edm::SortedCollection<T>::const_iterator j, je = inputCollection.end();
44 
45  for (CaloSubdetectorGeometry::DetIdSet::iterator i=dis.begin(); i!=dis.end(); i++) {
46  if (i->subdetId()!=subdet) continue; // possible for HCAL where the same geometry object handles all the detectors
47  j=inputCollection.find(*i);
48  if (j!=je) callback(*j);
49  }
50  }
51  }
52  }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
std::vector< T >::const_iterator const_iterator
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
int j
Definition: DBlmapReader.cc:9
const CaloGeometry * geom_
const_iterator end() const
iterator find(key_type k)

Member Data Documentation

template<class T>
double CaloDualConeSelector< T >::deltaRmax_
private
template<class T>
double CaloDualConeSelector< T >::deltaRmin_
private
template<class T>
DetId::Detector CaloDualConeSelector< T >::detector_
private
template<class T>
const CaloGeometry* CaloDualConeSelector< T >::geom_
private
template<class T>
int CaloDualConeSelector< T >::subdet_
private