Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
A01DriftChamberHit.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 //
28 //
29 // $Id$
30 // --------------------------------------------------------------
31 //
32 #include "A01DriftChamberHit.hh"
33 #include "G4ios.hh"
34 #include "G4VVisManager.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 "G4VisAttributes.hh"
43 #include "G4LogicalVolume.hh"
44 #include "G4SystemOfUnits.hh"
45 
47 
49 {
50  fLayerID = -1;
51  fTime = 0.;
52 }
53 
55 {
56  fLayerID = z;
57  fTime = 0.;
58 }
59 
61 {;}
62 
64  : G4VHit() {
65  fLayerID = right.fLayerID;
66  fWorldPos = right.fWorldPos;
67  fLocalPos = right.fLocalPos;
68  fTime = right.fTime;
69 }
70 
72 {
73  fLayerID = right.fLayerID;
74  fWorldPos = right.fWorldPos;
75  fLocalPos = right.fLocalPos;
76  fTime = right.fTime;
77  return *this;
78 }
79 
81 {
82  return 0;
83 }
84 
86 {
88  if(pVVisManager)
89  {
90  G4Circle circle(fWorldPos);
91  circle.SetScreenSize(2);
93  G4Colour colour(1.,1.,0.);
94  G4VisAttributes attribs(colour);
95  circle.SetVisAttributes(attribs);
96  pVVisManager->Draw(circle);
97  }
98 }
99 
100 const std::map<G4String,G4AttDef>* A01DriftChamberHit::GetAttDefs() const
101 {
102  G4bool isNew;
103  std::map<G4String,G4AttDef>* store
104  = G4AttDefStore::GetInstance("A01DriftChamberHit",isNew);
105  if (isNew) {
106  G4String HitType("HitType");
107  (*store)[HitType] = G4AttDef(HitType,"Hit Type","Physics","","G4String");
108 
109  G4String ID("ID");
110  (*store)[ID] = G4AttDef(ID,"ID","Physics","","G4int");
111 
112  G4String Time("Time");
113  (*store)[Time] = G4AttDef(Time,"Time","Physics","G4BestUnit","G4double");
114 
115  G4String Pos("Pos");
116  (*store)[Pos] = G4AttDef(Pos, "Position",
117  "Physics","G4BestUnit","G4ThreeVector");
118  }
119  return store;
120 }
121 
122 std::vector<G4AttValue>* A01DriftChamberHit::CreateAttValues() const
123 {
124  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
125 
126  values->push_back(G4AttValue("HitType","DriftChamberHit",""));
127 
128  values->push_back
129  (G4AttValue("ID",G4UIcommand::ConvertToString(fLayerID),""));
130 
131  values->push_back
132  (G4AttValue("Time",G4BestUnit(fTime,"Time"),""));
133 
134  values->push_back
135  (G4AttValue("Pos",G4BestUnit(fWorldPos,"Length"),""));
136 
137  return values;
138 }
139 
141 {
142  G4cout << " Layer[" << fLayerID << "] : time " << fTime/ns
143  << " (nsec) --- local (x,y) " << fLocalPos.x()
144  << ", " << fLocalPos.y() << G4endl;
145 }
146 
147