/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SimG4CMS/Forward/src/BSCG4Hit.cc
150 строк
4 KB
Fabio Cossutti
Squashed commit of the following:
08 апр 2026, 18:03
08 апр 2026, 18:03
5b2960f
Код
Авторство
О чём код?
/////////////////////////////////////////////////////////////////////////////// // File: BscG4Hit.cc // Date: 02.2006 // Description: Transient Hit class for the Bsc /////////////////////////////////////////////////////////////////////////////// #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "SimG4CMS/Forward/interface/BscG4Hit.h" #include "SimDataFormats/TrackingHit/interface/SimHitCategory.h" #include <iostream> BscG4Hit::BscG4Hit() : entry(0., 0., 0.), entrylp(0., 0., 0.), exitlp(0., 0., 0.) { elem = 0.f; hadr = 0.f; theIncidentEnergy = 0.f; theTimeSlice = 0.; theTrackID = -1; theUnitID = 0; thePabs = 0.f; theTof = 0.f; theEnergyLoss = 0.f; theParticleType = 0; theUnitID = 0; theTrackID = -1; theThetaAtEntry = -10000.f; thePhiAtEntry = -10000.f; theParentId = 0; theProcessId = 0; theX = 0.f; theY = 0.f; theZ = 0.f; theVx = 0.f; theVy = 0.f; theVz = 0.f; } BscG4Hit::~BscG4Hit() {} BscG4Hit::BscG4Hit(const BscG4Hit& right) { theUnitID = right.theUnitID; theTrackID = right.theTrackID; theTof = right.theTof; theEnergyLoss = right.theEnergyLoss; theParticleType = right.theParticleType; thePabs = right.thePabs; elem = right.elem; hadr = right.hadr; theIncidentEnergy = right.theIncidentEnergy; theTimeSlice = right.theTimeSlice; entry = right.entry; entrylp = right.entrylp; exitlp = right.exitlp; theThetaAtEntry = right.theThetaAtEntry; thePhiAtEntry = right.thePhiAtEntry; theParentId = right.theParentId; theProcessId = right.theProcessId; theX = right.theX; theY = right.theY; theZ = right.theZ; theVx = right.theVx; theVy = right.theVy; theVz = right.theVz; } const BscG4Hit& BscG4Hit::operator=(const BscG4Hit& right) { theUnitID = right.theUnitID; theTrackID = right.theTrackID; theTof = right.theTof; theEnergyLoss = right.theEnergyLoss; theParticleType = right.theParticleType; thePabs = right.thePabs; elem = right.elem; hadr = right.hadr; theIncidentEnergy = right.theIncidentEnergy; theTimeSlice = right.theTimeSlice; entry = right.entry; entrylp = right.entrylp; exitlp = right.exitlp; theThetaAtEntry = right.theThetaAtEntry; thePhiAtEntry = right.thePhiAtEntry; theParentId = right.theParentId; theProcessId = right.theProcessId; theX = right.theX; theY = right.theY; theZ = right.theZ; theVx = right.theVx; theVy = right.theVy; theVz = right.theVz; return *this; } void BscG4Hit::setEntry(const G4ThreeVector& v) { entry = v; theX = v.x(); theY = v.y(); theZ = v.z(); } void BscG4Hit::addEnergyDeposit(const BscG4Hit& aHit) { elem += aHit.getEM(); hadr += aHit.getHadr(); theEnergyLoss = elem + hadr; } void BscG4Hit::Print() { edm::LogVerbatim("ForwardSim") << (*this); } void BscG4Hit::addEnergyDeposit(float em, float hd) { elem += em; hadr += hd; theEnergyLoss = elem + hadr; } void BscG4Hit::setHitPosition(const G4ThreeVector& v) { theX = v.x(); theY = v.y(); theZ = v.z(); } void BscG4Hit::setVertexPosition(const G4ThreeVector& v) { theVx = v.x(); theVy = v.y(); theVz = v.z(); } std::ostream& operator<<(std::ostream& os, const BscG4Hit& hit) { os << " Data of this BscG4Hit are:" << std::endl << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl << " hitExitLocalP: " << hit.getExitLocalP() << std::endl << " Time slice ID: " << hit.getTimeSliceID() << std::endl << " Time slice : " << hit.getTimeSlice() << std::endl << " Tof : " << hit.getTof() << std::endl << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl << " elmenergy = " << hit.getEM() << std::endl << " hadrenergy = " << hit.getHadr() << std::endl << " EnergyLoss = " << hit.getEnergyLoss() << std::endl << " ParticleType = " << hit.getParticleType() << std::endl << " Pabs = " << hit.getPabs() << std::endl << " Energy of primary particle (ID = " << hit.getTrackID() << " hit type = " << hit.getProdType() << ") = " << hit.getIncidentEnergy() << " (MeV)" << std::endl << " Entry point in Bsc unit number " << hit.getUnitID() << " is: " << hit.getEntry() << " (mm)" << std::endl; os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl; return os; }