File indexing completed on 2024-04-06 12:30:11
0001
0002
0003 #include "SimG4CMS/PPS/interface/PPSDiamondG4Hit.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005
0006 #include <iostream>
0007
0008 PPSDiamondG4Hit::PPSDiamondG4Hit() : entry_(0), exit_(0), local_entry_(0), local_exit_(0) {
0009 theIncidentEnergy_ = 0.0;
0010 theTrackID_ = -1;
0011 theUnitID_ = 0;
0012 theTimeSlice_ = 0.0;
0013 theGlobaltimehit_ = 0.0;
0014 theX_ = 0.0;
0015 theY_ = 0.0;
0016 theZ_ = 0.0;
0017 thePabs_ = 0.0;
0018 theTof_ = 0.0;
0019 theEnergyLoss_ = 0.0;
0020 theParticleType_ = 0;
0021 theParentId_ = 0;
0022 theVx_ = 0.0;
0023 theVy_ = 0.0;
0024 theVz_ = 0.0;
0025 thePx_ = thePy_ = thePz_ = 0.0;
0026 theThetaAtEntry_ = 0;
0027 thePhiAtEntry_ = 0;
0028 }
0029
0030 PPSDiamondG4Hit::~PPSDiamondG4Hit() {}
0031
0032 PPSDiamondG4Hit::PPSDiamondG4Hit(const PPSDiamondG4Hit& right) {
0033 entry_ = right.entry_;
0034 exit_ = right.exit_;
0035 local_entry_ = right.local_entry_;
0036 local_exit_ = right.local_exit_;
0037 theIncidentEnergy_ = right.theIncidentEnergy_;
0038 theTrackID_ = right.theTrackID_;
0039 theUnitID_ = right.theUnitID_;
0040 theTimeSlice_ = right.theTimeSlice_;
0041 theGlobaltimehit_ = right.theGlobaltimehit_;
0042 theX_ = right.theX_;
0043 theY_ = right.theY_;
0044 theZ_ = right.theZ_;
0045 thePabs_ = right.thePabs_;
0046 theTof_ = right.theTof_;
0047 theEnergyLoss_ = right.theEnergyLoss_;
0048 theParticleType_ = right.theParticleType_;
0049 theParentId_ = right.theParentId_;
0050 theVx_ = right.theVx_;
0051 theVy_ = right.theVy_;
0052 theVz_ = right.theVz_;
0053 thePx_ = right.thePx_;
0054 thePy_ = right.thePy_;
0055 thePz_ = right.thePz_;
0056 theThetaAtEntry_ = right.theThetaAtEntry_;
0057 thePhiAtEntry_ = right.thePhiAtEntry_;
0058 }
0059
0060 const PPSDiamondG4Hit& PPSDiamondG4Hit::operator=(const PPSDiamondG4Hit& right) {
0061 entry_ = right.entry_;
0062 exit_ = right.exit_;
0063 local_entry_ = right.local_entry_;
0064 local_exit_ = right.local_exit_;
0065 theIncidentEnergy_ = right.theIncidentEnergy_;
0066 theTrackID_ = right.theTrackID_;
0067 theUnitID_ = right.theUnitID_;
0068 theTimeSlice_ = right.theTimeSlice_;
0069 theGlobaltimehit_ = right.theGlobaltimehit_;
0070 theX_ = right.theX_;
0071 theY_ = right.theY_;
0072 theZ_ = right.theZ_;
0073 thePabs_ = right.thePabs_;
0074 theTof_ = right.theTof_;
0075 theEnergyLoss_ = right.theEnergyLoss_;
0076 theParticleType_ = right.theParticleType_;
0077 theParentId_ = right.theParentId_;
0078 theVx_ = right.theVx_;
0079 theVy_ = right.theVy_;
0080 theVz_ = right.theVz_;
0081 thePx_ = right.thePx_;
0082 thePy_ = right.thePy_;
0083 thePz_ = right.thePz_;
0084 theThetaAtEntry_ = right.theThetaAtEntry_;
0085 thePhiAtEntry_ = right.thePhiAtEntry_;
0086
0087 return *this;
0088 }
0089
0090 void PPSDiamondG4Hit::Print() { edm::LogInfo("PPSSimDiamond") << (*this); }
0091
0092 const G4ThreeVector& PPSDiamondG4Hit::entry() const { return entry_; }
0093 void PPSDiamondG4Hit::setEntry(const G4ThreeVector& xyz) { entry_ = xyz; }
0094
0095 const G4ThreeVector& PPSDiamondG4Hit::exit() const { return exit_; }
0096 void PPSDiamondG4Hit::setExit(const G4ThreeVector& xyz) { exit_ = xyz; }
0097
0098 const G4ThreeVector& PPSDiamondG4Hit::localEntry() const { return local_entry_; }
0099 void PPSDiamondG4Hit::setLocalEntry(const G4ThreeVector& xyz) { local_entry_ = xyz; }
0100 const G4ThreeVector& PPSDiamondG4Hit::localExit() const { return local_exit_; }
0101 void PPSDiamondG4Hit::setLocalExit(const G4ThreeVector& xyz) { local_exit_ = xyz; }
0102
0103 double PPSDiamondG4Hit::incidentEnergy() const { return theIncidentEnergy_; }
0104 void PPSDiamondG4Hit::setIncidentEnergy(double e) { theIncidentEnergy_ = e; }
0105
0106 unsigned int PPSDiamondG4Hit::trackID() const { return theTrackID_; }
0107 void PPSDiamondG4Hit::setTrackID(int i) { theTrackID_ = i; }
0108
0109 int PPSDiamondG4Hit::unitID() const { return theUnitID_; }
0110 void PPSDiamondG4Hit::setUnitID(unsigned int i) { theUnitID_ = i; }
0111
0112 double PPSDiamondG4Hit::timeSlice() const { return theTimeSlice_; }
0113 void PPSDiamondG4Hit::setTimeSlice(double d) { theTimeSlice_ = d; }
0114 int PPSDiamondG4Hit::timeSliceID() const { return (int)theTimeSlice_; }
0115
0116 double PPSDiamondG4Hit::p() const { return thePabs_; }
0117 double PPSDiamondG4Hit::tof() const { return theTof_; }
0118 double PPSDiamondG4Hit::energyLoss() const { return theEnergyLoss_; }
0119 int PPSDiamondG4Hit::particleType() const { return theParticleType_; }
0120
0121 void PPSDiamondG4Hit::setP(double e) { thePabs_ = e; }
0122 void PPSDiamondG4Hit::setTof(double e) { theTof_ = e; }
0123 void PPSDiamondG4Hit::setEnergyLoss(double e) { theEnergyLoss_ = e; }
0124 void PPSDiamondG4Hit::addEnergyLoss(double e) { theEnergyLoss_ += e; }
0125 void PPSDiamondG4Hit::setParticleType(short i) { theParticleType_ = i; }
0126
0127 double PPSDiamondG4Hit::thetaAtEntry() const { return theThetaAtEntry_; }
0128 double PPSDiamondG4Hit::phiAtEntry() const { return thePhiAtEntry_; }
0129
0130 void PPSDiamondG4Hit::setThetaAtEntry(double t) { theThetaAtEntry_ = t; }
0131 void PPSDiamondG4Hit::setPhiAtEntry(double f) { thePhiAtEntry_ = f; }
0132
0133 double PPSDiamondG4Hit::x() const { return theX_; }
0134 void PPSDiamondG4Hit::setX(double t) { theX_ = t; }
0135
0136 double PPSDiamondG4Hit::y() const { return theY_; }
0137 void PPSDiamondG4Hit::setY(double t) { theY_ = t; }
0138
0139 double PPSDiamondG4Hit::z() const { return theZ_; }
0140 void PPSDiamondG4Hit::setZ(double t) { theZ_ = t; }
0141
0142 int PPSDiamondG4Hit::parentId() const { return theParentId_; }
0143 void PPSDiamondG4Hit::setParentId(int p) { theParentId_ = p; }
0144
0145 double PPSDiamondG4Hit::vx() const { return theVx_; }
0146 void PPSDiamondG4Hit::setVx(double t) { theVx_ = t; }
0147
0148 double PPSDiamondG4Hit::vy() const { return theVy_; }
0149 void PPSDiamondG4Hit::setVy(double t) { theVy_ = t; }
0150
0151 double PPSDiamondG4Hit::vz() const { return theVz_; }
0152 void PPSDiamondG4Hit::setVz(double t) { theVz_ = t; }
0153
0154 void PPSDiamondG4Hit::setPx(double p) { thePx_ = p; }
0155 void PPSDiamondG4Hit::setPy(double p) { thePy_ = p; }
0156 void PPSDiamondG4Hit::setPz(double p) { thePz_ = p; }
0157
0158 double PPSDiamondG4Hit::px() const { return thePx_; }
0159 double PPSDiamondG4Hit::py() const { return thePy_; }
0160 double PPSDiamondG4Hit::pz() const { return thePz_; }
0161
0162 double PPSDiamondG4Hit::globalTimehit() const { return theGlobaltimehit_; }
0163 void PPSDiamondG4Hit::setGlobalTimehit(double h) { theGlobaltimehit_ = h; }
0164
0165 std::ostream& operator<<(std::ostream& os, const PPSDiamondG4Hit& hit) {
0166 os << " Data of this PPSDiamondG4Hit are:" << std::endl
0167 << " Time slice ID: " << hit.timeSliceID() << std::endl
0168 << " EnergyDeposit = " << hit.energyLoss() << std::endl
0169 << " Energy of primary particle (ID = " << hit.trackID() << ") = " << hit.incidentEnergy() << " (MeV)"
0170 << "\n"
0171 << " Local entry and exit points in PPS unit number " << hit.unitID() << " are: " << hit.entry() << " (mm)"
0172 << hit.exit() << " (mm)"
0173 << "\n"
0174 << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
0175 return os;
0176 }