BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesMucDigit Class Reference

#include <BesMucDigit.hh>

Public Member Functions

 BesMucDigit ()
 ~BesMucDigit ()
void SetHit (BesMucHit *hit)
G4int GetTrackIndex ()
G4int GetPart ()
G4int GetSeg ()
G4int GetGap ()
G4VPhysicalVolume * GetNearestStrip ()
G4int GetNearestStripNo ()
G4VPhysicalVolume * GetStrip (G4int i)
G4float GetStripPos (G4VPhysicalVolume *pvStrip)
G4int IsNearest (G4int i)
 BesMucDigit ()
 ~BesMucDigit ()
void SetHit (BesMucHit *hit)
G4int GetTrackIndex ()
G4int GetPart ()
G4int GetSeg ()
G4int GetGap ()
G4VPhysicalVolume * GetNearestStrip ()
G4int GetNearestStripNo ()
G4VPhysicalVolume * GetStrip (G4int i)
G4float GetStripPos (G4VPhysicalVolume *pvStrip)
G4int IsNearest (G4int i)
 BesMucDigit ()
 ~BesMucDigit ()
void SetHit (BesMucHit *hit)
G4int GetTrackIndex ()
G4int GetPart ()
G4int GetSeg ()
G4int GetGap ()
G4VPhysicalVolume * GetNearestStrip ()
G4int GetNearestStripNo ()
G4VPhysicalVolume * GetStrip (G4int i)
G4float GetStripPos (G4VPhysicalVolume *pvStrip)
G4int IsNearest (G4int i)

Detailed Description

Constructor & Destructor Documentation

◆ BesMucDigit() [1/3]

BesMucDigit::BesMucDigit ( )

Definition at line 22 of file BesMucDigit.cc.

22{}

◆ ~BesMucDigit() [1/3]

BesMucDigit::~BesMucDigit ( )

Definition at line 24 of file BesMucDigit.cc.

24{}

◆ BesMucDigit() [2/3]

BesMucDigit::BesMucDigit ( )

◆ ~BesMucDigit() [2/3]

BesMucDigit::~BesMucDigit ( )

◆ BesMucDigit() [3/3]

BesMucDigit::BesMucDigit ( )

◆ ~BesMucDigit() [3/3]

BesMucDigit::~BesMucDigit ( )

Member Function Documentation

◆ GetGap() [1/3]

G4int BesMucDigit::GetGap ( )
inline

Definition at line 39 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucSim/BesMucDigit.hh.

39{ return m_pHit->GetGap(); }

Referenced by BesMucDigitizer::Digitize(), and BesMucSD::ProcessHits().

◆ GetGap() [2/3]

G4int BesMucDigit::GetGap ( )
inline

Definition at line 39 of file InstallArea/x86_64-el9-gcc13-opt/include/MucSim/BesMucDigit.hh.

39{ return m_pHit->GetGap(); }

◆ GetGap() [3/3]

G4int BesMucDigit::GetGap ( )
inline

Definition at line 39 of file Simulation/BOOST/MucSim/include/MucSim/BesMucDigit.hh.

39{ return m_pHit->GetGap(); }

◆ GetNearestStrip() [1/3]

G4VPhysicalVolume * BesMucDigit::GetNearestStrip ( )

Definition at line 51 of file BesMucDigit.cc.

51 {
52 m_pvStripDigit = GetStrip( GetNearestStripNo() );
53 if ( !m_pvStripDigit ) { G4cerr << "Nearest Strip is not found." << G4endl; }
54
55 return m_pvStripDigit;
56}
G4VPhysicalVolume * GetStrip(G4int i)
G4int GetNearestStripNo()

Referenced by BesMucEfficiency::SetHit().

◆ GetNearestStrip() [2/3]

G4VPhysicalVolume * BesMucDigit::GetNearestStrip ( )

◆ GetNearestStrip() [3/3]

G4VPhysicalVolume * BesMucDigit::GetNearestStrip ( )

◆ GetNearestStripNo() [1/3]

G4int BesMucDigit::GetNearestStripNo ( )

Definition at line 58 of file BesMucDigit.cc.

58 {
59 if ( m_pHit->GetTrackID() != -1 )
60 {
61 G4float posStrip0 = GetStripPos( GetStrip( 0 ) );
62 G4float posStrip1 = GetStripPos( GetStrip( 1 ) );
63 G4float width = posStrip1 - posStrip0;
64 // G4cout << "posStrip0 " << posStrip0 << " posStrip1 " << posStrip1 << G4endl;
65
66 G4int iGuessStrip = G4int( ( m_Pos - posStrip0 ) / width + 0.5 );
67 // confine iGuessStrip to an extend before check IsNearest.
68 if ( iGuessStrip < 0 ) { iGuessStrip = 0; }
69 else if ( iGuessStrip >= 112 ) { iGuessStrip = 112; }
70 // G4cout << "m_pos=" << m_Pos << "firstly, I guess: " << iGuessStrip << G4endl;
71
72 G4int step = IsNearest( iGuessStrip );
73 while ( step != 0 )
74 {
75 // G4cout << "guess " << iGuessStrip << " wrong , iGuess " << step << G4endl;
76 iGuessStrip += step;
77 step = IsNearest( iGuessStrip );
78 }
79 // G4cout << " guess " << iGuessStrip << " right " << G4endl;
80
81 // deal with barrel segment 2 gap%2!=0
82 G4int part = m_pHit->GetPart();
83 G4int seg = m_pHit->GetSeg();
84 G4int gap = m_pHit->GetGap();
85 // G4cout<<" in Digit iGuessStrip = "<< iGuessStrip <<G4endl;
86 if ( part == 1 && seg == 2 && gap % 2 != 0 && iGuessStrip > 79 )
87 {
88 if ( iGuessStrip > 79 && iGuessStrip <= 95 && m_Pos2 < 0 ) iGuessStrip += 16;
89 if ( iGuessStrip > 95 && iGuessStrip <= 111 && m_Pos2 > 0 ) iGuessStrip -= 16;
90 // G4cout<<" in barrel segment 2 and gap%2!=0, and strip > 79 strip="<< iGuessStrip<<"
91 // posx="<<m_Pos2<<" "<<" posy="<<m_Pos<<G4endl;
92 }
93
94 return iGuessStrip;
95 }
96 else return m_pHit->GetStrip();
97}
G4float GetStripPos(G4VPhysicalVolume *pvStrip)
G4int IsNearest(G4int i)

Referenced by BesMucDigitizer::Digitize(), GetNearestStrip(), BesMucSD::ProcessHits(), and BesMucEfficiency::SetHit().

◆ GetNearestStripNo() [2/3]

G4int BesMucDigit::GetNearestStripNo ( )

◆ GetNearestStripNo() [3/3]

G4int BesMucDigit::GetNearestStripNo ( )

◆ GetPart() [1/3]

G4int BesMucDigit::GetPart ( )
inline

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucSim/BesMucDigit.hh.

37{ return m_pHit->GetPart(); }

Referenced by BesMucDigitizer::Digitize(), and BesMucSD::ProcessHits().

◆ GetPart() [2/3]

G4int BesMucDigit::GetPart ( )
inline

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-opt/include/MucSim/BesMucDigit.hh.

37{ return m_pHit->GetPart(); }

◆ GetPart() [3/3]

G4int BesMucDigit::GetPart ( )
inline

Definition at line 37 of file Simulation/BOOST/MucSim/include/MucSim/BesMucDigit.hh.

37{ return m_pHit->GetPart(); }

◆ GetSeg() [1/3]

G4int BesMucDigit::GetSeg ( )
inline

Definition at line 38 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucSim/BesMucDigit.hh.

38{ return m_pHit->GetSeg(); }

Referenced by BesMucDigitizer::Digitize(), and BesMucSD::ProcessHits().

◆ GetSeg() [2/3]

G4int BesMucDigit::GetSeg ( )
inline

Definition at line 38 of file InstallArea/x86_64-el9-gcc13-opt/include/MucSim/BesMucDigit.hh.

38{ return m_pHit->GetSeg(); }

◆ GetSeg() [3/3]

G4int BesMucDigit::GetSeg ( )
inline

Definition at line 38 of file Simulation/BOOST/MucSim/include/MucSim/BesMucDigit.hh.

38{ return m_pHit->GetSeg(); }

◆ GetStrip() [1/3]

G4VPhysicalVolume * BesMucDigit::GetStrip ( G4int i)

Definition at line 99 of file BesMucDigit.cc.

99 {
100 // If no strip get, return 0.
101 // If i > daughtersNo, there will be run error.
102 G4LogicalVolume* lvStripPlane = m_lvGap->GetDaughter( 0 )->GetLogicalVolume();
103 G4int daughtersNo = lvStripPlane->GetNoDaughters();
104
105 if ( i >= 0 && i < daughtersNo )
106 {
107 G4VPhysicalVolume* pvStrip = lvStripPlane->GetDaughter( i );
108 G4String strStrip = pvStrip->GetLogicalVolume()->GetName();
109 // G4cout << "length " << strStrip.length() << G4endl;
110 // if(strStrip.length() == 30) { //use name length to determine whether it is a strip
111
112 if ( strStrip.find( "s" ) == 10 )
113 { //"Strip" at 23 of "logicalMucPart1Seg0Gap0Strip111"
114 //"s" at 10 of lMucP0S0G0s001
115 return pvStrip;
116 }
117 // return pvStrip;
118 }
119
120 return 0;
121}

Referenced by GetNearestStrip(), GetNearestStripNo(), and IsNearest().

◆ GetStrip() [2/3]

G4VPhysicalVolume * BesMucDigit::GetStrip ( G4int i)

◆ GetStrip() [3/3]

G4VPhysicalVolume * BesMucDigit::GetStrip ( G4int i)

◆ GetStripPos() [1/3]

G4float BesMucDigit::GetStripPos ( G4VPhysicalVolume * pvStrip)

Definition at line 123 of file BesMucDigit.cc.

123 {
124 G4float pos = 1.0e38;
125 if ( !pvStrip ) return pos;
126
127 G4int part = m_pHit->GetPart();
128 G4int gap = m_pHit->GetGap();
129
130 pos = pvStrip->GetObjectTranslation().x();
131 if ( ( part == 1 && gap % 2 != 0 ) || ( part != 1 && gap % 2 == 0 ) )
132 { pos = pvStrip->GetObjectTranslation().y(); }
133
134 G4String striptype = pvStrip->GetLogicalVolume()->GetSolid()->GetEntityType();
135 // G4String striplenght= pvStrip->GetLogicalVolume()->GetName();
136 G4Box* temp;
137 temp = (G4Box*)pvStrip->GetLogicalVolume()->GetSolid();
138 G4double length = temp->GetXHalfLength();
139 // std::ostream length;
140 // pvStrip->GetLogicalVolume()->GetSolid()->StreamInfo( length);
141
142 G4float box1, box2, box3;
143 // length>>box1>>box2>>box3;
144 // G4cout<<length<<" "<<striptype<<" in GetStripPos
145 // "<<pvStrip->GetObjectTranslation().x()<<" "<<pvStrip->GetObjectTranslation().y()<<"
146 // "<<pvStrip->GetObjectTranslation().z()<<G4endl;
147 return pos;
148}

Referenced by GetNearestStripNo(), and IsNearest().

◆ GetStripPos() [2/3]

G4float BesMucDigit::GetStripPos ( G4VPhysicalVolume * pvStrip)

◆ GetStripPos() [3/3]

G4float BesMucDigit::GetStripPos ( G4VPhysicalVolume * pvStrip)

◆ GetTrackIndex() [1/3]

G4int BesMucDigit::GetTrackIndex ( )
inline

Definition at line 36 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucSim/BesMucDigit.hh.

36{ return m_pHit->GetTrackIndex(); }

Referenced by BesMucDigitizer::Digitize().

◆ GetTrackIndex() [2/3]

G4int BesMucDigit::GetTrackIndex ( )
inline

Definition at line 36 of file InstallArea/x86_64-el9-gcc13-opt/include/MucSim/BesMucDigit.hh.

36{ return m_pHit->GetTrackIndex(); }

◆ GetTrackIndex() [3/3]

G4int BesMucDigit::GetTrackIndex ( )
inline

Definition at line 36 of file Simulation/BOOST/MucSim/include/MucSim/BesMucDigit.hh.

36{ return m_pHit->GetTrackIndex(); }

◆ IsNearest() [1/3]

G4int BesMucDigit::IsNearest ( G4int i)

Definition at line 150 of file BesMucDigit.cc.

150 {
151 G4float posMax = 1.0e38;
152 G4float posLeftStrip;
153 G4float posRightStrip;
154 G4float posCurrentStrip;
155
156 G4VPhysicalVolume* pvLeftStrip = GetStrip( i - 1 );
157 G4VPhysicalVolume* pvRightStrip = GetStrip( i + 1 );
158 G4VPhysicalVolume* pvCurrentStrip = GetStrip( i );
159
160 if ( i < 0 ) { return i; }
161 else if ( i == 0 )
162 {
163 posLeftStrip = -1.0 * posMax;
164 posRightStrip = GetStripPos( pvRightStrip );
165 }
166 else if ( !pvCurrentStrip )
167 {
168 // i > Max.
169 return -1;
170 }
171 else if ( !pvRightStrip )
172 {
173 // i = Max.
174 posLeftStrip = GetStripPos( pvLeftStrip );
175 posRightStrip = posMax;
176 }
177 else
178 {
179 // 0 < i < Max.
180 posLeftStrip = GetStripPos( pvLeftStrip );
181 posRightStrip = GetStripPos( pvRightStrip );
182 }
183 posCurrentStrip = GetStripPos( pvCurrentStrip );
184
185 G4float distCurrent = std::abs( m_Pos - posCurrentStrip );
186 G4float distLeft = std::abs( m_Pos - posLeftStrip );
187 G4float distRight = std::abs( m_Pos - posRightStrip );
188
189 // G4cout << "left " << distLeft << " current " << distCurrent << " right " << distRight <<
190 // G4endl;
191
192 if ( ( distCurrent <= distLeft ) && ( distCurrent <= distRight ) ) { return 0; }
193 else if ( distCurrent > distLeft ) { return -1; }
194 else { return 1; }
195}

Referenced by GetNearestStripNo().

◆ IsNearest() [2/3]

G4int BesMucDigit::IsNearest ( G4int i)

◆ IsNearest() [3/3]

G4int BesMucDigit::IsNearest ( G4int i)

◆ SetHit() [1/3]

void BesMucDigit::SetHit ( BesMucHit * hit)

Definition at line 26 of file BesMucDigit.cc.

26 {
27 m_pHit = hit;
28
29 G4int part = m_pHit->GetPart();
30 G4int seg = m_pHit->GetSeg();
31 G4int gap = m_pHit->GetGap();
32 m_Pos = m_pHit->GetPosLocal().x();
33 if ( ( part == 1 && gap % 2 != 0 ) || ( part != 1 && gap % 2 == 0 ) )
34 { m_Pos = m_pHit->GetPosLocal().y(); }
35
36 if ( part == 1 && seg == 2 && gap % 2 != 0 ) m_Pos2 = m_pHit->GetPosLocal().x();
37
38 G4VPhysicalVolume* pvGasChamber = m_pHit->GetVolume();
39 if ( m_pHit->GetTrackID() != -1 )
40 {
41 m_lvGap =
42 pvGasChamber->GetMotherLogical(); // after update gdml, mother of gaschamber change to
43 // be aluminumbox, but i still use the name m_lvGap
44 m_lvGapName = m_lvGap->GetName();
45
46 // G4cout<<"in digit----"<<m_lvGapName<<"
47 // "<<m_lvGap->GetDaughter(1)->GetLogicalVolume()->GetName()<<G4endl;
48 }
49}

Referenced by BesMucDigitizer::Digitize(), BesMucSD::ProcessHits(), and BesMucEfficiency::SetHit().

◆ SetHit() [2/3]

void BesMucDigit::SetHit ( BesMucHit * hit)

◆ SetHit() [3/3]

void BesMucDigit::SetHit ( BesMucHit * hit)

The documentation for this class was generated from the following files: