File indexing completed on 2025-12-16 09:29:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include "AnalysisManager.hh"
0028 #include "eRositaTrackerHit.hh"
0029
0030 #include "G4Circle.hh"
0031 #include "G4Colour.hh"
0032 #include "G4ios.hh"
0033 #include "G4UnitsTable.hh"
0034 #include "G4VisAttributes.hh"
0035 #include "G4VVisManager.hh"
0036
0037
0038
0039 G4ThreadLocal G4Allocator<eRositaTrackerHit> *trackerHitAllocator{nullptr};
0040
0041
0042
0043 eRositaTrackerHit::eRositaTrackerHit()
0044 {
0045 }
0046
0047
0048
0049 eRositaTrackerHit::~eRositaTrackerHit()
0050 {
0051 }
0052
0053
0054
0055 eRositaTrackerHit::eRositaTrackerHit(const eRositaTrackerHit& right) :
0056 trackIdentifier(right.trackIdentifier),
0057 chamberNumber(right.chamberNumber),
0058 depositedEnergy(right.depositedEnergy),
0059 position(right.position)
0060 {
0061 }
0062
0063
0064
0065 auto eRositaTrackerHit::operator=(const eRositaTrackerHit& right) -> const eRositaTrackerHit&
0066 {
0067 trackIdentifier = right.trackIdentifier;
0068 chamberNumber = right.chamberNumber;
0069 depositedEnergy = right.depositedEnergy;
0070 position = right.position;
0071
0072 return *this;
0073 }
0074
0075
0076
0077 auto eRositaTrackerHit::operator==(const eRositaTrackerHit& right) const -> G4bool
0078 {
0079 return this == &right;
0080 }
0081
0082
0083
0084 void eRositaTrackerHit::Draw()
0085 {
0086 auto *visualizationManager = G4VVisManager::GetConcreteInstance();
0087 if (visualizationManager != nullptr) {
0088 constexpr auto CIRCLE_SCREEN_SIZE = 2.;
0089
0090 G4Circle circle(position);
0091 circle.SetScreenSize(CIRCLE_SCREEN_SIZE);
0092 circle.SetFillStyle(G4Circle::filled);
0093 G4Colour colour(1., 0., 0.);
0094 G4VisAttributes attributes(colour);
0095 circle.SetVisAttributes(attributes);
0096 visualizationManager->Draw(circle);
0097 }
0098 }
0099
0100
0101
0102 void eRositaTrackerHit::Print()
0103 {
0104 G4cout << " track identifier: " << trackIdentifier
0105 << " deposited energy: " << G4BestUnit(depositedEnergy, "Energy")
0106 << " position: " << G4BestUnit(position, "Length") << G4endl;
0107 }
0108
0109
0110
0111 void eRositaTrackerHit::PrintToFile() const
0112 {
0113
0114
0115
0116
0117
0118
0119 AnalysisManager::Instance()->Score(depositedEnergy);
0120 }