#include <TrState.h>
Public Types | |
enum | Type { HasMomentum, StraightLine } |
enum | Location { BegVelo, EndVelo, AtTT, AtT, BegRICH1, EndRICH1, BegRICH2, EndRICH2, Calo, Muon } |
Public Methods | |
TrState () | |
Default constructor. State defined to be of type TrState::HasMomentum. More... | |
TrState (const Type &type) | |
Constructor with specification of the state type. More... | |
TrState (const TrState &state) | |
Copy constructor. More... | |
virtual | ~TrState () |
Destructor. More... | |
virtual const CLID & | clID () const |
Retrieve pointer to class definition structure. More... | |
unsigned int | nParameters () const |
Retrieve the number of state parameters. More... | |
void | positionAndMomentum (HepPoint3D &pos, HepVector3D &mom, HepSymMatrix &cov6D) |
Retrieve the position and momentum vectors and the corresponding 6D covariance matrix (pos:1->3,mom:4-6) of the state. More... | |
HepPoint3D | position () |
Retrieve the 3D-position vector of the state. More... | |
double | x () const |
Retrieve the x-position of the state. More... | |
double | y () const |
Retrieve the y-position of the state. More... | |
double | z () const |
Retrieve the z-position of the state. More... | |
HepVector3D | slopes () const |
Retrieve the slopes (Tx=dx/dz,Ty=dy/dz,1.) of the state. More... | |
double | tx () const |
Retrieve the Tx=dx/dz slope of the state. More... | |
double | ty () const |
Retrieve the Ty=dy/dz slope of the state. More... | |
virtual double | qOverP () const |
Retrieve the charge-over-momentum Q/P of the state. More... | |
virtual double | p () const |
Retrieve the momentum of the state. More... | |
virtual double | pt () const |
Retrieve the transverse momentum of the state. More... | |
HepVector3D | momentum () const |
Retrieve the momentum vector of the state. More... | |
double | qOverPperp () const |
Retrieve the Q/Pperp (ratio of the charge to the component of the momentum transverse to the magnetic field) of the state. More... | |
virtual HepSymMatrix | posMomCovariance () const |
Retrieve the 6D covariance matrix (x,y,z,px,py,pz) of the state. More... | |
HepSymMatrix | errPosition () const |
Retrieve the errors on the 3D-position vector of the state. More... | |
double | errX2 () const |
Retrieve the squared error on the x-position of the state. More... | |
double | errY2 () const |
Retrieve the squared error on the y-position of the state. More... | |
HepSymMatrix | errSlopes () const |
Retrieve the errors on the slopes of the state. More... | |
double | errTx2 () const |
Retrieve the squared error on the x-slope Tx=dx/dz of the state. More... | |
double | errTy2 () const |
Retrieve the squared error on the y-slope Ty=dy/dz of the state. More... | |
virtual double | errQOverP2 () const |
Retrieve the squared error on the charge-over-momentum Q/P of the state. More... | |
virtual double | errP2 () const |
Retrieve the squared error on the momentum of the state. More... | |
HepSymMatrix | errMomentum () const |
Retrieve the errors on the momentum vector of the state. More... | |
virtual double | errQOverPperp2 () const |
Retrieve the squared error on the Q/Pperp of the state. More... | |
virtual TrState * | clone () |
Clone the state. More... | |
virtual void | reset () |
Clear the state before re-using it. More... | |
void | setState (const HepVector &state) |
Update the state vector. More... | |
virtual void | setState (double x, double y, double z, double tx, double ty, double qOverP) |
Update the state vector (presumably of type TrState::HasMomentum). More... | |
void | setState (double x, double y, double z, double tx, double ty) |
Update the state vector (presumably of type TrState::StraightLine). More... | |
void | setCovariance (const HepSymMatrix &value) |
Update the state covariance. More... | |
void | setX (double value) |
Update the x-position of the state. More... | |
void | setY (double value) |
Update the y-position of the state. More... | |
void | setTx (double value) |
Update the Tx slope of the state. More... | |
void | setTy (double value) |
Update the Ty slope of the state. More... | |
virtual void | setQOverP (double value) |
Update the Q/P value of the state. More... | |
unsigned int | type () const |
Retrieve the type of the state. More... | |
unsigned int | location () const |
Retrieve the location of the state. More... | |
void | setLocation (unsigned int value) |
Update the location of the state. More... | |
const HepVector & | state () const |
Retrieve the state vector. More... | |
HepVector & | state () |
Retrieve the state vector (non-const). More... | |
const HepSymMatrix & | covariance () const |
Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p). More... | |
HepSymMatrix & | covariance () |
Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p) (non-const). More... | |
virtual StreamBuffer & | serialize (StreamBuffer &s) const |
Serialize the object for writing. More... | |
virtual StreamBuffer & | serialize (StreamBuffer &s) |
Serialize the object for reading. More... | |
virtual std::ostream & | fillStream (std::ostream &s) const |
Fill the ASCII output stream. More... | |
Static Public Methods | |
const CLID & | classID () |
Private Attributes | |
unsigned int | m_type |
the type of the state. More... | |
unsigned int | m_location |
the location of the state. More... | |
HepVector | m_state |
the state vector. More... | |
HepSymMatrix | m_covariance |
the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p). More... | |
double | m_z |
the z-position of the state. More... |
Definition at line 51 of file TrState.h.
|
Definition at line 57 of file TrState.h.
|
|
Definition at line 56 of file TrState.h.
00056 {HasMomentum,StraightLine}; |
|
Default constructor. State defined to be of type TrState::HasMomentum.
Definition at line 16 of file TrState.cpp. References HasMomentum, m_covariance, m_state, m_type, and m_z. Referenced by clone.
00016 { 00017 m_type = TrState::HasMomentum; 00018 m_z = 0.; 00019 m_state = HepVector(5,0); 00020 m_covariance = HepSymMatrix(5,0); 00021 } |
|
Constructor with specification of the state type.
Definition at line 26 of file TrState.cpp. References m_covariance, m_state, m_type, m_z, and type.
00026 : 00027 KeyedObject<int>() 00028 { 00029 m_type = type; 00030 m_z = 0.; 00031 m_state = HepVector(5,0); 00032 m_covariance = HepSymMatrix(5,0); 00033 } |
|
Copy constructor.
Definition at line 38 of file TrState.cpp. References m_covariance, m_state, m_type, m_z, and state.
00038 : 00039 KeyedObject<int>() 00040 { 00041 m_type = state.type(); 00042 m_z = state.z(); 00043 m_state = state.state(); 00044 m_covariance = state.covariance(); 00045 } |
|
Destructor.
Definition at line 69 of file TrState.h.
00069 {} |
|
Definition at line 235 of file TrState.h. References CLID_TrState. Referenced by clID.
00236 { 00237 return CLID_TrState; 00238 } |
|
Retrieve pointer to class definition structure.
Definition at line 230 of file TrState.h. References classID.
00231 { 00232 return TrState::classID(); 00233 } |
|
Clone the state.
Definition at line 138 of file TrState.cpp. References TrState.
00139 { 00140 return new TrState(*this); 00141 }; |
|
Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p) (non-const).
Definition at line 473 of file TrState.h. References m_covariance.
00474 { 00475 return m_covariance; 00476 } |
|
Retrieve the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p).
Definition at line 468 of file TrState.h. References m_covariance. Referenced by posMomCovariance.
00469 { 00470 return m_covariance; 00471 } |
|
Retrieve the errors on the momentum vector of the state.
Definition at line 369 of file TrState.h. References HasMomentum, m_type, and posMomCovariance.
00370 { 00371 00372 if ( m_type == TrState::HasMomentum ) { 00373 return posMomCovariance().sub(4,6); 00374 } 00375 else { 00376 // print out an error message ... 00377 return HepSymMatrix(3,0); 00378 } 00379 00380 } |
|
Retrieve the squared error on the momentum of the state.
Definition at line 100 of file TrState.cpp. References errQOverP2, and m_state.
00101 { 00102 if ( m_state[4] != 0. ) return errQOverP2() / pow( m_state[4], 4. ); 00103 return 0.; 00104 }; |
|
Retrieve the errors on the 3D-position vector of the state.
Definition at line 322 of file TrState.h. References posMomCovariance.
00323 { 00324 00325 return posMomCovariance().sub(1,3); 00326 00327 } |
|
Retrieve the squared error on the charge-over-momentum Q/P of the state.
Definition at line 92 of file TrState.cpp. References m_covariance. Referenced by errP2.
00093 { 00094 return m_covariance.fast(5,5); 00095 }; |
|
Retrieve the squared error on the Q/Pperp of the state.
Definition at line 109 of file TrState.cpp. References m_covariance, qOverP, tx, and ty.
00110 { 00111 double tx2 = tx() * tx(); 00112 double ty2 = ty() * ty(); 00113 double qOverP2 = qOverP() * qOverP(); 00114 double transSlope = 1. + tx2; 00115 double norm = 1 + tx2 + ty2; 00116 00117 double QOverPperpError = ( (norm/transSlope) * m_covariance[4][4] ) 00118 00119 + ( qOverP2 * tx2 * ty2*ty2 * m_covariance[2][2]/ 00120 (pow(transSlope,3.)*norm)) 00121 00122 + ( qOverP2 * ty2 * m_covariance[3][3] / (norm*transSlope) ) 00123 00124 - ( 2. * qOverP() * tx() * ty2 * m_covariance[2][4] 00125 / ( transSlope*transSlope ) ) 00126 00127 + 2. * qOverP() * ty() * m_covariance[3][4] / transSlope 00128 00129 - 2. * ( qOverP2 * tx() * ty() * ty2 * m_covariance[2][3] 00130 / ( norm* transSlope*transSlope ) ); 00131 00132 return QOverPperpError; 00133 }; |
|
Retrieve the errors on the slopes of the state.
Definition at line 343 of file TrState.h. References m_covariance.
00344 { 00345 00346 HepSymMatrix err = m_covariance.sub(3,5); 00347 err.fast(2,1) = 0.; 00348 err.fast(3,1) = 0.; 00349 err.fast(3,2) = 0.; 00350 err.fast(3,3) = 0.; 00351 return err; 00352 00353 } |
|
Retrieve the squared error on the x-slope Tx=dx/dz of the state.
Definition at line 355 of file TrState.h. References m_covariance.
00356 { 00357 00358 return m_covariance.fast(3,3); 00359 00360 } |
|
Retrieve the squared error on the y-slope Ty=dy/dz of the state.
Definition at line 362 of file TrState.h. References m_covariance.
00363 { 00364 00365 return m_covariance.fast(4,4); 00366 00367 } |
|
Retrieve the squared error on the x-position of the state.
Definition at line 329 of file TrState.h. References m_covariance.
00330 { 00331 00332 return m_covariance.fast(1,1); 00333 00334 } |
|
Retrieve the squared error on the y-position of the state.
Definition at line 336 of file TrState.h. References m_covariance.
00337 { 00338 00339 return m_covariance.fast(2,2); 00340 00341 } |
|
Fill the ASCII output stream.
Definition at line 502 of file TrState.h. References m_covariance, m_location, m_state, m_type, and m_z.
00503 { 00504 s << "{ " 00505 << " type:\t" << m_type << std::endl 00506 << " location:\t" << m_location << std::endl 00507 << " state:\t" << m_state << std::endl 00508 << " covariance:\t" << m_covariance << std::endl 00509 << " z:\t" << (float)m_z << " } "; 00510 return s; 00511 } |
|
Retrieve the location of the state.
Definition at line 448 of file TrState.h. References m_location.
00449 { 00450 return m_location; 00451 } |
|
Retrieve the momentum vector of the state.
Definition at line 305 of file TrState.h. Referenced by positionAndMomentum.
|
|
Retrieve the number of state parameters.
Definition at line 240 of file TrState.h. References m_state. Referenced by setCovariance.
00241 { 00242 00243 return (unsigned int) m_state.num_row(); 00244 00245 } |
|
Retrieve the momentum of the state.
Definition at line 58 of file TrState.cpp. References m_state. Referenced by momentum.
|
|
Retrieve the 3D-position vector of the state.
Definition at line 256 of file TrState.h. Referenced by positionAndMomentum.
|
|
Retrieve the position and momentum vectors and the corresponding 6D covariance matrix (pos:1->3,mom:4-6) of the state.
Definition at line 247 of file TrState.h. References momentum, position, and posMomCovariance.
00248 { 00249 00250 pos = position(); 00251 mom = momentum(); 00252 cov6D = posMomCovariance(); 00253 00254 } |
|
Retrieve the 6D covariance matrix (x,y,z,px,py,pz) of the state.
Definition at line 80 of file TrState.cpp. References covariance. Referenced by errMomentum, errPosition, and positionAndMomentum.
00081 { 00082 HepSymMatrix cov = covariance(); 00083 // to be written ... 00084 00085 return cov; 00086 00087 }; |
|
Retrieve the transverse momentum of the state.
Definition at line 67 of file TrState.cpp. References m_state.
|
|
Retrieve the charge-over-momentum Q/P of the state.
Definition at line 50 of file TrState.cpp. References m_state. Referenced by errQOverPperp2, qOverPperp, and setState.
00051 { 00052 return m_state[4]; 00053 }; |
|
Retrieve the Q/Pperp (ratio of the charge to the component of the momentum transverse to the magnetic field) of the state.
Definition at line 314 of file TrState.h. References qOverP, tx, and ty.
|
|
Clear the state before re-using it.
Definition at line 146 of file TrState.cpp. References m_covariance, m_state, and m_z.
00147 { 00148 m_z = 0.; 00149 m_state = HepVector(5,0); 00150 m_covariance = HepSymMatrix(5,0); 00151 }; |
|
Serialize the object for reading.
Definition at line 489 of file TrState.h. References m_covariance, m_location, m_state, m_type, and m_z.
00490 { 00491 float l_z; 00492 KeyedObject<int>::serialize(s); 00493 s >> m_type 00494 >> m_location 00495 >> m_state 00496 >> m_covariance 00497 >> l_z; 00498 m_z = l_z; 00499 return s; 00500 } |
|
Serialize the object for writing.
Definition at line 478 of file TrState.h. References m_covariance, m_location, m_state, m_type, and m_z.
00479 { 00480 KeyedObject<int>::serialize(s); 00481 s << m_type 00482 << m_location 00483 << m_state 00484 << m_covariance 00485 << (float)m_z; 00486 return s; 00487 } |
|
Update the state covariance.
Definition at line 400 of file TrState.h. References m_covariance, and nParameters.
00401 { 00402 00403 if ( value.num_row() == (int) nParameters() ) { 00404 m_covariance = value; 00405 } 00406 else { 00407 std::cerr << "ERROR The dimension of the covariance matrix does not match that of the state!" 00408 << "ERROR Using the default covariance matrix." << std::endl; 00409 int dim = nParameters(); 00410 m_covariance = HepSymMatrix(dim,0); 00411 } 00412 00413 } |
|
Update the location of the state.
Definition at line 453 of file TrState.h. References m_location.
00454 { 00455 m_location = value; 00456 } |
|
Update the Q/P value of the state.
Definition at line 178 of file TrState.cpp. References m_state.
00179 { 00180 m_state[4] = value; 00181 }; |
|
Update the state vector (presumably of type TrState::StraightLine).
Definition at line 389 of file TrState.h. References m_state, m_z, tx, ty, x, y, and z.
|
|
Update the state vector (presumably of type TrState::HasMomentum).
Definition at line 156 of file TrState.cpp. References m_state, m_type, m_z, qOverP, StraightLine, tx, ty, x, y, and z.
00159 { 00160 m_state[0] = x; 00161 m_state[1] = y; 00162 m_state[2] = tx; 00163 m_state[3] = ty; 00164 m_z = z; 00165 if ( m_type == TrState::StraightLine ) { 00166 std::cerr 00167 << "ERROR You're trying to set the Q/P value for a state of type TrState::StraightLine!" 00168 << "ERROR This value will be discarded." << std::endl; 00169 } 00170 else { 00171 m_state[4] = qOverP; 00172 } 00173 }; |
|
Update the state vector.
Definition at line 382 of file TrState.h. References m_state, and state.
|
|
Update the Tx slope of the state.
Definition at line 429 of file TrState.h. References m_state.
00430 { 00431 00432 m_state[2] = value; 00433 00434 } |
|
Update the Ty slope of the state.
Definition at line 436 of file TrState.h. References m_state.
00437 { 00438 00439 m_state[3] = value; 00440 00441 } |
|
Update the x-position of the state.
Definition at line 415 of file TrState.h. References m_state.
00416 { 00417 00418 m_state[0] = value; 00419 00420 } |
|
Update the y-position of the state.
Definition at line 422 of file TrState.h. References m_state.
00423 { 00424 00425 m_state[1] = value; 00426 00427 } |
|
Retrieve the slopes (Tx=dx/dz,Ty=dy/dz,1.) of the state.
Definition at line 284 of file TrState.h. References m_state. Referenced by momentum.
|
|
Retrieve the state vector (non-const).
Definition at line 463 of file TrState.h. References m_state.
00464 { 00465 return m_state; 00466 } |
|
Retrieve the state vector.
Definition at line 458 of file TrState.h. References m_state. Referenced by setState, and TrState.
00459 { 00460 return m_state; 00461 } |
|
Retrieve the Tx=dx/dz slope of the state.
Definition at line 291 of file TrState.h. References m_state. Referenced by errQOverPperp2, qOverPperp, and setState.
00292 { 00293 00294 return m_state[2]; 00295 00296 } |
|
Retrieve the Ty=dy/dz slope of the state.
Definition at line 298 of file TrState.h. References m_state. Referenced by errQOverPperp2, qOverPperp, and setState.
00299 { 00300 00301 return m_state[3]; 00302 00303 } |
|
Retrieve the type of the state.
Definition at line 443 of file TrState.h. References m_type. Referenced by TrState.
00444 { 00445 return m_type; 00446 } |
|
Retrieve the x-position of the state.
Definition at line 263 of file TrState.h. References m_state. Referenced by setState.
00264 { 00265 00266 return m_state[0]; 00267 00268 } |
|
Retrieve the y-position of the state.
Definition at line 270 of file TrState.h. References m_state. Referenced by setState.
00271 { 00272 00273 return m_state[1]; 00274 00275 } |
|
Retrieve the z-position of the state.
Definition at line 277 of file TrState.h. References m_z. Referenced by setState.
00278 { 00279 00280 return m_z; 00281 00282 } |
|
the state covariance matrix (indexes 1,...,5 for x, y, tx, ty, Q/p).
Definition at line 220 of file TrState.h. Referenced by covariance, errQOverP2, errQOverPperp2, errSlopes, errTx2, errTy2, errX2, errY2, fillStream, reset, serialize, setCovariance, and TrState. |
|
the location of the state.
Definition at line 218 of file TrState.h. Referenced by fillStream, location, serialize, and setLocation. |
|
the state vector.
Definition at line 219 of file TrState.h. Referenced by errP2, fillStream, nParameters, p, position, pt, qOverP, reset, serialize, setQOverP, setState, setTx, setTy, setX, setY, slopes, state, TrState, tx, ty, x, and y. |
|
the type of the state.
Definition at line 217 of file TrState.h. Referenced by errMomentum, fillStream, serialize, setState, TrState, and type. |
|
the z-position of the state.
Definition at line 221 of file TrState.h. Referenced by fillStream, position, reset, serialize, setState, TrState, and z. |