#include <RecoCaloTools/Selectors/interface/CaloConeSelector.h>
Public Member Functions | |
CaloConeSelector (double dR, const CaloGeometry *geom, DetId::Detector detector, int subdet=0) | |
CaloConeSelector (double dR, const CaloGeometry *geom) | |
std::auto_ptr < CaloRecHitMetaCollectionV > | select (const GlobalPoint &p, const CaloRecHitMetaCollectionV &inputCollection) |
std::auto_ptr < CaloRecHitMetaCollectionV > | select (double eta, double phi, const CaloRecHitMetaCollectionV &inputCollection) |
Private Attributes | |
double | deltaR_ |
DetId::Detector | detector_ |
const CaloGeometry * | geom_ |
int | subdet_ |
Definition at line 14 of file CaloConeSelector.h.
CaloConeSelector::CaloConeSelector | ( | double | dR, | |
const CaloGeometry * | geom | |||
) |
Definition at line 5 of file CaloConeSelector.cc.
00005 : 00006 geom_(geom),deltaR_(dR),detector_(DetId::Detector(0)),subdet_(0) { 00007 }
CaloConeSelector::CaloConeSelector | ( | double | dR, | |
const CaloGeometry * | geom, | |||
DetId::Detector | detector, | |||
int | subdet = 0 | |||
) |
std::auto_ptr< CaloRecHitMetaCollectionV > CaloConeSelector::select | ( | const GlobalPoint & | p, | |
const CaloRecHitMetaCollectionV & | inputCollection | |||
) |
Definition at line 18 of file CaloConeSelector.cc.
References CaloRecHitMetaCollectionFast::add(), c, deltaR_, detector_, CaloRecHitMetaCollectionV::end(), CaloRecHitMetaCollectionV::find(), geom_, CaloSubdetectorGeometry::getCells(), CaloGeometry::getSubdetectorGeometry(), i, j, and subdet_.
00018 { 00019 CaloRecHitMetaCollectionFast* c=new CaloRecHitMetaCollectionFast(); 00020 00021 // TODO: handle default setting of detector_ (loops over subdet) 00022 // TODO: heuristics of when it is better to loop over inputCollection instead (small # hits) 00023 for (int subdet=subdet_; subdet<=7 && (subdet_==0 || subdet_==subdet); subdet++) { 00024 const CaloSubdetectorGeometry* sdg=geom_->getSubdetectorGeometry(detector_,subdet); 00025 if (sdg!=0) { 00026 // get the list of detids within range (from geometry) 00027 CaloSubdetectorGeometry::DetIdSet dis=sdg->getCells(p,deltaR_); 00028 // loop over detids... 00029 CaloRecHitMetaCollectionV::const_iterator j,je=inputCollection.end(); 00030 00031 for (CaloSubdetectorGeometry::DetIdSet::iterator i=dis.begin(); i!=dis.end(); i++) { 00032 if (i->subdetId()!=subdet) continue; // possible for HCAL where the same geometry object handles all the detectors 00033 j=inputCollection.find(*i); 00034 if (j!=je) c->add(&(*j)); 00035 } 00036 } 00037 } 00038 00039 return std::auto_ptr<CaloRecHitMetaCollectionV>(c); 00040 }
std::auto_ptr< CaloRecHitMetaCollectionV > CaloConeSelector::select | ( | double | eta, | |
double | phi, | |||
const CaloRecHitMetaCollectionV & | inputCollection | |||
) |
Definition at line 13 of file CaloConeSelector.cc.
References p.
00013 { 00014 GlobalPoint p(GlobalPoint::Cylindrical(1,phi,tanh(eta))); 00015 return select(p,inputCollection); 00016 }
double CaloConeSelector::deltaR_ [private] |
DetId::Detector CaloConeSelector::detector_ [private] |
const CaloGeometry* CaloConeSelector::geom_ [private] |
int CaloConeSelector::subdet_ [private] |