15 #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;
103 if(result &&
fSurf.get() == 0)
110 for(
unsigned int i=0; i<
fVec.size(); ++i) {
151 else if(apdg == 2212)
174 throw cet::exception(
"KTrack") <<
"Position requested for invalid track.\n";
188 double ptx = std::sqrt(mom[1]*mom[1] + mom[2]*mom[2]);
190 if(ptx > 0. || mom[0] > 0.)
191 result = atan2(mom[0], ptx);
206 if(mom[1] != 0. || mom[2] != 0.)
207 result = atan2(mom[1], mom[2]);
221 throw cet::exception(
"KTrack") <<
"Momentum vector requested for invalid track.\n";
235 double p = std::sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]);
244 "BACKWARD" :
"UNKNOWN" )) <<
"\n" 246 <<
" Surface: " << *
fSurf <<
"\n" 247 <<
" Track parameters:\n" 249 for(
unsigned int i = 0; i <
fVec.size(); ++i) {
255 out <<
" Position: [" << xyz[0] <<
", " << xyz[1] <<
", " << xyz[2] <<
"]\n";
256 out <<
" Direction: [" << dir[0] <<
", " << dir[1] <<
", " << dir[2] <<
"]\n";
257 out <<
" X-Latitude = " <<
XLatitude() <<
"\n";
258 out <<
" X-Longitude = " <<
XLongitude() <<
"\n";
265 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.