Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExExChSensitiveDetectorHit.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 
31 #include "G4ios.hh"
32 #include "G4VVisManager.hh"
33 #include "G4Circle.hh"
34 #include "G4Colour.hh"
35 #include "G4AttDefStore.hh"
36 #include "G4AttDef.hh"
37 #include "G4AttValue.hh"
38 #include "G4UIcommand.hh"
39 #include "G4UnitsTable.hh"
40 #include "G4VisAttributes.hh"
41 #include "G4LogicalVolume.hh"
42 #include "G4SystemOfUnits.hh"
43 
44 #ifdef G4MULTITHREADED
47 #else
50 #endif
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
53 
55  fLayerID = -1;
56 }
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
59 
61  fLayerID = z;
62 }
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
65 
67 }
68 
69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
70 
73  fLayerID = right.fLayerID;
74  fWorldPos = right.fWorldPos;
75 }
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
78 
82  fLayerID = right.fLayerID;
83  fWorldPos = right.fWorldPos;
84  return *this;
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
88 
89 int ExExChSensitiveDetectorHit::operator==
90  (const ExExChSensitiveDetectorHit &/*right*/) const{
91  return 0;
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
95 
98  if(pVVisManager)
99  {
100  G4Circle circle(fWorldPos);
101  circle.SetScreenSize(2);
103  G4Colour colour(1.,1.,0.);
104  G4VisAttributes attribs(colour);
105  circle.SetVisAttributes(attribs);
106  pVVisManager->Draw(circle);
107  }
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
111 
112 const std::map<G4String,G4AttDef>*
114  G4bool isNew;
115  std::map<G4String,G4AttDef>* store =
116  G4AttDefStore::GetInstance("ExExChSensitiveDetectorHit",isNew);
117  if (isNew) {
118  G4String ID("ID");
119  (*store)[ID] = G4AttDef(ID,"ID","Physics","","G4int");
120 
121  G4String Pos("Pos");
122  (*store)[Pos] =
123  G4AttDef(Pos, "Position","Physics","G4BestUnit","G4ThreeVector");
124  }
125  return store;
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
129 
130 std::vector<G4AttValue>*
132  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
133 
134  values->push_back(G4AttValue("ID",
136  ""));
137 
138  values->push_back(G4AttValue("Pos",G4BestUnit(fWorldPos,"Length"),""));
139 
140  return values;
141 }
142 
143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
144 
146  G4cout << fLayerID <<
147  "," << fWorldPos.x() <<
148  "," << fWorldPos.z() <<
149  "," << fWorldPos.y() << G4endl;
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual std::vector< G4AttValue > * CreateAttValues() const
double x() const
static G4VVisManager * GetConcreteInstance()
ush Pos
Definition: deflate.h:89
void SetFillStyle(FillStyle)
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372
Definition: G4VHit.hh:48
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
#define G4ThreadLocal
Definition: tls.hh:89
Definition of the ExExChSensitiveDetectorHit class.
int G4int
Definition: G4Types.hh:78
double z() const
G4Allocator< ExExChSensitiveDetectorHit > ExExChSensitiveDetectorHitAllocator
G4GLOB_DLL std::ostream G4cout
const ExExChSensitiveDetectorHit & operator=(const ExExChSensitiveDetectorHit &right)
bool G4bool
Definition: G4Types.hh:79
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:80
double y() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
tuple z
Definition: test.py:28
#define G4endl
Definition: G4ios.hh:61
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
void SetScreenSize(G4double)