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