Geant4  10.00.p03
B5DriftChamberHit.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 // $Id: B5DriftChamberHit.cc 76474 2013-11-11 10:36:34Z gcosmo $
27 //
30 
31 #include "B5DriftChamberHit.hh"
32 
33 #include "G4VVisManager.hh"
34 #include "G4VisAttributes.hh"
35 #include "G4Circle.hh"
36 #include "G4Colour.hh"
37 #include "G4AttDefStore.hh"
38 #include "G4AttDef.hh"
39 #include "G4AttValue.hh"
40 #include "G4UIcommand.hh"
41 #include "G4UnitsTable.hh"
42 #include "G4SystemOfUnits.hh"
43 #include "G4ios.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
52 : G4VHit(), fLayerID(-1), fTime(0.), fLocalPos(0), fWorldPos(0)
53 {}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58 : G4VHit(), fLayerID(z), fTime(0.), fLocalPos(0), fWorldPos(0)
59 {}
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 
64 {}
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69 : G4VHit() {
70  fLayerID = right.fLayerID;
71  fWorldPos = right.fWorldPos;
72  fLocalPos = right.fLocalPos;
73  fTime = right.fTime;
74 }
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 {
80  fLayerID = right.fLayerID;
81  fWorldPos = right.fWorldPos;
82  fLocalPos = right.fLocalPos;
83  fTime = right.fTime;
84  return *this;
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
90 {
91  return 0;
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95 
97 {
99  if(pVVisManager)
100  {
101  G4Circle circle(fWorldPos);
102  circle.SetScreenSize(2);
104  G4Colour colour(1.,1.,0.);
105  G4VisAttributes attribs(colour);
106  circle.SetVisAttributes(attribs);
107  pVVisManager->Draw(circle);
108  }
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
113 const std::map<G4String,G4AttDef>* B5DriftChamberHit::GetAttDefs() const
114 {
115  G4bool isNew;
116  std::map<G4String,G4AttDef>* store
117  = G4AttDefStore::GetInstance("B5DriftChamberHit",isNew);
118 
119  if (isNew) {
120  (*store)["HitType"]
121  = G4AttDef("HitType","Hit Type","Physics","","G4String");
122 
123  (*store)["ID"]
124  = G4AttDef("ID","ID","Physics","","G4int");
125 
126  (*store)["Time"]
127  = G4AttDef("Time","Time","Physics","G4BestUnit","G4double");
128 
129  (*store)["Pos"]
130  = G4AttDef("Pos", "Position", "Physics","G4BestUnit","G4ThreeVector");
131  }
132  return store;
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
137 std::vector<G4AttValue>* B5DriftChamberHit::CreateAttValues() const
138 {
139  std::vector<G4AttValue>* 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......
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual void Draw()
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4VVisManager * GetConcreteInstance()
G4double z
Definition: TRTMaterials.hh:39
void SetFillStyle(FillStyle)
int operator==(const B5DriftChamberHit &right) const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:357
Definition: G4VHit.hh:48
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual ~B5DriftChamberHit()
virtual std::vector< G4AttValue > * CreateAttValues() const
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
Drift chamber hit.
G4ThreeVector fWorldPos
virtual void Print()
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:80
const B5DriftChamberHit & operator=(const B5DriftChamberHit &right)
G4ThreeVector fLocalPos
G4ThreadLocal G4Allocator< B5DriftChamberHit > * B5DriftChamberHitAllocator
#define G4endl
Definition: G4ios.hh:61
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
#define ns
Definition: xmlparse.cc:597
Definition of the B5DriftChamberHit class.
void SetScreenSize(G4double)