Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "SimG4CMS/ShowerLibraryProducer/interface/FiberG4Hit.h"
0002 #include <iostream>
0003 
0004 G4ThreadLocal G4Allocator<FiberG4Hit>* fFiberG4HitAllocator = nullptr;
0005 
0006 FiberG4Hit::FiberG4Hit() : theTowerId(0), theDepth(0), theTrackId(0), theNpe(0), theTime(0), theLogV(nullptr) {
0007   theHitPos.SetCoordinates(0., 0., 0.);
0008 }
0009 
0010 FiberG4Hit::FiberG4Hit(G4LogicalVolume* logVol, G4int tower, G4int depth, G4int tkID)
0011     : theTowerId(tower), theDepth(depth), theTrackId(tkID), theNpe(0), theTime(0), theLogV(logVol) {
0012   theHitPos.SetCoordinates(0., 0., 0.);
0013 }
0014 
0015 FiberG4Hit::~FiberG4Hit() {}
0016 
0017 FiberG4Hit::FiberG4Hit(const FiberG4Hit& right) {
0018   theTowerId = right.theTowerId;
0019   theDepth = right.theDepth;
0020   theNpe = right.theNpe;
0021   theTime = right.theTime;
0022   theHitPos = right.theHitPos;
0023   theLogV = right.theLogV;
0024 }
0025 
0026 const FiberG4Hit& FiberG4Hit::operator=(const FiberG4Hit& right) {
0027   theTowerId = right.theTowerId;
0028   theDepth = right.theDepth;
0029   theNpe = right.theNpe;
0030   theTime = right.theTime;
0031   theHitPos = right.theHitPos;
0032   theLogV = right.theLogV;
0033   return *this;
0034 }
0035 
0036 int FiberG4Hit::operator==(const FiberG4Hit& right) const { return (this == &right) ? 1 : 0; }
0037 
0038 std::ostream& operator<<(std::ostream& os, const FiberG4Hit& hit) {
0039   os << " Data of this FiberG4Hit are:\n"
0040      << " TowerId ID: " << hit.towerId() << "\n"
0041      << " Depth     : " << hit.depth() << "\n"
0042      << " Track ID  : " << hit.trackId() << "\n"
0043      << " Nb. of Cerenkov Photons : " << hit.npe() << "\n"
0044      << " Time   :" << hit.time() << " at " << hit.hitPos() << "\n"
0045      << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
0046   return os;
0047 }