CMS 3D CMS Logo

RoadSearchHelixMakerAlgorithm Class Reference

#include <RecoTracker/RoadSearchHelixMaker/interface/RoadSearchHelixMakerAlgorithm.h>

List of all members.

Public Member Functions

 RoadSearchHelixMakerAlgorithm (const edm::ParameterSet &conf)
void run (const TrackCandidateCollection *input, const edm::EventSetup &es, reco::TrackCollection &output)
 Runs the algorithm.
 ~RoadSearchHelixMakerAlgorithm ()

Private Attributes

edm::ParameterSet conf_


Detailed Description

Definition at line 29 of file RoadSearchHelixMakerAlgorithm.h.


Constructor & Destructor Documentation

RoadSearchHelixMakerAlgorithm::RoadSearchHelixMakerAlgorithm ( const edm::ParameterSet conf  ) 

Definition at line 55 of file RoadSearchHelixMakerAlgorithm.cc.

00055                                                                                         : conf_(conf) { 
00056 }

RoadSearchHelixMakerAlgorithm::~RoadSearchHelixMakerAlgorithm (  ) 

Definition at line 58 of file RoadSearchHelixMakerAlgorithm.cc.

00058                                                               {
00059 }


Member Function Documentation

void RoadSearchHelixMakerAlgorithm::run ( const TrackCandidateCollection input,
const edm::EventSetup es,
reco::TrackCollection output 
)

Runs the algorithm.

Definition at line 61 of file RoadSearchHelixMakerAlgorithm.cc.

References edm::EventSetup::get(), LogDebug, GluedGeomDet::monoDet(), edm::ESHandle< T >::product(), recHitId, TrackCandidate::recHits(), RectangularStripTopology::stripLength(), DetId::subdetId(), GeomDet::surface(), StripSubdetector::TIB, StripSubdetector::TOB, Surface::toGlobal(), GeomDetUnit::topology(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by cms::RoadSearchHelixMaker::produce().

00064 {
00065 
00066   edm::LogInfo("RoadSearch") << "Input of " << input->size() << " track candidate(s)."; 
00067 
00068   //
00069   //  no track candidates - nothing to try fitting
00070   //
00071   if ( input->empty() ){
00072     edm::LogInfo("RoadSearch") << "Created " << output.size() << " tracks.";
00073     return;  
00074   }
00075 
00076   //
00077   //  got > 0 track candidate - try fitting
00078   //
00079 
00080   // get tracker geometry
00081   edm::ESHandle<TrackerGeometry> tracker;
00082   es.get<TrackerDigiGeometryRecord>().get(tracker);
00083 
00084   // magnetic field
00085   edm::ESHandle<MagneticField> fieldHandle;
00086   es.get<IdealMagneticFieldRecord>().get(fieldHandle);
00087   const MagneticField *field = fieldHandle.product();
00088 
00089   unsigned int trackcandidate_ctr=0;
00090 
00091   // loop over clouds
00092   for ( TrackCandidateCollection::const_iterator trackcandidate = input->begin(); trackcandidate != input->end(); ++trackcandidate ) {
00093     TrackCandidate currentCandidate = *trackcandidate;
00094     ++trackcandidate_ctr;
00095     unsigned int trackcandidate_number_rechits = 0;
00096     TrackCandidate::range recHitRange = currentCandidate.recHits();
00097     for ( TrackCandidate::const_iterator recHit = recHitRange.first; recHit != recHitRange.second; ++recHit ) {
00098       ++trackcandidate_number_rechits;
00099     }
00100 
00101     LogDebug("RoadSearch") << "Track candidate number, number of TrackingRecHits = " << trackcandidate_ctr << " " 
00102                            << trackcandidate_number_rechits; 
00103 
00104     //
00105     // helix fitting here
00106     //
00107     edm::LogInfo("RoadSearch") << "Beware - Use Simple Helix Fitted Tracks only for Debugging Purposes!!" ;
00108 
00109     std::vector<DcxHit*> listohits; 
00110 
00111     for ( TrackCandidate::const_iterator recHit = recHitRange.first; recHit != recHitRange.second; ++recHit ) {
00112       DetId recHitId = recHit->geographicalId();
00113       const GeomDet *recHitGeomDet = tracker->idToDet(recHitId);
00114       GlobalPoint hit_global_pos = recHitGeomDet->surface().toGlobal(recHit->localPosition());
00115       // only for TIB and TOB (for now ... )
00116       if ( (unsigned int)recHitId.subdetId() == StripSubdetector::TIB ||
00117            (unsigned int)recHitId.subdetId() == StripSubdetector::TOB ) {
00118         const GeomDetUnit *recHitGeomDetUnit;
00119         // take rphi sensor in case of matched rechit to determine topology
00120         const GluedGeomDet *recHitGluedGeomDet = dynamic_cast<const GluedGeomDet*>(recHitGeomDet);
00121         if ( recHitGluedGeomDet != 0 ) {
00122           recHitGeomDetUnit = recHitGluedGeomDet->monoDet();
00123         } else {
00124           recHitGeomDetUnit = tracker->idToDetUnit(recHitId);
00125         }
00126         const RectangularStripTopology *recHitTopology = 
00127           dynamic_cast<const RectangularStripTopology*>(&(recHitGeomDetUnit->topology()));
00128         double iLength = recHitTopology->stripLength();
00129         LocalPoint temp_lpos = recHit->localPosition();
00130         LocalPoint temp_lpos_f(temp_lpos.x(),temp_lpos.y()+iLength/2.0,temp_lpos.z());
00131         LocalPoint temp_lpos_b(temp_lpos.x(),temp_lpos.y()-iLength/2.0,temp_lpos.z());
00132         GlobalPoint temp_gpos_f = recHitGeomDet->surface().toGlobal(temp_lpos_f);
00133         GlobalPoint temp_gpos_b = recHitGeomDet->surface().toGlobal(temp_lpos_b);
00134         GlobalVector fir_uvec((temp_gpos_f.x()-temp_gpos_b.x())/iLength,
00135                               (temp_gpos_f.y()-temp_gpos_b.y())/iLength,(temp_gpos_f.z()-temp_gpos_b.z())/iLength);
00136         DcxHit* try_me = new DcxHit(hit_global_pos.x(), hit_global_pos.y(), hit_global_pos.z(), 
00137                                     fir_uvec.x(), fir_uvec.y(), fir_uvec.z());
00138         listohits.push_back(try_me);
00139       }
00140     }
00141     DcxTrackCandidatesToTracks make_tracks(listohits,output, field);
00142   }//iterate over all track candidates
00143 
00144   edm::LogInfo("RoadSearch") << "Created " << output.size() << " tracks.";
00145 
00146 }


Member Data Documentation

edm::ParameterSet RoadSearchHelixMakerAlgorithm::conf_ [private]

Definition at line 42 of file RoadSearchHelixMakerAlgorithm.h.


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