CMS 3D CMS Logo

CaloConeSelector Class Reference

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

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

List of all members.

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 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 CaloConeSelector.h.


Constructor & Destructor Documentation

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 
)

Definition at line 9 of file CaloConeSelector.cc.

00009                                                                                                           : 
00010   geom_(geom),deltaR_(dR),detector_(detector),subdet_(subdet) {
00011 }


Member Function Documentation

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 }


Member Data Documentation

double CaloConeSelector::deltaR_ [private]

Definition at line 23 of file CaloConeSelector.h.

Referenced by select().

DetId::Detector CaloConeSelector::detector_ [private]

Definition at line 24 of file CaloConeSelector.h.

Referenced by select().

const CaloGeometry* CaloConeSelector::geom_ [private]

Definition at line 22 of file CaloConeSelector.h.

Referenced by select().

int CaloConeSelector::subdet_ [private]

Definition at line 25 of file CaloConeSelector.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