CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryStateClosestToPoint.cc
Go to the documentation of this file.
3 
4 // Private constructor
5 
7 TrajectoryStateClosestToPoint(const FTS& originalFTS, const GlobalPoint& referencePoint) :
8  valid(true), theFTS(originalFTS), theFTSavailable(true), theRefPoint(referencePoint)
9 {
10  try {
11  theParameters = perigeeConversions.ftsToPerigeeParameters(originalFTS, referencePoint, thePt);
12  if (theFTS.hasError()) {
14  errorIsAvailable = true;
15  }
16  else {
17  errorIsAvailable = false;
18  }
19  theField = &(originalFTS.parameters().magneticField());
20  } catch (const cms::Exception &ex) {
21  if (ex.category() != "PerigeeConversions") throw;
22  edm::LogWarning("TrajectoryStateClosestToPoint_PerigeeConversions") << "Caught exception " << ex.explainSelf() << ".\n";
23  valid = false;
24  }
25 }
26 
27 
35 TrajectoryStateClosestToPoint(const PerigeeTrajectoryParameters& perigeeParameters, double pt,
36  const GlobalPoint& referencePoint, const MagneticField* field) :
37  valid(true), theField(field), theFTSavailable(false), theRefPoint(referencePoint),
38  theParameters(perigeeParameters), thePt( pt ), errorIsAvailable(false)
39 {}
40 
48 TrajectoryStateClosestToPoint(const PerigeeTrajectoryParameters& perigeeParameters, double pt,
49  const PerigeeTrajectoryError& perigeeError, const GlobalPoint& referencePoint,
50  const MagneticField* field):
51  valid(true), theField(field), theFTSavailable(false), theRefPoint(referencePoint),
52  theParameters(perigeeParameters), thePt( pt ), thePerigeeError(perigeeError),
53  errorIsAvailable(true)
54 
55 {}
56 
57 
59 {
60  if(!isValid()) throw TrajectoryStateException(
61  "TrajectoryStateClosestToPoint is invalid and cannot return any parameters");
66  if (errorIsAvailable) {
68  } else {
69  theFTS = FTS(gtp);
70  }
71  theFTSavailable = true;
72 }
const GlobalTrajectoryParameters & parameters() const
virtual std::string explainSelf() const
Definition: Exception.cc:146
PerigeeTrajectoryParameters ftsToPerigeeParameters(const FTS &originalFTS, const GlobalPoint &referencePoint, double &pt) const
GlobalVector momentumFromPerigee(const AlgebraicVector3 &momentum, const TrackCharge &charge, const GlobalPoint &referencePoint, const MagneticField *field) const
std::string const & category() const
Definition: Exception.cc:183
CurvilinearTrajectoryError curvilinearError(const PerigeeTrajectoryError &perigeeError, const GlobalTrajectoryParameters &gtp) const
TrajectoryStateClosestToPoint()
parameter dimension
GlobalPoint positionFromPerigee(const PerigeeTrajectoryParameters &parameters, const GlobalPoint &referencePoint) const
PerigeeTrajectoryError ftsToPerigeeError(const FTS &originalFTS) const
const MagneticField & magneticField() const
PerigeeTrajectoryParameters theParameters