ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
B5DriftChamberHit.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file B5DriftChamberHit.cc
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 //
29 
30 #include "B5DriftChamberHit.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 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49 
51 : G4VHit(),
52  fLayerID(-1), fTime(0.), fLocalPos(0), fWorldPos(0)
53 {}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58 : G4VHit(),
59  fLayerID(layerID), fTime(0.), fLocalPos(0), fWorldPos(0)
60 {}
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63 
65 {}
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 : G4VHit(),
71  fLayerID(right.fLayerID),
72  fTime(right.fTime),
73  fLocalPos(right.fLocalPos),
74  fWorldPos(right.fWorldPos)
75 {}
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80 {
81  fLayerID = right.fLayerID;
82  fTime = right.fTime;
83  fLocalPos = right.fLocalPos;
84  fWorldPos = right.fWorldPos;
85  return *this;
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
92  return false;
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  auto visManager = G4VVisManager::GetConcreteInstance();
100  if (! visManager) return;
101 
102  G4Circle circle(fWorldPos);
103  circle.SetScreenSize(2);
105  G4Colour colour(1.,1.,0.);
106  G4VisAttributes attribs(colour);
107  circle.SetVisAttributes(attribs);
108  visManager->Draw(circle);
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
113 const std::map<G4String,G4AttDef>* B5DriftChamberHit::GetAttDefs() const
114 {
115  G4bool isNew;
116  auto store = G4AttDefStore::GetInstance("B5DriftChamberHit",isNew);
117 
118  if (isNew) {
119  (*store)["HitType"]
120  = G4AttDef("HitType","Hit Type","Physics","","G4String");
121 
122  (*store)["ID"]
123  = G4AttDef("ID","ID","Physics","","G4int");
124 
125  (*store)["Time"]
126  = G4AttDef("Time","Time","Physics","G4BestUnit","G4double");
127 
128  (*store)["Pos"]
129  = G4AttDef("Pos", "Position", "Physics","G4BestUnit","G4ThreeVector");
130  }
131 
132  return store;
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
137 std::vector<G4AttValue>* B5DriftChamberHit::CreateAttValues() const
138 {
139  auto values = new std::vector<G4AttValue>;
140 
141  values
142  ->push_back(G4AttValue("HitType","DriftChamberHit",""));
143  values
144  ->push_back(G4AttValue("ID",G4UIcommand::ConvertToString(fLayerID),""));
145  values
146  ->push_back(G4AttValue("Time",G4BestUnit(fTime,"Time"),""));
147  values
148  ->push_back(G4AttValue("Pos",G4BestUnit(fWorldPos,"Length"),""));
149 
150  return values;
151 }
152 
153 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
154 
156 {
157  G4cout << " Layer[" << fLayerID << "] : time " << fTime/ns
158  << " (nsec) --- local (x,y) " << fLocalPos.x()
159  << ", " << fLocalPos.y() << G4endl;
160 }
161 
162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......