Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
A01HodoscopeHit.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 "A01HodoscopeHit.hh"
33 #include "G4VVisManager.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 "G4VisAttributes.hh"
42 #include "G4SystemOfUnits.hh"
43 #include "G4ios.hh"
44 
46 
48 {
49  fId = i;
50  fTime = t;
51  fPLogV = 0;
52 }
53 
55 {;}
56 
58  : G4VHit() {
59  fId = right.fId;
60  fTime = right.fTime;
61  fPos = right.fPos;
62  fRot = right.fRot;
63  fPLogV = right.fPLogV;
64 }
65 
67 {
68  fId = right.fId;
69  fTime = right.fTime;
70  fPos = right.fPos;
71  fRot = right.fRot;
72  fPLogV = right.fPLogV;
73  return *this;
74 }
75 
76 int A01HodoscopeHit::operator==(const A01HodoscopeHit &/*right*/) const
77 {
78  return 0;
79 }
80 
82 {
84  if(pVVisManager)
85  {
86  G4Transform3D trans(fRot.inverse(),fPos);
87  G4VisAttributes attribs;
88  const G4VisAttributes* pVA = fPLogV->GetVisAttributes();
89  if(pVA) attribs = *pVA;
90  G4Colour colour(0.,1.,1.);
91  attribs.SetColour(colour);
92  attribs.SetForceSolid(true);
93  pVVisManager->Draw(*fPLogV,attribs,trans);
94  }
95 }
96 
97 const std::map<G4String,G4AttDef>* A01HodoscopeHit::GetAttDefs() const
98 {
99  G4bool isNew;
100  std::map<G4String,G4AttDef>* store
101  = G4AttDefStore::GetInstance("A01HodoscopeHit",isNew);
102  if (isNew) {
103  G4String HitType("HitType");
104  (*store)[HitType] = G4AttDef(HitType,"Hit Type","Physics","","G4String");
105 
106  G4String ID("ID");
107  (*store)[ID] = G4AttDef(ID,"ID","Physics","","G4int");
108 
109  G4String Time("Time");
110  (*store)[Time] = G4AttDef(Time,"Time","Physics","G4BestUnit","G4double");
111 
112  G4String Pos("Pos");
113  (*store)[Pos] = G4AttDef(Pos, "Position",
114  "Physics","G4BestUnit","G4ThreeVector");
115 
116  G4String LVol("LVol");
117  (*store)[LVol] = G4AttDef(LVol,"Logical Volume","Physics","","G4String");
118  }
119  return store;
120 }
121 
122 std::vector<G4AttValue>* A01HodoscopeHit::CreateAttValues() const
123 {
124  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
125 
126  values->push_back(G4AttValue("HitType","HodoscopeHit",""));
127 
128  values->push_back
130 
131  values->push_back
132  (G4AttValue("Time",G4BestUnit(fTime,"Time"),""));
133 
134  values->push_back
135  (G4AttValue("Pos",G4BestUnit(fPos,"Length"),""));
136 
137  if (fPLogV)
138  values->push_back
139  (G4AttValue("LVol",fPLogV->GetName(),""));
140  else
141  values->push_back
142  (G4AttValue("LVol"," ",""));
143 
144  return values;
145 }
146 
148 {
149  G4cout << " Hodoscope[" << fId << "] " << fTime/ns << " (nsec)" << G4endl;
150 }
151 
152 
153