Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // $Id: H02MuonHit.cc 77801 2013-11-28 13:33:20Z gcosmo $
30 //
31 #include <iomanip>
32 #include "G4Circle.hh"
33 #include "G4Colour.hh"
34 #include "G4SystemOfUnits.hh"
35 #include "G4VisAttributes.hh"
36 #include "G4VVisManager.hh"
37 #include "H02MuonHit.hh"
38 
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43  : moduleID(-1)
44 {
45 }
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49  const G4ThreeVector& pxyz,
50  const G4ThreeVector& xyz, G4double atof)
51  : moduleID(imod), pname(aname), momentum(pxyz),
52  position(xyz), tof(atof)
53 {
54 }
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 {
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63  : G4VHit()
64 {
65  *this= right;
66 }
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70 {
71  moduleID= right.moduleID;
72  pname= right.pname;
73  momentum= right.momentum;
74  position= right.position;
75  tof= right.tof;
76 
77  return *this;
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 {
83  return (this==&right) ? 1 : 0;
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 {
89  const G4double pt_min=20.*GeV;
90 
92  if(pVVisManager) {
93  G4Circle circle(position);
94  circle.SetScreenSize(5.);
96 
97  G4Color color, goodColor(1.,0.,0.), badColor(0.,0.,1.);
98  if(momentum.perp()>pt_min) color=goodColor;
99  else color=badColor;
100 
101  G4VisAttributes attribs(color);
102  circle.SetVisAttributes(attribs);
103  pVVisManager->Draw(circle);
104  }
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109 {
110  G4int id= moduleID;
111  G4String tag="B";
112  if(moduleID >=10) {
113  id -=10;
114  tag="E";
115  }
116  G4cout << tag << id << " :" << std::setw(12) << pname.c_str()
117  << " : pT=" << std::setprecision(3) << momentum.perp()/GeV
118  << " : TOF=" << std::setprecision(3) << tof/ns
119  << " : x=" << std::setprecision(3) << position*(1./m)
120  << G4endl;
121 }
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
virtual void Draw()
Definition: H02MuonHit.cc:87
static G4VVisManager * GetConcreteInstance()
const H02MuonHit & operator=(const H02MuonHit &right)
Definition: H02MuonHit.cc:69
Definition: xmlparse.cc:187
void SetFillStyle(FillStyle)
Definition: G4VHit.hh:48
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static constexpr double m
Definition: G4SIunits.hh:129
string pname
Definition: eplot.py:33
void SetVisAttributes(const G4VisAttributes *)
Definition: G4Visible.cc:80
virtual void Print()
Definition: H02MuonHit.cc:108
static constexpr double GeV
Definition: G4SIunits.hh:217
G4int operator==(const H02MuonHit &right) const
Definition: H02MuonHit.cc:81
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
double perp() const
G4Allocator< H02MuonHit > H02MuonHitAllocator
Definition: H02MuonHit.cc:39
Definition of the H02MuonHit class.
#define ns
Definition: xmlparse.cc:614
void SetScreenSize(G4double)