Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:01

0001 // -*- C++ -*-
0002 //
0003 // Package:     Forward
0004 // Class  :     TotemG4Hit
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:
0010 //         Created:  Tue May 16 10:14:34 CEST 2006
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0017 #include "SimG4CMS/Forward/interface/TotemG4Hit.h"
0018 
0019 //
0020 // constructors and destructor
0021 //
0022 
0023 TotemG4Hit::TotemG4Hit() {
0024   setEntry(0., 0., 0.);
0025   theEntryPoint.SetCoordinates(0., 0., 0.);
0026   theExitPoint.SetCoordinates(0., 0., 0.);
0027 
0028   elem = 0.;
0029   hadr = 0.;
0030   theIncidentEnergy = 0.;
0031   theTrackID = -1;
0032   theUnitID = 0;
0033   theTimeSlice = 0.;
0034 
0035   theX = 0.;
0036   theY = 0.;
0037   theZ = 0.;
0038   thePabs = 0.;
0039   theTof = 0.;
0040   theEnergyLoss = 0.;
0041   theParticleType = 0;
0042   theThetaAtEntry = 0.;
0043   thePhiAtEntry = 0.;
0044   theParentId = 0;
0045   theVx = 0.;
0046   theVy = 0.;
0047   theVz = 0.;
0048 }
0049 
0050 TotemG4Hit::~TotemG4Hit() {}
0051 
0052 TotemG4Hit::TotemG4Hit(const TotemG4Hit& right) {
0053   entry = right.entry;
0054   elem = right.elem;
0055   hadr = right.hadr;
0056   theIncidentEnergy = right.theIncidentEnergy;
0057   theTrackID = right.theTrackID;
0058   theUnitID = right.theUnitID;
0059   theTimeSlice = right.theTimeSlice;
0060 
0061   theX = right.theX;
0062   theY = right.theY;
0063   theZ = right.theZ;
0064   thePabs = right.thePabs;
0065   theTof = right.theTof;
0066   theEnergyLoss = right.theEnergyLoss;
0067   theParticleType = right.theParticleType;
0068 
0069   theThetaAtEntry = right.theThetaAtEntry;
0070   thePhiAtEntry = right.thePhiAtEntry;
0071   theEntryPoint = right.theEntryPoint;
0072   theExitPoint = right.theExitPoint;
0073   theParentId = right.theParentId;
0074   theVx = right.theVx;
0075   theVy = right.theVy;
0076   theVz = right.theVz;
0077 }
0078 
0079 const TotemG4Hit& TotemG4Hit::operator=(const TotemG4Hit& right) {
0080   entry = right.entry;
0081   elem = right.elem;
0082   hadr = right.hadr;
0083   theIncidentEnergy = right.theIncidentEnergy;
0084   theTrackID = right.theTrackID;
0085   theUnitID = right.theUnitID;
0086   theTimeSlice = right.theTimeSlice;
0087 
0088   theX = right.theX;
0089   theY = right.theY;
0090   theZ = right.theZ;
0091   thePabs = right.thePabs;
0092   theTof = right.theTof;
0093   theEnergyLoss = right.theEnergyLoss;
0094   theParticleType = right.theParticleType;
0095 
0096   theThetaAtEntry = right.theThetaAtEntry;
0097   thePhiAtEntry = right.thePhiAtEntry;
0098   theEntryPoint = right.theEntryPoint;
0099   theExitPoint = right.theExitPoint;
0100   theParentId = right.theParentId;
0101   theVx = right.theVx;
0102   theVy = right.theVy;
0103   theVz = right.theVz;
0104 
0105   return *this;
0106 }
0107 
0108 void TotemG4Hit::addEnergyDeposit(const TotemG4Hit& aHit) {
0109   elem += aHit.getEM();
0110   hadr += aHit.getHadr();
0111 }
0112 
0113 void TotemG4Hit::Print() { edm::LogVerbatim("ForwardSim") << (*this); }
0114 
0115 math::XYZPoint TotemG4Hit::getEntry() const { return entry; }
0116 
0117 double TotemG4Hit::getEM() const { return elem; }
0118 void TotemG4Hit::setEM(double e) { elem = e; }
0119 
0120 double TotemG4Hit::getHadr() const { return hadr; }
0121 void TotemG4Hit::setHadr(double e) { hadr = e; }
0122 
0123 double TotemG4Hit::getIncidentEnergy() const { return theIncidentEnergy; }
0124 void TotemG4Hit::setIncidentEnergy(double e) { theIncidentEnergy = e; }
0125 
0126 int TotemG4Hit::getTrackID() const { return theTrackID; }
0127 void TotemG4Hit::setTrackID(int i) { theTrackID = i; }
0128 
0129 uint32_t TotemG4Hit::getUnitID() const { return theUnitID; }
0130 void TotemG4Hit::setUnitID(uint32_t i) { theUnitID = i; }
0131 
0132 double TotemG4Hit::getTimeSlice() const { return theTimeSlice; }
0133 void TotemG4Hit::setTimeSlice(double d) { theTimeSlice = d; }
0134 int TotemG4Hit::getTimeSliceID() const { return (int)theTimeSlice; }
0135 
0136 void TotemG4Hit::addEnergyDeposit(double em, double hd) {
0137   elem += em;
0138   hadr += hd;
0139 }
0140 
0141 double TotemG4Hit::getEnergyDeposit() const { return elem + hadr; }
0142 
0143 float TotemG4Hit::getPabs() const { return thePabs; }
0144 float TotemG4Hit::getTof() const { return theTof; }
0145 float TotemG4Hit::getEnergyLoss() const { return theEnergyLoss; }
0146 int TotemG4Hit::getParticleType() const { return theParticleType; }
0147 
0148 void TotemG4Hit::setPabs(float e) { thePabs = e; }
0149 void TotemG4Hit::setTof(float e) { theTof = e; }
0150 void TotemG4Hit::setEnergyLoss(float e) { theEnergyLoss = e; }
0151 void TotemG4Hit::setParticleType(short i) { theParticleType = i; }
0152 
0153 float TotemG4Hit::getThetaAtEntry() const { return theThetaAtEntry; }
0154 float TotemG4Hit::getPhiAtEntry() const { return thePhiAtEntry; }
0155 
0156 void TotemG4Hit::setThetaAtEntry(float t) { theThetaAtEntry = t; }
0157 void TotemG4Hit::setPhiAtEntry(float f) { thePhiAtEntry = f; }
0158 
0159 float TotemG4Hit::getX() const { return theX; }
0160 void TotemG4Hit::setX(float t) { theX = t; }
0161 
0162 float TotemG4Hit::getY() const { return theY; }
0163 void TotemG4Hit::setY(float t) { theY = t; }
0164 
0165 float TotemG4Hit::getZ() const { return theZ; }
0166 void TotemG4Hit::setZ(float t) { theZ = t; }
0167 
0168 int TotemG4Hit::getParentId() const { return theParentId; }
0169 void TotemG4Hit::setParentId(int p) { theParentId = p; }
0170 
0171 float TotemG4Hit::getVx() const { return theVx; }
0172 void TotemG4Hit::setVx(float t) { theVx = t; }
0173 
0174 float TotemG4Hit::getVy() const { return theVy; }
0175 void TotemG4Hit::setVy(float t) { theVy = t; }
0176 
0177 float TotemG4Hit::getVz() const { return theVz; }
0178 void TotemG4Hit::setVz(float t) { theVz = t; }
0179 
0180 std::ostream& operator<<(std::ostream& os, const TotemG4Hit& hit) {
0181   os << " Data of this TotemG4Hit are:\n"
0182      << " Time slice ID: " << hit.getTimeSliceID() << "\n"
0183      << " EnergyDeposit = " << hit.getEnergyLoss() << "\n"
0184      << " Energy of primary particle (ID = " << hit.getTrackID() << ") = " << hit.getIncidentEnergy() << " (MeV)"
0185      << "\n"
0186      << " Entry point in Totem unit number " << hit.getUnitID() << " is: " << hit.getEntry() << " (mm)"
0187      << "\n"
0188      << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
0189   return os;
0190 }