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