BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTofHit.cc
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool //
3//---------------------------------------------------------------------------//
4//Description:
5//Author: Dengzy
6//Created: Mar, 2004
7//Modified:
8//Comment:
9//---------------------------------------------------------------------------//
10// $Id: BesTofHit.cc
11
12#include "BesTofHit.hh"
13#include "G4UnitsTable.hh"
14#include "G4VVisManager.hh"
15#include "G4Circle.hh"
16#include "G4Colour.hh"
17#include "G4VisAttributes.hh"
18#include "G4ios.hh"
19
20G4Allocator<BesTofHit> BesTofHitAllocator;
21
23
25
27 :G4VHit()
28{
29 m_trackIndex=right.m_trackIndex;
30 m_g4Index=right.m_g4Index;
31 m_partId=right.m_partId;
32 m_scinNb=right.m_scinNb;
33 m_gapNb=right.m_gapNb;
34 m_edep=right.m_edep;
35 m_stepL=right.m_stepL;
36 m_trackL=right.m_trackL;
37 m_pos=right.m_pos;
38 m_time=right.m_time;
39 m_deltaT=right.m_deltaT;
40 m_pDirection=right.m_pDirection;
41 m_momentum=right.m_momentum;
42 //m_scinMaterial = right.m_scinMaterial;
43 m_charge = right.m_charge;
44 m_number_of_ions=right.m_number_of_ions;
45 m_strip = right.m_strip;
46 m_locPos = right.m_locPos;
47}
48
49
51{
52 m_trackIndex=right.m_trackIndex;
53 m_g4Index=right.m_g4Index;
54 m_partId=right.m_partId;
55 m_scinNb=right.m_scinNb;
56 m_gapNb=right.m_gapNb;
57 m_edep=right.m_edep;
58 m_stepL=right.m_stepL;
59 m_trackL=right.m_trackL;
60 m_pos=right.m_pos;
61 m_time=right.m_time;
62 m_deltaT=right.m_deltaT;
63 m_pDirection=right.m_pDirection;
64 m_momentum=right.m_momentum;
65 //m_scinMaterial = right.m_scinMaterial;
66 m_charge = right.m_charge;
67 m_number_of_ions = right.m_number_of_ions;
68 m_strip = right.m_strip;
69 m_locPos = right.m_locPos;
70
71 return *this;
72}
73
74
75
76int BesTofHit::operator==(const BesTofHit& right) const
77{
78 return (this==&right) ? 1 : 0;
79}
80
81void BesTofHit::AddHit(const BesTofHit& newHit)
82{
83 m_edep += newHit.m_edep;
84 if (m_edep>newHit.m_edep)
85 {
86 m_time = newHit.m_time;
87 m_pos = newHit.m_pos;
88 }
89}
90
92{
93 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
94 if (pVVisManager)
95 {
96 G4Circle circle(m_pos);
97 circle.SetScreenSize(1.);
98 circle.SetFillStyle(G4Circle::filled);
99 G4Colour colour(0.,0.,1.);
100 G4VisAttributes attribs(colour);
101 circle.SetVisAttributes(attribs);
102 pVVisManager->Draw(circle);
103 }
104}
105
106
108{
109 G4cout<<m_trackIndex<<" "<<m_g4Index<<" "<<m_partId<<" "<<m_scinNb<<" ";
110 G4double posx = m_pos.x();
111 G4double posy = m_pos.y();
112 G4double posr = sqrt(posx*posx + posy*posy);
113 G4cout<<posr<<" "<<m_edep<<" "<<m_stepL<<G4endl<<G4endl;
114}
115
116
G4Allocator< BesTofHit > BesTofHitAllocator
Definition: BesTofHit.cc:20
virtual G4int operator==(const BesTofHit &) const
Definition: BesTofHit.cc:76
virtual void Print()
Definition: BesTofHit.cc:107
virtual ~BesTofHit()
Definition: BesTofHit.cc:24
const BesTofHit & operator=(const BesTofHit &)
Definition: BesTofHit.cc:50
virtual void Draw()
Definition: BesTofHit.cc:91
void AddHit(const BesTofHit &)
Definition: BesTofHit.cc:81