BOSS 6.6.4.p01
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_edep=right.m_edep;
34 m_stepL=right.m_stepL;
35 m_trackL=right.m_trackL;
36 m_pos=right.m_pos;
37 m_time=right.m_time;
38 m_deltaT=right.m_deltaT;
39 m_pDirection=right.m_pDirection;
40 m_momentum=right.m_momentum;
41 //m_scinMaterial = right.m_scinMaterial;
42 m_charge = right.m_charge;
43 m_number_of_ions=right.m_number_of_ions;
44 }
45
46
48{
49 m_trackIndex=right.m_trackIndex;
50 m_g4Index=right.m_g4Index;
51 m_partId=right.m_partId;
52 m_scinNb=right.m_scinNb;
53 m_edep=right.m_edep;
54 m_stepL=right.m_stepL;
55 m_trackL=right.m_trackL;
56 m_pos=right.m_pos;
57 m_time=right.m_time;
58 m_deltaT=right.m_deltaT;
59 m_pDirection=right.m_pDirection;
60 m_momentum=right.m_momentum;
61 //m_scinMaterial = right.m_scinMaterial;
62 m_charge = right.m_charge;
63 m_number_of_ions = right.m_number_of_ions;
64
65 return *this;
66}
67
68
69
70int BesTofHit::operator==(const BesTofHit& right) const
71{
72 return (this==&right) ? 1 : 0;
73}
74
75void BesTofHit::AddHit(const BesTofHit& newHit)
76{
77 m_edep += newHit.m_edep;
78 if (m_edep>newHit.m_edep)
79 {
80 m_time = newHit.m_time;
81 m_pos = newHit.m_pos;
82 }
83}
84
86{
87 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
88 if (pVVisManager)
89 {
90 G4Circle circle(m_pos);
91 circle.SetScreenSize(1.);
92 circle.SetFillStyle(G4Circle::filled);
93 G4Colour colour(0.,0.,1.);
94 G4VisAttributes attribs(colour);
95 circle.SetVisAttributes(attribs);
96 pVVisManager->Draw(circle);
97 }
98}
99
100
102{
103 G4cout<<m_trackIndex<<" "<<m_g4Index<<" "<<m_partId<<" "<<m_scinNb<<" ";
104 G4double posx = m_pos.x();
105 G4double posy = m_pos.y();
106 G4double posr = sqrt(posx*posx + posy*posy);
107 G4cout<<posr<<" "<<m_edep<<" "<<m_stepL<<G4endl;
108}
109
110
G4Allocator< BesTofHit > BesTofHitAllocator
Definition: BesTofHit.cc:20
virtual G4int operator==(const BesTofHit &) const
Definition: BesTofHit.cc:70
virtual void Print()
Definition: BesTofHit.cc:101
virtual ~BesTofHit()
Definition: BesTofHit.cc:24
const BesTofHit & operator=(const BesTofHit &)
Definition: BesTofHit.cc:47
virtual void Draw()
Definition: BesTofHit.cc:85
void AddHit(const BesTofHit &)
Definition: BesTofHit.cc:75