CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/RecoTracker/TkSeedGenerator/plugins/SeedFromConsecutiveHitsStraightLineCreator.cc

Go to the documentation of this file.
00001 #include "SeedFromConsecutiveHitsStraightLineCreator.h"
00002 
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 #include "MagneticField/Engine/interface/MagneticField.h"
00005 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00006 #include "FWCore/Framework/interface/ESHandle.h"
00007 #include "FWCore/Framework/interface/EventSetup.h"
00008 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h"
00009 
00010 
00011 GlobalTrajectoryParameters SeedFromConsecutiveHitsStraightLineCreator::initialKinematic(
00012       const SeedingHitSet & hits,
00013       const TrackingRegion & region,
00014       const edm::EventSetup& es,
00015       const SeedComparitor *filter,
00016       bool                 &passesFilter) const
00017 {
00018   GlobalTrajectoryParameters kine;
00019 
00020   const TransientTrackingRecHit::ConstRecHitPointer& tth1 = hits[0];
00021   const TransientTrackingRecHit::ConstRecHitPointer& tth2 = hits[1];
00022 
00023   const GlobalPoint& vertexPos = region.origin();
00024   edm::ESHandle<MagneticField> bfield;
00025   es.get<IdealMagneticFieldRecord>().get(bfield);
00026 
00027   // Assume initial state is straight line passing through beam spot
00028   // with direction given by innermost two seed hits (with big uncertainty)
00029   GlobalVector initMomentum(tth2->globalPosition() - tth1->globalPosition());
00030   double rescale = 1000./initMomentum.perp();
00031   initMomentum *= rescale; // set to approximately infinite momentum
00032   TrackCharge q = 1; // irrelevant, since infinite momentum
00033   kine = GlobalTrajectoryParameters(vertexPos, initMomentum, q, &*bfield);
00034 
00035   passesFilter = (filter ? filter->compatible(hits, kine, region) : true); 
00036   return kine;
00037 }
00038