00001 #include "UTIL/Operators.h"
00002
00003
00004
00005
00006
00007 using namespace std;
00008 using namespace EVENT;
00009
00010 namespace UTIL{
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 std::ostream& operator<<( std::ostream& out, const UTIL::lcio_short<EVENT::Vertex>& sV){
00042 const EVENT::Vertex* v = sV.obj;
00043
00044 out << setfill('0');
00045 out << " [" << setw(8) << hex << v->id() << "] | " << v->isPrimary()<< " | ";
00046 out << setfill(' ') << setw(17) << left << v->getAlgorithmType() << " | ";
00047
00048 out << setfill('0') << right << scientific << setprecision(3) << v->getChi2() << " | " << v->getProbability() << " | " <<
00049 v->getPosition()[0] << "," <<
00050 v->getPosition()[1] << "," <<
00051 v->getPosition()[2] << " | [" ;
00052
00053 out << setw(3) << v->getParameters().size() << "] | [";
00054 out << setw(8) << hex << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) << "]\n";
00055
00056 return out;
00057
00058 }
00059
00060 std::ostream& operator<<( std::ostream& out, const EVENT::Vertex* v){
00061
00062 out << setfill('0');
00063 out << "Vertex ID:\t\t[" << setw(8) << hex << v->id() << "]" << endl;
00064 out << "Is Primary Vertex:\t" << (v->isPrimary() ? "yes":"no") << endl;
00065 out << "Algorithm Type:\t" << v->getAlgorithmType() << endl;
00066 out << scientific << setprecision(5);
00067 out << "Chi2:\t\t\t" << v->getChi2() << endl;
00068 out << "Probability:\t\t" << v->getProbability() << endl;
00069 out << "Position (x, y, z):\t" <<
00070 v->getPosition()[0] <<", "<<
00071 v->getPosition()[1] <<", "<<
00072 v->getPosition()[2] << endl;
00073
00074 out << "Covariance Matrix:\t";
00075 for(unsigned int i=0; i<v->getCovMatrix().size(); i++)
00076 out << v->getCovMatrix()[i] << (i<(v->getCovMatrix().size()-1)?", ":"\n");
00077
00078 out << "Parameters:";
00079 if(v->getParameters().size()==0){
00080 out << "\t\t[Empty]" << endl;
00081 }
00082 else { out << endl; }
00083 for(unsigned int i=0; i < v->getParameters().size(); i++){
00084 out << " Parameter [";
00085 out << setw(3) << i << "]:\t";
00086 out << scientific << setprecision(5) << v->getParameters()[i] << endl;
00087 }
00088
00089 out << "Associated Reconstructed Particle ID:\t[";
00090 out << setw(8) << hex << (v->getAssociatedParticle()!=NULL?v->getAssociatedParticle()->id():0) <<"]\n\n";
00091
00092 return out;
00093 }
00094
00095 const std::string& header(const EVENT::Vertex* v){
00096
00097 static std::string _vtxh(
00098 "\n [id] |pri| alg. type | chi2 | prob. | position ( x, y, z) | [par] | [idRecP] \n");
00099 _vtxh+=tail(v);
00100 return _vtxh;
00101 }
00102
00103 const std::string& tail(const EVENT::Vertex* v){
00104
00105 static std::string _vtxt(
00106 "------------|---|-------------------|-----------|-----------|-------------------------------|-------|------------\n");
00107 return _vtxt;
00108 }
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 }
00137