Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:29:28

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