CMS 3D CMS Logo

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