File indexing completed on 2024-05-10 02:21:14
0001 #include "SimG4CMS/Calo/interface/CaloGVHit.h"
0002 #include <iostream>
0003
0004 #include <CLHEP/Units/SystemOfUnits.h>
0005
0006 CaloGVHit::CaloGVHit() {
0007 eventID_ = 0;
0008 elem_ = 0.;
0009 hadr_ = 0.;
0010 }
0011
0012 CaloGVHit::~CaloGVHit() {}
0013
0014 CaloGVHit::CaloGVHit(const CaloGVHit& right) {
0015 eventID_ = right.eventID_;
0016 elem_ = right.elem_;
0017 hadr_ = right.hadr_;
0018 hitID_ = right.hitID_;
0019 }
0020
0021 const CaloGVHit& CaloGVHit::operator=(const CaloGVHit& right) {
0022 eventID_ = right.eventID_;
0023 elem_ = right.elem_;
0024 hadr_ = right.hadr_;
0025 hitID_ = right.hitID_;
0026 return *this;
0027 }
0028
0029 void CaloGVHit::addEnergyDeposit(double em, double hd) {
0030 elem_ += em;
0031 hadr_ += hd;
0032 }
0033
0034 void CaloGVHit::addEnergyDeposit(const CaloGVHit& aHit) { addEnergyDeposit(aHit.getEM(), aHit.getHadr()); }
0035
0036 std::ostream& operator<<(std::ostream& os, const CaloGVHit& hit) {
0037 os << " Data of this CaloGVHit are:"
0038 << " EventID: " << hit.getEventID() << " HitID: " << hit.getID() << " EnergyDeposit (EM): " << hit.getEM()
0039 << " (Had): " << hit.getHadr() << "\n";
0040 return os;
0041 }