ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
H02MuonHit.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file H02MuonHit.cc
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 #include <iomanip>
31 #include "G4Circle.hh"
32 #include "G4Colour.hh"
33 #include "G4SystemOfUnits.hh"
34 #include "G4VisAttributes.hh"
35 #include "G4VVisManager.hh"
36 #include "H02MuonHit.hh"
37 
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42  : G4VHit(),
43  fModuleID(-1), fPname(), fMomentum(), fPosition(), fTof(0.)
44 {
45 }
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49  const G4ThreeVector& pxyz,
50  const G4ThreeVector& xyz, G4double atof)
51  : fModuleID(imod), fPname(aname), fMomentum(pxyz),
52  fPosition(xyz), fTof(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  fModuleID= right.fModuleID;
72  fPname= right.fPname;
73  fMomentum= right.fMomentum;
74  fPosition= right.fPosition;
75  fTof= right.fTof;
76 
77  return *this;
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 {
83  return (this==&right) ? true : false;
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 {
89  const G4double pt_min=20.*GeV;
90 
92  if(pVVisManager) {
93  G4Circle circle(fPosition);
94  circle.SetScreenSize(5.);
96 
97  G4Color color, goodColor(1.,0.,0.), badColor(0.,0.,1.);
98  if(fMomentum.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= fModuleID;
111  G4String tag="B";
112  if(fModuleID >=10) {
113  id -=10;
114  tag="E";
115  }
116  G4cout << tag << id << " :" << std::setw(12) << fPname.c_str()
117  << " : pT=" << std::setprecision(3) << fMomentum.perp()/GeV
118  << " : TOF=" << std::setprecision(3) << fTof/ns
119  << " : x=" << std::setprecision(3) << fPosition*(1./m)
120  << G4endl;
121 }