Geant4  10.01.p02
XAluminumElectrodeHit.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: XAluminumElectrodeHit.cc 84197 2014-10-10 14:33:03Z gcosmo $
30 //
31 // 20141008 Allocators must be thread-local, and must be pointers
32 
33 #include "XAluminumElectrodeHit.hh"
34 
35 #include "G4LogicalVolume.hh"
36 #include "G4Transform3D.hh"
37 #include "G4RotationMatrix.hh"
38 #include "G4ios.hh"
39 #include "G4VVisManager.hh"
40 #include "G4Circle.hh"
41 #include "G4Colour.hh"
42 #include "G4AttDefStore.hh"
43 #include "G4AttDef.hh"
44 #include "G4AttValue.hh"
45 #include "G4UnitsTable.hh"
46 #include "G4VisAttributes.hh"
47 #include "G4SystemOfUnits.hh"
48 
50 
52 {
53  fTime = 0.;
54  fEdep = 0.;
55 }
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
58 
60 {;}
61 
62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63 
65 : G4VHit() {
66  fTime = right.fTime;
67  fEdep = right.fEdep;
68  fWorldPos = right.fWorldPos;
69  fLocalPos = right.fLocalPos;
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
73 
75 {
76  fTime = right.fTime;
77  fEdep = right.fEdep;
78  fWorldPos = right.fWorldPos;
79  fLocalPos = right.fLocalPos;
80  return *this;
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
84 
86 {
87  return 0;
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
91 
93 {
95  if(pVVisManager)
96  {
97  G4Circle circle(fWorldPos);
98  circle.SetScreenSize(15);
100  G4Colour colour(0.65,0.65,0.);
101  G4VisAttributes attribs(colour);
102  attribs.SetStartTime(fTime);
103  attribs.SetEndTime(fTime+1*ms);
104  circle.SetVisAttributes(attribs);
105  pVVisManager->Draw(circle);
106  }
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
110 
111 const std::map<G4String,G4AttDef>* XAluminumElectrodeHit::GetAttDefs() const
112 {
113  G4bool isNew;
114  std::map<G4String,G4AttDef>* store
115  = G4AttDefStore::GetInstance("XAluminumElectrodeHit",isNew);
116  if (isNew) {
117  G4String HitType("HitType");
118  (*store)[HitType] = G4AttDef(HitType,"Hit Type","Physics","","G4String");
119 
120  G4String Time("Time");
121  (*store)[Time] = G4AttDef(Time,"Time","Physics","G4BestUnit","G4double");
122 
123  G4String EDep("EDep");
124  (*store)[EDep] = G4AttDef(Time,"EDep","Physics","G4BestUnit","G4double");
125 
126  G4String Pos("Pos");
127  (*store)[Pos] = G4AttDef(Pos, "Position",
128  "Physics","G4BestUnit","G4ThreeVector");
129  }
130  return store;
131 }
132 
133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
134 
135 std::vector<G4AttValue>* XAluminumElectrodeHit::CreateAttValues() const
136 {
137  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
138 
139  values->push_back(G4AttValue("HitType","XAluminumElectrodeHit",""));
140 
141  values->push_back
142  (G4AttValue("Time",G4BestUnit(fTime,"Time"),""));
143 
144  values->push_back
145  (G4AttValue("EDep",G4BestUnit(fEdep,"Energy"),""));
146 
147  values->push_back
148  (G4AttValue("Pos",G4BestUnit(fWorldPos,"Length"),""));
149 
150  return values;
151 }
152 
153 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
154 
156 {
157  G4cout << " time " << fTime/ns << " (nsec) : at " << fLocalPos
158  << " -- fEdep = " << fEdep/eV << " [eV]" << G4endl;
159 }
160 
161 
const XAluminumElectrodeHit & operator=(const XAluminumElectrodeHit &right)
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
G4ThreadLocal G4Allocator< XAluminumElectrodeHit > * XAluminumElectrodeHitAllocator
static G4VVisManager * GetConcreteInstance()
void SetFillStyle(FillStyle)
void SetStartTime(G4double)
Definition: G4VHit.hh:48
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
#define G4ThreadLocal
Definition: tls.hh:89
void SetEndTime(G4double)
static const double ms
Definition: G4SIunits.hh:151
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition of the XAluminumElectrodeHit class.
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:80
static const double eV
Definition: G4SIunits.hh:194
#define G4endl
Definition: G4ios.hh:61
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
int operator==(const XAluminumElectrodeHit &right) const
#define ns
Definition: xmlparse.cc:597
void SetScreenSize(G4double)