CMS 3D CMS Logo

CaloDualConeSelector Class Reference

Date
2006/08/29 12:49:10
Revision
1.1
More...

#include <RecoCaloTools/Selectors/interface/CaloDualConeSelector.h>

List of all members.

Public Member Functions

 CaloDualConeSelector (double dRmin, double dRmax, const CaloGeometry *geom, DetId::Detector detector, int subdet=0)
 CaloDualConeSelector (double dRmin, double dRmax, 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 deltaRmax_
double deltaRmin_
DetId::Detector detector_
const CaloGeometrygeom_
int subdet_


Detailed Description

Date
2006/08/29 12:49:10
Revision
1.1

Author:
J. Mans - Minnesota

Definition at line 14 of file CaloDualConeSelector.h.


Constructor & Destructor Documentation

CaloDualConeSelector::CaloDualConeSelector ( double  dRmin,
double  dRmax,
const CaloGeometry geom 
)

Definition at line 5 of file CaloDualConeSelector.cc.

00005                                                                                                :
00006   geom_(geom),deltaRmin_(dRmin),deltaRmax_(dRmax),detector_(DetId::Detector(0)),subdet_(0) {
00007 }

CaloDualConeSelector::CaloDualConeSelector ( double  dRmin,
double  dRmax,
const CaloGeometry geom,
DetId::Detector  detector,
int  subdet = 0 
)

Definition at line 9 of file CaloDualConeSelector.cc.

00009                                                                                                                                    : 
00010   geom_(geom),deltaRmin_(dRmin),deltaRmax_(dRmax),detector_(detector),subdet_(subdet) {
00011 }


Member Function Documentation

std::auto_ptr< CaloRecHitMetaCollectionV > CaloDualConeSelector::select ( const GlobalPoint p,
const CaloRecHitMetaCollectionV inputCollection 
)

Definition at line 18 of file CaloDualConeSelector.cc.

References CaloRecHitMetaCollectionFast::add(), c, deltaRmax_, deltaRmin_, 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_excl=sdg->getCells(p,deltaRmin_);
00028       CaloSubdetectorGeometry::DetIdSet dis_all=sdg->getCells(p,deltaRmax_);
00029       // use set operations to determine detids in annulus
00030       CaloSubdetectorGeometry::DetIdSet dis;
00031       std::set_difference(dis_all.begin(),dis_all.end(),
00032                           dis_excl.begin(),dis_excl.end(),
00033                           std::inserter(dis,dis.begin()));
00034       // loop over detids...
00035       CaloRecHitMetaCollectionV::const_iterator j,je=inputCollection.end();      
00036 
00037       for (CaloSubdetectorGeometry::DetIdSet::iterator i=dis.begin(); i!=dis.end(); i++) {
00038         if (i->subdetId()!=subdet) continue; // possible for HCAL where the same geometry object handles all the detectors
00039         j=inputCollection.find(*i);
00040         if (j!=je) c->add(&(*j));
00041       }
00042     }    
00043   }
00044 
00045   return std::auto_ptr<CaloRecHitMetaCollectionV>(c);
00046 }

std::auto_ptr< CaloRecHitMetaCollectionV > CaloDualConeSelector::select ( double  eta,
double  phi,
const CaloRecHitMetaCollectionV inputCollection 
)

Definition at line 13 of file CaloDualConeSelector.cc.

References p.

Referenced by egammaisolation::EgammaRecHitExtractor::collect(), egammaisolation::EgammaHcalExtractor::deposit(), EgammaHcalIsolation::getHcalEtSum(), and EgammaRecHitIsolation::getSum_().

00013                                                                                                                                             {
00014   GlobalPoint p(GlobalPoint::Cylindrical(1,phi,tanh(eta)));
00015   return select(p,inputCollection);
00016 }


Member Data Documentation

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().

DetId::Detector CaloDualConeSelector::detector_ [private]

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:15:44 2009 for CMSSW by  doxygen 1.5.4