Go to the documentation of this file.00001 #include "SeedFromConsecutiveHitsTripletOnlyCreator.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 #include "RecoTracker/TkSeedGenerator/interface/FastHelix.h"
00010
00011
00012 GlobalTrajectoryParameters SeedFromConsecutiveHitsTripletOnlyCreator::initialKinematic(
00013 const SeedingHitSet& hits,
00014 const TrackingRegion & region,
00015 const edm::EventSetup& es,
00016 const SeedComparitor *filter,
00017 bool &passesFilter) const
00018 {
00019 GlobalTrajectoryParameters kine;
00020
00021 const TransientTrackingRecHit::ConstRecHitPointer& tth1 = hits[0];
00022 const TransientTrackingRecHit::ConstRecHitPointer& tth2 = hits[1];
00023 const TransientTrackingRecHit::ConstRecHitPointer& tth3 = hits[2];
00024
00025 FastHelix helix(tth3->globalPosition(), tth2->globalPosition(), tth1->globalPosition(), es, tth1->globalPosition());
00026 kine = helix.stateAtVertex().parameters();
00027
00028 edm::ESHandle<MagneticField> bfield;
00029 es.get<IdealMagneticFieldRecord>().get(bfield);
00030 bool isBOFF = ( std::abs(bfield->inTesla(GlobalPoint(0,0,0)).z()) < 1e-3 );
00031 if (isBOFF && (theBOFFMomentum > 0)) {
00032 kine = GlobalTrajectoryParameters(kine.position(),
00033 kine.momentum().unit() * theBOFFMomentum,
00034 kine.charge(),
00035 &*bfield);
00036 }
00037 passesFilter = (filter ? filter->compatible(hits, kine, helix, region) : true);
00038 return kine;
00039 }