#include #include #include "HEPUnits.hxx" #include "IG4HitCheren.hxx" #include "ICOMETEvent.hxx" #include "IEventFolder.hxx" ClassImp(COMET::IG4HitCheren); COMET::IG4HitCheren::IG4HitCheren() : IG4VHit(), fCharge(0), fBeta(0), fStartPos(), fStopPos(), fMomentum() {} COMET::IG4HitCheren::IG4HitCheren(const COMET::IG4HitCheren& rhs) : IG4VHit(rhs), fCharge(rhs.fCharge), fBeta(rhs.fBeta), fStartPos(rhs.fStartPos), fStopPos(rhs.fStopPos), fMomentum(rhs.fMomentum) {} COMET::IG4HitCheren::~IG4HitCheren() {} double COMET::IG4HitCheren::GetHitLength(void) const{ // Return the magnitude of the difference between the start and stop point double dX = (fStopPos.vX - fStartPos.vX); double dY = (fStopPos.vY - fStartPos.vY); double dZ = (fStopPos.vZ - fStartPos.vZ); return sqrt(dX*dX + dY*dY + dZ*dZ); } void COMET::IG4HitCheren::ls(Option_t *opt) const { COMET::ls_header(this,opt); std::cout << " Primary ID (Track ID): " << GetPrimaryId() << std::endl; int prec = std::cout.precision(); std::cout.precision(3); std::string option(opt); if (option.find("dump") != std::string::npos) { TROOT::IncreaseDirLevel(); TROOT::IndentLevel(); std::cout << "Charge: " << GetCharge() << std::endl; TROOT::IndentLevel(); std::cout << "Beta (v/c): " << GetBeta() << std::endl; TROOT::IndentLevel(); std::cout << "Start Position: (" << fStartPos.vX*(1./unit::mm) << " mm, " << fStartPos.vY*(1./unit::mm) << " mm, " << fStartPos.vZ*(1./unit::mm) << " mm, " << fStartPos.vT << " ns)" << std::endl; TROOT::IndentLevel(); std::cout << "Stop Position: (" << fStopPos.vX*(1./unit::mm) << " mm, " << fStopPos.vY*(1./unit::mm) << " mm, " << fStopPos.vZ*(1./unit::mm) << " mm, " << fStopPos.vT << " ns)" << std::endl; TROOT::IndentLevel(); std::cout << "Momentum: (" << fMomentum.vX << " MeV/c, " << fMomentum.vY << " MeV/c, " << fMomentum.vZ << " MeV/c, " << fMomentum.vT << " MeV/(c^2))" << std::endl; TROOT::DecreaseDirLevel(); } std::cout.precision(prec); }