File indexing completed on 2023-03-17 11:24:28
0001
0002
0003
0004
0005
0006 #include "SimG4CMS/FP420/interface/FP420G4Hit.h"
0007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0008 #include <iostream>
0009
0010 FP420G4Hit::FP420G4Hit() : entry(0) {
0011 entrylp(0);
0012 exitlp(0);
0013 elem = 0.;
0014 hadr = 0.;
0015 theIncidentEnergy = 0.;
0016 theTimeSlice = 0.;
0017 theTrackID = -1;
0018 theUnitID = 0;
0019 thePabs = 0.;
0020 theTof = 0.;
0021 theEnergyLoss = 0.;
0022 theParticleType = 0;
0023 theUnitID = 0;
0024 theTrackID = -1;
0025 theThetaAtEntry = -10000.;
0026 thePhiAtEntry = -10000.;
0027 theParentId = 0;
0028
0029 theX = 0.;
0030 theY = 0.;
0031 theZ = 0.;
0032 theVx = 0.;
0033 theVy = 0.;
0034 theVz = 0.;
0035 }
0036
0037 FP420G4Hit::~FP420G4Hit() {}
0038
0039 FP420G4Hit::FP420G4Hit(const FP420G4Hit& right) {
0040 theUnitID = right.theUnitID;
0041
0042 theTrackID = right.theTrackID;
0043 theTof = right.theTof;
0044 theEnergyLoss = right.theEnergyLoss;
0045 theParticleType = right.theParticleType;
0046 thePabs = right.thePabs;
0047 elem = right.elem;
0048 hadr = right.hadr;
0049 theIncidentEnergy = right.theIncidentEnergy;
0050 theTimeSlice = right.theTimeSlice;
0051 entry = right.entry;
0052 entrylp = right.entrylp;
0053 exitlp = right.exitlp;
0054 theThetaAtEntry = right.theThetaAtEntry;
0055 thePhiAtEntry = right.thePhiAtEntry;
0056 theParentId = right.theParentId;
0057
0058 theX = right.theX;
0059 theY = right.theY;
0060 theZ = right.theZ;
0061
0062 theVx = right.theVx;
0063 theVy = right.theVy;
0064 theVz = right.theVz;
0065 }
0066
0067 const FP420G4Hit& FP420G4Hit::operator=(const FP420G4Hit& right) {
0068 theUnitID = right.theUnitID;
0069
0070 theTrackID = right.theTrackID;
0071 theTof = right.theTof;
0072 theEnergyLoss = right.theEnergyLoss;
0073 theParticleType = right.theParticleType;
0074 thePabs = right.thePabs;
0075 elem = right.elem;
0076 hadr = right.hadr;
0077 theIncidentEnergy = right.theIncidentEnergy;
0078 theTimeSlice = right.theTimeSlice;
0079 entry = right.entry;
0080 entrylp = right.entrylp;
0081 exitlp = right.exitlp;
0082 theThetaAtEntry = right.theThetaAtEntry;
0083 thePhiAtEntry = right.thePhiAtEntry;
0084 theParentId = right.theParentId;
0085
0086 theX = right.theX;
0087 theY = right.theY;
0088 theZ = right.theZ;
0089
0090 theVx = right.theVx;
0091 theVy = right.theVy;
0092 theVz = right.theVz;
0093
0094 return *this;
0095 }
0096
0097 void FP420G4Hit::addEnergyDeposit(const FP420G4Hit& aHit) {
0098 elem += aHit.getEM();
0099 hadr += aHit.getHadr();
0100 }
0101
0102 void FP420G4Hit::Print() { edm::LogVerbatim("FP420") << (*this); }
0103
0104 G4ThreeVector FP420G4Hit::getEntry() const { return entry; }
0105 void FP420G4Hit::setEntry(const G4ThreeVector& xyz) { entry = xyz; }
0106
0107 G4ThreeVector FP420G4Hit::getEntryLocalP() const { return entrylp; }
0108 void FP420G4Hit::setEntryLocalP(const G4ThreeVector& xyz1) { entrylp = xyz1; }
0109
0110 G4ThreeVector FP420G4Hit::getExitLocalP() const { return exitlp; }
0111 void FP420G4Hit::setExitLocalP(const G4ThreeVector& xyz1) { exitlp = xyz1; }
0112
0113 double FP420G4Hit::getEM() const { return elem; }
0114 void FP420G4Hit::setEM(double e) { elem = e; }
0115
0116 double FP420G4Hit::getHadr() const { return hadr; }
0117 void FP420G4Hit::setHadr(double e) { hadr = e; }
0118
0119 double FP420G4Hit::getIncidentEnergy() const { return theIncidentEnergy; }
0120 void FP420G4Hit::setIncidentEnergy(double e) { theIncidentEnergy = e; }
0121
0122 unsigned int FP420G4Hit::getTrackID() const { return theTrackID; }
0123 void FP420G4Hit::setTrackID(int i) { theTrackID = i; }
0124
0125 unsigned int FP420G4Hit::getUnitID() const { return theUnitID; }
0126 void FP420G4Hit::setUnitID(unsigned int i) { theUnitID = i; }
0127
0128 double FP420G4Hit::getTimeSlice() const { return theTimeSlice; }
0129 void FP420G4Hit::setTimeSlice(double d) { theTimeSlice = d; }
0130 int FP420G4Hit::getTimeSliceID() const { return (int)theTimeSlice; }
0131
0132 void FP420G4Hit::addEnergyDeposit(double em, double hd) {
0133 elem += em;
0134 hadr += hd;
0135 }
0136
0137 double FP420G4Hit::getEnergyDeposit() const { return elem + hadr; }
0138
0139 float FP420G4Hit::getPabs() const { return thePabs; }
0140 float FP420G4Hit::getTof() const { return theTof; }
0141 float FP420G4Hit::getEnergyLoss() const { return theEnergyLoss; }
0142 int FP420G4Hit::getParticleType() const { return theParticleType; }
0143
0144 void FP420G4Hit::setPabs(float e) { thePabs = e; }
0145 void FP420G4Hit::setTof(float e) { theTof = e; }
0146 void FP420G4Hit::addEnergyLoss(float e) { theEnergyLoss += e; }
0147 void FP420G4Hit::setEnergyLoss(float e) { theEnergyLoss = e; }
0148 void FP420G4Hit::setParticleType(short i) { theParticleType = i; }
0149
0150 float FP420G4Hit::getThetaAtEntry() const { return theThetaAtEntry; }
0151 float FP420G4Hit::getPhiAtEntry() const { return thePhiAtEntry; }
0152
0153 void FP420G4Hit::setThetaAtEntry(float t) { theThetaAtEntry = t; }
0154 void FP420G4Hit::setPhiAtEntry(float f) { thePhiAtEntry = f; }
0155
0156 float FP420G4Hit::getX() const { return theX; }
0157 void FP420G4Hit::setX(float t) { theX = t; }
0158
0159 float FP420G4Hit::getY() const { return theY; }
0160 void FP420G4Hit::setY(float t) { theY = t; }
0161
0162 float FP420G4Hit::getZ() const { return theZ; }
0163 void FP420G4Hit::setZ(float t) { theZ = t; }
0164
0165 int FP420G4Hit::getParentId() const { return theParentId; }
0166 void FP420G4Hit::setParentId(int p) { theParentId = p; }
0167
0168 float FP420G4Hit::getVx() const { return theVx; }
0169 void FP420G4Hit::setVx(float t) { theVx = t; }
0170
0171 float FP420G4Hit::getVy() const { return theVy; }
0172 void FP420G4Hit::setVy(float t) { theVy = t; }
0173
0174 float FP420G4Hit::getVz() const { return theVz; }
0175 void FP420G4Hit::setVz(float t) { theVz = t; }
0176
0177 std::ostream& operator<<(std::ostream& os, const FP420G4Hit& hit) {
0178 os << " Data of this FP420G4Hit are:" << std::endl
0179 << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl
0180 << " hitExitLocalP: " << hit.getExitLocalP() << std::endl
0181 << " Time slice ID: " << hit.getTimeSliceID() << std::endl
0182 << " Time slice : " << hit.getTimeSlice() << std::endl
0183 << " Tof : " << hit.getTof() << std::endl
0184 << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl
0185 << " elmenergy = " << hit.getEM() << std::endl
0186 << " hadrenergy = " << hit.getHadr() << std::endl
0187 << " EnergyLoss = " << hit.getEnergyLoss() << std::endl
0188 << " ParticleType = " << hit.getParticleType() << std::endl
0189 << " ParticleType = " << hit.getParticleType() << std::endl
0190 << " Theta at Entry = " << hit.getThetaAtEntry() << std::endl
0191 << " Phi at Entry = " << hit.getPhiAtEntry() << std::endl
0192 << " X at Entry = " << hit.getX() << std::endl
0193 << " Y at Entry = " << hit.getY() << std::endl
0194 << " Z at Entry = " << hit.getZ() << std::endl
0195 << " VtxX = " << hit.getVx() << std::endl
0196 << " VtxY = " << hit.getVy() << std::endl
0197 << " VtxZ = " << hit.getVz() << std::endl
0198 << " parentID = " << hit.getParentId() << std::endl
0199 << " Pabs = " << hit.getPabs() << std::endl
0200 << " Energy of primary particle (ID = " << hit.getTrackID() << ") = " << hit.getIncidentEnergy() << " (MeV)"
0201 << std::endl
0202 << " Entry point in FP420 unit number " << hit.getUnitID() << " is: " << hit.getEntry() << " (mm)" << std::endl;
0203 os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << std::endl;
0204 return os;
0205 }