CMS 3D CMS Logo

FiberG4Hit.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 G4ThreadLocal G4Allocator<FiberG4Hit> *fFiberG4HitAllocator = nullptr;
5 
6 FiberG4Hit::FiberG4Hit() : theTowerId(0), theDepth(0), theTrackId(0),
7  theNpe(0), theTime(0), theLogV(nullptr) {
8  theHitPos.SetCoordinates(0.,0.,0.);
9 }
10 
11 FiberG4Hit::FiberG4Hit(G4LogicalVolume* logVol, G4int tower, G4int depth,
12  G4int tkID) : theTowerId(tower), theDepth(depth),
13  theTrackId(tkID), theNpe(0), theTime(0),
14  theLogV(logVol) {
15  theHitPos.SetCoordinates(0.,0.,0.);
16 }
17 
19 
21  theTowerId = right.theTowerId;
22  theDepth = right.theDepth;
23  theNpe = right.theNpe;
24  theTime = right.theTime;
25  theHitPos = right.theHitPos;
26  theLogV = right.theLogV;
27 }
28 
30  theTowerId = right.theTowerId;
31  theDepth = right.theDepth;
32  theNpe = right.theNpe;
33  theTime = right.theTime;
34  theHitPos = right.theHitPos;
35  theLogV = right.theLogV;
36  return *this;
37 }
38 
39 int FiberG4Hit::operator==(const FiberG4Hit &right) const {
40  return (this==&right) ? 1 : 0;
41 }
42 
43 std::ostream& operator<<(std::ostream& os, const FiberG4Hit& hit) {
44  os << " Data of this FiberG4Hit are:\n"
45  << " TowerId ID: " << hit.towerId() << "\n"
46  << " Depth : " << hit.depth() << "\n"
47  << " Track ID : " << hit.trackId() << "\n"
48  << " Nb. of Cerenkov Photons : " << hit.npe() << "\n"
49  << " Time :" << hit.time() << " at " << hit.hitPos() << "\n"
50  << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
51  return os;
52 }
G4int theTrackId
Definition: FiberG4Hit.h:32
~FiberG4Hit() override
Definition: FiberG4Hit.cc:18
G4int depth() const
Definition: FiberG4Hit.h:49
G4double theTime
Definition: FiberG4Hit.h:34
#define nullptr
G4int operator==(const FiberG4Hit &right) const
Definition: FiberG4Hit.cc:39
G4int theTowerId
Definition: FiberG4Hit.h:30
G4int towerId() const
Definition: FiberG4Hit.h:48
std::ostream & operator<<(std::ostream &os, const FiberG4Hit &hit)
Definition: FiberG4Hit.cc:43
G4ThreadLocal G4Allocator< FiberG4Hit > * fFiberG4HitAllocator
Definition: FiberG4Hit.cc:4
G4double time() const
Definition: FiberG4Hit.h:53
const FiberG4Hit & operator=(const FiberG4Hit &right)
Definition: FiberG4Hit.cc:29
math::XYZPoint hitPos() const
Definition: FiberG4Hit.h:52
const G4LogicalVolume * theLogV
Definition: FiberG4Hit.h:37
G4int theNpe
Definition: FiberG4Hit.h:33
G4int npe() const
Definition: FiberG4Hit.h:51
math::XYZPoint theHitPos
Definition: FiberG4Hit.h:35
G4int theDepth
Definition: FiberG4Hit.h:31
G4int trackId() const
Definition: FiberG4Hit.h:50