EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairRecoCandidate.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairRecoCandidate.cxx
1 
2 // //
3 // VAbsMicroCandidate //
4 // //
5 // Definition of an abstract interface to a micro candidate. //
6 // //
7 // Author: Sascha Berger and Marcel Kunze, RUB, March 1999 //
8 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
9 // //
11 
12 #include "TVector3.h"
13 #include "FairRecoCandidate.h"
14 
16 
17 TBuffer &operator>>(TBuffer &buf, FairRecoCandidate *&obj)
18 {
19  obj = (FairRecoCandidate *) buf.ReadObject(FairRecoCandidate::Class());
20  return buf;
21 }
22 
23 #include <iostream>
24 using namespace std;
25 
26 void FairRecoCandidate::PrintOn(std::ostream &o) const
27 {
28  o << " ======= Fit Params ======= " << endl;
29  TVector3 r = GetPosition();
30  TVector3 p = GetMomentum();
31  o << " Position : (" << r.X() << ";" << r.Y() << ";" << r.Z() << ")" << endl;
32  o << " Momentum : (" << p.X() << ";" << p.Y() << ";" << p.Z() << ")" << endl;
33  o << " Momentum.mag : " << p.Mag() << endl;
34  o << " Charge : " << GetCharge() << endl;
35  o << " Energy : " << GetEnergy() << endl;
36 
37  if (GetCharge() != 0) {
38  o << " ======= Track Quality ======= "
39  << "\n Fit quality : Ndof " << GetDegreesOfFreedom()<< " chi2 " << GetChiSquared()
40  << endl;//"\n track length : " << GetTrackLength()<<endl;
41  }
42 
43 }
44 
45 std::ostream& operator << (std::ostream& o, const FairRecoCandidate& a) { a.PrintOn(o); return o; }