BOSS 8.0.0
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 "TofSim/BesTofHit.hh"
13#include "G4Circle.hh"
14#include "G4Colour.hh"
15#include "G4UnitsTable.hh"
16#include "G4VVisManager.hh"
17#include "G4VisAttributes.hh"
18#include "G4ios.hh"
19
20G4Allocator<BesTofHit> BesTofHitAllocator;
21
23
25
26BesTofHit::BesTofHit( const BesTofHit& right ) : G4VHit() {
27 m_trackIndex = right.m_trackIndex;
28 m_g4Index = right.m_g4Index;
29 m_partId = right.m_partId;
30 m_scinNb = right.m_scinNb;
31 m_gapNb = right.m_gapNb;
32 m_edep = right.m_edep;
33 m_stepL = right.m_stepL;
34 m_trackL = right.m_trackL;
35 m_pos = right.m_pos;
36 m_time = right.m_time;
37 m_deltaT = right.m_deltaT;
38 m_pDirection = right.m_pDirection;
39 m_momentum = right.m_momentum;
40 // m_scinMaterial = right.m_scinMaterial;
41 m_charge = right.m_charge;
42 m_number_of_ions = right.m_number_of_ions;
43 m_strip = right.m_strip;
44 m_locPos = right.m_locPos;
45}
46
48 m_trackIndex = right.m_trackIndex;
49 m_g4Index = right.m_g4Index;
50 m_partId = right.m_partId;
51 m_scinNb = right.m_scinNb;
52 m_gapNb = right.m_gapNb;
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 m_strip = right.m_strip;
65 m_locPos = right.m_locPos;
66
67 return *this;
68}
69
70int BesTofHit::operator==( const BesTofHit& right ) const {
71 return ( this == &right ) ? 1 : 0;
72}
73
74void BesTofHit::AddHit( const BesTofHit& newHit ) {
75 m_edep += newHit.m_edep;
76 if ( m_edep > newHit.m_edep )
77 {
78 m_time = newHit.m_time;
79 m_pos = newHit.m_pos;
80 }
81}
82
84 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
85 if ( pVVisManager )
86 {
87 G4Circle circle( m_pos );
88 circle.SetScreenSize( 1. );
89 circle.SetFillStyle( G4Circle::filled );
90 G4Colour colour( 0., 0., 1. );
91 G4VisAttributes attribs( colour );
92 circle.SetVisAttributes( attribs );
93 pVVisManager->Draw( circle );
94 }
95}
96
98 G4cout << m_trackIndex << " " << m_g4Index << " " << m_partId << " " << m_scinNb << " ";
99 G4double posx = m_pos.x();
100 G4double posy = m_pos.y();
101 G4double posr = sqrt( posx * posx + posy * posy );
102 G4cout << posr << " " << m_edep << " " << m_stepL << G4endl << G4endl;
103}
G4Allocator< BesTofHit > BesTofHitAllocator
Definition BesTofHit.cc:20
virtual G4int operator==(const BesTofHit &) const
Definition BesTofHit.cc:70
virtual void Print()
Definition BesTofHit.cc:97
virtual ~BesTofHit()
Definition BesTofHit.cc:24
const BesTofHit & operator=(const BesTofHit &)
Definition BesTofHit.cc:47
virtual void Draw()
Definition BesTofHit.cc:83
void AddHit(const BesTofHit &)
Definition BesTofHit.cc:74