//////////////////////////////////////////////////////////// // $Id: IG4PrimaryVertex.cxx,v 1.15 2009/09/16 18:30:06 mcgrew Exp $ // #include #include #include #include #include "HEPUnits.hxx" #include "IG4PrimaryVertex.hxx" ClassImp(COMET::IG4PrimaryVertex); ClassImp(COMET::IG4PrimaryVertexContainer); COMET::IG4PrimaryVertex::IG4PrimaryVertex(void) : fPosition(0,0,0,0), fGeneratorName("none"), fReaction("none"), fFilename("none"), fInteractionNumber(0), fCrossSection(0.0), fDiffCrossSection(0.0), fWeight(0.0), fProbability(0.0), TObject() {} COMET::IG4PrimaryVertex::IG4PrimaryVertex(const COMET::IG4PrimaryVertex& rhs) : TObject(rhs), fPosition(rhs.fPosition), fPrimaryParticles(rhs.fPrimaryParticles), fGeneratorName(rhs.fGeneratorName), fReaction(rhs.fReaction), fInformational(rhs.fInformational), fFilename(rhs.fFilename), fInteractionNumber(rhs.fInteractionNumber), fCrossSection(rhs.fCrossSection), fDiffCrossSection(rhs.fDiffCrossSection), fWeight(rhs.fWeight), fProbability(rhs.fWeight) {} COMET::IG4PrimaryVertex::~IG4PrimaryVertex() { } void COMET::IG4PrimaryVertex::ls(Option_t* opt) const { COMET::ls_header(this,opt); std::cout << " #" << fInteractionNumber << " at: (" << fPosition.X()/unit::cm << "," << fPosition.Y()/unit::cm << "," << fPosition.Z()/unit::cm << "," << fPosition.T()/unit::ns << ") (cm,ns)" << std::endl; TROOT::IncreaseDirLevel(); std::string generatorName = GetGeneratorName(); std::string reactionMode = GetReaction(); if (generatorName != "" || reactionMode != "") { TROOT::IndentLevel(); std::cout << "Generator: " << generatorName << " Reaction: <" << reactionMode << ">" << std::endl; } std::string filename = GetFilename(); if (filename != "") { TROOT::IndentLevel(); std::cout << "Filename: " << filename << std::endl; } if (fCrossSection>0.0 || fDiffCrossSection>0.0) { TROOT::IndentLevel(); std::cout << "Cross Section: " << fCrossSection/(unit::femto*unit::barn) << "fb" << " Diff: " << fDiffCrossSection/(unit::femto*unit::barn) << "fb" << std::endl; } if (std::abs(fProbability-1.0)>1E-3 || std::abs(fWeight-1.0)>1E-3) { TROOT::IndentLevel(); std::cout << "Probability: " << fProbability << " Weight: " << fWeight << std::endl; } for (COMET::TG4PrimaryParticleContainer::const_iterator v = fPrimaryParticles.begin(); v != fPrimaryParticles.end(); ++v) { v->ls(opt); }; if (fInformational.size()>0) { TROOT::IncreaseDirLevel(); fInformational.ls(opt); TROOT::DecreaseDirLevel(); } TROOT::DecreaseDirLevel(); } void COMET::IG4PrimaryVertexContainer::ls(Option_t* opt) const { COMET::IDatum::ls(opt); TROOT::IncreaseDirLevel(); for (const_iterator v = begin(); v != end(); ++v) { v->ls(opt); }; TROOT::DecreaseDirLevel(); } void COMET::IG4PrimaryVertex::SetGeneratorName(const char *name) { fGeneratorName = name; } void COMET::IG4PrimaryVertex::SetReaction(const char *reaction) { fReaction = reaction; } void COMET::IG4PrimaryVertex::SetInfoVertex(const COMET::IG4PrimaryVertexContainer& info) { fInformational = info; } void COMET::IG4PrimaryVertex::SetFilename(const char *filename) { fFilename = filename; }