83 {
84 for ( G4int part = 0; part < 3; part++ )
85 {
86 for ( G4int seg = 0; seg < 8; seg++ )
87 {
88 for ( G4int gap = 0; gap < 9; gap++ )
89 {
90 m_noise[part][seg][gap] = 1;
91 }
92 }
93 }
94
95 G4cout << "filename: " << filename << G4endl;
96 std::ifstream fin( filename );
97 if ( !fin ) { G4cout << "error opening muc_noise data" << G4endl; }
98 char buffer[200];
99 fin.getline( buffer, 200, '\n' );
100 std::istringstream stringBuf( buffer );
101
102
103 G4int tot_NoDaughter = logicalMuc->GetNoDaughters();
104
105 for ( G4int i = 0; i < tot_NoDaughter; i++ )
106 {
107 G4LogicalVolume* i_LogicalGap = logicalMuc->GetDaughter( i )->GetLogicalVolume();
108 G4String i_GapName = i_LogicalGap->GetName();
109
110 if ( i_GapName.find( "G" ) == 8 )
111 {
112 G4LogicalVolume* i_LogicalBox = i_LogicalGap->GetDaughter( 0 )->GetLogicalVolume();
113 G4LogicalVolume* i_LogicalStripPlane =
114 i_LogicalBox->GetDaughter( 0 )->GetLogicalVolume();
115
116
117 G4String strPart = i_GapName.substr( 5, 1 );
118 G4String strSeg = i_GapName.substr( 7, 1 );
119 G4String strGap = i_GapName.substr( 9, 1 );
120
121 std::istrstream partBuf( strPart.c_str(), strlen( strPart.c_str() ) );
122 std::istrstream segBuf( strSeg.c_str(), strlen( strSeg.c_str() ) );
123 std::istrstream gapBuf( strGap.c_str(), strlen( strGap.c_str() ) );
124
125 G4int part, seg, gap;
126
127 partBuf >> part;
128 segBuf >> seg;
129 gapBuf >> gap;
130
131
132 G4int tot_NoStrip = i_LogicalStripPlane->GetNoDaughters();
133 area[part][seg][gap][0] = tot_NoStrip;
134 G4float tot_Area = 0;
135
136 G4LogicalVolume* i_LogicalStrip1 =
137 i_LogicalStripPlane->GetDaughter( 1 )->GetLogicalVolume();
138 G4LogicalVolume* i_LogicalStrip2 =
139 i_LogicalStripPlane->GetDaughter( 2 )->GetLogicalVolume();
140 G4Box* temp1;
141 G4Box* temp2;
142
143 temp1 = (G4Box*)i_LogicalStrip1->GetSolid();
144 temp2 = (G4Box*)i_LogicalStrip2->GetSolid();
145 G4float Width1 = temp1->GetXHalfLength() * 2;
146 G4float Width2 = temp2->GetXHalfLength() * 2;
147 G4float pos1 = i_LogicalStripPlane->GetDaughter( 1 )->GetObjectTranslation().x();
148 G4float pos2 = i_LogicalStripPlane->GetDaughter( 2 )->GetObjectTranslation().x();
149 if ( ( part == 1 && gap % 2 != 0 ) || ( part != 1 && gap % 2 == 0 ) )
150 {
151 Width1 = temp1->GetYHalfLength() * 2;
152 Width2 = temp2->GetYHalfLength() * 2;
153 pos1 = i_LogicalStripPlane->GetDaughter( 1 )->GetObjectTranslation().y();
154 pos2 = i_LogicalStripPlane->GetDaughter( 2 )->GetObjectTranslation().y();
155 }
156 G4float width_between_strip = pos2 - pos1 - Width1 / 2 - Width2 / 2;
157
158
159
160
161 for ( G4int j = 0; j < tot_NoStrip; j++ )
162 {
163 G4LogicalVolume* i_LogicalStrip =
164 i_LogicalStripPlane->GetDaughter( j )->GetLogicalVolume();
165 G4Box* temp;
166 temp = (G4Box*)i_LogicalStrip->GetSolid();
167 G4float
Width = temp->GetXHalfLength() * 2;
168 G4float Length = temp->GetYHalfLength() * 2;
169 if ( ( part == 1 && gap % 2 != 0 ) || ( part != 1 && gap % 2 == 0 ) )
170 {
171 Width = temp->GetYHalfLength() * 2;
172 Length = temp->GetXHalfLength() * 2;
173 }
174
175
176 if ( j == 0 || j == ( tot_NoStrip - 1 ) )
Width =
Width + width_between_strip / 2;
178 G4float Strip_Area = fabs(
Width * Length );
179 tot_Area = tot_Area + Strip_Area;
180 area[part][seg][gap][j + 1] = tot_Area;
181 strip_area[part][seg][gap][j] = Strip_Area;
182
183
184 }
185
186
187 box_area[part][seg][gap] = tot_Area;
188
189 for ( G4int k = 1; k < tot_NoStrip + 1; k++ )
190 {
191 area[part][seg][gap][k] = area[part][seg][gap][k] / tot_Area;
192
193 }
194
195 }
196 }
197
198
199
200
201
202
203
204 m_ptrIdTr = new MucIdTransform();
207}
unsigned Width(const AList< TMLink > &)