00001
00002
00003
00004
00005
00006 #include <algorithm>
00007 #ifndef ST_NO_NAMESPACES
00008 using std::find;
00009 #endif
00010
00011 #include "StMcVertexC.h"
00012 #include "StMcTrack.hh"
00013
00014 static const char rcsid[] = "$Id: StMcVertexC.cxx,v 2.1 2010/05/04 23:58:43 fine Exp $";
00015
00016 int StMcVertexC::operator==(const StMcVertexC& v) const
00017 {
00018 return (geantProcess() == v.geantProcess() &&
00019 position() == v.position() &&
00020 tof() == v.tof() &&
00021 key() == v.key()
00022 ) ;
00023 }
00024
00025 #if 0
00026
00027 StMcVertexC::~StMcVertexC()
00028 {
00029 mDaughters.clear();
00030 }
00031
00032
00033 int StMcVertexC::operator==(const StMcVertexC& v) const
00034 {
00035 return (mGeantProcess == v.mGeantProcess &&
00036 mPosition == v.mPosition &&
00037 mTof == v.mTof &&
00038 mKey == v.mKey);
00039 }
00040
00041 int StMcVertexC::operator!=(const StMcVertexC& v) const
00042 {
00043 return !(v == *this);
00044 }
00045
00046 ostream& operator<<(ostream& os, const StMcVertexC& v)
00047 {
00048 os << "Position : " << Form("%8.3f%8.3f%8.3f",v.position().x(),v.position().y(),v.position().z()) << endl;
00049 os << "Geant Volume : " << v.geantVolume() << endl;
00050 os << "Time of Flight: " << v.tof() << endl;
00051 os << "Geant Process : " << v.geantProcess() << endl;
00052 Int_t nDaughters = v.numberOfDaughters();
00053 os << "N. Daughters : " << nDaughters;
00054
00055
00056
00057
00058 return os;
00059 }
00060
00061
00062 void StMcVertexC::setParent(StMcTrack* val) { mParent = val; }
00063
00064 void StMcVertexC::addDaughter(StMcTrack* val) { mDaughters.push_back(val); }
00065
00066 void StMcVertexC::setGeantVolume(const Char_t *val) { mGeantVolume = val; }
00067
00068 void StMcVertexC::setTof(float val) { mTof = val; }
00069
00070 void StMcVertexC::setGeantProcess(int val) { mGeantProcess = val; }
00071
00072 void StMcVertexC::removeDaughter(StMcTrack* trk) {
00073 StMcTrackIterator iter = find(mDaughters.begin(), mDaughters.end(), trk);
00074 if (iter != mDaughters.end()) mDaughters.erase(iter);
00075 }
00076
00077 void StMcVertexC::Print(Option_t *option) const {
00078 cout << "StMcVertexC: pos:" << Form("%8.3f%8.3f%8.3f",position().x(),position().y(),position().z())
00079 << " Volume: " << geantVolume()
00080 << " Time of Flight(ns): " << 1.e9*tof()
00081 << " Process: " << geantProcess();
00082 Int_t nDaughters = numberOfDaughters();
00083 cout << " N.Daughters: " << nDaughters;
00084 for (int j = 0; j < nDaughters; j++) {
00085 cout << "\t" << daughter(j)->key();
00086 }
00087 cout << endl;
00088 }
00089 #endif