#include "HEPUnits.hxx" #include "IG4HitGas.hxx" using namespace COMET; IG4HitGas::IG4HitGas() : IG4VHit(), fPOCA(0, 0, 0), fPOCAOnWire(0, 0, 0), fTime(0.), fMomentum(0, 0, 0), fFirstPosition(0, 0, 0), fFirstTime(0.), fFirstMomentum(0, 0, 0), fLastPosition(0, 0, 0), fLastTime(0.), fLastMomentum(0, 0, 0), fLength(0.), fEnergyDeposit(0.), fPDGEncoding(-1) { } IG4HitGas::~IG4HitGas() {} double IG4HitGas::GetPosX() const { return fPOCA.X(); } double IG4HitGas::GetPosY() const { return fPOCA.Y(); } double IG4HitGas::GetPosZ() const { return fPOCA.Z(); } double IG4HitGas::GetPosT() const { return fTime; } const TVector3& IG4HitGas::GetPosition() const { return fPOCA; } double IG4HitGas::GetMomX() const { return fMomentum.X(); } double IG4HitGas::GetMomY() const { return fMomentum.Y(); } double IG4HitGas::GetMomZ() const { return fMomentum.Z(); } double IG4HitGas::GetMomentumMag() const { return fMomentum.Mag(); } const TVector3& IG4HitGas::GetMomentum() const { return fMomentum; } const TVector3& IG4HitGas::GetFirstPosition() const { return fFirstPosition; } double IG4HitGas::GetFirstTime() const { return fFirstTime; } const TVector3& IG4HitGas::GetFirstMomentum() const { return fFirstMomentum; } const TVector3& IG4HitGas::GetLastPosition() const { return fLastPosition; } double IG4HitGas::GetLastTime() const { return fLastTime; } const TVector3& IG4HitGas::GetLastMomentum() const { return fLastMomentum; } double IG4HitGas::GetDOCA() const { return (fPOCA - fPOCAOnWire).Mag(); } const TVector3& IG4HitGas::GetPOCA() const { return fPOCA; } const TVector3& IG4HitGas::GetPOCAOnWire() const { return fPOCAOnWire; } double IG4HitGas::GetLength() const { return fLength; } const std::vector& IG4HitGas::GetAuxiliaryPoints() const { return fAuxiliaryPoints; } void IG4HitGas::ls(Option_t *opt) const { ls_header(this,opt); std::cout << "\nMain track ID: " << fPrimaryId << "\nPDG encoding: " << fPDGEncoding << 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 << "DOCA: " << GetDOCA() / unit::mm << " mm" << std::endl; TROOT::IndentLevel(); std::cout << "Pos: (" << fPOCA.X()/unit::mm << ", " << fPOCA.Y()/unit::mm << ", " << fPOCA.Z()/unit::mm << ") mm " << fTime/unit::ns << " ns" << std::endl; TROOT::IndentLevel(); std::cout << "Mom: (" << fMomentum.X()/unit::MeV << ", " << fMomentum.Y()/unit::MeV << ", " << fMomentum.Z()/unit::MeV << ") " << fMomentum.Mag()/unit::MeV << " MeV/c" << std::endl; TROOT::IndentLevel(); std::cout << "Energy deposit: " << fEnergyDeposit/unit::keV << " keV"< 0) { TROOT::IndentLevel(); std::cout << "Auxiliary points: \n"; TROOT::IncreaseDirLevel(); for (const auto& point: fAuxiliaryPoints) { TROOT::IndentLevel(); std::cout << "Pos: (" << point.fPosition.X() << ", " << point.fPosition.Y() << ", " << point.fPosition.Z() << ") mm\n"; TROOT::IndentLevel(); std::cout << "Time: " << point.fTime << " ns\n"; TROOT::IndentLevel(); std::cout << "Energy deposit: " << point.fEnergyDeposit << " MeV\n"; } TROOT::DecreaseDirLevel(); } TROOT::DecreaseDirLevel(); } std::cout.precision(prec); } void IG4HitGas::Print(Option_t* opt) const { ls("dump"); }