test
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
CaloConeSelector< T > Class Template Reference

#include <CaloConeSelector.h>

Public Member Functions

 CaloConeSelector (double dR, const CaloGeometry *geom)
 
 CaloConeSelector (double dR, 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 deltaR_
 
DetId::Detector detector_
 
const CaloGeometrygeom_
 
int subdet_
 

Detailed Description

template<class T>
class CaloConeSelector< T >

Author
J. Mans - Minnesota

Definition at line 15 of file CaloConeSelector.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Definition at line 23 of file CaloConeSelector.h.

References cmsHarvester::callback, and AlCaHLTBitMon_ParallelJobs::p.

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

Definition at line 28 of file CaloConeSelector.h.

References cmsHarvester::callback, CaloConeSelector< T >::deltaR_, CaloConeSelector< T >::detector_, edm::SortedCollection< T, SORT >::end(), edm::SortedCollection< T, SORT >::find(), CaloConeSelector< T >::geom_, CaloSubdetectorGeometry::getCells(), CaloGeometry::getSubdetectorGeometry(), i, j, and CaloConeSelector< T >::subdet_.

28  {
29  // TODO: handle default setting of detector_ (loops over subdet)
30  // TODO: heuristics of when it is better to loop over inputCollection instead (small # hits)
31  for (int subdet=subdet_; subdet<=7 && (subdet_==0 || subdet_==subdet); subdet++) {
33  if (sdg!=0) {
34  // get the list of detids within range (from geometry)
36  // loop over detids...
37  typename edm::SortedCollection<T>::const_iterator j, je = inputCollection.end();
38 
39  for (CaloSubdetectorGeometry::DetIdSet::iterator i=dis.begin(); i!=dis.end(); i++) {
40  if (i->subdetId()!=subdet) continue; // possible for HCAL where the same geometry object handles all the detectors
41  j=inputCollection.find(*i);
42  if (j!=je)
43  callback(*j);
44  }
45  }
46  }
47  }
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
const CaloGeometry * geom_
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_iterator end() const
iterator find(key_type k)
DetId::Detector detector_

Member Data Documentation

template<class T >
double CaloConeSelector< T >::deltaR_
private

Definition at line 51 of file CaloConeSelector.h.

Referenced by CaloConeSelector< T >::selectCallback().

template<class T >
DetId::Detector CaloConeSelector< T >::detector_
private

Definition at line 52 of file CaloConeSelector.h.

Referenced by CaloConeSelector< T >::selectCallback().

template<class T >
const CaloGeometry* CaloConeSelector< T >::geom_
private

Definition at line 50 of file CaloConeSelector.h.

Referenced by CaloConeSelector< T >::selectCallback().

template<class T >
int CaloConeSelector< T >::subdet_
private

Definition at line 53 of file CaloConeSelector.h.

Referenced by CaloConeSelector< T >::selectCallback().