CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/SimG4CMS/ShowerLibraryProducer/src/HFShowerG4Hit.cc

Go to the documentation of this file.
00001 #include "SimG4CMS/ShowerLibraryProducer/interface/HFShowerG4Hit.h"
00002 
00003 #include <iostream>
00004 
00005 
00006 G4Allocator<HFShowerG4Hit> HFShowerG4HitAllocator;
00007 
00008 HFShowerG4Hit::HFShowerG4Hit() : theHitId(0), theTrackId(0), theEdep(0),
00009                                  theTime(0) {}
00010 
00011 HFShowerG4Hit::HFShowerG4Hit(G4int hitId, G4int tkID, double edep,
00012                              double time) : theHitId(hitId), theTrackId(tkID),
00013                                             theEdep(edep), theTime(time) {}
00014 
00015 HFShowerG4Hit::~HFShowerG4Hit() {}
00016 
00017 HFShowerG4Hit::HFShowerG4Hit(const HFShowerG4Hit &right) {
00018   theHitId   = right.theHitId;
00019   theTrackId = right.theTrackId;
00020   theEdep    = right.theEdep;
00021   theTime    = right.theTime;
00022   localPos   = right.localPos;
00023   globalPos  = right.globalPos;
00024   momDir     = right.momDir;
00025 }
00026 
00027 const HFShowerG4Hit& HFShowerG4Hit::operator=(const HFShowerG4Hit &right) {
00028   theHitId   = right.theHitId;
00029   theTrackId = right.theTrackId;
00030   theEdep    = right.theEdep;
00031   theTime    = right.theTime;
00032   localPos   = right.localPos;
00033   globalPos  = right.globalPos;
00034   momDir     = right.momDir;
00035   return *this;
00036 }
00037 
00038 int HFShowerG4Hit::operator==(const HFShowerG4Hit &right) const {
00039   return (this==&right) ? 1 : 0;
00040 }
00041 
00042 std::ostream& operator<<(std::ostream& os, const HFShowerG4Hit& hit) {
00043   os << " Data of this HFShowerG4Hit: ID " << hit.hitId() << " Track ID "
00044      << hit.trackId() << " Edep " << hit.edep() << " Time " << hit.time()
00045      << " Position (Local) " << hit.localPosition() << ", " << " (Global) "
00046      << hit.globalPosition() << " Momentum " << hit.primaryMomDir() << "\n";
00047   return os;
00048 }