Download
|
User Forum
|
Contact Us
|
Bug Reports
Home
>
Examples
Loading...
Searching...
No Matches
extended
runAndEvent
RE01
src
RE01CalorimeterHit.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
/// \file runAndEvent/RE01/src/RE01CalorimeterHit.cc
27
/// \brief Implementation of the RE01CalorimeterHit class
28
//
29
//
30
//
31
32
#include "
RE01CalorimeterHit.hh
"
33
#include "G4ios.hh"
34
#include "G4VVisManager.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 "G4LogicalVolume.hh"
43
#include "G4SystemOfUnits.hh"
44
45
G4ThreadLocal
G4Allocator<RE01CalorimeterHit>
*
RE01CalorimeterHitAllocator
= 0;
46
47
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48
RE01CalorimeterHit::RE01CalorimeterHit
(
G4LogicalVolume
* logVol,
49
G4int z, G4int phi)
50
:
G4VHit
(), fZCellID(z), fPhiCellID(phi), fEdep(0.0),
51
fPos(0),fRot(0.,0.,0.),fPLogV(logVol),fEdepByATrack(0.0),fTrackInfo()
52
{;}
53
54
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55
RE01CalorimeterHit::~RE01CalorimeterHit
()
56
{;}
57
58
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59
void
RE01CalorimeterHit::Draw
()
60
{
61
G4VVisManager
* pVVisManager = G4VVisManager::GetConcreteInstance();
62
if
(pVVisManager)
63
{
64
G4Transform3D trans(
fRot
,
fPos
);
65
G4VisAttributes
attribs;
66
const
G4VisAttributes
* pVA =
fPLogV
->GetVisAttributes();
67
if
(pVA) attribs = *pVA;
68
G4Colour
colour(1.,0.,0.);
69
attribs.SetColour(colour);
70
attribs.SetForceWireframe(
false
);
71
attribs.SetForceSolid(
true
);
72
pVVisManager->Draw(*
fPLogV
,attribs,trans);
73
}
74
}
75
76
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77
const
std::map<G4String,G4AttDef>*
RE01CalorimeterHit::GetAttDefs
()
const
78
{
79
G4bool isNew;
80
std::map<G4String,G4AttDef>* store
81
= G4AttDefStore::GetInstance(
"RE01CalorimeterHit"
,isNew);
82
if
(isNew) {
83
G4String
hitType(
"HitType"
);
84
(*store)[hitType] =
G4AttDef
(hitType,
"Hit Type"
,
"Physics"
,
""
,
"G4String"
);
85
86
G4String
zCellID(
"ZCellID"
);
87
(*store)[zCellID] =
G4AttDef
(zCellID,
"Z Cell ID"
,
"Physics"
,
""
,
"G4int"
);
88
89
G4String
phiCellID(
"PhiCellID"
);
90
(*store)[phiCellID] =
G4AttDef
(phiCellID,
"Phi Cell ID"
,
"Physics"
,
""
,
"G4int"
);
91
92
G4String
energy(
"Energy"
);
93
(*store)[energy] =
G4AttDef
(energy,
"Energy Deposited"
,
"Physics"
,
"G4BestUnit"
,
94
"G4double"
);
95
96
G4String
eTrack(
"ETrack"
);
97
(*store)[eTrack] =
G4AttDef
(eTrack,
"Energy Deposited By Track"
,
"Physics"
,
98
"G4BestUnit"
,
"G4double"
);
99
100
G4String
pos(
"Pos"
);
101
(*store)[pos] =
G4AttDef
(pos,
"Position"
,
102
"Physics"
,
"G4BestUnit"
,
"G4ThreeVector"
);
103
104
G4String
lvol(
"LVol"
);
105
(*store)[lvol] =
G4AttDef
(lvol,
"Logical Volume"
,
"Physics"
,
""
,
"G4String"
);
106
}
107
108
return
store;
109
}
110
111
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112
std::vector<G4AttValue>*
RE01CalorimeterHit::CreateAttValues
()
const
113
{
114
std::vector<G4AttValue>* values =
new
std::vector<G4AttValue>;
115
116
values->push_back(
G4AttValue
(
"HitType"
,
"RE01CalorimeterHit"
,
""
));
117
118
values->push_back
119
(
G4AttValue
(
"ZCellID"
,G4UIcommand::ConvertToString(
fZCellID
),
""
));
120
121
values->push_back
122
(
G4AttValue
(
"PhiCellID"
,G4UIcommand::ConvertToString(
fPhiCellID
),
""
));
123
124
values->push_back
125
(
G4AttValue
(
"Energy"
,
G4BestUnit
(
fEdep
,
"Energy"
),
""
));
126
127
values->push_back
128
(
G4AttValue
(
"ETrack"
,
G4BestUnit
(
fEdepByATrack
,
"Energy"
),
""
));
129
130
values->push_back
131
(
G4AttValue
(
"Pos"
,
G4BestUnit
(
fPos
,
"Length"
),
""
));
132
133
if
(
fPLogV
)
134
values->push_back
135
(
G4AttValue
(
"LVol"
,
fPLogV
->GetName(),
""
));
136
else
137
values->push_back
138
(
G4AttValue
(
"LVol"
,
" "
,
""
));
139
140
return
values;
141
}
142
143
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
144
void
RE01CalorimeterHit::Print
()
145
{
146
G4cout <<
"Cell["
<<
fZCellID
<<
","
<<
fPhiCellID
<<
"] "
147
<<
fEdep
/GeV <<
" [GeV]"
<< G4endl;
148
}
149
150
RE01CalorimeterHitAllocator
G4ThreadLocal G4Allocator< RE01CalorimeterHit > * RE01CalorimeterHitAllocator
Definition
RE01CalorimeterHit.cc:45
RE01CalorimeterHit.hh
Definition of the RE01CalorimeterHit class.
G4Allocator
G4AttDef
G4AttValue
G4BestUnit
G4Colour
G4LogicalVolume
G4String
G4VHit
G4VVisManager
G4VisAttributes
RE01CalorimeterHit::CreateAttValues
virtual std::vector< G4AttValue > * CreateAttValues() const
Definition
RE01CalorimeterHit.cc:112
RE01CalorimeterHit::GetAttDefs
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
Definition
RE01CalorimeterHit.cc:77
RE01CalorimeterHit::fEdep
G4double fEdep
Definition
RE01CalorimeterHit.hh:90
RE01CalorimeterHit::fPLogV
const G4LogicalVolume * fPLogV
Definition
RE01CalorimeterHit.hh:93
RE01CalorimeterHit::~RE01CalorimeterHit
virtual ~RE01CalorimeterHit()
Definition
RE01CalorimeterHit.cc:55
RE01CalorimeterHit::Draw
virtual void Draw()
Definition
RE01CalorimeterHit.cc:59
RE01CalorimeterHit::fPos
G4ThreeVector fPos
Definition
RE01CalorimeterHit.hh:91
RE01CalorimeterHit::RE01CalorimeterHit
RE01CalorimeterHit(G4LogicalVolume *logVol, G4int z, G4int phi)
Definition
RE01CalorimeterHit.cc:48
RE01CalorimeterHit::fPhiCellID
G4int fPhiCellID
Definition
RE01CalorimeterHit.hh:89
RE01CalorimeterHit::fZCellID
G4int fZCellID
Definition
RE01CalorimeterHit.hh:88
RE01CalorimeterHit::Print
virtual void Print()
Definition
RE01CalorimeterHit.cc:144
RE01CalorimeterHit::fEdepByATrack
G4double fEdepByATrack
Definition
RE01CalorimeterHit.hh:94
RE01CalorimeterHit::fRot
G4RotationMatrix fRot
Definition
RE01CalorimeterHit.hh:92
Generated on Tue Jan 30 2024 12:18:45 for Geant4 examples by
1.9.8
Applications
|
User Support
|
Publications
|
Collaboration