CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SeedFromConsecutiveHitsTripletOnlyCreator.cc
Go to the documentation of this file.
2 
11 
12 bool SeedFromConsecutiveHitsTripletOnlyCreator::initialKinematic(GlobalTrajectoryParameters & kine,
13  const SeedingHitSet & hits) const {
14 
15 
18 
19  if (hits.size()==3 && !(hits[2]->transientHits().size()==1 && (hits[2]->geographicalId().subdetId()==SiStripDetId::TID ||
20  hits[2]->geographicalId().subdetId()==SiStripDetId::TEC ) ) ) {
21  //if 3rd hit is mono and endcap pT is not well defined so take initial state from pair
23  FastHelix helix(tth3->globalPosition(), tth2->globalPosition(), tth1->globalPosition(), nomField, &*bfield, tth1->globalPosition());
24  kine = helix.stateAtVertex();
25  if unlikely(isBOFF && (theBOFFMomentum > 0)) {
26  kine = GlobalTrajectoryParameters(kine.position(),
27  kine.momentum().unit() * theBOFFMomentum,
28  kine.charge(),
29  &*bfield);
30  }
31  return (filter ? filter->compatible(hits, kine, helix, *region) : true);
32  }
33 
34  const GlobalPoint& vertexPos = region->origin();
35 
36  FastHelix helix(tth2->globalPosition(), tth1->globalPosition(), vertexPos, nomField,&*bfield);
37  if (helix.isValid()) {
38  kine = helix.stateAtVertex();
39  } else {
40  GlobalVector initMomentum(tth2->globalPosition() - vertexPos);
41  initMomentum *= (100./initMomentum.perp());
42  kine = GlobalTrajectoryParameters(vertexPos, initMomentum, 1, &*bfield);
43  }
44 
45  if unlikely(isBOFF && (theBOFFMomentum > 0)) {
46  kine = GlobalTrajectoryParameters(kine.position(),
47  kine.momentum().unit() * theBOFFMomentum,
48  kine.charge(),
49  &*bfield);
50  }
51  return (filter ? filter->compatible(hits, kine, helix, *region) : true);
52 }
#define unlikely(x)
Definition: Likely.h:21
unsigned int size() const
Definition: SeedingHitSet.h:41
GlobalTrajectoryParameters stateAtVertex() const
Definition: FastHelix.h:65