CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
SeedFromConsecutiveHitsCreator Class Reference

#include <SeedFromConsecutiveHitsCreator.h>

Inheritance diagram for SeedFromConsecutiveHitsCreator:
SeedCreator SeedFromConsecutiveHitsStraightLineCreator SeedFromConsecutiveHitsTripletOnlyCreator

Public Member Functions

 SeedFromConsecutiveHitsCreator (const edm::ParameterSet &cfg)
 
 SeedFromConsecutiveHitsCreator (const std::string &propagator="PropagatorWithMaterial", double seedMomentumForBOFF=-5.0)
 
virtual const TrajectorySeedtrajectorySeed (TrajectorySeedCollection &seedCollection, const SeedingHitSet &ordered, const TrackingRegion &region, const edm::EventSetup &es)
 
virtual ~SeedFromConsecutiveHitsCreator ()
 
- Public Member Functions inherited from SeedCreator
virtual ~SeedCreator ()
 

Protected Member Functions

virtual const TrajectorySeedbuildSeed (TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const FreeTrajectoryState &fts, const edm::EventSetup &es) const
 
virtual bool checkHit (const TrajectoryStateOnSurface &, const TransientTrackingRecHit::ConstRecHitPointer &hit, const edm::EventSetup &es) const
 
virtual CurvilinearTrajectoryError initialError (const TrackingRegion &region, float sinTheta) const
 
virtual GlobalTrajectoryParameters initialKinematic (const SeedingHitSet &hits, const TrackingRegion &region, const edm::EventSetup &es) const
 
virtual
TransientTrackingRecHit::RecHitPointer 
refitHit (const TransientTrackingRecHit::ConstRecHitPointer &hit, const TrajectoryStateOnSurface &state) const
 

Protected Attributes

double theBOFFMomentum
 
std::string thePropagatorLabel
 

Detailed Description

Definition at line 8 of file SeedFromConsecutiveHitsCreator.h.

Constructor & Destructor Documentation

SeedFromConsecutiveHitsCreator::SeedFromConsecutiveHitsCreator ( const edm::ParameterSet cfg)
inline

Definition at line 11 of file SeedFromConsecutiveHitsCreator.h.

11  :
12  thePropagatorLabel(cfg.getParameter<std::string>("propagator")),
13  theBOFFMomentum(cfg.existsAs<double>("SeedMomentumForBOFF") ? cfg.getParameter<double>("SeedMomentumForBOFF") : 5.0)
14  {}
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:180
SeedFromConsecutiveHitsCreator::SeedFromConsecutiveHitsCreator ( const std::string &  propagator = "PropagatorWithMaterial",
double  seedMomentumForBOFF = -5.0 
)
inline
virtual SeedFromConsecutiveHitsCreator::~SeedFromConsecutiveHitsCreator ( )
inlinevirtual

Definition at line 21 of file SeedFromConsecutiveHitsCreator.h.

21 {}

Member Function Documentation

const TrajectorySeed * SeedFromConsecutiveHitsCreator::buildSeed ( TrajectorySeedCollection seedCollection,
const SeedingHitSet hits,
const FreeTrajectoryState fts,
const edm::EventSetup es 
) const
protectedvirtual

Definition at line 101 of file SeedFromConsecutiveHitsCreator.cc.

References alongMomentum, checkHit(), TrackingRecHit::geographicalId(), edm::EventSetup::get(), TrajectoryStateOnSurface::isValid(), TrajectoryStateTransform::persistentState(), Propagator::propagate(), LargeD0_PixelPairStep_cff::propagator, edm::OwnVector< T, P >::push_back(), DetId::rawId(), refitHit(), SeedingHitSet::size(), evf::utils::state, thePropagatorLabel, patCandidatesForDimuonsSequences_cff::tracker, KFUpdator::update(), and ExpressReco_HICollisions_FallBack::updator.

Referenced by trajectorySeed().

106 {
107  // get tracker
109  es.get<TrackerDigiGeometryRecord>().get(tracker);
110 
111  // get propagator
112  edm::ESHandle<Propagator> propagatorHandle;
113  es.get<TrackingComponentsRecord>().get(thePropagatorLabel, propagatorHandle);
114  const Propagator* propagator = &(*propagatorHandle);
115 
116  // get updator
118 
119  // Now update initial state track using information from seed hits.
120 
121  TrajectoryStateOnSurface updatedState;
123 
124  const TrackingRecHit* hit = 0;
125  for ( unsigned int iHit = 0; iHit < hits.size(); iHit++) {
126  hit = hits[iHit]->hit();
127  TrajectoryStateOnSurface state = (iHit==0) ?
128  propagator->propagate(fts,tracker->idToDet(hit->geographicalId())->surface())
129  : propagator->propagate(updatedState, tracker->idToDet(hit->geographicalId())->surface());
130  if (!state.isValid()) return 0;
131 
133 
134  TransientTrackingRecHit::RecHitPointer newtth = refitHit( tth, state);
135 
136  if (!checkHit(state,newtth,es)) return 0;
137 
138  updatedState = updator.update(state, *newtth);
139  if (!updatedState.isValid()) return 0;
140 
141  seedHits.push_back(newtth->hit()->clone());
142  }
143 
144  TrajectoryStateTransform transformer;
145  boost::shared_ptr<PTrajectoryStateOnDet> PTraj(
146  transformer.persistentState(updatedState, hit->geographicalId().rawId()));
147 
148  seedCollection.push_back( TrajectorySeed(*PTraj,seedHits,alongMomentum));
149  return &seedCollection.back();
150 }
virtual bool checkHit(const TrajectoryStateOnSurface &, const TransientTrackingRecHit::ConstRecHitPointer &hit, const edm::EventSetup &es) const
virtual TransientTrackingRecHit::RecHitPointer refitHit(const TransientTrackingRecHit::ConstRecHitPointer &hit, const TrajectoryStateOnSurface &state) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void push_back(D *&d)
Definition: OwnVector.h:288
PTrajectoryStateOnDet * persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid) const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:9
const T & get() const
Definition: EventSetup.h:55
char state
Definition: procUtils.cc:75
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const
Definition: KFUpdator.cc:10
unsigned int size() const
Definition: SeedingHitSet.h:14
DetId geographicalId() const
virtual bool SeedFromConsecutiveHitsCreator::checkHit ( const TrajectoryStateOnSurface ,
const TransientTrackingRecHit::ConstRecHitPointer hit,
const edm::EventSetup es 
) const
inlineprotectedvirtual

Definition at line 29 of file SeedFromConsecutiveHitsCreator.h.

Referenced by buildSeed().

32  { return true; }
CurvilinearTrajectoryError SeedFromConsecutiveHitsCreator::initialError ( const TrackingRegion region,
float  sinTheta 
) const
protectedvirtual

Definition at line 75 of file SeedFromConsecutiveHitsCreator.cc.

References funct::C, GlobalErrorBase< T, ErrorWeightType >::cxx(), GlobalErrorBase< T, ErrorWeightType >::czz(), max(), TrackingRegion::originRBound(), TrackingRegion::originZBound(), TrackingRegion::ptMin(), ExpressReco_HICollisions_FallBack::ptMin, and funct::sqr().

Referenced by trajectorySeed().

76 {
77  // Set initial uncertainty on track parameters, using only P.V. constraint and no hit
78  // information.
79  GlobalError vertexErr( sqr(region.originRBound()), 0, sqr(region.originRBound()),
80  0, 0, sqr(region.originZBound()));
81 
82  float ptMin = region.ptMin();
83 
84 
85  AlgebraicSymMatrix C(5,1);
86 
87 // FIXME: minC00. Prevent apriori uncertainty in 1/P from being too small,
88 // to avoid instabilities.
89 // N.B. This parameter needs optimising ...
90  float sin2th = sqr(sinTheta);
91  float minC00 = 1.0;
92  C[0][0] = std::max(sin2th/sqr(ptMin), minC00);
93  float zErr = vertexErr.czz();
94  float transverseErr = vertexErr.cxx(); // assume equal cxx cyy
95  C[3][3] = transverseErr;
96  C[4][4] = zErr*sin2th + transverseErr*(1-sin2th);
97 
99 }
virtual float ptMin() const =0
minimal pt of interest
const T & max(const T &a, const T &b)
virtual float originRBound() const =0
bounds the particle vertex in the transverse plane
virtual float originZBound() const =0
bounds the particle vertex in the longitudinal plane
Square< F >::type sqr(const F &f)
Definition: Square.h:13
CLHEP::HepSymMatrix AlgebraicSymMatrix
GlobalTrajectoryParameters SeedFromConsecutiveHitsCreator::initialKinematic ( const SeedingHitSet hits,
const TrackingRegion region,
const edm::EventSetup es 
) const
protectedvirtual

Reimplemented in SeedFromConsecutiveHitsStraightLineCreator, and SeedFromConsecutiveHitsTripletOnlyCreator.

Definition at line 39 of file SeedFromConsecutiveHitsCreator.cc.

References abs, GlobalTrajectoryParameters::charge(), ExpressReco_HICollisions_FallBack::e, edm::EventSetup::get(), GlobalTrajectoryParameters::momentum(), TrackingRegion::origin(), GlobalTrajectoryParameters::position(), theBOFFMomentum, and Vector3DBase< T, FrameTag >::unit().

Referenced by trajectorySeed().

43 {
45  es.get<IdealMagneticFieldRecord>().get(bfield);
46 
48 
51  const GlobalPoint& vertexPos = region.origin();
52 
53  FastHelix helix(tth2->globalPosition(), tth1->globalPosition(), vertexPos, es);
54  if (helix.isValid()) {
55  kine = helix.stateAtVertex().parameters();
56  } else {
57  GlobalVector initMomentum(tth2->globalPosition() - vertexPos);
58  initMomentum *= (100./initMomentum.perp());
59  kine = GlobalTrajectoryParameters(vertexPos, initMomentum, 1, &*bfield);
60  }
61 
62  bool isBOFF = ( std::abs(bfield->inTesla(GlobalPoint(0,0,0)).z()) < 1e-3 );
63  if (isBOFF && (theBOFFMomentum > 0)) {
65  kine.momentum().unit() * theBOFFMomentum,
66  kine.charge(),
67  &*bfield);
68  }
69  return kine;
70 }
virtual GlobalPoint origin() const =0
#define abs(x)
Definition: mlp_lapack.h:159
Vector3DBase unit() const
Definition: Vector3DBase.h:57
const T & get() const
Definition: EventSetup.h:55
TransientTrackingRecHit::RecHitPointer SeedFromConsecutiveHitsCreator::refitHit ( const TransientTrackingRecHit::ConstRecHitPointer hit,
const TrajectoryStateOnSurface state 
) const
protectedvirtual

Definition at line 152 of file SeedFromConsecutiveHitsCreator.cc.

Referenced by buildSeed().

155 {
156  return hit->clone(state);
157 }
const TrajectorySeed * SeedFromConsecutiveHitsCreator::trajectorySeed ( TrajectorySeedCollection seedCollection,
const SeedingHitSet ordered,
const TrackingRegion region,
const edm::EventSetup es 
)
virtual

Implements SeedCreator.

Definition at line 21 of file SeedFromConsecutiveHitsCreator.cc.

References buildSeed(), error, initialError(), initialKinematic(), GlobalTrajectoryParameters::momentum(), funct::sin(), SeedingHitSet::size(), and PV3DBase< T, PVType, FrameType >::theta().

Referenced by SeedFromConsecutiveHits::SeedFromConsecutiveHits().

26 {
27  if ( hits.size() < 2) return 0;
28 
29  GlobalTrajectoryParameters kine = initialKinematic(hits, region, es);
30  float sinTheta = sin(kine.momentum().theta());
31 
32  CurvilinearTrajectoryError error = initialError(region, sinTheta);
33  FreeTrajectoryState fts(kine, error);
34 
35  return buildSeed(seedCollection,hits,fts,es);
36 }
virtual const TrajectorySeed * buildSeed(TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const FreeTrajectoryState &fts, const edm::EventSetup &es) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual GlobalTrajectoryParameters initialKinematic(const SeedingHitSet &hits, const TrackingRegion &region, const edm::EventSetup &es) const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:69
virtual CurvilinearTrajectoryError initialError(const TrackingRegion &region, float sinTheta) const

Member Data Documentation

double SeedFromConsecutiveHitsCreator::theBOFFMomentum
protected
std::string SeedFromConsecutiveHitsCreator::thePropagatorLabel
protected

Definition at line 54 of file SeedFromConsecutiveHitsCreator.h.

Referenced by buildSeed().