Loading...
Searching...
No Matches
HodoscopeHit.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27/// \file B5/src/HodoscopeHit.cc
28/// \brief Implementation of the B5::HodoscopeHit class
29
30#include "HodoscopeHit.hh"
31
32#include "G4VVisManager.hh"
33#include "G4VisAttributes.hh"
34#include "G4Circle.hh"
35#include "G4Colour.hh"
36#include "G4AttDefStore.hh"
37#include "G4AttDef.hh"
38#include "G4AttValue.hh"
39#include "G4UIcommand.hh"
40#include "G4UnitsTable.hh"
41#include "G4SystemOfUnits.hh"
42#include "G4ios.hh"
43
44namespace B5
45{
46
47//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48
50
51//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52
53HodoscopeHit::HodoscopeHit(G4int id,G4double time)
54: fId(id), fTime(time)
55{}
56
57//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58
59G4bool HodoscopeHit::operator==(const HodoscopeHit &/*right*/) const
60{
61 return false;
62}
63
64//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65
67{
68 auto visManager = G4VVisManager::GetConcreteInstance();
69 if (! visManager) return;
70
71 G4Transform3D trans(fRot.inverse(),fPos);
72 G4VisAttributes attribs;
73 auto pVA = fPLogV->GetVisAttributes();
74 if (pVA) attribs = *pVA;
75 attribs.SetColour(G4Colour::Cyan());
76 attribs.SetForceSolid(true);
77 visManager->Draw(*fPLogV,attribs,trans);
78}
79
80//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81
82const std::map<G4String,G4AttDef>* HodoscopeHit::GetAttDefs() const
83{
84 G4bool isNew;
85 auto store = G4AttDefStore::GetInstance("HodoscopeHit",isNew);
86
87 if (isNew) {
88 (*store)["HitType"]
89 = G4AttDef("HitType","Hit Type","Physics","","G4String");
90
91 (*store)["ID"]
92 = G4AttDef("ID","ID","Physics","","G4int");
93
94 (*store)["Time"]
95 = G4AttDef("Time","Time","Physics","G4BestUnit","G4double");
96
97 (*store)["Pos"]
98 = G4AttDef("Pos","Position","Physics","G4BestUnit","G4ThreeVector");
99
100 (*store)["LVol"]
101 = G4AttDef("LVol","Logical Volume","Physics","","G4String");
102 }
103 return store;
104}
105
106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107
108std::vector<G4AttValue>* HodoscopeHit::CreateAttValues() const
109{
110 auto values = new std::vector<G4AttValue>;
111
112 values
113 ->push_back(G4AttValue("HitType","HodoscopeHit",""));
114 values
115 ->push_back(G4AttValue("ID",G4UIcommand::ConvertToString(fId),""));
116 values
117 ->push_back(G4AttValue("Time",G4BestUnit(fTime,"Time"),""));
118 values
119 ->push_back(G4AttValue("Pos",G4BestUnit(fPos,"Length"),""));
120
121 if (fPLogV)
122 values->push_back(G4AttValue("LVol",fPLogV->GetName(),""));
123 else
124 values->push_back(G4AttValue("LVol"," ",""));
125
126 return values;
127}
128
129//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130
132{
133 G4cout << " Hodoscope[" << fId << "] " << fTime/ns << " (nsec)" << G4endl;
134}
135
136//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
137
138}
Definition of the B5::HodoscopeHit class.
G4bool operator==(const HodoscopeHit &right) const
G4ThreeVector fPos
HodoscopeHit(G4int i, G4double t)
std::vector< G4AttValue > * CreateAttValues() const override
void Draw() override
const G4LogicalVolume * fPLogV
void Print() override
G4RotationMatrix fRot
const std::map< G4String, G4AttDef > * GetAttDefs() const override
G4ThreadLocal G4Allocator< HodoscopeHit > * HodoscopeHitAllocator

Applications | User Support | Publications | Collaboration