14 #include "cetlib_except/exception.h" 19 const double mumass = 0.105658367;
20 const double pimass = 0.13957;
21 const double kmass = 0.493677;
22 const double pmass = 0.938272;
102 if(result &&
fSurf.get() == 0)
109 for(
unsigned int i=0; i<
fVec.size(); ++i) {
150 else if(apdg == 2212)
173 throw cet::exception(
"KTrack") <<
"Position requested for invalid track.\n";
187 double ptx = std::sqrt(mom[1]*mom[1] + mom[2]*mom[2]);
189 if(ptx > 0. || mom[0] > 0.)
190 result = atan2(mom[0], ptx);
205 if(mom[1] != 0. || mom[2] != 0.)
206 result = atan2(mom[1], mom[2]);
220 throw cet::exception(
"KTrack") <<
"Momentum vector requested for invalid track.\n";
234 double p = std::sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]);
243 "BACKWARD" :
"UNKNOWN" )) <<
"\n" 245 <<
" Surface: " << *
fSurf <<
"\n" 246 <<
" Track parameters:\n" 248 for(
unsigned int i = 0; i <
fVec.size(); ++i) {
254 out <<
" Position: [" << xyz[0] <<
", " << xyz[1] <<
", " << xyz[2] <<
"]\n";
255 out <<
" Direction: [" << dir[0] <<
", " << dir[1] <<
", " << dir[2] <<
"]\n";
256 out <<
" X-Latitude = " <<
XLatitude() <<
"\n";
257 out <<
" X-Longitude = " <<
XLongitude() <<
"\n";
264 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.
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.