#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) | |
std::auto_ptr < CaloRecHitMetaCollectionV > | select (double eta, double phi, const CaloRecHitMetaCollectionV &inputCollection) |
std::auto_ptr < CaloRecHitMetaCollectionV > | select (const GlobalPoint &p, const CaloRecHitMetaCollectionV &inputCollection) |
Private Attributes | |
double | deltaRmax_ |
double | deltaRmin_ |
DetId::Detector | detector_ |
const CaloGeometry * | geom_ |
int | subdet_ |
CaloDualConeSelector::CaloDualConeSelector | ( | double | dRmin, |
double | dRmax, | ||
const CaloGeometry * | geom | ||
) |
Definition at line 7 of file CaloDualConeSelector.cc.
: geom_(geom),deltaRmin_(dRmin),deltaRmax_(dRmax),detector_(DetId::Detector(0)),subdet_(0) { }
CaloDualConeSelector::CaloDualConeSelector | ( | double | dRmin, |
double | dRmax, | ||
const CaloGeometry * | geom, | ||
DetId::Detector | detector, | ||
int | subdet = 0 |
||
) |
Definition at line 11 of file CaloDualConeSelector.cc.
: geom_(geom),deltaRmin_(dRmin),deltaRmax_(dRmax),detector_(detector),subdet_(subdet) { }
std::auto_ptr< CaloRecHitMetaCollectionV > CaloDualConeSelector::select | ( | double | eta, |
double | phi, | ||
const CaloRecHitMetaCollectionV & | inputCollection | ||
) |
Definition at line 15 of file CaloDualConeSelector.cc.
References AlCaHLTBitMon_ParallelJobs::p.
Referenced by egammaisolation::EgammaHcalExtractor::deposit(), and EgammaHcalIsolation::getHcalSum().
{ GlobalPoint p(GlobalPoint::Cylindrical(1,phi,tanh(eta))); return select(p,inputCollection); }
std::auto_ptr< CaloRecHitMetaCollectionV > CaloDualConeSelector::select | ( | const GlobalPoint & | p, |
const CaloRecHitMetaCollectionV & | inputCollection | ||
) |
Definition at line 20 of file CaloDualConeSelector.cc.
References CaloRecHitMetaCollectionFast::add(), trackerHits::c, deltaRmax_, deltaRmin_, detector_, CaloRecHitMetaCollectionV::end(), CaloRecHitMetaCollectionV::find(), geom_, CaloSubdetectorGeometry::getCells(), CaloGeometry::getSubdetectorGeometry(), i, j, and subdet_.
{ CaloRecHitMetaCollectionFast* c=new CaloRecHitMetaCollectionFast(); // TODO: handle default setting of detector_ (loops over subdet) // TODO: heuristics of when it is better to loop over inputCollection instead (small # hits) for (int subdet=subdet_; subdet<=7 && (subdet_==0 || subdet_==subdet); subdet++) { const CaloSubdetectorGeometry* sdg=geom_->getSubdetectorGeometry(detector_,subdet); if (sdg!=0) { // get the list of detids within range (from geometry) CaloSubdetectorGeometry::DetIdSet dis_excl=sdg->getCells(p,deltaRmin_); CaloSubdetectorGeometry::DetIdSet dis_all=sdg->getCells(p,deltaRmax_); // use set operations to determine detids in annulus CaloSubdetectorGeometry::DetIdSet dis; std::set_difference(dis_all.begin(),dis_all.end(), dis_excl.begin(),dis_excl.end(), std::inserter(dis,dis.begin())); // loop over detids... CaloRecHitMetaCollectionV::const_iterator j,je=inputCollection.end(); for (CaloSubdetectorGeometry::DetIdSet::iterator i=dis.begin(); i!=dis.end(); i++) { if (i->subdetId()!=subdet) continue; // possible for HCAL where the same geometry object handles all the detectors j=inputCollection.find(*i); if (j!=je) c->add(&(*j)); } } } return std::auto_ptr<CaloRecHitMetaCollectionV>(c); }
double CaloDualConeSelector::deltaRmax_ [private] |
Definition at line 23 of file CaloDualConeSelector.h.
Referenced by select().
double CaloDualConeSelector::deltaRmin_ [private] |
Definition at line 23 of file CaloDualConeSelector.h.
Referenced by select().
Definition at line 24 of file CaloDualConeSelector.h.
Referenced by select().
const CaloGeometry* CaloDualConeSelector::geom_ [private] |
Definition at line 22 of file CaloDualConeSelector.h.
Referenced by select().
int CaloDualConeSelector::subdet_ [private] |
Definition at line 25 of file CaloDualConeSelector.h.
Referenced by select().