SToGS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SToGS_G4_CopClusterHit.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 
29 #include "G4VVisManager.hh"
30 #include "G4Circle.hh"
31 #include "G4Colour.hh"
32 #include "G4VisAttributes.hh"
33 #include "G4UnitsTable.hh"
34 
35 #ifdef G4MULTITHREADED
36 G4ThreadLocal G4Allocator<SToGS::CopClusterHit> *SToGS::CopClusterHitAllocator = 0;
37 #else
38 G4Allocator<SToGS::CopClusterHit> *SToGS::CopClusterHitAllocator = 0;
39 #endif
40 
42  detID(-1),
43  motherID(-1),
44  edep(0.0),
45  ToF(0.0),
46  pos(0.0,0.0,0.0),
47  detName("-"),
48  motherDetName("-")
49 {
50 }
51 
53 {
54  ;
55 }
56 
58 {
59  if ( this == &from ) return;
60 
61  edep = from.edep;
62  pos = from.pos;
63 
64  detID = from.detID;
65  motherID = from.motherID;
66 
67  ToF = from.ToF;
68 
69  detName = from.detName;
70  motherDetName = from.motherDetName;
71 
72  NbHits = from.NbHits;
73 }
74 
76 {
77  if ( this == &from )
78  return (*this);
79 
80  edep = from.edep;
81  pos = from.pos;
82 
83  detID = from.detID;
84  motherID = from.motherID;
85 
86  ToF = from.ToF;
87 
88  detName = from.detName;
89  motherDetName = from.motherDetName;
90 
91  NbHits = from.NbHits;
92 
93  return (*this);
94 }
95 
97 {
98  return (this==&from) ? 1 : 0;
99 }
100 
102 {
103  G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
104  if(pVVisManager)
105  {
106  G4Circle circle(pos);
107  circle.SetScreenSize(0.04); circle.SetFillStyle(G4Circle::filled);
108 
109  G4Colour colour(1.,0.,0.);
110  G4VisAttributes attribs(G4Colour(1.,0.,0.)); circle.SetVisAttributes(attribs);
111  pVVisManager->Draw(circle);
112  }
113 }
114 
116 {
117  G4cout << "--------------- SToGS::CopClusterHit::Print() --------------------- " << G4endl;
118  G4cout << "detID: " << detID
119  << ", detName: " << detName
120  << ", motherID: " << motherID
121  << ", motherDetName: " << motherDetName << G4endl;
122  G4cout << "edep: " << edep / CLHEP::keV << " keV"
123  << ", pos: " << pos
124  << ", ToF: " << ToF / CLHEP::ns << " ns" << G4endl;
125  G4cout << "--------------------------------------------------------------" << G4endl;
126 }
127 
129 {
130  if ( edep == 0.0 )
131  return;
132 
133  ToF /= edep;
134  pos /= edep;
135 }
136 
137 
138 
139 
140 
141 
142 
143 
G4ThreadLocal G4Allocator< CopClusterHit > * CopClusterHitAllocator
void EndOfEvent()
to be applied at the end of an event to calculate properly the mean values
#define G4ThreadLocal
Informations to keep the energy is in a sensitive detector.
G4int operator==(const CopClusterHit &right) const
const CopClusterHit & operator=(const CopClusterHit &right)