12 #include "cetlib_except/exception.h" 20 const double mumass = 0.105658367;
21 const double pimass = 0.13957;
22 const double kmass = 0.493677;
23 const double pmass = 0.938272;
92 if (result &&
fSurf.get() == 0) result =
false;
98 for (
unsigned int i = 0; i <
fVec.size(); ++i) {
108 if (result && !
fSurf->isTrackValid(
fVec)) result =
false;
123 if (apdg == 13) mass = mumass;
127 else if (apdg == 211)
132 else if (apdg == 321)
137 else if (apdg == 2212)
173 double ptx = std::sqrt(mom[1] * mom[1] + mom[2] * mom[2]);
175 if (ptx > 0. || mom[0] > 0.) result = atan2(mom[0], ptx);
190 if (mom[1] != 0. || mom[2] != 0.) result = atan2(mom[1], mom[2]);
204 throw cet::exception(
"KTrack") <<
"Momentum vector requested for invalid track.\n";
212 if (doTitle) out <<
"KTrack:\n";
217 double p = std::sqrt(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
223 out <<
" Surface direction = " 228 <<
" Surface: " << *
fSurf <<
"\n" 229 <<
" Track parameters:\n" 231 for (
unsigned int i = 0; i <
fVec.size(); ++i) {
232 if (i != 0) out <<
", ";
236 out <<
" Position: [" << xyz[0] <<
", " << xyz[1] <<
", " << xyz[2] <<
"]\n";
237 out <<
" Direction: [" << dir[0] <<
", " << dir[1] <<
", " << dir[2] <<
"]\n";
238 out <<
" X-Latitude = " <<
XLatitude() <<
"\n";
239 out <<
" X-Longitude = " <<
XLongitude() <<
"\n";
246 return trk.
Print(out);
TrackVector fVec
Track state vector.
TrackDirection
Track direction enum.
std::shared_ptr< const Surface > fSurf
Track surface.
double Mass() const
Based on pdg code.
double XLongitude() const
Get x-longitude.
constexpr auto abs(T v)
Returns the absolute value of the argument.
int fPdgCode
Pdg id. hypothesis.
bool isfinite(Vector const &v)
Returns whether all components of the vector are finite.
std::ostream & operator<<(std::ostream &out, const KGTrack &trg)
Output operator.
void getPosition(double xyz[3]) const
Get position of track.
virtual ~KTrack()
Destructor.
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Surface::TrackDirection fDir
Track direction.
void getMomentum(double mom[3]) const
Get momentum vector of track.
Surface::TrackDirection getDirection() const
Track direction.
Basic Kalman filter track class, without error.
cet::coded_exception< error, detail::translate > exception
bool isValid() const
Test if track is valid.
double XLatitude() const
Get x-latitude.