Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:     PPS
0004 // Class  :     PPSPixelG4Hit
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/PPS/interface/PPSPixelG4Hit.h"
0018 #include <iostream>
0019 
0020 //
0021 // constructors and destructor
0022 //
0023 
0024 PPSPixelG4Hit::PPSPixelG4Hit() : MeanPosition_(0), theEntryPoint_(0), theExitPoint_(0) {
0025   elem_ = 0.;
0026   hadr_ = 0.;
0027   theIncidentEnergy_ = 0.;
0028   theTrackID_ = -1;
0029   theUnitID_ = 0;
0030   theTimeSlice_ = 0.;
0031 
0032   theX_ = 0.;
0033   theY_ = 0.;
0034   theZ_ = 0.;
0035   thePabs_ = 0.;
0036   theTof_ = 0.;
0037   theEnergyLoss_ = 0.;
0038   theParticleType_ = 0;
0039   theThetaAtEntry_ = 0.;
0040   thePhiAtEntry_ = 0.;
0041   theParentId_ = 0;
0042   theVx_ = 0.;
0043   theVy_ = 0.;
0044   theVz_ = 0.;
0045   thePx_ = 0;
0046   thePy_ = 0;
0047   thePz_ = 0;
0048   theVPx_ = 0;
0049   theVPy_ = 0;
0050   theVPz_ = 0;
0051 }
0052 
0053 PPSPixelG4Hit::PPSPixelG4Hit(const PPSPixelG4Hit& right) {
0054   MeanPosition_ = right.MeanPosition_;
0055 
0056   elem_ = right.elem_;
0057   hadr_ = right.hadr_;
0058   theIncidentEnergy_ = right.theIncidentEnergy_;
0059   theTrackID_ = right.theTrackID_;
0060   theUnitID_ = right.theUnitID_;
0061   theTimeSlice_ = right.theTimeSlice_;
0062 
0063   theX_ = right.theX_;
0064   theY_ = right.theY_;
0065   theZ_ = right.theZ_;
0066   thePabs_ = right.thePabs_;
0067   theTof_ = right.theTof_;
0068   theEnergyLoss_ = right.theEnergyLoss_;
0069   theParticleType_ = right.theParticleType_;
0070 
0071   theThetaAtEntry_ = right.theThetaAtEntry_;
0072   thePhiAtEntry_ = right.thePhiAtEntry_;
0073   theEntryPoint_ = right.theEntryPoint_;
0074   theExitPoint_ = right.theExitPoint_;
0075   theParentId_ = right.theParentId_;
0076   theVx_ = right.theVx_;
0077   theVy_ = right.theVy_;
0078   theVz_ = right.theVz_;
0079   thePx_ = right.thePx_;
0080   thePy_ = right.thePy_;
0081   thePz_ = right.thePz_;
0082   theVPx_ = right.theVPx_;
0083   theVPy_ = right.theVPy_;
0084   theVPz_ = right.theVPz_;
0085 }
0086 
0087 const PPSPixelG4Hit& PPSPixelG4Hit::operator=(const PPSPixelG4Hit& right) {
0088   MeanPosition_ = right.MeanPosition_;
0089   elem_ = right.elem_;
0090   hadr_ = right.hadr_;
0091   theIncidentEnergy_ = right.theIncidentEnergy_;
0092   theTrackID_ = right.theTrackID_;
0093   theUnitID_ = right.theUnitID_;
0094   theTimeSlice_ = right.theTimeSlice_;
0095 
0096   theX_ = right.theX_;
0097   theY_ = right.theY_;
0098   theZ_ = right.theZ_;
0099   thePabs_ = right.thePabs_;
0100   theTof_ = right.theTof_;
0101   theEnergyLoss_ = right.theEnergyLoss_;
0102   theParticleType_ = right.theParticleType_;
0103 
0104   theThetaAtEntry_ = right.theThetaAtEntry_;
0105   thePhiAtEntry_ = right.thePhiAtEntry_;
0106   theEntryPoint_ = right.theEntryPoint_;
0107   theExitPoint_ = right.theExitPoint_;
0108   theParentId_ = right.theParentId_;
0109   theVx_ = right.theVx_;
0110   theVy_ = right.theVy_;
0111   theVz_ = right.theVz_;
0112   thePx_ = right.thePx_;
0113   thePy_ = right.thePy_;
0114   thePz_ = right.thePz_;
0115   theVPx_ = right.theVPx_;
0116   theVPy_ = right.theVPy_;
0117   theVPz_ = right.theVPz_;
0118 
0119   return *this;
0120 }
0121 
0122 void PPSPixelG4Hit::addEnergyDeposit(const PPSPixelG4Hit& aHit) {
0123   elem_ += aHit.eM();
0124   hadr_ += aHit.hadr();
0125 }
0126 
0127 void PPSPixelG4Hit::Print() { edm::LogInfo("PPSPixelG4Hit") << (*this); }
0128 
0129 const G4ThreeVector& PPSPixelG4Hit::entryPoint() const { return theEntryPoint_; }
0130 
0131 void PPSPixelG4Hit::setEntryPoint(const G4ThreeVector& xyz) { theEntryPoint_ = xyz; }
0132 
0133 const G4ThreeVector& PPSPixelG4Hit::exitPoint() const { return theExitPoint_; }
0134 
0135 void PPSPixelG4Hit::setExitPoint(const G4ThreeVector& xyz) { theExitPoint_ = xyz; }
0136 
0137 double PPSPixelG4Hit::eM() const { return elem_; }
0138 void PPSPixelG4Hit::setEM(double e) { elem_ = e; }
0139 
0140 double PPSPixelG4Hit::hadr() const { return hadr_; }
0141 void PPSPixelG4Hit::setHadr(double e) { hadr_ = e; }
0142 
0143 double PPSPixelG4Hit::incidentEnergy() const { return theIncidentEnergy_; }
0144 void PPSPixelG4Hit::setIncidentEnergy(double e) { theIncidentEnergy_ = e; }
0145 
0146 int PPSPixelG4Hit::trackID() const { return theTrackID_; }
0147 void PPSPixelG4Hit::setTrackID(int i) { theTrackID_ = i; }
0148 
0149 uint32_t PPSPixelG4Hit::unitID() const { return theUnitID_; }
0150 void PPSPixelG4Hit::setUnitID(uint32_t i) { theUnitID_ = i; }
0151 
0152 double PPSPixelG4Hit::timeSlice() const { return theTimeSlice_; }
0153 void PPSPixelG4Hit::setTimeSlice(double d) { theTimeSlice_ = d; }
0154 int PPSPixelG4Hit::timeSliceID() const { return (int)theTimeSlice_; }
0155 
0156 void PPSPixelG4Hit::addEnergyDeposit(double em, double hd) {
0157   elem_ += em;
0158   hadr_ += hd;
0159 }
0160 
0161 double PPSPixelG4Hit::energyDeposit() const { return elem_ + hadr_; }
0162 
0163 float PPSPixelG4Hit::p() const { return thePabs_; }
0164 float PPSPixelG4Hit::tof() const { return theTof_; }
0165 float PPSPixelG4Hit::energyLoss() const { return theEnergyLoss_; }
0166 int PPSPixelG4Hit::particleType() const { return theParticleType_; }
0167 float PPSPixelG4Hit::px() const { return thePx_; }
0168 float PPSPixelG4Hit::py() const { return thePy_; }
0169 float PPSPixelG4Hit::pz() const { return thePz_; }
0170 float PPSPixelG4Hit::vPx() const { return theVPx_; }
0171 float PPSPixelG4Hit::vPy() const { return theVPy_; }
0172 float PPSPixelG4Hit::vPz() const { return theVPz_; }
0173 
0174 void PPSPixelG4Hit::setP(float e) { thePabs_ = e; }
0175 void PPSPixelG4Hit::setPx(float e) { thePx_ = e; }
0176 void PPSPixelG4Hit::setPy(float e) { thePy_ = e; }
0177 void PPSPixelG4Hit::setPz(float e) { thePz_ = e; }
0178 void PPSPixelG4Hit::setVPx(float e) { theVPx_ = e; }
0179 void PPSPixelG4Hit::setVPy(float e) { theVPy_ = e; }
0180 void PPSPixelG4Hit::setVPz(float e) { theVPz_ = e; }
0181 void PPSPixelG4Hit::setTof(float e) { theTof_ = e; }
0182 void PPSPixelG4Hit::setEnergyLoss(float e) { theEnergyLoss_ = e; }
0183 void PPSPixelG4Hit::setParticleType(short i) { theParticleType_ = i; }
0184 
0185 float PPSPixelG4Hit::thetaAtEntry() const { return theThetaAtEntry_; }
0186 float PPSPixelG4Hit::phiAtEntry() const { return thePhiAtEntry_; }
0187 
0188 void PPSPixelG4Hit::setThetaAtEntry(float t) { theThetaAtEntry_ = t; }
0189 void PPSPixelG4Hit::setPhiAtEntry(float f) { thePhiAtEntry_ = f; }
0190 
0191 float PPSPixelG4Hit::x() const { return theX_; }
0192 void PPSPixelG4Hit::setX(float t) { theX_ = t; }
0193 
0194 float PPSPixelG4Hit::y() const { return theY_; }
0195 void PPSPixelG4Hit::setY(float t) { theY_ = t; }
0196 
0197 float PPSPixelG4Hit::z() const { return theZ_; }
0198 void PPSPixelG4Hit::setZ(float t) { theZ_ = t; }
0199 
0200 int PPSPixelG4Hit::parentId() const { return theParentId_; }
0201 void PPSPixelG4Hit::setParentId(int p) { theParentId_ = p; }
0202 
0203 float PPSPixelG4Hit::vx() const { return theVx_; }
0204 void PPSPixelG4Hit::setVx(float t) { theVx_ = t; }
0205 
0206 float PPSPixelG4Hit::vy() const { return theVy_; }
0207 void PPSPixelG4Hit::setVy(float t) { theVy_ = t; }
0208 
0209 float PPSPixelG4Hit::vz() const { return theVz_; }
0210 void PPSPixelG4Hit::setVz(float t) { theVz_ = t; }
0211 
0212 std::ostream& operator<<(std::ostream& os, const PPSPixelG4Hit& hit) {
0213   os << " Data of this PPSPixelG4Hit are:\n"
0214      << " Time slice ID: " << hit.timeSliceID() << "\n"
0215      << " EnergyDeposit = " << hit.energyLoss() << "\n"
0216      << " Energy of primary particle (ID = " << hit.trackID() << ") = " << hit.incidentEnergy() << " (MeV)"
0217      << "\n"
0218      << " Local entry and exit points in PPS unit number " << hit.unitID() << " are: " << hit.entryPoint() << " (mm)"
0219      << hit.exitPoint() << " (mm)"
0220      << "\n"
0221      << " Global posizion in PPS unit number " << hit.unitID() << " are: " << hit.meanPosition() << " (mm)"
0222      << "\n"
0223      << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
0224   return os;
0225 }