7 #include "gutsConventions.h"
10 #include "G4VVisManager.hh"
11 #include "G4Circle.hh"
12 #include "G4VisAttributes.hh"
13 #include "Randomize.hh"
26 for (
int i = 0; i < nsteps; ++i) {
27 globalPositions.push_back(G4ThreeVector(G4UniformRand() * 100, G4UniformRand() * 100, G4UniformRand() * 100));
28 localPositions.push_back(G4ThreeVector(G4UniformRand() * 10, G4UniformRand() * 10, G4UniformRand() * 10));
29 times.push_back(G4UniformRand() * 100);
30 edeps.push_back(G4UniformRand() * 10);
31 pids.push_back(
static_cast<int>(G4UniformRand() * 1000));
38 colorSchema(std::move(cScheme)),
46 averageTime = UNINITIALIZEDNUMBERQUANTITY;
47 avgGlobalPosition = G4ThreeVector(UNINITIALIZEDNUMBERQUANTITY, UNINITIALIZEDNUMBERQUANTITY, UNINITIALIZEDNUMBERQUANTITY);
48 avgLocalPosition = G4ThreeVector(UNINITIALIZEDNUMBERQUANTITY, UNINITIALIZEDNUMBERQUANTITY, UNINITIALIZEDNUMBERQUANTITY);
49 processName = UNINITIALIZEDSTRINGQUANTITY;
61 vector <GIdentifier> gids =
getGID();
62 ttid.reserve(gids.size());
63 for (
auto &gid: gids) {
65 ttid.push_back(gid.getValue());
79 G4VVisManager *pVVisManager = G4VVisManager::GetConcreteInstance();
86 if (globalPositions.empty())
return;
88 G4Circle circle(globalPositions[0]);
89 circle.SetFillStyle(G4Circle::filled);
94 circle.SetScreenSize(10);
95 circle.SetVisAttributes(G4VisAttributes(colour_hit));
96 }
else if (etot == 0) {
97 circle.SetScreenSize(8);
98 circle.SetVisAttributes(G4VisAttributes(colour_passby));
101 pVVisManager->Draw(circle);
112 bool GHit::setColorSchema() {
114 colour_hit = G4Colour(1.0, 0.0, 0.0);
115 colour_passby = G4Colour(0.0, 1.0, 0.0);
Represents a hit in the detector.
GTouchable * getGTouchable() const
Returns the GTouchable associated with the hit.
void addHitInfosForBitset(HitBitSet hbs, const G4Step *thisStep)
Adds hit information based on a HitBitSet.
GHit(GTouchable *gt, HitBitSet hbs, const G4Step *thisStep=nullptr, std::string cScheme="default")
Constructor for GHit.
std::vector< GIdentifier > getGID() const
Returns the detector element identity.
void randomizeHitForTesting(int nsteps)
bool is_same_hit(GHit *hit)
Compare two ghits.
void Draw() override
Draws the hit using Geant4 visualization.
double getTotalEnergyDeposited()
Computes the total energy deposited.
std::vector< int > getTTID()
Returns the touchable identity values as integers.
std::bitset< NHITBITS > HitBitSet
G4ThreadLocal G4Allocator< GHit > * GHitAllocator