#include "B2TrackerHit.hh" #include "G4UnitsTable.hh" #include "G4VVisManager.hh" #include "G4Circle.hh" #include "G4Colour.hh" #include "G4VisAttributes.hh" #include <iomanip>
The code includes necessary headers for Geant4 classes and C++ standard libraries.
G4ThreadLocal G4Allocator<B2TrackerHit>* B2TrackerHitAllocator=0;
This declares a thread-local allocator for B2TrackerHit
objects, which is used for efficient memory management in multi-threaded environments.
B2TrackerHit::B2TrackerHit() : G4VHit(), fTrackID(-1), fChamberNb(-1), fEdep(0.), fPos(G4ThreeVector()) {}
This constructor initializes the B2TrackerHit object with default values:
B2TrackerHit::~B2TrackerHit() {}
This is an empty destructor. It doesn't need to do anything special when the object is destroyed.
B2TrackerHit::B2TrackerHit(const B2TrackerHit& right) : G4VHit() { fTrackID = right.fTrackID; fChamberNb = right.fChamberNb; fEdep = right.fEdep; fPos = right.fPos; }
This constructor creates a new B2TrackerHit object by copying data from an existing one
const B2TrackerHit& B2TrackerHit::operator=(const B2TrackerHit& right) { fTrackID = right.fTrackID; fChamberNb = right.fChamberNb; fEdep = right.fEdep; fPos = right.fPos; return *this; }