Geant4  10.02.p02
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 //
26 
28 #include "G4ios.hh"
29 #include "G4VVisManager.hh"
30 #include "G4Circle.hh"
31 #include "G4Colour.hh"
32 #include "G4AttDefStore.hh"
33 #include "G4AttDef.hh"
34 #include "G4AttValue.hh"
35 #include "G4UIcommand.hh"
36 #include "G4UnitsTable.hh"
37 #include "G4VisAttributes.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4SystemOfUnits.hh"
40 
41 #ifdef G4MULTITHREADED
44 #else
47 #endif
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 
52  fLayerID = -1;
53 }
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56 
58  fLayerID = z;
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62 
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
67 
70  fLayerID = right.fLayerID;
71  fWorldPos = right.fWorldPos;
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
75 
79  fLayerID = right.fLayerID;
80  fWorldPos = right.fWorldPos;
81  return *this;
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
85 
86 int ExExChSensitiveDetectorHit::operator==
87  (const ExExChSensitiveDetectorHit &/*right*/) const{
88  return 0;
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
92 
95  if(pVVisManager)
96  {
97  G4Circle circle(fWorldPos);
98  circle.SetScreenSize(2);
100  G4Colour colour(1.,1.,0.);
101  G4VisAttributes attribs(colour);
102  circle.SetVisAttributes(attribs);
103  pVVisManager->Draw(circle);
104  }
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
108 
109 const std::map<G4String,G4AttDef>*
111  G4bool isNew;
112  std::map<G4String,G4AttDef>* store =
113  G4AttDefStore::GetInstance("ExExChSensitiveDetectorHit",isNew);
114  if (isNew) {
115  G4String ID("ID");
116  (*store)[ID] = G4AttDef(ID,"ID","Physics","","G4int");
117 
118  G4String Pos("Pos");
119  (*store)[Pos] =
120  G4AttDef(Pos, "Position","Physics","G4BestUnit","G4ThreeVector");
121  }
122  return store;
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
126 
127 std::vector<G4AttValue>*
129  std::vector<G4AttValue>* values = new std::vector<G4AttValue>;
130 
131  values->push_back(G4AttValue("ID",
133  ""));
134 
135  values->push_back(G4AttValue("Pos",G4BestUnit(fWorldPos,"Length"),""));
136 
137  return values;
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
141 
143  G4cout << fLayerID <<
144  "," << fWorldPos.x() <<
145  "," << fWorldPos.z() <<
146  "," << fWorldPos.y() << G4endl;
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual std::vector< G4AttValue > * CreateAttValues() const
static G4VVisManager * GetConcreteInstance()
G4double z
Definition: TRTMaterials.hh:39
void SetFillStyle(FillStyle)
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
Definition: G4VHit.hh:48
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
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
G4Allocator< ExExChSensitiveDetectorHit > ExExChSensitiveDetectorHitAllocator
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
#define G4endl
Definition: G4ios.hh:61
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
void SetScreenSize(G4double)