File indexing completed on 2026-03-29 07:52:07
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
0028
0029 #include "RE05CalorimeterHit.hh"
0030
0031 #include "G4AttCheck.hh"
0032 #include "G4AttDef.hh"
0033 #include "G4AttValue.hh"
0034 #include "G4Colour.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4UIcommand.hh"
0037 #include "G4UnitsTable.hh"
0038 #include "G4VVisManager.hh"
0039 #include "G4VisAttributes.hh"
0040 #include "G4ios.hh"
0041
0042 G4ThreadLocal G4Allocator<RE05CalorimeterHit>* RE05CalorimeterHitAllocator = 0;
0043
0044 std::map<G4String, G4AttDef> RE05CalorimeterHit::fAttDefs;
0045
0046
0047
0048 RE05CalorimeterHit::RE05CalorimeterHit()
0049 : G4VHit(), fZCellID(-1), fPhiCellID(-1), fEdep(0.), fPos(), fRot(), fLogV(0)
0050 {}
0051
0052
0053
0054 RE05CalorimeterHit::RE05CalorimeterHit(G4LogicalVolume* logVol, G4int z, G4int phi)
0055 : G4VHit(), fZCellID(z), fPhiCellID(phi), fEdep(0.), fPos(), fRot(), fLogV(logVol)
0056 {}
0057
0058
0059
0060 RE05CalorimeterHit::~RE05CalorimeterHit() {}
0061
0062
0063
0064 RE05CalorimeterHit::RE05CalorimeterHit(const RE05CalorimeterHit& right) : G4VHit()
0065 {
0066 fZCellID = right.fZCellID;
0067 fPhiCellID = right.fPhiCellID;
0068 fEdep = right.fEdep;
0069 fPos = right.fPos;
0070 fRot = right.fRot;
0071 fLogV = right.fLogV;
0072 }
0073
0074
0075
0076 const RE05CalorimeterHit& RE05CalorimeterHit::operator=(const RE05CalorimeterHit& right)
0077 {
0078 fZCellID = right.fZCellID;
0079 fPhiCellID = right.fPhiCellID;
0080 fEdep = right.fEdep;
0081 fPos = right.fPos;
0082 fRot = right.fRot;
0083 fLogV = right.fLogV;
0084 return *this;
0085 }
0086
0087
0088
0089 G4bool RE05CalorimeterHit::operator==(const RE05CalorimeterHit& right) const
0090 {
0091 return ((fZCellID == right.fZCellID) && (fPhiCellID == right.fPhiCellID));
0092 }
0093
0094
0095
0096 void RE05CalorimeterHit::Draw()
0097 {
0098 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
0099 if (pVVisManager) {
0100 G4Transform3D trans(fRot, fPos);
0101 G4VisAttributes attribs;
0102 const G4VisAttributes* pVA = fLogV->GetVisAttributes();
0103 if (pVA) attribs = *pVA;
0104 G4Colour colour(1., 0., 0.);
0105 attribs.SetColour(colour);
0106 attribs.SetForceSolid(true);
0107 pVVisManager->Draw(*fLogV, attribs, trans);
0108 }
0109 }
0110
0111
0112
0113 const std::map<G4String, G4AttDef>* RE05CalorimeterHit::GetAttDefs() const
0114 {
0115
0116 if (fAttDefs.empty()) {
0117 fAttDefs["HitType"] = G4AttDef("HitType", "Type of hit", "Physics", "", "G4String");
0118 fAttDefs["ZID"] = G4AttDef("ZID", "Z Cell ID", "Physics", "", "G4int");
0119 fAttDefs["PhiID"] = G4AttDef("PhiID", "Phi Cell ID", "Physics", "", "G4int");
0120 fAttDefs["EDep"] = G4AttDef("EDep", "Energy defPosited", "Physics", "G4BestUnit", "G4double");
0121 }
0122 return &fAttDefs;
0123 }
0124
0125
0126
0127 std::vector<G4AttValue>* RE05CalorimeterHit::CreateAttValues() const
0128 {
0129
0130 std::vector<G4AttValue>* attValues = new std::vector<G4AttValue>;
0131 attValues->push_back(G4AttValue("HitType", "RE05CalorimeterHit", ""));
0132 attValues->push_back(G4AttValue("ZID", G4UIcommand::ConvertToString(fZCellID), ""));
0133 attValues->push_back(G4AttValue("PhiID", G4UIcommand::ConvertToString(fPhiCellID), ""));
0134 attValues->push_back(G4AttValue("EDep", G4BestUnit(fEdep, "Energy"), ""));
0135
0136 return attValues;
0137 }
0138
0139
0140
0141 void RE05CalorimeterHit::Print() {}
0142
0143