CMS 3D CMS Logo

SeedFromConsecutiveHitsTripletOnlyCreator.cc
Go to the documentation of this file.
2 
11 
13  const SeedingHitSet & hits) const {
14 
15  SeedingHitSet::ConstRecHitPointer tth1 = hits[0];
16  SeedingHitSet::ConstRecHitPointer tth2 = hits[1];
17 
18 
19 
20  if (hits.size()==3 && !( trackerHitRTTI::isSingleType(*hits[2]) && (hits[2]->geographicalId().subdetId()==SiStripDetId::TID ||
21  hits[2]->geographicalId().subdetId()==SiStripDetId::TEC )
22  ) ) {
23  //if 3rd hit is mono and endcap pT is not well defined so take initial state from pair
24  SeedingHitSet::ConstRecHitPointer tth3 = hits[2];
25  FastHelix helix(tth3->globalPosition(), tth2->globalPosition(), tth1->globalPosition(), nomField, &*bfield, tth1->globalPosition());
26  kine = helix.stateAtVertex();
27  if UNLIKELY(isBOFF && (theBOFFMomentum > 0)) {
28  kine = GlobalTrajectoryParameters(kine.position(),
29  kine.momentum().unit() * theBOFFMomentum,
30  kine.charge(),
31  &*bfield);
32  }
33  return (filter ? filter->compatible(hits, kine, helix) : true);
34  }
35 
36  const GlobalPoint& vertexPos = region->origin();
37 
38  FastHelix helix(tth2->globalPosition(), tth1->globalPosition(), vertexPos, nomField,&*bfield);
39  if (helix.isValid()) {
40  kine = helix.stateAtVertex();
41  } else {
42  GlobalVector initMomentum(tth2->globalPosition() - vertexPos);
43  initMomentum *= (100./initMomentum.perp());
44  kine = GlobalTrajectoryParameters(vertexPos, initMomentum, 1, &*bfield);
45  }
46 
47  if UNLIKELY(isBOFF && (theBOFFMomentum > 0)) {
49  kine.momentum().unit() * theBOFFMomentum,
50  kine.charge(),
51  &*bfield);
52  }
53  return (filter ? filter->compatible(hits, kine, helix) : true);
54 }
bool isSingleType(TrackingRecHit const &hit)
GlobalPoint const & origin() const
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:11
virtual bool compatible(const SeedingHitSet &hits) const =0
bool initialKinematic(GlobalTrajectoryParameters &kine, const SeedingHitSet &hits) const override
Vector3DBase unit() const
Definition: Vector3DBase.h:57
unsigned int size() const
Definition: SeedingHitSet.h:46
edm::ESHandle< MagneticField > bfield
#define UNLIKELY(x)