#include #include #include #include #include ClassImp(COMET::IPAIDeltaRay); ClassImp(COMET::IPAIDeltaRayContainer); COMET::IPAIDeltaRay::IPAIDeltaRay() : fG4TrackID(0), fG4ParentID(0), fParticleName("none"), //fPDGEncoding(-999), fKinEnergy(0), fTime(0), fPosX(0), fPosY(0), fPosZ(0), fDirX(0), fDirY(0), fDirZ(0), fNumOfSecondaries(0){} COMET::IPAIDeltaRay::IPAIDeltaRay(const COMET::IPAIDeltaRay& rhs) : fG4TrackID(rhs.fG4TrackID), fG4ParentID(rhs.fG4ParentID), fParticleName(rhs.fParticleName), fKinEnergy(rhs.fKinEnergy), fTime(rhs.fTime), fChannelID(rhs.fChannelID), fADCSum(rhs.fADCSum), fInducedCharge(rhs.fInducedCharge), fPulseHeight(rhs.fPulseHeight), fPosX(rhs.fPosX), fPosY(rhs.fPosY), fPosZ(rhs.fPosZ), fDirX(rhs.fDirX), fDirY(rhs.fDirY), fDirZ(rhs.fDirZ), fNumOfSecondaries(rhs.fNumOfSecondaries) {} COMET::IPAIDeltaRay::IPAIDeltaRay(std::string particleName, double eKin, double time, double posX, double posY, double posZ, double dirX, double dirY, double dirZ) : fG4TrackID(0), fG4ParentID(0), fNumOfSecondaries(0) { fParticleName = particleName; fKinEnergy = eKin; fTime = time; fPosX = posX; fPosY = posY; fPosZ = posZ; fDirX = dirX; fDirY = dirY; fDirZ = dirZ; /* TVector3 pos = TVector3(fPosX, fPosY, fPosZ); if (!COMET::IGeomInfo::Get().CDC().GlobalPositionToChannel(pos, fChannelID)) { std::cout << "Could not find channel ID!" << std::endl; fChannelID=-1; } */ } void COMET::IPAIDeltaRay::ls(Option_t* opt) const { COMET::ls_header(this,opt); int prec = std::cout.precision(); std::cout.precision(3); std::cout << " ID: " << fG4TrackID << " Particle Name: " << fParticleName << " Kinetic Energ [eV]: " << fKinEnergy / (unit::eV) << " Position [cm]: (" << fPosX / (unit::cm) << "," << fPosY / (unit::cm) << "," << fPosZ / (unit::cm) << ")" << " Direction: (" << fDirX << "," << fDirY << "," << fDirZ << ")" << " Time [ns]: " << fTime / (unit::ns) << " from: " << fG4ParentID << std::endl; std::string option(opt); std::cout.precision(prec); } COMET::IPAIDeltaRay::~IPAIDeltaRay() { } void COMET::IPAIDeltaRayContainer::ls(Option_t* opt) const { COMET::IDatum::ls(opt); std::string option(opt); if (option.find("dump") != std::string::npos) { TROOT::IncreaseDirLevel(); for (const_iterator v = begin(); v != end(); ++v) { (*v)->ls(opt); }; TROOT::DecreaseDirLevel(); } }