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
eventgenerator
HepMC
HepMCEx02
src
H02MuonHit.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
//
31
// H02MuonHit.cc
32
// $Id$
33
//
34
// ====================================================================
35
#include "
H02MuonHit.hh
"
36
#include "
G4VVisManager.hh
"
37
#include "
G4Circle.hh
"
38
#include "
G4Colour.hh
"
39
#include "
G4VisAttributes.hh
"
40
#include "
G4SystemOfUnits.hh
"
41
#include <iomanip>
42
43
G4Allocator<H02MuonHit>
H02MuonHitAllocator
;
44
46
H02MuonHit::H02MuonHit
()
47
: moduleID(-1)
49
{
50
}
51
53
H02MuonHit::H02MuonHit
(
G4int
imod,
G4String
aname,
54
const
G4ThreeVector
& pxyz,
55
const
G4ThreeVector
& xyz,
G4double
atof)
56
: moduleID(imod),
pname
(aname), momentum(pxyz),
57
position
(xyz), tof(atof)
59
{
60
}
61
63
H02MuonHit::~H02MuonHit
()
65
{
66
}
67
69
H02MuonHit::H02MuonHit
(
const
H02MuonHit
&
right
)
71
:
G4VHit
()
72
{
73
*
this
=
right
;
74
}
75
77
const
H02MuonHit
&
H02MuonHit::operator=
(
const
H02MuonHit
&
right
)
79
{
80
moduleID= right.moduleID;
81
pname= right.pname;
82
momentum= right.momentum;
83
position
= right.position;
84
tof= right.tof;
85
86
return
*
this
;
87
}
88
90
G4int
H02MuonHit::operator==
(
const
H02MuonHit
&
right
)
const
92
{
93
return
(
this
==&
right
) ? 1 : 0;
94
}
95
97
void
H02MuonHit::Draw
()
99
{
100
const
G4double
pt_min=20.*
GeV
;
101
102
G4VVisManager
* pVVisManager=
G4VVisManager::GetConcreteInstance
();
103
if
(pVVisManager) {
104
G4Circle
circle(
position
);
105
circle.
SetScreenSize
(5.);
106
circle.
SetFillStyle
(
G4Circle::filled
);
107
108
G4Color
color, goodColor(1.,0.,0.), badColor(0.,0.,1.);
109
if
(momentum.
perp
()>pt_min) color=goodColor;
110
else
color=badColor;
111
112
G4VisAttributes
attribs(color);
113
circle.
SetVisAttributes
(attribs);
114
pVVisManager->
Draw
(circle);
115
}
116
}
117
119
void
H02MuonHit::Print
()
121
{
122
G4int
id
= moduleID;
123
G4String
tag
=
"B"
;
124
if
(moduleID >=10) {
125
id
-=10;
126
tag=
"E"
;
127
}
128
G4cout
<< tag <<
id
<<
" :"
<< std::setw(12) << pname.c_str()
129
<<
" : pT="
<< std::setprecision(3) << momentum.
perp
()/
GeV
130
<<
" : TOF="
<< std::setprecision(3) << tof/
ns
131
<<
" : x="
<< std::setprecision(3) <<
position
*(1./
m
)
132
<<
G4endl
;
133
}
Generated on Sat May 25 2013 14:32:24 for Geant4 by
1.8.4