CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #include "SimG4CMS/ShowerLibraryProducer/interface/FiberG4Hit.h"
00002 #include <iostream>
00003 
00004 
00005 G4Allocator<FiberG4Hit> FiberG4HitAllocator;
00006 
00007 FiberG4Hit::FiberG4Hit() : theTowerId(0), theDepth(0), theTrackId(0),
00008                            theNpe(0), theTime(0), theLogV(0) {
00009   theHitPos.SetCoordinates(0.,0.,0.);
00010 }
00011 
00012 FiberG4Hit::FiberG4Hit(G4LogicalVolume* logVol, G4int tower, G4int depth,
00013                        G4int tkID) : theTowerId(tower), theDepth(depth), 
00014                                      theTrackId(tkID), theNpe(0), theTime(0), 
00015                                      theLogV(logVol) {
00016   theHitPos.SetCoordinates(0.,0.,0.);
00017 }
00018 
00019 FiberG4Hit::~FiberG4Hit() {}
00020 
00021 FiberG4Hit::FiberG4Hit(const FiberG4Hit &right) {
00022   theTowerId = right.theTowerId;
00023   theDepth   = right.theDepth;
00024   theNpe     = right.theNpe;
00025   theTime    = right.theTime;
00026   theHitPos  = right.theHitPos;
00027   theLogV    = right.theLogV;
00028 }
00029 
00030 const FiberG4Hit& FiberG4Hit::operator=(const FiberG4Hit &right) {
00031   theTowerId = right.theTowerId;
00032   theDepth   = right.theDepth;
00033   theNpe     = right.theNpe;
00034   theTime    = right.theTime;
00035   theHitPos  = right.theHitPos;
00036   theLogV    = right.theLogV;
00037   return *this;
00038 }
00039 
00040 int FiberG4Hit::operator==(const FiberG4Hit &right) const {
00041   return (this==&right) ? 1 : 0;
00042 }
00043 
00044 std::ostream& operator<<(std::ostream& os, const FiberG4Hit& hit) {
00045   os << " Data of this FiberG4Hit are:\n"
00046      << " TowerId ID: " << hit.towerId() << "\n"
00047      << " Depth     : " << hit.depth() << "\n"
00048      << " Track ID  : " << hit.trackId() << "\n"
00049      << " Nb. of Cerenkov Photons : " << hit.npe() << "\n"
00050      << " Time   :" << hit.time() << " at " << hit.hitPos() << "\n"
00051      << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
00052   return os;
00053 }