Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
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
//
28
//
29
//
30
// $Id$
31
//
32
33
#include "
RE01CalorimeterHit.hh
"
34
#include "
G4ios.hh
"
35
#include "
G4VVisManager.hh
"
36
#include "
G4Colour.hh
"
37
#include "
G4AttDefStore.hh
"
38
#include "
G4AttDef.hh
"
39
#include "
G4AttValue.hh
"
40
#include "
G4UIcommand.hh
"
41
#include "
G4UnitsTable.hh
"
42
#include "
G4VisAttributes.hh
"
43
#include "
G4LogicalVolume.hh
"
44
#include "
G4SystemOfUnits.hh
"
45
46
G4Allocator<RE01CalorimeterHit>
RE01CalorimeterHitAllocator
;
47
48
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49
RE01CalorimeterHit::RE01CalorimeterHit
(
G4LogicalVolume
* logVol,
50
G4int
z
,
G4int
phi)
51
:
G4VHit
(), fZCellID(z), fPhiCellID(phi), fEdep(0.0),
52
fPos(0),fRot(0.,0.,0.),fPLogV(logVol),fEdepByATrack(0.0),fTrackInfo()
53
{;}
54
55
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56
RE01CalorimeterHit::~RE01CalorimeterHit
()
57
{;}
58
59
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60
void
RE01CalorimeterHit::Draw
()
61
{
62
G4VVisManager
* pVVisManager =
G4VVisManager::GetConcreteInstance
();
63
if
(pVVisManager)
64
{
65
G4Transform3D
trans(fRot,fPos);
66
G4VisAttributes
attribs;
67
const
G4VisAttributes
* pVA = fPLogV->
GetVisAttributes
();
68
if
(pVA) attribs = *pVA;
69
G4Colour
colour(1.,0.,0.);
70
attribs.
SetColour
(colour);
71
attribs.
SetForceWireframe
(
false
);
72
attribs.
SetForceSolid
(
true
);
73
pVVisManager->
Draw
(*fPLogV,attribs,trans);
74
}
75
}
76
77
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
const
std::map<G4String,G4AttDef>*
RE01CalorimeterHit::GetAttDefs
()
const
79
{
80
G4bool
isNew;
81
std::map<G4String,G4AttDef>* store
82
=
G4AttDefStore::GetInstance
(
"RE01CalorimeterHit"
,isNew);
83
if
(isNew) {
84
G4String
hitType(
"HitType"
);
85
(*store)[hitType] =
G4AttDef
(hitType,
"Hit Type"
,
"Physics"
,
""
,
"G4String"
);
86
87
G4String
zCellID(
"ZCellID"
);
88
(*store)[zCellID] =
G4AttDef
(zCellID,
"Z Cell ID"
,
"Physics"
,
""
,
"G4int"
);
89
90
G4String
phiCellID(
"PhiCellID"
);
91
(*store)[phiCellID] =
G4AttDef
(phiCellID,
"Phi Cell ID"
,
"Physics"
,
""
,
"G4int"
);
92
93
G4String
energy
(
"Energy"
);
94
(*store)[
energy
] =
G4AttDef
(energy,
"Energy Deposited"
,
"Physics"
,
"G4BestUnit"
,
95
"G4double"
);
96
97
G4String
eTrack(
"ETrack"
);
98
(*store)[eTrack] =
G4AttDef
(eTrack,
"Energy Deposited By Track"
,
"Physics"
,
99
"G4BestUnit"
,
"G4double"
);
100
101
G4String
pos(
"Pos"
);
102
(*store)[pos] =
G4AttDef
(pos,
"Position"
,
103
"Physics"
,
"G4BestUnit"
,
"G4ThreeVector"
);
104
105
G4String
lvol(
"LVol"
);
106
(*store)[lvol] =
G4AttDef
(lvol,
"Logical Volume"
,
"Physics"
,
""
,
"G4String"
);
107
}
108
109
return
store;
110
}
111
112
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113
std::vector<G4AttValue>*
RE01CalorimeterHit::CreateAttValues
()
const
114
{
115
std::vector<G4AttValue>* values =
new
std::vector<G4AttValue>;
116
117
values->push_back(
G4AttValue
(
"HitType"
,
"RE01CalorimeterHit"
,
""
));
118
119
values->push_back
120
(
G4AttValue
(
"ZCellID"
,
G4UIcommand::ConvertToString
(fZCellID),
""
));
121
122
values->push_back
123
(
G4AttValue
(
"PhiCellID"
,
G4UIcommand::ConvertToString
(fPhiCellID),
""
));
124
125
values->push_back
126
(
G4AttValue
(
"Energy"
,
G4BestUnit
(fEdep,
"Energy"
),
""
));
127
128
values->push_back
129
(
G4AttValue
(
"ETrack"
,
G4BestUnit
(fEdepByATrack,
"Energy"
),
""
));
130
131
values->push_back
132
(
G4AttValue
(
"Pos"
,
G4BestUnit
(fPos,
"Length"
),
""
));
133
134
if
(fPLogV)
135
values->push_back
136
(
G4AttValue
(
"LVol"
,fPLogV->
GetName
(),
""
));
137
else
138
values->push_back
139
(
G4AttValue
(
"LVol"
,
" "
,
""
));
140
141
return
values;
142
}
143
144
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145
void
RE01CalorimeterHit::Print
()
146
{
147
G4cout
<<
"Cell["
<< fZCellID <<
","
<< fPhiCellID <<
"] "
148
<< fEdep/
GeV
<<
" [GeV]"
<<
G4endl
;
149
}
150
151
Generated on Sat May 25 2013 14:33:01 for Geant4 by
1.8.4