CMS 3D CMS Logo

Functions
fw Namespace Reference

Functions

double estimate_field (const reco::Track &track, bool highQuality=false)
 
double estimate_field (double vx1, double vy1, double vx2, double vy2, double px, double py)
 

Function Documentation

◆ estimate_field() [1/2]

double fw::estimate_field ( const reco::Track track,
bool  highQuality = false 
)

Definition at line 11 of file estimate_field.cc.

11  {
12  if (!track.extra().isAvailable())
13  return -1;
14  // We have 3 states so we can form 3 pairs to check for curvature
15  // In practice we want to avoid estimates over lost of material and
16  // in regions with small field. Therefore we should look at the pair
17  // based on POCA and closest state to it. Than we will estimate the
18  // filed inside the solenoid.
19  double estimate = -1;
20  if (pow(track.outerPosition().x() - track.vx(), 2) + pow(track.outerPosition().y() - track.vy(), 2) <
21  pow(track.innerPosition().x() - track.vx(), 2) + pow(track.innerPosition().y() - track.vy(), 2)) {
22  estimate = estimate_field(
23  track.outerPosition().x(), track.outerPosition().y(), track.vx(), track.vy(), track.px(), track.py());
24  } else {
25  estimate = estimate_field(
26  track.innerPosition().x(), track.innerPosition().y(), track.vx(), track.vy(), track.px(), track.py());
27  }
28 
29  if (highQuality) {
30  if (fabs(track.outerMomentum().rho() / track.pt() - 1) < 0.1 && track.innerPosition().rho() < 129 &&
31  track.outerPosition().rho() < 129) {
32  /*printf("outer-poca: \tPOCA Pt: %0.2f, \tinner Rho: %0.1f, \touter Rho: %0.1f, \tchange in pt: %0.1f%%, \testimate: %0.2f\n",
33  track.pt(), track.innerPosition().rho(), track.outerPosition().rho(),
34  fabs( track.outerMomentum().rho()/track.pt()-1 )*100, estimate);*/
35  return estimate;
36  } else {
37  return -1;
38  }
39  } else
40  return estimate;
41 }

References PFTrackAlgoTools::highQuality(), funct::pow(), and HLT_2018_cff::track.

Referenced by FWTrackProxyBuilder::build(), FWMuonBuilder::calculateField(), FWPFTrackUtils::setupLegoTrack(), and FWPFTrackUtils::setupTrack().

◆ estimate_field() [2/2]

double fw::estimate_field ( double  vx1,
double  vy1,
double  vx2,
double  vy2,
double  px,
double  py 
)

Definition at line 43 of file estimate_field.cc.

43  {
44  math::XYZVector displacement(vx2 - vx1, vy2 - vy1, 0);
45  math::XYZVector transverseMomentum(px, py, 0);
46  double cosAlpha = transverseMomentum.Dot(displacement) / transverseMomentum.r() / displacement.r();
47  return 200 * sqrt(1 - cosAlpha * cosAlpha) / 0.2998 * transverseMomentum.r() / displacement.r();
48 }

References multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, and mathSSE::sqrt().

multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
PFTrackAlgoTools::highQuality
bool highQuality(const reco::TrackBase::TrackAlgorithm &)
Definition: PFTrackAlgoTools.cc:193
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
fw::estimate_field
double estimate_field(const reco::Track &track, bool highQuality=false)
Definition: estimate_field.cc:11