From effaebd60affccad3e8a0ef33e33c9ed437af575 Mon Sep 17 00:00:00 2001 From: olantwin Date: Thu, 24 Oct 2024 13:06:53 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2062496?= =?UTF-8?q?f47580776d37806230176f32ca58808f2c9=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EmulsionMagnet_8cxx_source.html | 853 +++++++++++----------- HPT_8cxx_source.html | 347 +++++---- HPT_8h_source.html | 14 +- NuTauMudet_8cxx_source.html | 1212 +++++++++++++++---------------- NuTauMudet_8h_source.html | 14 +- TargetTracker_8cxx_source.html | 364 +++++----- TargetTracker_8h_source.html | 14 +- Target_8cxx_source.html | 1027 +++++++++++++------------- Target_8h_source.html | 14 +- classEmulsionMagnet.html | 853 +++++++++++----------- classHpt.html | 311 ++++---- classNuTauMudet.html | 1180 +++++++++++++++--------------- classTarget.html | 995 ++++++++++++------------- classTargetTracker.html | 324 ++++----- md_CHANGELOG.html | 1 + 15 files changed, 3707 insertions(+), 3816 deletions(-) diff --git a/EmulsionMagnet_8cxx_source.html b/EmulsionMagnet_8cxx_source.html index 35aa304880..68984319d5 100644 --- a/EmulsionMagnet_8cxx_source.html +++ b/EmulsionMagnet_8cxx_source.html @@ -244,462 +244,454 @@
157 
158 void EmulsionMagnet::ConstructGeometry()
159 {
-
160  TGeoVolume *top=gGeoManager->GetTopVolume();
-
161 
-
162  InitMedium("air");
-
163  TGeoMedium *air =gGeoManager->GetMedium("air");
-
164 
-
165  InitMedium("iron");
-
166  TGeoMedium *Fe =gGeoManager->GetMedium("iron");
-
167 
-
168  InitMedium("CoilAluminium");
-
169  TGeoMedium *Al = gGeoManager->GetMedium("CoilAluminium");
-
170 
-
171  InitMedium("CoilCopper");
-
172  TGeoMedium *Cu = gGeoManager->GetMedium("CoilCopper");
-
173 
-
174  InitMedium("steel");
-
175  TGeoMedium *Steel = gGeoManager->GetMedium("steel");
-
176 
-
177  gGeoManager->SetVisLevel(10);
-
178 
-
179  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
-
180  cout<< "Tau Nu Detector fDesign: "<< fDesign<<endl;
-
181 
-
182  if(fDesign==0)//OLD, TP
-
183  {
-
184  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field in Magnet pillars
-
185  TGeoUniformMagField *magField2 = new TGeoUniformMagField(0.,fField,0.); //magnetic field in target
-
186 
-
187  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Goliath");
-
188  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
-
189 
-
190  //Iron basis on which the coils are placed
-
191  TGeoBBox *Base = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
-
192  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Fe);
-
193  volBase->SetLineColor(kRed);
-
194  MagnetVol->AddNode(volBase,1,new TGeoTranslation(0, fMagnetY/2 - fBaseY/2, 0)); //upper part
-
195  MagnetVol->AddNode(volBase,2,new TGeoTranslation(0, -fMagnetY/2 + fBaseY/2, 0)); //lower part
-
196 
-
197  //Coils Description: 2 volumes must be defined being the upper coil in Cu and the lower one in Al and also heghts are different
-
198  TGeoTube *CoilBoxU = new TGeoTube("C",0,fCoilR,fCoilH1/2);
-
199  TGeoVolume *CoilVolUp = new TGeoVolume("CoilVolUp",CoilBoxU, Cu);
-
200  CoilVolUp->SetLineColor(kGreen);
-
201  TGeoTube *CoilBoxD = new TGeoTube("C",0,fCoilR,fCoilH2/2);
-
202  TGeoVolume *CoilVolDown = new TGeoVolume("CoilVolDown",CoilBoxD, Al);
-
203  CoilVolDown->SetLineColor(kGreen);
-
204 
-
205  TGeoRotation *r1 = new TGeoRotation();
-
206  r1->SetAngles(0,90,0);
-
207  TGeoCombiTrans tUp(0, fMagnetY/2 - fBaseY - fCoilH1/2, 0,r1);
-
208  TGeoHMatrix *mUp = new TGeoHMatrix(tUp);
-
209  TGeoCombiTrans tDown(0, -fMagnetY/2 + fBaseY + fCoilH2/2, 0,r1);
-
210  TGeoHMatrix *mDown = new TGeoHMatrix(tDown);
-
211 
-
212  MagnetVol->AddNode(CoilVolUp,1,mUp);
-
213  MagnetVol->AddNode(CoilVolDown,1,mDown);
+
160 
+
161  InitMedium("air");
+
162  TGeoMedium *air =gGeoManager->GetMedium("air");
+
163 
+
164  InitMedium("iron");
+
165  TGeoMedium *Fe =gGeoManager->GetMedium("iron");
+
166 
+
167  InitMedium("CoilAluminium");
+
168  TGeoMedium *Al = gGeoManager->GetMedium("CoilAluminium");
+
169 
+
170  InitMedium("CoilCopper");
+
171  TGeoMedium *Cu = gGeoManager->GetMedium("CoilCopper");
+
172 
+
173  InitMedium("steel");
+
174  TGeoMedium *Steel = gGeoManager->GetMedium("steel");
+
175 
+
176  gGeoManager->SetVisLevel(10);
+
177 
+
178  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
+
179  cout<< "Tau Nu Detector fDesign: "<< fDesign<<endl;
+
180 
+
181  if(fDesign==0)//OLD, TP
+
182  {
+
183  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field in Magnet pillars
+
184 
+
185  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Goliath");
+
186  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
+
187 
+
188  //Iron basis on which the coils are placed
+
189  TGeoBBox *Base = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
+
190  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Fe);
+
191  volBase->SetLineColor(kRed);
+
192  MagnetVol->AddNode(volBase,1,new TGeoTranslation(0, fMagnetY/2 - fBaseY/2, 0)); //upper part
+
193  MagnetVol->AddNode(volBase,2,new TGeoTranslation(0, -fMagnetY/2 + fBaseY/2, 0)); //lower part
+
194 
+
195  //Coils Description: 2 volumes must be defined being the upper coil in Cu and the lower one in Al and also heghts are different
+
196  TGeoTube *CoilBoxU = new TGeoTube("C",0,fCoilR,fCoilH1/2);
+
197  TGeoVolume *CoilVolUp = new TGeoVolume("CoilVolUp",CoilBoxU, Cu);
+
198  CoilVolUp->SetLineColor(kGreen);
+
199  TGeoTube *CoilBoxD = new TGeoTube("C",0,fCoilR,fCoilH2/2);
+
200  TGeoVolume *CoilVolDown = new TGeoVolume("CoilVolDown",CoilBoxD, Al);
+
201  CoilVolDown->SetLineColor(kGreen);
+
202 
+
203  TGeoRotation *r1 = new TGeoRotation();
+
204  r1->SetAngles(0,90,0);
+
205  TGeoCombiTrans tUp(0, fMagnetY/2 - fBaseY - fCoilH1/2, 0,r1);
+
206  TGeoHMatrix *mUp = new TGeoHMatrix(tUp);
+
207  TGeoCombiTrans tDown(0, -fMagnetY/2 + fBaseY + fCoilH2/2, 0,r1);
+
208  TGeoHMatrix *mDown = new TGeoHMatrix(tDown);
+
209 
+
210  MagnetVol->AddNode(CoilVolUp,1,mUp);
+
211  MagnetVol->AddNode(CoilVolDown,1,mDown);
+
212 
+
213  //********************* Columns ****************************
214 
-
215  //********************* Columns ****************************
+
215  //Each column is made of a longer pillar (rectangle + trapezoid) and on top a shorter pillar (rectangle + trapezoid again)
216 
-
217  //Each column is made of a longer pillar (rectangle + trapezoid) and on top a shorter pillar (rectangle + trapezoid again)
-
218 
-
219  Double_t base1 = 135, base2 = 78; //basis of the trapezoid
-
220  Double_t side1 = 33, side2 = 125, side3 = 57, side4 = 90; //Sides of the columns
+
217  Double_t base1 = 135, base2 = 78; //basis of the trapezoid
+
218  Double_t side1 = 33, side2 = 125, side3 = 57, side4 = 90; //Sides of the columns
+
219 
+
220  //***** SIDE Left Front ****
221 
-
222  //***** SIDE Left Front ****
-
223 
-
224  //Shorter Pillar: rectangle
-
225  TGeoBBox *LateralS1 = new TGeoBBox("LateralS1",side1/2,fCoilH1/2,base1/2);
-
226  TGeoTranslation *tr1 = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2 + base1/2);
-
227  TGeoVolume *volLateralS1 = new TGeoVolume("volLateralS1",LateralS1,Fe);
-
228  volLateralS1->SetLineColor(kRed);
-
229  volLateralS1->SetField(magField1);
-
230  MagnetVol->AddNode(volLateralS1, 1, tr1);
+
222  //Shorter Pillar: rectangle
+
223  TGeoBBox *LateralS1 = new TGeoBBox("LateralS1",side1/2,fCoilH1/2,base1/2);
+
224  TGeoTranslation *tr1 = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2 + base1/2);
+
225  TGeoVolume *volLateralS1 = new TGeoVolume("volLateralS1",LateralS1,Fe);
+
226  volLateralS1->SetLineColor(kRed);
+
227  volLateralS1->SetField(magField1);
+
228  MagnetVol->AddNode(volLateralS1, 1, tr1);
+
229 
+
230  //Shorter Pillar: trapezoid
231 
-
232  //Shorter Pillar: trapezoid
-
233 
-
234  TGeoArb8 *LateralS2 = new TGeoArb8("LateralS2",fCoilH1/2);
-
235  LateralS2->SetVertex(0, side4, 0);
-
236  LateralS2->SetVertex(1, side1, 0);
-
237  LateralS2->SetVertex(2, side1, base1);
-
238  LateralS2->SetVertex(3, side4, base2);
-
239  LateralS2->SetVertex(4, side4, 0);
-
240  LateralS2->SetVertex(5, side1, 0);
-
241  LateralS2->SetVertex(6, side1, base1);
-
242  LateralS2->SetVertex(7, side4, base2);
-
243 
-
244  TGeoVolume *volLateralS2 = new TGeoVolume("volLateralS2",LateralS2,Fe);
-
245  volLateralS2->SetLineColor(kRed);
-
246  volLateralS2->SetField(magField1);
-
247 
-
248  TGeoRotation *r2 = new TGeoRotation();
-
249  r2->SetAngles(0,90,0);
-
250  TGeoCombiTrans tr3(-fMagnetX/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2,r2);
-
251  TGeoHMatrix *m3_a = new TGeoHMatrix(tr3);
-
252  MagnetVol->AddNode(volLateralS2, 1, m3_a);
+
232  TGeoArb8 *LateralS2 = new TGeoArb8("LateralS2",fCoilH1/2);
+
233  LateralS2->SetVertex(0, side4, 0);
+
234  LateralS2->SetVertex(1, side1, 0);
+
235  LateralS2->SetVertex(2, side1, base1);
+
236  LateralS2->SetVertex(3, side4, base2);
+
237  LateralS2->SetVertex(4, side4, 0);
+
238  LateralS2->SetVertex(5, side1, 0);
+
239  LateralS2->SetVertex(6, side1, base1);
+
240  LateralS2->SetVertex(7, side4, base2);
+
241 
+
242  TGeoVolume *volLateralS2 = new TGeoVolume("volLateralS2",LateralS2,Fe);
+
243  volLateralS2->SetLineColor(kRed);
+
244  volLateralS2->SetField(magField1);
+
245 
+
246  TGeoRotation *r2 = new TGeoRotation();
+
247  r2->SetAngles(0,90,0);
+
248  TGeoCombiTrans tr3(-fMagnetX/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2,r2);
+
249  TGeoHMatrix *m3_a = new TGeoHMatrix(tr3);
+
250  MagnetVol->AddNode(volLateralS2, 1, m3_a);
+
251 
+
252  //LOWER LATERAL SURFACE
253 
-
254  //LOWER LATERAL SURFACE
-
255 
-
256  //LONGER RECTANGLE
-
257  TGeoBBox *LateralSurface1low = new TGeoBBox("LateralSurface1low",side1/2,(fCoilDist + fCoilH2)/2,side2/2);
-
258  TGeoVolume *volLateralSurface1low = new TGeoVolume("volLateralSurface1low",LateralSurface1low,Fe);
-
259  volLateralSurface1low->SetLineColor(kRed);
-
260  volLateralSurface1low->SetField(magField1);
-
261  TGeoTranslation *tr1low = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + side2/2);
-
262  MagnetVol->AddNode(volLateralSurface1low, 1, tr1low);;
-
263 
-
264 
-
265  //SHORTER RECTANGLE
-
266  TGeoBBox *LateralSurface2low = new TGeoBBox("LateralSurface2low",side3/2,(fCoilDist + fCoilH2)/2,base2/2);
-
267  TGeoVolume *volLateralSurface2low = new TGeoVolume("volLateralSurface2low",LateralSurface2low,Fe);
-
268  volLateralSurface2low->SetLineColor(kRed);
-
269  TGeoTranslation *tr2low = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY -fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + base2/2);
-
270  MagnetVol->AddNode(volLateralSurface2low, 1, tr2low);
-
271  volLateralSurface2low->SetField(magField1);
+
254  //LONGER RECTANGLE
+
255  TGeoBBox *LateralSurface1low = new TGeoBBox("LateralSurface1low",side1/2,(fCoilDist + fCoilH2)/2,side2/2);
+
256  TGeoVolume *volLateralSurface1low = new TGeoVolume("volLateralSurface1low",LateralSurface1low,Fe);
+
257  volLateralSurface1low->SetLineColor(kRed);
+
258  volLateralSurface1low->SetField(magField1);
+
259  TGeoTranslation *tr1low = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + side2/2);
+
260  MagnetVol->AddNode(volLateralSurface1low, 1, tr1low);;
+
261 
+
262 
+
263  //SHORTER RECTANGLE
+
264  TGeoBBox *LateralSurface2low = new TGeoBBox("LateralSurface2low",side3/2,(fCoilDist + fCoilH2)/2,base2/2);
+
265  TGeoVolume *volLateralSurface2low = new TGeoVolume("volLateralSurface2low",LateralSurface2low,Fe);
+
266  volLateralSurface2low->SetLineColor(kRed);
+
267  TGeoTranslation *tr2low = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY -fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + base2/2);
+
268  MagnetVol->AddNode(volLateralSurface2low, 1, tr2low);
+
269  volLateralSurface2low->SetField(magField1);
+
270 
+
271  //***** SIDE Right Front ****
272 
-
273  //***** SIDE Right Front ****
-
274 
-
275  //LONGER RECTANGLE
-
276  TGeoTranslation *tr1_b = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2 - base1/2);
-
277  TGeoVolume *volLateralS1_b = new TGeoVolume("volLateralS1_b",LateralS1,Fe);
-
278  volLateralS1_b->SetLineColor(kRed);
-
279  volLateralS1_b->SetField(magField1);
-
280  MagnetVol->AddNode(volLateralS1_b, 1, tr1_b);
-
281 
-
282  //TRAPEZOID
-
283  TGeoArb8 *LateralS2_b = new TGeoArb8("LateralS2_b",fCoilH1/2);
-
284  LateralS2_b ->SetVertex(0, side4, 0);
-
285  LateralS2_b ->SetVertex(1, side1, 0);
-
286  LateralS2_b ->SetVertex(2, side1, base1);
-
287  LateralS2_b ->SetVertex(3, side4, base2);
-
288  LateralS2_b ->SetVertex(4, side4, 0);
-
289  LateralS2_b ->SetVertex(5, side1, 0);
-
290  LateralS2_b ->SetVertex(6, side1, base1);
-
291  LateralS2_b ->SetVertex(7, side4, base2);
-
292 
-
293  TGeoVolume *volLateralS2_b = new TGeoVolume("volLateralS2_b",LateralS2_b,Fe);
-
294  volLateralS2_b->SetLineColor(kRed);
-
295  volLateralS2_b->SetField(magField1);
-
296 
-
297  TGeoRotation *r2_b = new TGeoRotation();
-
298  r2_b->SetAngles(0,270,0);
-
299  TGeoCombiTrans tr2_b(-fMagnetX/2 , fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2,r2_b);
-
300  TGeoHMatrix *m3_b = new TGeoHMatrix(tr2_b);
-
301  MagnetVol->AddNode(volLateralS2_b, 1, m3_b);
-
302 
+
273  //LONGER RECTANGLE
+
274  TGeoTranslation *tr1_b = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2 - base1/2);
+
275  TGeoVolume *volLateralS1_b = new TGeoVolume("volLateralS1_b",LateralS1,Fe);
+
276  volLateralS1_b->SetLineColor(kRed);
+
277  volLateralS1_b->SetField(magField1);
+
278  MagnetVol->AddNode(volLateralS1_b, 1, tr1_b);
+
279 
+
280  //TRAPEZOID
+
281  TGeoArb8 *LateralS2_b = new TGeoArb8("LateralS2_b",fCoilH1/2);
+
282  LateralS2_b ->SetVertex(0, side4, 0);
+
283  LateralS2_b ->SetVertex(1, side1, 0);
+
284  LateralS2_b ->SetVertex(2, side1, base1);
+
285  LateralS2_b ->SetVertex(3, side4, base2);
+
286  LateralS2_b ->SetVertex(4, side4, 0);
+
287  LateralS2_b ->SetVertex(5, side1, 0);
+
288  LateralS2_b ->SetVertex(6, side1, base1);
+
289  LateralS2_b ->SetVertex(7, side4, base2);
+
290 
+
291  TGeoVolume *volLateralS2_b = new TGeoVolume("volLateralS2_b",LateralS2_b,Fe);
+
292  volLateralS2_b->SetLineColor(kRed);
+
293  volLateralS2_b->SetField(magField1);
+
294 
+
295  TGeoRotation *r2_b = new TGeoRotation();
+
296  r2_b->SetAngles(0,270,0);
+
297  TGeoCombiTrans tr2_b(-fMagnetX/2 , fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2,r2_b);
+
298  TGeoHMatrix *m3_b = new TGeoHMatrix(tr2_b);
+
299  MagnetVol->AddNode(volLateralS2_b, 1, m3_b);
+
300 
+
301 
+
302  //LOWER LATERAL SURFACE
303 
-
304  //LOWER LATERAL SURFACE
-
305 
-
306  //LONGER RECTANGLE
-
307  TGeoVolume *volLateralSurface1blow = new TGeoVolume("volLateralSurface1blow",LateralSurface1low,Fe);
-
308  volLateralSurface1blow->SetLineColor(kRed);
-
309  volLateralSurface1blow->SetField(magField1);
-
310  TGeoTranslation *tr1blow = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - side2/2);
-
311  MagnetVol->AddNode(volLateralSurface1blow, 1, tr1blow);;
-
312 
-
313 
-
314  //SHORTER RECTANGLE
-
315  TGeoVolume *volLateralSurface2blow = new TGeoVolume("volLateralSurface2blow",LateralSurface2low,Fe);
-
316  volLateralSurface2blow->SetLineColor(kRed);
-
317  volLateralSurface2blow->SetField(magField1);
-
318  TGeoTranslation *tr2blow = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - base2/2);
-
319  MagnetVol->AddNode(volLateralSurface2blow, 1, tr2blow);
-
320 
+
304  //LONGER RECTANGLE
+
305  TGeoVolume *volLateralSurface1blow = new TGeoVolume("volLateralSurface1blow",LateralSurface1low,Fe);
+
306  volLateralSurface1blow->SetLineColor(kRed);
+
307  volLateralSurface1blow->SetField(magField1);
+
308  TGeoTranslation *tr1blow = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - side2/2);
+
309  MagnetVol->AddNode(volLateralSurface1blow, 1, tr1blow);;
+
310 
+
311 
+
312  //SHORTER RECTANGLE
+
313  TGeoVolume *volLateralSurface2blow = new TGeoVolume("volLateralSurface2blow",LateralSurface2low,Fe);
+
314  volLateralSurface2blow->SetLineColor(kRed);
+
315  volLateralSurface2blow->SetField(magField1);
+
316  TGeoTranslation *tr2blow = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - base2/2);
+
317  MagnetVol->AddNode(volLateralSurface2blow, 1, tr2blow);
+
318 
+
319 
+
320  //***** SIDE left Back ****
321 
-
322  //***** SIDE left Back ****
-
323 
-
324 
-
325  //LONGER RECTANGLE
-
326  TGeoBBox *LateralS1_d = new TGeoBBox("LateralS1_d",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
-
327  TGeoTranslation *tr1_d = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2 + base1/2);
-
328  TGeoVolume *volLateralS1_d = new TGeoVolume("volLateralS1_d",LateralS1_d,Fe);
-
329  volLateralS1_d->SetLineColor(kRed);
-
330  volLateralS1_d->SetField(magField1);
-
331  MagnetVol->AddNode(volLateralS1_d, 1, tr1_d);
+
322 
+
323  //LONGER RECTANGLE
+
324  TGeoBBox *LateralS1_d = new TGeoBBox("LateralS1_d",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
+
325  TGeoTranslation *tr1_d = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2 + base1/2);
+
326  TGeoVolume *volLateralS1_d = new TGeoVolume("volLateralS1_d",LateralS1_d,Fe);
+
327  volLateralS1_d->SetLineColor(kRed);
+
328  volLateralS1_d->SetField(magField1);
+
329  MagnetVol->AddNode(volLateralS1_d, 1, tr1_d);
+
330 
+
331  //TRAPEZOID
332 
-
333  //TRAPEZOID
-
334 
-
335  TGeoArb8 *LateralS2_d = new TGeoArb8("LateralS2_d",(fCoilH1 + fCoilH2 + fCoilDist)/2);
-
336  LateralS2_d->SetVertex(0, side4, 0);
-
337  LateralS2_d->SetVertex(1, side1, 0);
-
338  LateralS2_d->SetVertex(2, side1, base1);
-
339  LateralS2_d->SetVertex(3, side4, base2);
-
340  LateralS2_d->SetVertex(4, side4, 0);
-
341  LateralS2_d->SetVertex(5, side1, 0);
-
342  LateralS2_d->SetVertex(6, side1, base1);
-
343  LateralS2_d->SetVertex(7, side4, base2);
-
344 
-
345 
-
346  TGeoVolume *volLateralS2_d = new TGeoVolume("volLateralS2_d",LateralS2_d,Fe);
-
347  volLateralS2_d->SetLineColor(kRed);
-
348  volLateralS2_d->SetField(magField1);
-
349 
-
350  TGeoRotation *r2_d = new TGeoRotation();
-
351  r2_d->SetAngles(0,270,180);
-
352  TGeoCombiTrans tr2_d(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2,r2_d);
-
353  TGeoHMatrix *m3_d = new TGeoHMatrix(tr2_d);
-
354  MagnetVol->AddNode(volLateralS2_d, 1, m3_d);
+
333  TGeoArb8 *LateralS2_d = new TGeoArb8("LateralS2_d",(fCoilH1 + fCoilH2 + fCoilDist)/2);
+
334  LateralS2_d->SetVertex(0, side4, 0);
+
335  LateralS2_d->SetVertex(1, side1, 0);
+
336  LateralS2_d->SetVertex(2, side1, base1);
+
337  LateralS2_d->SetVertex(3, side4, base2);
+
338  LateralS2_d->SetVertex(4, side4, 0);
+
339  LateralS2_d->SetVertex(5, side1, 0);
+
340  LateralS2_d->SetVertex(6, side1, base1);
+
341  LateralS2_d->SetVertex(7, side4, base2);
+
342 
+
343 
+
344  TGeoVolume *volLateralS2_d = new TGeoVolume("volLateralS2_d",LateralS2_d,Fe);
+
345  volLateralS2_d->SetLineColor(kRed);
+
346  volLateralS2_d->SetField(magField1);
+
347 
+
348  TGeoRotation *r2_d = new TGeoRotation();
+
349  r2_d->SetAngles(0,270,180);
+
350  TGeoCombiTrans tr2_d(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2,r2_d);
+
351  TGeoHMatrix *m3_d = new TGeoHMatrix(tr2_d);
+
352  MagnetVol->AddNode(volLateralS2_d, 1, m3_d);
+
353 
+
354 //***** SIDE right Back ****
355 
-
356 //***** SIDE right Back ****
-
357 
-
358 
-
359  //LONGER RECTANGLE
-
360  TGeoBBox *LateralS1_c = new TGeoBBox("LateralS1_c",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
-
361  TGeoTranslation *tr1_c = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2 - base1/2);
-
362  TGeoVolume *volLateralS1_c = new TGeoVolume("volLateralS1_c",LateralS1_c,Fe);
-
363  volLateralS1_c->SetLineColor(kRed);
-
364  volLateralS1_c->SetField(magField1);
-
365  MagnetVol->AddNode(volLateralS1_c, 1, tr1_c);
+
356 
+
357  //LONGER RECTANGLE
+
358  TGeoBBox *LateralS1_c = new TGeoBBox("LateralS1_c",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
+
359  TGeoTranslation *tr1_c = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2 - base1/2);
+
360  TGeoVolume *volLateralS1_c = new TGeoVolume("volLateralS1_c",LateralS1_c,Fe);
+
361  volLateralS1_c->SetLineColor(kRed);
+
362  volLateralS1_c->SetField(magField1);
+
363  MagnetVol->AddNode(volLateralS1_c, 1, tr1_c);
+
364 
+
365  //TRAPEZOID
366 
-
367  //TRAPEZOID
-
368 
-
369  TGeoArb8 *LateralS2_c = new TGeoArb8("LateralS2_c",(fCoilH1 + fCoilH2 + fCoilDist)/2);
-
370  LateralS2_c ->SetVertex(0, side4, 0);
-
371  LateralS2_c ->SetVertex(1, side1, 0);
-
372  LateralS2_c ->SetVertex(2, side1, base1);
-
373  LateralS2_c ->SetVertex(3, side4, base2);
-
374  LateralS2_c ->SetVertex(4, side4, 0);
-
375  LateralS2_c ->SetVertex(5, side1, 0);
-
376  LateralS2_c ->SetVertex(6, side1, base1);
-
377  LateralS2_c ->SetVertex(7, side4, base2);
-
378 
-
379  TGeoVolume *volLateralS2_c = new TGeoVolume("volLateralS2_c",LateralS2_c,Fe);
-
380  volLateralS2_c->SetLineColor(kRed);
-
381  volLateralS2_c->SetField(magField1);
-
382 
-
383  TGeoRotation *r2_c = new TGeoRotation();
-
384  r2_c->SetAngles(0,90,180);
-
385  TGeoCombiTrans tr2_c(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2,r2_c);
-
386  TGeoHMatrix *m3_c = new TGeoHMatrix(tr2_c);
-
387  MagnetVol->AddNode(volLateralS2_c, 1, m3_c);
-
388 
+
367  TGeoArb8 *LateralS2_c = new TGeoArb8("LateralS2_c",(fCoilH1 + fCoilH2 + fCoilDist)/2);
+
368  LateralS2_c ->SetVertex(0, side4, 0);
+
369  LateralS2_c ->SetVertex(1, side1, 0);
+
370  LateralS2_c ->SetVertex(2, side1, base1);
+
371  LateralS2_c ->SetVertex(3, side4, base2);
+
372  LateralS2_c ->SetVertex(4, side4, 0);
+
373  LateralS2_c ->SetVertex(5, side1, 0);
+
374  LateralS2_c ->SetVertex(6, side1, base1);
+
375  LateralS2_c ->SetVertex(7, side4, base2);
+
376 
+
377  TGeoVolume *volLateralS2_c = new TGeoVolume("volLateralS2_c",LateralS2_c,Fe);
+
378  volLateralS2_c->SetLineColor(kRed);
+
379  volLateralS2_c->SetField(magField1);
+
380 
+
381  TGeoRotation *r2_c = new TGeoRotation();
+
382  r2_c->SetAngles(0,90,180);
+
383  TGeoCombiTrans tr2_c(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2,r2_c);
+
384  TGeoHMatrix *m3_c = new TGeoHMatrix(tr2_c);
+
385  MagnetVol->AddNode(volLateralS2_c, 1, m3_c);
+
386 
+
387 
+
388  }
389 
-
390  }
-
391 
-
392  if(fDesign==1) //NEW with magnet
-
393  {
-
394  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
-
395  TGeoUniformMagField *magField2 = new TGeoUniformMagField(fField,0.,0.); //magnetic field in target
+
390  if(fDesign==1) //NEW with magnet
+
391  {
+
392  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
+
393 
+
394  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Davide");
+
395  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
396 
-
397  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Davide");
-
398  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
-
399 
-
400  //The -0.01*mm is only for drawing reasons
-
401  TGeoBBox *LateralBox = new TGeoBBox("LB",fBaseZ/2,fBaseY/2,(fBaseX-0.01*mm)/2);
-
402  TGeoTube *CoilBox = new TGeoTube("C",0,fCoilR,fCoilH1/2);
-
403 
-
404  TGeoCompositeShape *LateralSurf = new TGeoCompositeShape("LS","LB-C");
-
405 
-
406  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",CoilBox, Cu);
-
407  CoilVol->SetLineColor(kGreen);
-
408  TGeoVolume *LateralSurfVol = new TGeoVolume("LateralSurfVol",LateralSurf, Fe);
-
409  LateralSurfVol->SetLineColor(kRed);
-
410 
-
411  TGeoRotation *r1 = new TGeoRotation();
-
412  r1->RotateY(90);
-
413  //r1->RotateY(90);
-
414  //r1->RotateY(90);
-
415  r1->RegisterYourself();
-
416  TGeoTranslation *t1r = new TGeoTranslation(-fMagnetX/2+fBaseX/2,0,0);
-
417  TGeoTranslation *t1l = new TGeoTranslation(fMagnetX/2-fBaseX/2,0,0);
-
418 
-
419  TGeoCombiTrans *trans1r = new TGeoCombiTrans(-fMagnetX/2+fBaseX/2,0,0,r1);
-
420  TGeoCombiTrans *trans1l = new TGeoCombiTrans(fMagnetX/2-fBaseX/2,0,0,r1);
-
421  TGeoHMatrix *m1_r = new TGeoHMatrix("m1_r");
-
422  *m1_r = trans1r;
-
423  TGeoHMatrix *m1_l = new TGeoHMatrix("m1_l");
-
424  *m1_l = trans1l;
+
397  //The -0.01*mm is only for drawing reasons
+
398  [[maybe_unused]] auto *LateralBox = new TGeoBBox("LB",fBaseZ/2,fBaseY/2,(fBaseX-0.01*mm)/2);
+
399  TGeoTube *CoilBox = new TGeoTube("C",0,fCoilR,fCoilH1/2);
+
400 
+
401  TGeoCompositeShape *LateralSurf = new TGeoCompositeShape("LS","LB-C");
+
402 
+
403  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",CoilBox, Cu);
+
404  CoilVol->SetLineColor(kGreen);
+
405  TGeoVolume *LateralSurfVol = new TGeoVolume("LateralSurfVol",LateralSurf, Fe);
+
406  LateralSurfVol->SetLineColor(kRed);
+
407 
+
408  TGeoRotation *r1 = new TGeoRotation();
+
409  r1->RotateY(90);
+
410  //r1->RotateY(90);
+
411  //r1->RotateY(90);
+
412  r1->RegisterYourself();
+
413 
+
414  TGeoCombiTrans *trans1r = new TGeoCombiTrans(-fMagnetX/2+fBaseX/2,0,0,r1);
+
415  TGeoCombiTrans *trans1l = new TGeoCombiTrans(fMagnetX/2-fBaseX/2,0,0,r1);
+
416  TGeoHMatrix *m1_r = new TGeoHMatrix("m1_r");
+
417  *m1_r = trans1r;
+
418  TGeoHMatrix *m1_l = new TGeoHMatrix("m1_l");
+
419  *m1_l = trans1l;
+
420 
+
421  MagnetVol->AddNode(CoilVol,1, m1_r);
+
422  MagnetVol->AddNode(LateralSurfVol,1,m1_r);
+
423  MagnetVol->AddNode(CoilVol,2, m1_l);
+
424  MagnetVol->AddNode(LateralSurfVol,2,m1_l);
425 
-
426  MagnetVol->AddNode(CoilVol,1, m1_r);
-
427  MagnetVol->AddNode(LateralSurfVol,1,m1_r);
-
428  MagnetVol->AddNode(CoilVol,2, m1_l);
-
429  MagnetVol->AddNode(LateralSurfVol,2,m1_l);
-
430 
-
431  TGeoBBox *ColumnBox = new TGeoBBox(fColumnX/2, fColumnY/2, fColumnZ/2);
-
432  TGeoVolume *ColumnVol = new TGeoVolume("ColumnVol",ColumnBox,Fe);
-
433  ColumnVol->SetField(magField1);
-
434  ColumnVol->SetLineColor(kRed);
-
435  MagnetVol->AddNode(ColumnVol,1,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, -fMagnetZ/2+fColumnZ/2));
-
436  MagnetVol->AddNode(ColumnVol,2,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, fMagnetZ/2-fColumnZ/2));
-
437  MagnetVol->AddNode(ColumnVol,3,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, -fMagnetZ/2+fColumnZ/2));
-
438  MagnetVol->AddNode(ColumnVol,4,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, fMagnetZ/2-fColumnZ/2));
+
426  TGeoBBox *ColumnBox = new TGeoBBox(fColumnX/2, fColumnY/2, fColumnZ/2);
+
427  TGeoVolume *ColumnVol = new TGeoVolume("ColumnVol",ColumnBox,Fe);
+
428  ColumnVol->SetField(magField1);
+
429  ColumnVol->SetLineColor(kRed);
+
430  MagnetVol->AddNode(ColumnVol,1,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, -fMagnetZ/2+fColumnZ/2));
+
431  MagnetVol->AddNode(ColumnVol,2,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, fMagnetZ/2-fColumnZ/2));
+
432  MagnetVol->AddNode(ColumnVol,3,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, -fMagnetZ/2+fColumnZ/2));
+
433  MagnetVol->AddNode(ColumnVol,4,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, fMagnetZ/2-fColumnZ/2));
+
434 
+
435  TGeoBBox *BaseBox = new TGeoBBox(fCoilDist/2,fColumnY/2, fBaseZ/2);
+
436  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
+
437  BaseVol->SetLineColor(kRed);
+
438  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fColumnY/2,0));
439 
-
440  TGeoBBox *BaseBox = new TGeoBBox(fCoilDist/2,fColumnY/2, fBaseZ/2);
-
441  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
-
442  BaseVol->SetLineColor(kRed);
-
443  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fColumnY/2,0));
-
444 
-
445  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
446  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
-
447  PillarVol->SetLineColor(kGreen+3);
-
448  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
449  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
450  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
451  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
452  }
-
453 
-
454  if(fDesign==3) //NEW with magnet
-
455  {
-
456  //Box for Magnet
-
457  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("NudetMagnet");
-
458  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
+
440  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
441  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
+
442  PillarVol->SetLineColor(kGreen+3);
+
443  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
444  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
445  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
446  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
447  }
+
448 
+
449  if(fDesign==3) //NEW with magnet
+
450  {
+
451  //Box for Magnet
+
452  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("NudetMagnet");
+
453  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
+
454 
+
455  TGeoBBox *BaseBox = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
+
456  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
+
457  BaseVol->SetLineColor(kRed);
+
458  TGeoBBox *LateralBox = new TGeoBBox(fColumnX/2,fColumnY/2,fColumnZ/2);
459 
-
460  TGeoBBox *BaseBox = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
-
461  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
-
462  BaseVol->SetLineColor(kRed);
-
463  TGeoBBox *LateralBox = new TGeoBBox(fColumnX/2,fColumnY/2,fColumnZ/2);
-
464 
-
465  //prepare for triangolar cuts
-
466  LateralBox->SetName("L");
-
467  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
-
468  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fColumnZ+delta)/2,(fColumnZ+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
-
469  Model->SetName("T");
-
470 
-
471  const Double_t SemiLateralBoxHeight =(fColumnY - fCutHeight)/2;
-
472 
-
473  //we need different volumes to place different magnetic fields
-
474  TGeoBBox *SemiLateralBox = new TGeoBBox("SemiLateralBox",(fColumnX)/2, SemiLateralBoxHeight /2, fColumnZ/2);
-
475  TGeoVolume *volUpLateral = new TGeoVolume("volUpLateral",SemiLateralBox,Fe); //up and down refer to the magnetic field verse
+
460  //prepare for triangolar cuts
+
461  LateralBox->SetName("L");
+
462  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
+
463  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fColumnZ+delta)/2,(fColumnZ+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
+
464  Model->SetName("T");
+
465 
+
466  const Double_t SemiLateralBoxHeight =(fColumnY - fCutHeight)/2;
+
467 
+
468  //we need different volumes to place different magnetic fields
+
469  TGeoBBox *SemiLateralBox = new TGeoBBox("SemiLateralBox",(fColumnX)/2, SemiLateralBoxHeight /2, fColumnZ/2);
+
470  TGeoVolume *volUpLateral = new TGeoVolume("volUpLateral",SemiLateralBox,Fe); //up and down refer to the magnetic field verse
+
471 
+
472  TGeoVolume *volDownLateral = new TGeoVolume("volDownLateral",SemiLateralBox,Fe);
+
473  SemiLateralBox->SetName("S");
+
474  volUpLateral->SetLineColor(kRed);
+
475  volDownLateral->SetLineColor(kRed);
476 
-
477  TGeoVolume *volDownLateral = new TGeoVolume("volDownLateral",SemiLateralBox,Fe);
-
478  SemiLateralBox->SetName("S");
-
479  volUpLateral->SetLineColor(kRed);
-
480  volDownLateral->SetLineColor(kRed);
+
477  const Double_t MidBoxHeight = fCutHeight/2;
+
478 
+
479  TGeoBBox *MidLateralBox = new TGeoBBox("MidLateralBox",fColumnX/2, MidBoxHeight/2, fColumnZ/2);
+
480  MidLateralBox->SetName("M");
481 
-
482  const Double_t MidBoxHeight = fCutHeight/2;
+
482  //some boolean operations for triangular cuts
483 
-
484  TGeoBBox *MidLateralBox = new TGeoBBox("MidLateralBox",fColumnX/2, MidBoxHeight/2, fColumnZ/2);
-
485  MidLateralBox->SetName("M");
-
486 
-
487  //some boolean operations for triangular cuts
-
488 
-
489  TGeoRotation rot("rot",90,90,0);
-
490  TGeoRotation rot1("rot1",-90,90,0);
-
491  const TGeoTranslation trans("trans",-fColumnX/2.+ fCutLength/2,0,0);
-
492  TGeoCombiTrans* comb = new TGeoCombiTrans(trans,rot);
-
493  comb->SetName("comb");
-
494  comb->RegisterYourself();
-
495  TGeoCompositeShape *cut = new TGeoCompositeShape("CUT", "L-T:comb");
-
496 
+
484  TGeoRotation rot("rot",90,90,0);
+
485  TGeoRotation rot1("rot1",-90,90,0);
+
486  const TGeoTranslation trans("trans",-fColumnX/2.+ fCutLength/2,0,0);
+
487  TGeoCombiTrans* comb = new TGeoCombiTrans(trans,rot);
+
488  comb->SetName("comb");
+
489  comb->RegisterYourself();
+
490  [[maybe_unused]] auto *cut = new TGeoCompositeShape("CUT", "L-T:comb");
+
491 
+
492 
+
493  TGeoTranslation* transcuttop = new TGeoTranslation("transcuttop",0, fCutHeight/2 + SemiLateralBoxHeight/2 ,0); //top and bottom refer to their geometrical positions
+
494  TGeoTranslation* transcuttop1 = new TGeoTranslation("transcuttop1",0, MidBoxHeight/2 ,0);
+
495  TGeoTranslation* transcutbottom = new TGeoTranslation("transcutbottom",0, - fCutHeight/2 - SemiLateralBoxHeight/2 ,0);
+
496  TGeoTranslation* transcutbottom1 = new TGeoTranslation("transcutbottom1",0, -MidBoxHeight/2 ,0);
497 
-
498  TGeoTranslation* transcuttop = new TGeoTranslation("transcuttop",0, fCutHeight/2 + SemiLateralBoxHeight/2 ,0); //top and bottom refer to their geometrical positions
-
499  TGeoTranslation* transcuttop1 = new TGeoTranslation("transcuttop1",0, MidBoxHeight/2 ,0);
-
500  TGeoTranslation* transcutbottom = new TGeoTranslation("transcutbottom",0, - fCutHeight/2 - SemiLateralBoxHeight/2 ,0);
-
501  TGeoTranslation* transcutbottom1 = new TGeoTranslation("transcutbottom1",0, -MidBoxHeight/2 ,0);
+
498  transcuttop->RegisterYourself();
+
499  transcuttop1->RegisterYourself();
+
500  transcutbottom->RegisterYourself();
+
501  transcutbottom1->RegisterYourself();
502 
-
503  transcuttop->RegisterYourself();
-
504  transcuttop1->RegisterYourself();
-
505  transcutbottom->RegisterYourself();
-
506  transcutbottom1->RegisterYourself();
-
507 
-
508  TGeoCompositeShape *cuttop = new TGeoCompositeShape("CUTTOP", "CUT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the right lateral wall
-
509  TGeoVolume *volcuttop = new TGeoVolume("volcuttop", cuttop, Fe);
-
510  volcuttop->SetLineColor(kRed);
-
511 
-
512  const TGeoTranslation transleft("transleft",+fColumnX/2.- fCutLength/2,0,0);
-
513  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
-
514  combleft->SetName("combleft");
-
515  combleft->RegisterYourself();
-
516  TGeoCompositeShape *cutleft;
-
517  cutleft = new TGeoCompositeShape("CUTLEFT", "L-T:combleft");
-
518  TGeoCompositeShape *cuttopleft = new TGeoCompositeShape("CUTTOPLEFT", "CUTLEFT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the left lateral wall
-
519  TGeoVolume *volcuttopleft = new TGeoVolume("volcuttopleft", cuttopleft, Fe);
-
520  volcuttopleft->SetLineColor(kRed);
+
503  TGeoCompositeShape *cuttop = new TGeoCompositeShape("CUTTOP", "CUT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the right lateral wall
+
504  TGeoVolume *volcuttop = new TGeoVolume("volcuttop", cuttop, Fe);
+
505  volcuttop->SetLineColor(kRed);
+
506 
+
507  const TGeoTranslation transleft("transleft",+fColumnX/2.- fCutLength/2,0,0);
+
508  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
+
509  combleft->SetName("combleft");
+
510  combleft->RegisterYourself();
+
511  [[maybe_unused]] auto *cutleft = new TGeoCompositeShape("CUTLEFT", "L-T:combleft");
+
512  TGeoCompositeShape *cuttopleft = new TGeoCompositeShape("CUTTOPLEFT", "CUTLEFT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the left lateral wall
+
513  TGeoVolume *volcuttopleft = new TGeoVolume("volcuttopleft", cuttopleft, Fe);
+
514  volcuttopleft->SetLineColor(kRed);
+
515 
+
516  //composite coil
+
517  TGeoBBox *IncoilBox = new TGeoBBox("IC", fCoilX/2,fCoilH2/2,(fMagnetZ-fCoilH1)/2);
+
518 
+
519  //circular arcs (first two options are radii, not half radii!)
+
520  Double_t OuterRadius = fCoilY + fCoilThickness;
521 
-
522  //composite coil
-
523  TGeoBBox *OutcoilBox = new TGeoBBox("OC", fCoilX/2, fCoilH1/2,fMagnetZ/2-fCoilH1/2);
-
524  TGeoBBox *IncoilBox = new TGeoBBox("IC", fCoilX/2,fCoilH2/2,(fMagnetZ-fCoilH1)/2);
-
525 
-
526  //circular arcs (first two options are radii, not half radii!)
-
527  Double_t OuterRadius = fCoilY + fCoilThickness;
-
528 
-
529  TGeoTubeSeg *Coillateraltuberightdown = new TGeoTubeSeg("Coillateraltuberightdown",fCoilThickness,OuterRadius, fCoilX/2,90,180);
-
530  TGeoTubeSeg *Coillateraltuberighttup = new TGeoTubeSeg("Coillateraltuberightup",fCoilThickness,OuterRadius, fCoilX/2,0,90);
-
531  TGeoTubeSeg *Coillateraltubeleftup = new TGeoTubeSeg("Coillateraltubeleftup",fCoilThickness,OuterRadius, fCoilX/2,270,360);
-
532  TGeoTubeSeg *Coillateraltubeleftdown = new TGeoTubeSeg("Coillateraltubeleftdown",fCoilThickness,OuterRadius, fCoilX/2,180,270);
-
533 
-
534  TGeoBBox *Coillateralcenter = new TGeoBBox("Coillateralcenter",fCoilX/2., (fCoilH2-2*fCoilThickness)/2, fCoilY/2.);
-
535 
-
536  TGeoRotation rottube("rottube",90,90,0);
-
537  //transformations to combine them
-
538  const TGeoTranslation transtube("transtube",0.,-(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
-
539  const TGeoTranslation transtube1("transtube1",0.,(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
-
540  const TGeoTranslation transtube2("transtube2",0.,-(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
-
541  const TGeoTranslation transtube3("transtube3",0.,(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
-
542  TGeoCombiTrans* combination = new TGeoCombiTrans(transtube,rottube);
-
543  TGeoCombiTrans* combination1 = new TGeoCombiTrans(transtube1,rottube);
-
544  TGeoCombiTrans* combination2 = new TGeoCombiTrans(transtube2,rottube);
-
545  TGeoCombiTrans* combination3 = new TGeoCombiTrans(transtube3,rottube);
-
546 
-
547  combination->SetName("combination");
-
548  combination->RegisterYourself();
-
549  combination1->SetName("combination1");
-
550  combination1->RegisterYourself();
-
551  combination2->SetName("combination2");
-
552  combination2->RegisterYourself();
-
553  combination3->SetName("combination3");
-
554  combination3->RegisterYourself();
-
555  //adding the shapes and making the volumes
-
556  TGeoCompositeShape * CoilRight = new TGeoCompositeShape("CoilRight","Coillateraltuberightdown:combination+Coillateraltuberightup:combination1+Coillateralcenter");
-
557  TGeoVolume *CoilVolright = new TGeoVolume("CoilVolright",CoilRight,Cu);
+
522  [[maybe_unused]] auto *Coillateraltuberightdown = new TGeoTubeSeg("Coillateraltuberightdown",fCoilThickness,OuterRadius, fCoilX/2,90,180);
+
523  [[maybe_unused]] auto *Coillateraltuberighttup = new TGeoTubeSeg("Coillateraltuberightup",fCoilThickness,OuterRadius, fCoilX/2,0,90);
+
524  [[maybe_unused]] auto *Coillateraltubeleftup = new TGeoTubeSeg("Coillateraltubeleftup",fCoilThickness,OuterRadius, fCoilX/2,270,360);
+
525  [[maybe_unused]] auto *Coillateraltubeleftdown = new TGeoTubeSeg("Coillateraltubeleftdown",fCoilThickness,OuterRadius, fCoilX/2,180,270);
+
526  [[maybe_unused]] auto *Coillateralcenter = new TGeoBBox("Coillateralcenter",fCoilX/2., (fCoilH2-2*fCoilThickness)/2, fCoilY/2.);
+
527 
+
528  TGeoRotation rottube("rottube",90,90,0);
+
529  //transformations to combine them
+
530  const TGeoTranslation transtube("transtube",0.,-(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
+
531  const TGeoTranslation transtube1("transtube1",0.,(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
+
532  const TGeoTranslation transtube2("transtube2",0.,-(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
+
533  const TGeoTranslation transtube3("transtube3",0.,(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
+
534  TGeoCombiTrans* combination = new TGeoCombiTrans(transtube,rottube);
+
535  TGeoCombiTrans* combination1 = new TGeoCombiTrans(transtube1,rottube);
+
536  TGeoCombiTrans* combination2 = new TGeoCombiTrans(transtube2,rottube);
+
537  TGeoCombiTrans* combination3 = new TGeoCombiTrans(transtube3,rottube);
+
538 
+
539  combination->SetName("combination");
+
540  combination->RegisterYourself();
+
541  combination1->SetName("combination1");
+
542  combination1->RegisterYourself();
+
543  combination2->SetName("combination2");
+
544  combination2->RegisterYourself();
+
545  combination3->SetName("combination3");
+
546  combination3->RegisterYourself();
+
547  //adding the shapes and making the volumes
+
548  TGeoCompositeShape * CoilRight = new TGeoCompositeShape("CoilRight","Coillateraltuberightdown:combination+Coillateraltuberightup:combination1+Coillateralcenter");
+
549  TGeoVolume *CoilVolright = new TGeoVolume("CoilVolright",CoilRight,Cu);
+
550 
+
551  TGeoCompositeShape * CoilLeft = new TGeoCompositeShape("CoilLeft","Coillateraltubeleftdown:combination2+Coillateraltubeleftup:combination3+Coillateralcenter");
+
552  TGeoVolume *CoilVolleft = new TGeoVolume("CoilVolleft",CoilLeft,Cu);
+
553 
+
554 
+
555 
+
556  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilX/2,fCoilY/2, (fMagnetZ-2*OuterRadius)/2); //two times the external radius
+
557  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",Coil, Cu);
558 
-
559  TGeoCompositeShape * CoilLeft = new TGeoCompositeShape("CoilLeft","Coillateraltubeleftdown:combination2+Coillateraltubeleftup:combination3+Coillateralcenter");
-
560  TGeoVolume *CoilVolleft = new TGeoVolume("CoilVolleft",CoilLeft,Cu);
-
561 
-
562 
+
559  //adding obtained volumes
+
560 
+
561  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fBaseY/2,0));
+
562  MagnetVol->AddNode(BaseVol,2, new TGeoTranslation(0,fMagnetY/2-fBaseY/2,0));
563 
-
564  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilX/2,fCoilY/2, (fMagnetZ-2*OuterRadius)/2); //two times the external radius
-
565  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",Coil, Cu);
-
566 
-
567  //adding obtained volumes
-
568 
-
569  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fBaseY/2,0));
-
570  MagnetVol->AddNode(BaseVol,2, new TGeoTranslation(0,fMagnetY/2-fBaseY/2,0));
+
564  MagnetVol->AddNode(volUpLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (fCutHeight + (fColumnY - fCutHeight)/2)/2 ,0));
+
565  MagnetVol->AddNode(volDownLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2,0));
+
566  MagnetVol->AddNode(volcuttop, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, 0, 0));
+
567 
+
568  MagnetVol->AddNode(volUpLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2 ,0));
+
569  MagnetVol->AddNode(volDownLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (+fCutHeight + (fColumnY - fCutHeight)/2)/2,0));
+
570  MagnetVol->AddNode(volcuttopleft,2, new TGeoTranslation(fMagnetX/2-fColumnX/2,0,0));
571 
-
572  MagnetVol->AddNode(volUpLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (fCutHeight + (fColumnY - fCutHeight)/2)/2 ,0));
-
573  MagnetVol->AddNode(volDownLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2,0));
-
574  MagnetVol->AddNode(volcuttop, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, 0, 0));
-
575 
-
576  MagnetVol->AddNode(volUpLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2 ,0));
-
577  MagnetVol->AddNode(volDownLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (+fCutHeight + (fColumnY - fCutHeight)/2)/2,0));
-
578  MagnetVol->AddNode(volcuttopleft,2, new TGeoTranslation(fMagnetX/2-fColumnX/2,0,0));
+
572  CoilVolleft->SetLineColor(kGreen);
+
573  MagnetVol->AddNode(CoilVolleft,1,new TGeoTranslation(0,0,-fMagnetZ/2.+fCoilY/2.));
+
574  CoilVolright->SetLineColor(kGreen);
+
575  MagnetVol->AddNode(CoilVolright,1,new TGeoTranslation(0,0,+fMagnetZ/2.-fCoilY/2.));
+
576  CoilVol->SetLineColor(kGreen);
+
577  MagnetVol->AddNode(CoilVol,1,new TGeoTranslation(0,(fCoilH1+fCoilH2)/4,0));
+
578  MagnetVol->AddNode(CoilVol,2,new TGeoTranslation(0,-(fCoilH1+fCoilH2)/4,0));
579 
-
580  CoilVolleft->SetLineColor(kGreen);
-
581  MagnetVol->AddNode(CoilVolleft,1,new TGeoTranslation(0,0,-fMagnetZ/2.+fCoilY/2.));
-
582  CoilVolright->SetLineColor(kGreen);
-
583  MagnetVol->AddNode(CoilVolright,1,new TGeoTranslation(0,0,+fMagnetZ/2.-fCoilY/2.));
-
584  CoilVol->SetLineColor(kGreen);
-
585  MagnetVol->AddNode(CoilVol,1,new TGeoTranslation(0,(fCoilH1+fCoilH2)/4,0));
-
586  MagnetVol->AddNode(CoilVol,2,new TGeoTranslation(0,-(fCoilH1+fCoilH2)/4,0));
-
587 
-
588  //magnetized region
-
589 
-
590  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion",IncoilBox, air);
-
591  MagnetVol->AddNode(volMagRegion, 1, new TGeoTranslation(0,0,0));
-
592 
-
593  //pillars for the magnet
-
594  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
595  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
-
596  PillarVol->SetLineColor(kGreen+3);
-
597  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
598  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
599  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
600  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
601 
-
602 
-
603  if (fConstField){ //adding magnetic field if not implemented from nudet field map
-
604  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
-
605  TGeoUniformMagField *magField2 = new TGeoUniformMagField(fField,0.,0.); //magnetic field in target
-
606  TGeoUniformMagField *magField1y = new TGeoUniformMagField(0.,-fField,0.); //down return magnetic field along y
-
607  TGeoUniformMagField *magField2y = new TGeoUniformMagField(0.,fField,0.); //up return magnetic field along y
-
608 
-
609  BaseVol->SetField(magField1);
-
610  volUpLateral->SetField(magField2y);
-
611  volDownLateral->SetField(magField1y);
-
612  volMagRegion->SetField(magField2);
-
613  }
-
614  }
-
615 }
+
580  //magnetized region
+
581 
+
582  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion",IncoilBox, air);
+
583  MagnetVol->AddNode(volMagRegion, 1, new TGeoTranslation(0,0,0));
+
584 
+
585  //pillars for the magnet
+
586  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
587  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
+
588  PillarVol->SetLineColor(kGreen+3);
+
589  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
590  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
591  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
592  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
593 
+
594 
+
595  if (fConstField){ //adding magnetic field if not implemented from nudet field map
+
596  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
+
597  TGeoUniformMagField *magField2 = new TGeoUniformMagField(fField,0.,0.); //magnetic field in target
+
598  TGeoUniformMagField *magField1y = new TGeoUniformMagField(0.,-fField,0.); //down return magnetic field along y
+
599  TGeoUniformMagField *magField2y = new TGeoUniformMagField(0.,fField,0.); //up return magnetic field along y
+
600 
+
601  BaseVol->SetField(magField1);
+
602  volUpLateral->SetField(magField2y);
+
603  volDownLateral->SetField(magField1y);
+
604  volMagRegion->SetField(magField2);
+
605  }
+
606  }
+
607 }
Double_t mm
@@ -750,7 +742,6 @@
r2
r1
dictionary delta
-
top
BaseX
BaseZ
Thickness
diff --git a/HPT_8cxx_source.html b/HPT_8cxx_source.html index 4e8828db08..be7fd663ca 100644 --- a/HPT_8cxx_source.html +++ b/HPT_8cxx_source.html @@ -319,183 +319,180 @@
232  if (fDesign == 3){
233  //Trackers that in design 3 follow the target --------------------------------------------------------------------------------------
234  TGeoVolume *volMagRegion=gGeoManager->GetVolume("volMagRegion");
-
235  TGeoVolume *volTarget =gGeoManager->GetVolume("volTarget");
-
236  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
-
237 
-
238  Double_t DZMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDZ() *2;
-
239  Double_t DYMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDY() *2;
-
240  Double_t DXMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDX() *2;
-
241 
-
242  Double_t DZTarget = ((TGeoBBox*) volTarget->GetShape())->GetDZ() *2;
-
243 
-
244  //HPT is DownStreamTracker
-
245  TGeoBBox *DT = new TGeoBBox("DT", DimX/2, DimY/2, DimZ/2);
-
246  TGeoVolume *volDT = new TGeoVolume("volDT",DT,HPTmat);
-
247  volDT->SetLineColor(kBlue-5);
-
248 
-
249  // Creating of SciFi modules in HPT
-
250  InitMedium("CarbonComposite");
-
251  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
+
235  TGeoVolume *volTarget =gGeoManager->GetVolume("volTarget");
+
236 
+
237  Double_t DZMagnetizedRegion = static_cast<TGeoBBox*> (volMagRegion->GetShape())->GetDZ() *2;
+
238 
+
239  Double_t DZTarget = static_cast<TGeoBBox*> (volTarget->GetShape())->GetDZ() *2;
+
240 
+
241  //HPT is DownStreamTracker
+
242  TGeoBBox *DT = new TGeoBBox("DT", DimX/2, DimY/2, DimZ/2);
+
243  TGeoVolume *volDT = new TGeoVolume("volDT",DT,HPTmat);
+
244  volDT->SetLineColor(kBlue-5);
+
245 
+
246  // Creating of SciFi modules in HPT
+
247  InitMedium("CarbonComposite");
+
248  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
+
249 
+
250  InitMedium("SciFiMat");
+
251  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
252 
-
253  InitMedium("SciFiMat");
-
254  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
+
253  InitMedium("Airex");
+
254  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
255 
-
256  InitMedium("Airex");
-
257  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
-
258 
-
259  //Support Carbon Composite
-
260  TGeoBBox* HPT_support_box = new TGeoBBox("HPT_support_box", HPTrackerX / 2, HPTrackerY / 2, support_z / 2);
-
261  TGeoVolume* HPT_support_volume = new TGeoVolume("HPT_support", HPT_support_box, CarbonComposite);
-
262  HPT_support_volume->SetLineColor(kGray - 2);
-
263  HPT_support_volume->SetVisibility(1);
-
264 
-
265  //Honeycomb Airex (or Nomex)
-
266  TGeoBBox* HPT_honeycomb_box = new TGeoBBox("HPT_honeycomb_box", HPTrackerX / 2, HPTrackerY / 2, honeycomb_z / 2);
-
267  TGeoVolume* HPT_honeycomb_volume = new TGeoVolume("HPT_honeycomb", HPT_honeycomb_box, Airex);
-
268  HPT_honeycomb_volume->SetLineColor(kYellow);
-
269  HPT_honeycomb_volume->SetVisibility(1);
-
270 
-
271  //SciFi planes
-
272  TGeoBBox* HPT_scifi_plane_hor_box = new TGeoBBox("HPT_scifi_plane_hor_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
-
273  TGeoVolume* HPT_scifi_plane_hor_volume = new TGeoVolume("HPT_scifi_plane_hor", HPT_scifi_plane_hor_box, SciFiMat);
-
274  HPT_scifi_plane_hor_volume->SetVisibility(1);
-
275 
-
276  TGeoBBox* HPT_scifi_plane_vert_box = new TGeoBBox("HPT_scifi_plane_vert_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
-
277  TGeoVolume* HPT_scifi_plane_vert_volume = new TGeoVolume("HPT_scifi_plane_vert", HPT_scifi_plane_vert_box, SciFiMat);
-
278  HPT_scifi_plane_vert_volume->SetVisibility(1);
-
279 
-
280  //SciFi mats
-
281  TGeoBBox* HPT_scifimat_hor_box = new TGeoBBox("HPT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
-
282  TGeoVolume* HPT_scifimat_hor_volume = new TGeoVolume("HPT_scifimat_hor", HPT_scifimat_hor_box, SciFiMat);
-
283  HPT_scifimat_hor_volume->SetLineColor(kCyan);
-
284 
-
285  TGeoBBox* HPT_scifimat_vert_box = new TGeoBBox("HPT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
-
286  TGeoVolume* HPT_scifimat_vert_volume = new TGeoVolume("HPT_scifimat_vert", HPT_scifimat_vert_box, SciFiMat);
-
287  HPT_scifimat_vert_volume->SetLineColor(kGreen);
+
256  //Support Carbon Composite
+
257  TGeoBBox* HPT_support_box = new TGeoBBox("HPT_support_box", HPTrackerX / 2, HPTrackerY / 2, support_z / 2);
+
258  TGeoVolume* HPT_support_volume = new TGeoVolume("HPT_support", HPT_support_box, CarbonComposite);
+
259  HPT_support_volume->SetLineColor(kGray - 2);
+
260  HPT_support_volume->SetVisibility(1);
+
261 
+
262  //Honeycomb Airex (or Nomex)
+
263  TGeoBBox* HPT_honeycomb_box = new TGeoBBox("HPT_honeycomb_box", HPTrackerX / 2, HPTrackerY / 2, honeycomb_z / 2);
+
264  TGeoVolume* HPT_honeycomb_volume = new TGeoVolume("HPT_honeycomb", HPT_honeycomb_box, Airex);
+
265  HPT_honeycomb_volume->SetLineColor(kYellow);
+
266  HPT_honeycomb_volume->SetVisibility(1);
+
267 
+
268  //SciFi planes
+
269  TGeoBBox* HPT_scifi_plane_hor_box = new TGeoBBox("HPT_scifi_plane_hor_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
+
270  TGeoVolume* HPT_scifi_plane_hor_volume = new TGeoVolume("HPT_scifi_plane_hor", HPT_scifi_plane_hor_box, SciFiMat);
+
271  HPT_scifi_plane_hor_volume->SetVisibility(1);
+
272 
+
273  TGeoBBox* HPT_scifi_plane_vert_box = new TGeoBBox("HPT_scifi_plane_vert_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
+
274  TGeoVolume* HPT_scifi_plane_vert_volume = new TGeoVolume("HPT_scifi_plane_vert", HPT_scifi_plane_vert_box, SciFiMat);
+
275  HPT_scifi_plane_vert_volume->SetVisibility(1);
+
276 
+
277  //SciFi mats
+
278  TGeoBBox* HPT_scifimat_hor_box = new TGeoBBox("HPT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
+
279  TGeoVolume* HPT_scifimat_hor_volume = new TGeoVolume("HPT_scifimat_hor", HPT_scifimat_hor_box, SciFiMat);
+
280  HPT_scifimat_hor_volume->SetLineColor(kCyan);
+
281 
+
282  TGeoBBox* HPT_scifimat_vert_box = new TGeoBBox("HPT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
+
283  TGeoVolume* HPT_scifimat_vert_volume = new TGeoVolume("HPT_scifimat_vert", HPT_scifimat_vert_box, SciFiMat);
+
284  HPT_scifimat_vert_volume->SetLineColor(kGreen);
+
285 
+
286  AddSensitiveVolume(HPT_scifimat_hor_volume);
+
287  AddSensitiveVolume(HPT_scifimat_vert_volume);
288 
-
289  AddSensitiveVolume(HPT_scifimat_hor_volume);
-
290  AddSensitiveVolume(HPT_scifimat_vert_volume);
-
291 
-
292  // Creating physical volumes and multiply
-
293  for (int i = 0; i < n_hor_planes; i++){
-
294  HPT_scifi_plane_hor_volume->AddNode(HPT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
+
289  // Creating physical volumes and multiply
+
290  for (int i = 0; i < n_hor_planes; i++){
+
291  HPT_scifi_plane_hor_volume->AddNode(HPT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
+
292  }
+
293  for (int i = 0; i < n_vert_planes; i++){
+
294  HPT_scifi_plane_vert_volume->AddNode(HPT_scifimat_vert_volume, 100+i+1 , new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
295  }
-
296  for (int i = 0; i < n_vert_planes; i++){
-
297  HPT_scifi_plane_vert_volume->AddNode(HPT_scifimat_vert_volume, 100+i+1 , new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
-
298  }
-
299 
-
300  volDT->AddNode(HPT_support_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z / 2));
-
301  volDT->AddNode(HPT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z / 2));
-
302  volDT->AddNode(HPT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z + scifimat_z / 2));
-
303  volDT->AddNode(HPT_honeycomb_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z / 2));
-
304  volDT->AddNode(HPT_support_volume, 1, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z + support_z / 2));
-
306 
-
307  Double_t first_DT_position = -DZMagnetizedRegion/2 + DZTarget + DimZ/2;
-
308  for(int i=0;i<fnHPT;i++){
-
309  for (int j = 0; j < fntarget; j++){
-
310  volMagRegion->AddNode(volDT,(i+1)*1000+j*fnHPT,new TGeoTranslation(0,0, first_DT_position + i*(fDistance+DimZ) + j*(DZTarget+ fnHPT * DimZ + (fnHPT-1)*fDistance)));
-
311  }
-
312  }
-
313  }
-
314 }
-
315 
-
316 Bool_t Hpt::ProcessHits(FairVolume* vol)
-
317 {
-
319  //Set parameters at entrance of volume. Reset ELoss.
-
320  if ( gMC->IsTrackEntering() ) {
-
321  fELoss = 0.;
-
322  fTime = gMC->TrackTime() * 1.0e09;
-
323  fLength = gMC->TrackLength();
-
324  gMC->TrackPosition(fPos);
-
325  gMC->TrackMomentum(fMom);
-
326  }
-
327  // Sum energy loss for all steps in the active volume
-
328  fELoss += gMC->Edep();
-
329 
-
330  // Create muonPoint at exit of active volume
-
331  if ( gMC->IsTrackExiting() ||
-
332  gMC->IsTrackStop() ||
-
333  gMC->IsTrackDisappeared() ){
-
334  if (fELoss == 0. ) { return kFALSE; }
-
335  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
336  Int_t pdgCode = p->GetPdgCode();
-
337  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
338 
-
339  gMC->CurrentVolID(fVolumeID);
-
340  Int_t detID = fVolumeID;
-
341  Int_t TTstationID;
-
342  gMC->CurrentVolOffID(2, TTstationID);
-
343  fVolumeID = TTstationID + detID;
-
344 
-
345  TLorentzVector Pos;
-
346  gMC->TrackPosition(Pos);
-
347  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
348  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
349  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
350 
-
351  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
-
352  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
-
353  fTime, fLength,fELoss, pdgCode);
-
354 
-
355  // Increment number of muon det points in TParticle
-
356  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
357  stack->AddPoint(ktauRpc);
-
358  }
+
296 
+
297  volDT->AddNode(HPT_support_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z / 2));
+
298  volDT->AddNode(HPT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z / 2));
+
299  volDT->AddNode(HPT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z + scifimat_z / 2));
+
300  volDT->AddNode(HPT_honeycomb_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z / 2));
+
301  volDT->AddNode(HPT_support_volume, 1, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z + support_z / 2));
+
303 
+
304  Double_t first_DT_position = -DZMagnetizedRegion/2 + DZTarget + DimZ/2;
+
305  for(int i=0;i<fnHPT;i++){
+
306  for (int j = 0; j < fntarget; j++){
+
307  volMagRegion->AddNode(volDT,(i+1)*1000+j*fnHPT,new TGeoTranslation(0,0, first_DT_position + i*(fDistance+DimZ) + j*(DZTarget+ fnHPT * DimZ + (fnHPT-1)*fDistance)));
+
308  }
+
309  }
+
310  }
+
311 }
+
312 
+
313 Bool_t Hpt::ProcessHits(FairVolume* vol)
+
314 {
+
316  //Set parameters at entrance of volume. Reset ELoss.
+
317  if ( gMC->IsTrackEntering() ) {
+
318  fELoss = 0.;
+
319  fTime = gMC->TrackTime() * 1.0e09;
+
320  fLength = gMC->TrackLength();
+
321  gMC->TrackPosition(fPos);
+
322  gMC->TrackMomentum(fMom);
+
323  }
+
324  // Sum energy loss for all steps in the active volume
+
325  fELoss += gMC->Edep();
+
326 
+
327  // Create muonPoint at exit of active volume
+
328  if ( gMC->IsTrackExiting() ||
+
329  gMC->IsTrackStop() ||
+
330  gMC->IsTrackDisappeared() ){
+
331  if (fELoss == 0. ) { return kFALSE; }
+
332  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
333  Int_t pdgCode = p->GetPdgCode();
+
334  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
335 
+
336  gMC->CurrentVolID(fVolumeID);
+
337  Int_t detID = fVolumeID;
+
338  Int_t TTstationID;
+
339  gMC->CurrentVolOffID(2, TTstationID);
+
340  fVolumeID = TTstationID + detID;
+
341 
+
342  TLorentzVector Pos;
+
343  gMC->TrackPosition(Pos);
+
344  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
345  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
346  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
+
347 
+
348  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
+
349  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
+
350  fTime, fLength,fELoss, pdgCode);
+
351 
+
352  // Increment number of muon det points in TParticle
+
353  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
354  stack->AddPoint(ktauRpc);
+
355  }
+
356 
+
357  return kTRUE;
+
358 }
359 
-
360  return kTRUE;
-
361 }
-
362 
-
363 void Hpt::EndOfEvent()
-
364 {
-
365  fHptPointCollection->Clear();
-
366 }
-
367 
+
360 void Hpt::EndOfEvent()
+
361 {
+
362  fHptPointCollection->Clear();
+
363 }
+
364 
+
365 
+
366 void Hpt::Register()
+
367 {
368 
-
369 void Hpt::Register()
-
370 {
-
371 
-
378  FairRootManager::Instance()->Register("HptPoint", "Hpt",
-
379  fHptPointCollection, kTRUE);
-
380 }
-
381 
-
382 // ----- Public method to Decode volume info -------------------------------------------
-
383 // ----- returns hpt, arm, rpc numbers -----------------------------------
-
384 void Hpt::DecodeVolumeID(Int_t detID,int &nHPT, int &nplane, Bool_t &ishor)
-
385 {
-
386  nHPT = detID/1000;
-
387  int idir = (detID - nHPT*1000)/100;
+
375  FairRootManager::Instance()->Register("HptPoint", "Hpt",
+
376  fHptPointCollection, kTRUE);
+
377 }
+
378 
+
379 // ----- Public method to Decode volume info -------------------------------------------
+
380 // ----- returns hpt, arm, rpc numbers -----------------------------------
+
381 void Hpt::DecodeVolumeID(Int_t detID,int &nHPT, int &nplane, Bool_t &ishor)
+
382 {
+
383  nHPT = detID/1000;
+
384  int idir = (detID - nHPT*1000)/100;
+
385 
+
386  if (idir == 1) ishor = kFALSE;
+
387  else if (idir == 0) ishor = kTRUE;
388 
-
389  if (idir == 1) ishor = kFALSE;
-
390  else if (idir == 0) ishor = kTRUE;
+
389  nplane = (detID - nHPT*1000 - idir*100);
+
390 
391 
-
392  nplane = (detID - nHPT*1000 - idir*100);
+
392 }
393 
-
394 
-
395 }
-
396 
-
397 TClonesArray* Hpt::GetCollection(Int_t iColl) const
-
398 {
-
399  if (iColl == 0) { return fHptPointCollection; }
-
400  else { return NULL; }
-
401 }
-
402 
-
403 void Hpt::Reset()
-
404 {
-
405  fHptPointCollection->Clear();
-
406 }
-
407 
-
408 
-
409 HptPoint* Hpt::AddHit(Int_t trackID, Int_t detID,
-
410  TVector3 pos, TVector3 mom,
-
411  Double_t time, Double_t length,
-
412  Double_t eLoss, Int_t pdgCode)
-
413 
-
414 {
-
415  TClonesArray& clref = *fHptPointCollection;
-
416  Int_t size = clref.GetEntriesFast();
-
417 
-
418  return new(clref[size]) HptPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
-
419 }
+
394 TClonesArray* Hpt::GetCollection(Int_t iColl) const
+
395 {
+
396  if (iColl == 0) { return fHptPointCollection; }
+
397  else { return NULL; }
+
398 }
+
399 
+
400 void Hpt::Reset()
+
401 {
+
402  fHptPointCollection->Clear();
+
403 }
+
404 
+
405 
+
406 HptPoint* Hpt::AddHit(Int_t trackID, Int_t detID,
+
407  TVector3 pos, TVector3 mom,
+
408  Double_t time, Double_t length,
+
409  Double_t eLoss, Int_t pdgCode)
+
410 
+
411 {
+
412  TClonesArray& clref = *fHptPointCollection;
+
413  Int_t size = clref.GetEntriesFast();
+
414 
+
415  return new(clref[size]) HptPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
+
416 }
@@ -508,20 +505,20 @@
Definition: HptPoint.h:11
virtual void Initialize()
Definition: HPT.cxx:93
Double_t scifimat_width
Definition: HPT.h:124
-
virtual void EndOfEvent()
Definition: HPT.cxx:363
+
virtual void EndOfEvent()
Definition: HPT.cxx:360
void SetNumberSciFi(Int_t n_hor_planes_, Int_t n_vert_planes_)
Definition: HPT.cxx:175
void SetHPTNumber(Int_t nHPT)
Definition: HPT.cxx:117
TLorentzVector fPos
volume id
Definition: HPT.h:92
void GetMagnetGeometry(Double_t EmuzC, Double_t EmuY)
Definition: HPT.cxx:132
Int_t fVolumeID
pdg code
Definition: HPT.h:91
-
virtual void Reset()
Definition: HPT.cxx:403
+
virtual void Reset()
Definition: HPT.cxx:400
void GetNumberofTargets(Int_t ntarget)
Definition: HPT.cxx:138
Double_t HPTrackerY
Definition: HPT.h:121
Int_t InitMedium(const char *name)
Definition: HPT.cxx:144
Double_t fDistance
Definition: HPT.h:117
Double32_t fLength
time
Definition: HPT.h:95
Double_t DimY
Definition: HPT.h:108
-
void DecodeVolumeID(Int_t detID, int &nHPT, int &nplane, Bool_t &ishor)
Definition: HPT.cxx:384
+
void DecodeVolumeID(Int_t detID, int &nHPT, int &nplane, Bool_t &ishor)
Definition: HPT.cxx:381
Double_t fConcreteX
Definition: HPT.h:111
Double_t fDesign
Definition: HPT.h:116
Int_t fTrackID
Definition: HPT.h:89
@@ -533,8 +530,8 @@
void SetZsize(const Double_t Mudetsize)
Definition: HPT.cxx:99
void SetConcreteBaseDim(Double_t X, Double_t Y, Double_t Z)
Definition: HPT.cxx:105
virtual ~Hpt()
Definition: HPT.cxx:85
-
virtual void Register()
Definition: HPT.cxx:369
-
HptPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: HPT.cxx:409
+
virtual void Register()
Definition: HPT.cxx:366
+
HptPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: HPT.cxx:406
void SetHPTrackerParam(Double_t HPTX, Double_t HPTY, Double_t HPTZ)
Definition: HPT.cxx:181
Double_t scifimat_z
Definition: HPT.h:127
void ConstructGeometry()
Definition: HPT.cxx:188
@@ -552,14 +549,14 @@
void SetSurroundingDetHeight(Double_t height)
Definition: HPT.cxx:127
Double_t zSizeMudet
Definition: HPT.h:110
Double_t fmagnety
Definition: HPT.h:133
-
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: HPT.cxx:397
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: HPT.cxx:394
void SetSciFiParam(Double_t scifimat_width, Double_t scifimat_hor, Double_t scifimat_vert, Double_t scifimat_z, Double_t support_z, Double_t honeycomb_z)
Definition: HPT.cxx:164
TClonesArray * fHptPointCollection
energy loss
Definition: HPT.h:99
Double_t honeycomb_z
Definition: HPT.h:129
Double_t scifimat_vert
Definition: HPT.h:126
Hpt()
Definition: HPT.cxx:54
Double_t fConcreteY
Definition: HPT.h:112
-
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: HPT.cxx:316
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: HPT.cxx:313
Double_t fmagnetcenter
Definition: HPT.h:134
Int_t n_hor_planes
Definition: HPT.h:130
Definition: ShipStack.h:47
diff --git a/HPT_8h_source.html b/HPT_8h_source.html index 2ea970157d..2ed166f509 100644 --- a/HPT_8h_source.html +++ b/HPT_8h_source.html @@ -214,20 +214,20 @@
Definition: HPT.h:19
virtual void Initialize()
Definition: HPT.cxx:93
Double_t scifimat_width
Definition: HPT.h:124
-
virtual void EndOfEvent()
Definition: HPT.cxx:363
+
virtual void EndOfEvent()
Definition: HPT.cxx:360
void SetNumberSciFi(Int_t n_hor_planes_, Int_t n_vert_planes_)
Definition: HPT.cxx:175
void SetHPTNumber(Int_t nHPT)
Definition: HPT.cxx:117
TLorentzVector fPos
volume id
Definition: HPT.h:92
void GetMagnetGeometry(Double_t EmuzC, Double_t EmuY)
Definition: HPT.cxx:132
Int_t fVolumeID
pdg code
Definition: HPT.h:91
-
virtual void Reset()
Definition: HPT.cxx:403
+
virtual void Reset()
Definition: HPT.cxx:400
void GetNumberofTargets(Int_t ntarget)
Definition: HPT.cxx:138
Double_t HPTrackerY
Definition: HPT.h:121
Int_t InitMedium(const char *name)
Definition: HPT.cxx:144
Double_t fDistance
Definition: HPT.h:117
Double32_t fLength
time
Definition: HPT.h:95
Double_t DimY
Definition: HPT.h:108
-
void DecodeVolumeID(Int_t detID, int &nHPT, int &nplane, Bool_t &ishor)
Definition: HPT.cxx:384
+
void DecodeVolumeID(Int_t detID, int &nHPT, int &nplane, Bool_t &ishor)
Definition: HPT.cxx:381
Double_t fConcreteX
Definition: HPT.h:111
Int_t fPdgCode
track index
Definition: HPT.h:90
Double_t fDesign
Definition: HPT.h:116
@@ -241,8 +241,8 @@
void SetZsize(const Double_t Mudetsize)
Definition: HPT.cxx:99
void SetConcreteBaseDim(Double_t X, Double_t Y, Double_t Z)
Definition: HPT.cxx:105
virtual ~Hpt()
Definition: HPT.cxx:85
-
virtual void Register()
Definition: HPT.cxx:369
-
HptPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: HPT.cxx:409
+
virtual void Register()
Definition: HPT.cxx:366
+
HptPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: HPT.cxx:406
Hpt(const Hpt &)
void SetHPTrackerParam(Double_t HPTX, Double_t HPTY, Double_t HPTZ)
Definition: HPT.cxx:181
Double_t scifimat_z
Definition: HPT.h:127
@@ -266,7 +266,7 @@
void SetSurroundingDetHeight(Double_t height)
Definition: HPT.cxx:127
Double_t zSizeMudet
Definition: HPT.h:110
Double_t fmagnety
Definition: HPT.h:133
-
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: HPT.cxx:397
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: HPT.cxx:394
void SetSciFiParam(Double_t scifimat_width, Double_t scifimat_hor, Double_t scifimat_vert, Double_t scifimat_z, Double_t support_z, Double_t honeycomb_z)
Definition: HPT.cxx:164
TClonesArray * fHptPointCollection
energy loss
Definition: HPT.h:99
Double_t honeycomb_z
Definition: HPT.h:129
@@ -274,7 +274,7 @@
virtual void FinishRun()
Definition: HPT.h:76
Hpt()
Definition: HPT.cxx:54
Double_t fConcreteY
Definition: HPT.h:112
-
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: HPT.cxx:316
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: HPT.cxx:313
virtual void PostTrack()
Definition: HPT.h:78
Double_t fmagnetcenter
Definition: HPT.h:134
virtual void BeginPrimary()
Definition: HPT.h:77
diff --git a/NuTauMudet_8cxx_source.html b/NuTauMudet_8cxx_source.html index 78cbdb11d3..fbacf9fe70 100644 --- a/NuTauMudet_8cxx_source.html +++ b/NuTauMudet_8cxx_source.html @@ -402,630 +402,624 @@
315  TGeoUniformMagField *retFieldU = new TGeoUniformMagField(0.,0.,-fField); //magnetic field up return yoke
316  TGeoUniformMagField *retFieldL = new TGeoUniformMagField(0.,0.,fField); //magnetic field low return yoke
317 
-
318  Double_t d = 0;
-
319 
-
320  if(fDesign<3)
-
321  {
-
322  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volNuTauMudet");
-
323  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,10*cm,fZcenter));
-
324 
-
325  TGeoBBox *UpYokeBox = new TGeoBBox("UpYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
-
326  TGeoVolume *volUpYoke = new TGeoVolume("volUpYoke",UpYokeBox,air);
-
327  volMudetBox->AddNode(volUpYoke,1,new TGeoTranslation(0,fYtot/2 - fYRyoke/2,0));
-
328  volUpYoke->SetField(retFieldU);
-
329 
-
330 
-
331  TGeoBBox *FeYoke = new TGeoBBox("FeYoke",fXtot/2, fYRyoke/2, fZArm/2);
-
332  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke",FeYoke,Iron);
-
333  volFeYoke->SetLineColor(kGray+1);
-
334 
-
335  TGeoBBox *FeYoke1 = new TGeoBBox("FeYoke1",fXtot/2, fYRyoke_s/2, fZRyoke_s/2);
-
336  TGeoVolume *volFeYoke1 = new TGeoVolume("volFeYoke1",FeYoke1,Iron);
-
337  volFeYoke1->SetLineColor(kGray+1);
-
338 
-
339  TGeoBBox *CoilContainer = new TGeoBBox("CoilContainer",fXtot/2, fCoilH/2, 40*cm);
-
340  TGeoVolume *volCoilContainer = new TGeoVolume("volCoilContainer",CoilContainer,air);
-
341 
-
342  TGeoBBox *Coil = new TGeoBBox("Coil",fXtot/2, fCoilH/2, fCoilW/2);
-
343  TGeoVolume *volCoil = new TGeoVolume("volCoil",Coil,Cu);
-
344  volCoil->SetLineColor(kOrange -5);
-
345  for(int i = 0; i < fNCoil; i++)
-
346  {
-
347  volCoilContainer->AddNode(volCoil, i, new TGeoTranslation(0,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
348  }
-
349 
-
350  //vertical coils
-
351  TGeoBBox *CoilV = new TGeoBBox("CoilV",fCoilH/2, fYRyoke/2 , fCoilW/2);
-
352  TGeoVolume *volCoilV = new TGeoVolume("volCoilV",CoilV,Cu);
-
353  volCoilV->SetLineColor(kOrange -5);
-
354  for(int i = 0; i < fNCoil; i++)
-
355  {
-
356  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
357  }
-
358  for(int i = 0; i < fNCoil; i++)
-
359  {
-
360  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
361  }
+
318  if(fDesign<3)
+
319  {
+
320  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volNuTauMudet");
+
321  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,10*cm,fZcenter));
+
322 
+
323  TGeoBBox *UpYokeBox = new TGeoBBox("UpYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
+
324  TGeoVolume *volUpYoke = new TGeoVolume("volUpYoke",UpYokeBox,air);
+
325  volMudetBox->AddNode(volUpYoke,1,new TGeoTranslation(0,fYtot/2 - fYRyoke/2,0));
+
326  volUpYoke->SetField(retFieldU);
+
327 
+
328 
+
329  TGeoBBox *FeYoke = new TGeoBBox("FeYoke",fXtot/2, fYRyoke/2, fZArm/2);
+
330  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke",FeYoke,Iron);
+
331  volFeYoke->SetLineColor(kGray+1);
+
332 
+
333  TGeoBBox *FeYoke1 = new TGeoBBox("FeYoke1",fXtot/2, fYRyoke_s/2, fZRyoke_s/2);
+
334  TGeoVolume *volFeYoke1 = new TGeoVolume("volFeYoke1",FeYoke1,Iron);
+
335  volFeYoke1->SetLineColor(kGray+1);
+
336 
+
337  TGeoBBox *CoilContainer = new TGeoBBox("CoilContainer",fXtot/2, fCoilH/2, 40*cm);
+
338  TGeoVolume *volCoilContainer = new TGeoVolume("volCoilContainer",CoilContainer,air);
+
339 
+
340  TGeoBBox *Coil = new TGeoBBox("Coil",fXtot/2, fCoilH/2, fCoilW/2);
+
341  TGeoVolume *volCoil = new TGeoVolume("volCoil",Coil,Cu);
+
342  volCoil->SetLineColor(kOrange -5);
+
343  for(int i = 0; i < fNCoil; i++)
+
344  {
+
345  volCoilContainer->AddNode(volCoil, i, new TGeoTranslation(0,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
346  }
+
347 
+
348  //vertical coils
+
349  TGeoBBox *CoilV = new TGeoBBox("CoilV",fCoilH/2, fYRyoke/2 , fCoilW/2);
+
350  TGeoVolume *volCoilV = new TGeoVolume("volCoilV",CoilV,Cu);
+
351  volCoilV->SetLineColor(kOrange -5);
+
352  for(int i = 0; i < fNCoil; i++)
+
353  {
+
354  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
355  }
+
356  for(int i = 0; i < fNCoil; i++)
+
357  {
+
358  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
359  }
+
360 
+
361  //cout <<"fZArm: " << fZArm<< endl;
362 
-
363  //cout <<"fZArm: " << fZArm<< endl;
-
364 
-
365  volUpYoke->AddNode(volFeYoke,1, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
-
366  volUpYoke->AddNode(volFeYoke,2, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
-
367  volUpYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
-
368  volUpYoke->AddNode(volCoilContainer,1,new TGeoTranslation(0,fYRyoke/2 - fCoilH/2,0)); //up
-
369  volUpYoke->AddNode(volCoilContainer,2,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
-
370 
-
371  TGeoBBox *LowYokeBox = new TGeoBBox("LowYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
-
372  TGeoVolume *volLowYoke = new TGeoVolume("volLowYoke",LowYokeBox,air);
-
373  volMudetBox->AddNode(volLowYoke,1,new TGeoTranslation(0,-fYtot/2 + fYRyoke/2,0));
-
374  volLowYoke->SetField(retFieldL);
-
375 
-
376  //vertical coils
-
377  for(int i = 0; i < fNCoil; i++)
-
378  {
-
379  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
380  }
-
381  for(int i = 0; i < fNCoil; i++)
-
382  {
-
383  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
384  }
-
385 
-
386  volLowYoke->AddNode(volFeYoke,3, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
-
387  volLowYoke->AddNode(volFeYoke,4, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
-
388  volLowYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
-
389  volLowYoke->AddNode(volCoilContainer,3,new TGeoTranslation(0,fYRyoke/2- fCoilH/2,0)); //up
-
390  volLowYoke->AddNode(volCoilContainer,4,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
-
391 
-
392  Int_t ArmNumber = 1;
-
393  TGeoBBox *Arm1Box = new TGeoBBox("Arm1MudetBox", fXFe/2, fYFe/2, fZArm/2);
-
394  TGeoVolume *volArm1 = new TGeoVolume("volArm1Mudet", Arm1Box,air);
-
395  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field arm1
-
396  volArm1->SetField(magField1);
-
397  volMudetBox ->AddNode(volArm1,ArmNumber,new TGeoTranslation(0,0,-(fGapMiddle+fZArm)/2));
+
363  volUpYoke->AddNode(volFeYoke,1, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
+
364  volUpYoke->AddNode(volFeYoke,2, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
+
365  volUpYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
+
366  volUpYoke->AddNode(volCoilContainer,1,new TGeoTranslation(0,fYRyoke/2 - fCoilH/2,0)); //up
+
367  volUpYoke->AddNode(volCoilContainer,2,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
+
368 
+
369  TGeoBBox *LowYokeBox = new TGeoBBox("LowYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
+
370  TGeoVolume *volLowYoke = new TGeoVolume("volLowYoke",LowYokeBox,air);
+
371  volMudetBox->AddNode(volLowYoke,1,new TGeoTranslation(0,-fYtot/2 + fYRyoke/2,0));
+
372  volLowYoke->SetField(retFieldL);
+
373 
+
374  //vertical coils
+
375  for(int i = 0; i < fNCoil; i++)
+
376  {
+
377  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
378  }
+
379  for(int i = 0; i < fNCoil; i++)
+
380  {
+
381  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
382  }
+
383 
+
384  volLowYoke->AddNode(volFeYoke,3, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
+
385  volLowYoke->AddNode(volFeYoke,4, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
+
386  volLowYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
+
387  volLowYoke->AddNode(volCoilContainer,3,new TGeoTranslation(0,fYRyoke/2- fCoilH/2,0)); //up
+
388  volLowYoke->AddNode(volCoilContainer,4,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
+
389 
+
390  Int_t ArmNumber = 1;
+
391  TGeoBBox *Arm1Box = new TGeoBBox("Arm1MudetBox", fXFe/2, fYFe/2, fZArm/2);
+
392  TGeoVolume *volArm1 = new TGeoVolume("volArm1Mudet", Arm1Box,air);
+
393  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field arm1
+
394  volArm1->SetField(magField1);
+
395  volMudetBox ->AddNode(volArm1,ArmNumber,new TGeoTranslation(0,0,-(fGapMiddle+fZArm)/2));
+
396 
+
397  Int_t nr = ArmNumber*1E4;
398 
-
399  Int_t nr = ArmNumber*1E4;
-
400 
-
401  TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
-
402  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
-
403  //volIron->SetField(magField1);
-
404 
-
405  for(Int_t i = 0; i < fNFe; i++)
-
406  {
-
407  volArm1->AddNode(volIron,nr + 100 + i, new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
-
408  }
-
409 
-
410 
-
411  TGeoBBox *RpcContainer = new TGeoBBox("RpcContainer", fXRpc/2, fYRpc/2, fZRpc/2);
-
412  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
-
413 
-
414  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
-
415  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
-
416  volStrip->SetLineColor(kRed);
-
417  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
-
418  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
-
419  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
-
420  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
-
421  volPETinsulator->SetLineColor(kYellow);
-
422  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
-
423  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
-
424  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
-
425  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
-
426  volElectrode->SetLineColor(kGreen);
-
427  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
-
428  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
-
429  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXGas/2, fYGas/2, fZGas/2);
-
430  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
-
431  volRpc->SetLineColor(kCyan);
-
432  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
+
399  TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
+
400  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
+
401  //volIron->SetField(magField1);
+
402 
+
403  for(Int_t i = 0; i < fNFe; i++)
+
404  {
+
405  volArm1->AddNode(volIron,nr + 100 + i, new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
+
406  }
+
407 
+
408 
+
409  TGeoBBox *RpcContainer = new TGeoBBox("RpcContainer", fXRpc/2, fYRpc/2, fZRpc/2);
+
410  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
+
411 
+
412  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
+
413  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
+
414  volStrip->SetLineColor(kRed);
+
415  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
+
416  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
+
417  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
+
418  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
+
419  volPETinsulator->SetLineColor(kYellow);
+
420  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
+
421  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
+
422  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
+
423  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
+
424  volElectrode->SetLineColor(kGreen);
+
425  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
+
426  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
+
427  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXGas/2, fYGas/2, fZGas/2);
+
428  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
+
429  volRpc->SetLineColor(kCyan);
+
430  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
+
431 
+
432  AddSensitiveVolume(volRpc);
433 
-
434  AddSensitiveVolume(volRpc);
-
435 
-
436  for(Int_t i = 0; i < fNRpc; i++)
-
437  {
-
438  volArm1->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
-
439  }
-
440 
-
441  ArmNumber = 2;
-
442  nr = ArmNumber*1E4;
-
443 
-
444  TGeoBBox *Arm2Box = new TGeoBBox("Arm2MudetBox",fXFe/2, fYFe/2, fZArm/2);
-
445  TGeoVolume *volArm2 = new TGeoVolume("volArm2Mudet", Arm2Box,air);
-
446  TGeoUniformMagField *magField2 = new TGeoUniformMagField(0.,fField,0.); //magnetic field arm2
-
447  volArm2->SetField(magField2);
-
448  volMudetBox ->AddNode(volArm2,1,new TGeoTranslation(0,0,(fGapMiddle+fZArm)/2));
-
449  TGeoVolume *volIron2 = new TGeoVolume("volIron2",IronLayer,Iron);
+
434  for(Int_t i = 0; i < fNRpc; i++)
+
435  {
+
436  volArm1->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
+
437  }
+
438 
+
439  ArmNumber = 2;
+
440  nr = ArmNumber*1E4;
+
441 
+
442  TGeoBBox *Arm2Box = new TGeoBBox("Arm2MudetBox",fXFe/2, fYFe/2, fZArm/2);
+
443  TGeoVolume *volArm2 = new TGeoVolume("volArm2Mudet", Arm2Box,air);
+
444  TGeoUniformMagField *magField2 = new TGeoUniformMagField(0.,fField,0.); //magnetic field arm2
+
445  volArm2->SetField(magField2);
+
446  volMudetBox ->AddNode(volArm2,1,new TGeoTranslation(0,0,(fGapMiddle+fZArm)/2));
+
447  TGeoVolume *volIron2 = new TGeoVolume("volIron2",IronLayer,Iron);
+
448 
+
449  //different volumes for second arm
450 
-
451  //different volumes for second arm
-
452 
-
453  TGeoVolume *volRpcContainer2 = new TGeoVolume("volRpcContainer2",RpcContainer,air);
-
454  TGeoVolume *volStrip2 = new TGeoVolume("volStrip2",Strip,Cu);
-
455 
-
456  volStrip2->SetLineColor(kRed);
-
457  volRpcContainer2->AddNode(volStrip2,1,new TGeoTranslation (0,0,-3.25*mm));
-
458  volRpcContainer2->AddNode(volStrip2,2,new TGeoTranslation (0,0,3.25*mm));
-
459 
-
460  TGeoVolume *volPETinsulator2 = new TGeoVolume("volPETinsulator2", PETinsulator, bakelite);
-
461  volPETinsulator2->SetLineColor(kYellow);
-
462  volRpcContainer2->AddNode(volPETinsulator2,1,new TGeoTranslation(0,0,-3.1*mm));
-
463  volRpcContainer2->AddNode(volPETinsulator2,2,new TGeoTranslation(0,0, 3.1*mm));
-
464 
-
465  TGeoVolume *volElectrode2 = new TGeoVolume("volElectrode2",Electrode,bakelite);
-
466  volElectrode2->SetLineColor(kGreen);
-
467  volRpcContainer2->AddNode(volElectrode2,1,new TGeoTranslation(0,0,-2*mm));
-
468  volRpcContainer2->AddNode(volElectrode2,2,new TGeoTranslation(0,0, 2*mm));
-
469 
-
470  TGeoVolume *volRpc2 = new TGeoVolume("volRpc2",RpcGas,RPCmat);
-
471  volRpc2->SetLineColor(kCyan);
-
472  volRpcContainer2->AddNode(volRpc2,1,new TGeoTranslation(0,0,0));
-
473  AddSensitiveVolume(volRpc2);
-
474 
-
475  for(Int_t i = 0; i < fNFe; i++)
-
476  {
-
477  volArm2->AddNode(volIron2,nr + 100 + i,new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
-
478  }
-
479 
-
480  for(Int_t i = 0; i < fNRpc; i++)
-
481  {
-
482  volArm2->AddNode(volRpcContainer2, nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
-
483  }
-
484 
-
485  //10 cm of Concrete on which the whole Magnetic Spectrometer volume (HPT included) will be placed
-
486  TGeoBBox *Base = new TGeoBBox("Base", fXtot/2, 10*cm/2, fZtot/2);
-
487  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
-
488  volBase->SetLineColor(kYellow-3);
+
451  TGeoVolume *volRpcContainer2 = new TGeoVolume("volRpcContainer2",RpcContainer,air);
+
452  TGeoVolume *volStrip2 = new TGeoVolume("volStrip2",Strip,Cu);
+
453 
+
454  volStrip2->SetLineColor(kRed);
+
455  volRpcContainer2->AddNode(volStrip2,1,new TGeoTranslation (0,0,-3.25*mm));
+
456  volRpcContainer2->AddNode(volStrip2,2,new TGeoTranslation (0,0,3.25*mm));
+
457 
+
458  TGeoVolume *volPETinsulator2 = new TGeoVolume("volPETinsulator2", PETinsulator, bakelite);
+
459  volPETinsulator2->SetLineColor(kYellow);
+
460  volRpcContainer2->AddNode(volPETinsulator2,1,new TGeoTranslation(0,0,-3.1*mm));
+
461  volRpcContainer2->AddNode(volPETinsulator2,2,new TGeoTranslation(0,0, 3.1*mm));
+
462 
+
463  TGeoVolume *volElectrode2 = new TGeoVolume("volElectrode2",Electrode,bakelite);
+
464  volElectrode2->SetLineColor(kGreen);
+
465  volRpcContainer2->AddNode(volElectrode2,1,new TGeoTranslation(0,0,-2*mm));
+
466  volRpcContainer2->AddNode(volElectrode2,2,new TGeoTranslation(0,0, 2*mm));
+
467 
+
468  TGeoVolume *volRpc2 = new TGeoVolume("volRpc2",RpcGas,RPCmat);
+
469  volRpc2->SetLineColor(kCyan);
+
470  volRpcContainer2->AddNode(volRpc2,1,new TGeoTranslation(0,0,0));
+
471  AddSensitiveVolume(volRpc2);
+
472 
+
473  for(Int_t i = 0; i < fNFe; i++)
+
474  {
+
475  volArm2->AddNode(volIron2,nr + 100 + i,new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
+
476  }
+
477 
+
478  for(Int_t i = 0; i < fNRpc; i++)
+
479  {
+
480  volArm2->AddNode(volRpcContainer2, nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
+
481  }
+
482 
+
483  //10 cm of Concrete on which the whole Magnetic Spectrometer volume (HPT included) will be placed
+
484  TGeoBBox *Base = new TGeoBBox("Base", fXtot/2, 10*cm/2, fZtot/2);
+
485  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
+
486  volBase->SetLineColor(kYellow-3);
+
487 
+
488  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-fYtot/2 + 10*cm/2,fZcenter));
489 
-
490  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-fYtot/2 + 10*cm/2,fZcenter));
-
491 
-
492 
-
493  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
494  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
-
495  Pillar1Vol->SetLineColor(kGreen+3);
-
496 
-
497  tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
-
498  tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
-
499  tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
-
500  tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
-
501  }
-
502  if(fDesign==3)
-
503  {
-
504  Double_t supportasymmetry = fUpSuppY - fLowSuppY; //upper and lower support have different dimensions, so the mother box must be large enough to contain both
-
505  Int_t nr = 1E4;
+
490 
+
491  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
492  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
+
493  Pillar1Vol->SetLineColor(kGreen+3);
+
494 
+
495  tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
+
496  tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
+
497  tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
+
498  tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
+
499  }
+
500  if(fDesign==3)
+
501  {
+
502  Int_t nr = 1E4;
+
503 
+
504  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volTauNuMudet");
+
505  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,0,fZcenter));
506 
-
507  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volTauNuMudet");
-
508  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,0,fZcenter));
-
509 
-
510  TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
-
511  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
-
512  volIron->SetLineColor(kGray);
+
507  TGeoBBox *IronLayer = new TGeoBBox("MUDETIRON",fXFe/2, fYFe/2, fZFe/2);
+
508  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
+
509  volIron->SetLineColor(kGray);
+
510 
+
511  auto* IronLayer1 = new TGeoBBox("MUDETIRON1",fXFe/2, fYFe/2, fZFethin/2);
+
512  //***********************ADDING EXTERNAL DETAILS TO THE MUON FILTER
513 
-
514  TGeoBBox *IronLayer1 = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFethin/2);
-
515  TGeoVolume *volIron1 = new TGeoVolume("volIron1",IronLayer1,Iron);
-
516  //***********************ADDING EXTERNAL DETAILS TO THE MUON FILTER
-
517 
-
518  //********UPPER COVER***********
-
519 
-
520  TGeoBBox *UpperCover = new TGeoBBox("UpperCover",fXCov/2, fYCov/2, fZCov/2);
-
521  TGeoVolume *volUpperCover = new TGeoVolume("volUpperCover",UpperCover, Al);
-
522  volUpperCover->SetLineColor(kYellow-7);
-
523  volMudetBox->AddNode(volUpperCover, 1, new TGeoTranslation(0, fYFe/2+fYCov/2+fUpSuppY, -fZtot/2 + fZCov/2));
-
524 
-
525  //**********LATERAL COVER**********
-
526 
-
527  TGeoBBox *LateralCover = new TGeoBBox("LateralCover",fXLateral/2, fYLateral/2, fZLateral/2);
-
528  TGeoVolume *volLateralCover = new TGeoVolume("volLateralCover",LateralCover, Al);
-
529  volLateralCover->SetLineColor(kYellow-7);
-
530  volMudetBox->AddNode(volLateralCover, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low right
-
531  volMudetBox->AddNode(volLateralCover, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low left
-
532  volMudetBox->AddNode(volLateralCover, 3, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up right
-
533  volMudetBox->AddNode(volLateralCover, 4, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up left
-
534 
-
535  //*********** LATERAL CROSSES************
-
536 
-
537  Double_t Inclination =TMath::Pi()/2 - TMath::ATan(fYCross/(fZCross - fWidthArm));
-
538  TGeoRotation *Crossrot1 = new TGeoRotation("Crossrot1", 0., 0.,0.); TGeoRotation *Crossrot2 = new TGeoRotation("Crossrot2", 0., 0.,0.);
-
539  Crossrot1->RotateY(-90); Crossrot2->RotateY(90);
-
540  Crossrot1->SetName("NegativeRot"); Crossrot2->SetName("PositiveRot");
-
541  Crossrot1->RegisterYourself(); Crossrot2->RegisterYourself();
-
542 
-
543  TGeoPara *ArmCross1 = new TGeoPara ("ArmCross1", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
-
544  ArmCross1->SetName("ARMCROSS1");
-
545  TGeoPara *ArmCross2 = new TGeoPara ("ArmCross2", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
-
546  ArmCross2->SetName("ARMCROSS2");
-
547  TGeoCompositeShape *MuCross = new TGeoCompositeShape("MUFILTERCROSS", "ARMCROSS1:NegativeRot+ARMCROSS2:PositiveRot");
-
548  TGeoVolume *volMuDetCross = new TGeoVolume("volMuDetCross",MuCross, Al);
-
549  volMuDetCross->SetLineColor(kYellow-7);
-
550  volMudetBox->AddNode(volMuDetCross, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral+fXCross/2., 0., -fZtot/2 + fZCross/2)); // right
-
551  volMudetBox->AddNode(volMuDetCross, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral-fXCross/2., 0., -fZtot/2 + fZCross/2)); // left
-
552 
-
553  //***********************ADDING CUTS AT MID-LATERAL IN WALLS
-
554  IronLayer->SetName("MUDETIRON");
-
555  IronLayer1->SetName("MUDETIRON1");
-
556 
-
557  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
-
558  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fZFe+delta)/2,(fZFe+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
-
559  Model->SetName("MUDETTRIANGLE");
-
560 
-
561  TGeoRotation rot("rot",90,90,0);
-
562  TGeoRotation rot1("rot1",-90,90,0);
-
563  //cut on the right (seen from beam)
-
564  const TGeoTranslation transright("trans",-fXFe/2.+ fCutLength/2,0,0);
-
565  TGeoCombiTrans* combright = new TGeoCombiTrans(transright,rot);
-
566  combright->SetName("MuDetcombright");
-
567  combright->RegisterYourself();
-
568  //cut on the left (seen from beam)
-
569  const TGeoTranslation transleft("transleft",+fXFe/2.- fCutLength/2,0,0);
-
570  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
-
571  combleft->SetName("MuDetcombleft");
-
572  combleft->RegisterYourself();
-
573  //unique volume, we cut the triangles
-
574  TGeoCompositeShape *mudetcut = new TGeoCompositeShape("MUDETCUT", "(MUDETIRON-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
-
575  mudetcut->SetName("MUDETTRIANGCUT");
-
576  //same, for the thin layers
-
577  TGeoCompositeShape *mudetcut1 = new TGeoCompositeShape("MUDETCUT1", "(MUDETIRON1-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
-
578  mudetcut1->SetName("MUDETTRIANGCUT1");
-
579  //addition of iron support structures
-
580  //support layers, fot thick layers upstream
-
581  TGeoBBox *UpperSupport = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFe/2.);
-
582  UpperSupport->SetName("MUDETUPSUPPORT");
-
583  TGeoBBox *LowerSupport = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFe/2.);
-
584  LowerSupport->SetName("MUDETLOWSUPPORT");
-
585  TGeoBBox *LateralSupport = new TGeoBBox(fLatSuppX/2., fLatSuppY/2., fZFe/2.);
-
586  LateralSupport->SetName("MUDETLATERALSUPPORT");
-
587  //support layers, for thin layers downstream
-
588  TGeoBBox *UpperSupport1 = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFethin/2.); //The 1 shapes have less z thickness
-
589  UpperSupport1->SetName("MUDETUPSUPPORT1");
-
590  TGeoBBox *LowerSupport1 = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFethin/2.);
-
591  LowerSupport1->SetName("MUDETLOWSUPPORT1");
-
592  TGeoBBox *LateralSupport1 = new TGeoBBox(fLatSuppX/2., fLatSuppY/2.,fZFethin/2.);
-
593  LateralSupport1->SetName("MUDETLATERALSUPPORT1");
-
594  //Translations (left is considered from the beam, positive x)
-
595 
-
596  TGeoTranslation * upright = new TGeoTranslation("MuDetupright",-fXFe/2.+fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
-
597  TGeoTranslation * upleft = new TGeoTranslation("MuDetupleft",+fXFe/2.-fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
-
598  TGeoTranslation * lateralupleft = new TGeoTranslation("MuDetlateralupleft",+fXFe/2.+fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
-
599  TGeoTranslation * lateralupright = new TGeoTranslation("MuDetlateralupright",-fXFe/2.-fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
-
600  TGeoTranslation * laterallowleft = new TGeoTranslation("MuDetlaterallowleft",+fXFe/2.+fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
-
601  TGeoTranslation * laterallowright = new TGeoTranslation("MuDetlaterallowright",-fXFe/2.-fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
-
602  TGeoTranslation * lowright = new TGeoTranslation("MuDetlowright",-fXFe/2.+fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
-
603  TGeoTranslation * lowleft = new TGeoTranslation("MuDetlowleft",+fXFe/2.-fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
-
604  //necessary to put SetName, otherwise it will not find them
-
605  upright->SetName("MuDetupright");
-
606  upright->RegisterYourself();
-
607  upleft->SetName("MuDetupleft");
-
608  upleft->RegisterYourself();
-
609  lowright->SetName("MuDetlowright");
-
610  lowright->RegisterYourself();
-
611  lowleft->SetName("MuDetlowleft");
-
612  lowleft->RegisterYourself();
-
613 
-
614  lateralupleft->SetName("MuDetlateralupleft");
-
615  lateralupleft->RegisterYourself();
-
616  lateralupright->SetName("MuDetlateralupright");
-
617  lateralupright->RegisterYourself();
-
618  laterallowleft->SetName("MuDetlaterallowleft");
-
619  laterallowleft->RegisterYourself();
-
620  laterallowright->SetName("MuDetlaterallowright");
-
621  laterallowright->RegisterYourself();
-
622  //building composite shapes, writing compositions as TString first to improve readibility
-
623  TString *supportaddition = new TString("MUDETTRIANGCUT+MUDETUPSUPPORT:MuDetupright+MUDETUPSUPPORT:MuDetupleft+MUDETLOWSUPPORT:MuDetlowright+MUDETLOWSUPPORT:MuDetlowleft+MUDETLATERALSUPPORT:MuDetlateralupleft+MUDETLATERALSUPPORT:MuDetlateralupright+MUDETLATERALSUPPORT:MuDetlaterallowleft+MUDETLATERALSUPPORT:MuDetlaterallowright");
-
624  TString *supportaddition1 = new TString("MUDETTRIANGCUT1+MUDETUPSUPPORT1:MuDetupright+MUDETUPSUPPORT1:MuDetupleft+MUDETLOWSUPPORT1:MuDetlowright+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLATERALSUPPORT1:MuDetlateralupleft+MUDETLATERALSUPPORT1:MuDetlateralupright+MUDETLATERALSUPPORT1:MuDetlaterallowleft+MUDETLATERALSUPPORT1:MuDetlaterallowright");
-
625  TGeoCompositeShape * SupportedIronLayer = new TGeoCompositeShape("SupportedIronLayer",supportaddition->Data());
-
626  TGeoCompositeShape * SupportedIronLayer1 = new TGeoCompositeShape("SupportedIronLayer1",supportaddition1->Data());
-
627 
-
628  TGeoVolume *MudetIronLayer = new TGeoVolume("MudetIronLayer", SupportedIronLayer, Iron);
-
629  MudetIronLayer->SetLineColor(kRed+2);
-
630  TGeoVolume *MudetIronLayer1 = new TGeoVolume("MudetIronLayer1", SupportedIronLayer1, Iron);
-
631  MudetIronLayer1->SetLineColor(kRed+2);
-
632 
-
633  for(Int_t i = 0; i < fNFe; i++)
-
634  {
-
635  double dz = -fZtot/2+i*fZFe+fZFe/2+i*fZRpc;
-
636  volMudetBox->AddNode(MudetIronLayer,nr + 100 + i, new TGeoTranslation(0, 0, dz));
-
637  }
-
638  for(Int_t i = 0; i < fNFethin; i++)
-
639  {
-
640  double dz = -fZtot/2+fNFe*(fZRpc+fZFe)+i*fZFethin+fZFethin/2+i*fZRpc;
-
641  volMudetBox->AddNode(MudetIronLayer1,nr + 100 + fNFe + i, new TGeoTranslation(0, 0,dz));
-
642  }
-
643  //*****************************RPC LAYERS****************************************
-
644 
-
645  TGeoBBox *RpcContainer_0 = new TGeoBBox("RpcContainer", fXRpc_outer/2, fYRpc_outer/2, fZRpc/2);
-
646  RpcContainer_0->SetName("RPCCOINTAINER_0");
-
647 
-
648  /*
-
649  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
-
650  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
-
651  volStrip->SetLineColor(kGreen);
-
652  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
-
653  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
-
654  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
-
655  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
-
656  volPETinsulator->SetLineColor(kYellow);
-
657  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
-
658  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
-
659  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
-
660  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
-
661  volElectrode->SetLineColor(kGreen);
-
662  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
-
663  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
-
664  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
-
665  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
-
666  volRpc->SetLineColor(kCyan);
-
667  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
-
668  */
-
669 
-
670  TGeoBBox *RpcOuter = new TGeoBBox("RpcOuter", fXRpc_outer/2, fYRpc_outer/2, fZRpc_outer/2);
-
671  RpcOuter->SetName("RPCOUTER");
-
672  TGeoTrd2 *Indentation = new TGeoTrd2("Indentation", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc_outer+0.1*cm)/2,(fZRpc_outer+0.1*cm)/2,(15.*cm+0.1*cm)/2); // (b, B, Z_up, Z_down, h)
-
673  Indentation->SetName("INDENTATION");
-
674  const TGeoTranslation leftindent("leftindent", (fXRpc_outer-15.*cm)/2, 0, 0);
-
675  TGeoCombiTrans* left_ind = new TGeoCombiTrans(leftindent, rot);
-
676  left_ind->SetName("LEFTINDENT");
-
677  left_ind->RegisterYourself();
-
678  const TGeoTranslation rightindent("rightindent", (-fXRpc_outer+15.*cm)/2, 0, 0);
-
679  TGeoCombiTrans* right_ind = new TGeoCombiTrans(rightindent, rot1);
-
680  right_ind->SetName("RIGHTINDENT");
-
681  right_ind->RegisterYourself();
-
682  TGeoBBox *RpcInner = new TGeoBBox("RpcInner", fXRpc_inner/2, fYRpc_inner/2, fZRpc_inner/2);
-
683  RpcInner->SetName("RPCINNER");
-
684  TGeoTranslation *exclusion = new TGeoTranslation(0, 0, (-fZRpc_inner/2) -0.6*cm);
-
685  exclusion->SetName("EXCLUSION");
-
686  exclusion->RegisterYourself();
-
687  TGeoCompositeShape *RpcShell = new TGeoCompositeShape("RpcShell", "RPCOUTER-INDENTATION:RIGHTINDENT-INDENTATION:LEFTINDENT-RPCINNER:EXCLUSION");
-
688  TGeoVolume *volRpcShell = new TGeoVolume("volRpcShell", RpcShell, Al);
-
689  volRpcShell->SetLineColor(kGray);
-
690 
-
691  TGeoBBox *GasShape = new TGeoBBox("GasShape", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
-
692  GasShape->SetName("RPCGAS");
-
693  TGeoBBox *GapSpacing = new TGeoBBox("GapSpacing", fXRpcGap/2, 6./2*cm, (fZGas+0.01*cm)/2 );
-
694  GapSpacing->SetName("GAPSPACE");
-
695  TGeoTranslation *mdown = new TGeoTranslation("mdown", 0., -(fYRpcGap+6*cm)/2, 0.); // 6 cm is the spacing between two gaps
-
696  mdown->SetName("MDOWN");
-
697  mdown->RegisterYourself();
-
698  TGeoTranslation *mup = new TGeoTranslation("mup",0., (fYRpcGap+6*cm)/2, 0.);
-
699  mup->SetName("MUP");
-
700  mup->RegisterYourself();
-
701  TGeoCompositeShape *RpcGas = new TGeoCompositeShape("RpcGas", "RPCGAS-GAPSPACE:MUP-GAPSPACE:MDOWN");
-
702  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas, RPCmat);
-
703  volRpc->SetLineColor(kCyan);
-
704 
-
705  //****RPC container framing*********
-
706  TGeoTrd2 *Indentation_0 = new TGeoTrd2("Indentation_0", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc)/2,(fZRpc)/2,(15.*cm+0.1*cm)/2);
-
707  Indentation_0->SetName("INDENTATION_0");
-
708  TGeoCompositeShape *RpcContainer = new TGeoCompositeShape("RpcContainer", "RPCCOINTAINER_0-INDENTATION_0:RIGHTINDENT-INDENTATION_0:LEFTINDENT");
-
709  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
-
710  //***********************************
-
711 
-
712  TGeoBBox *GapShape = new TGeoBBox("GapShape", fXRpcGap/2, fYRpc_inner/2, fZRpcGap/2);
-
713  GapShape->SetName("RPCGAP");
-
714  TGeoBBox *GapSpacing1 = new TGeoBBox("GapSpacing1", fXRpcGap/2, 6./2*cm, (fZRpcGap+0.01*cm)/2);
-
715  GapSpacing1->SetName("GAPSPACE1");
-
716  TGeoCompositeShape *RpcGap = new TGeoCompositeShape("RpcGap", "RPCGAP-GAPSPACE1:MUP-GAPSPACE1:MDOWN");
-
717  TGeoVolume *volRpcGap = new TGeoVolume("volRpcGap",RpcGap, bakelite);
-
718  volRpcGap->SetLineColor(kOrange);
-
719 
-
720  TGeoBBox *Strip = new TGeoBBox("Strip", fXRpc_inner/2, fYRpc_inner/2, fZStrip/2);
-
721  TGeoVolume *volStrip= new TGeoVolume("volStrip", Strip, Cu);
-
722  volStrip->SetLineColor(kOrange+5);
-
723  TGeoRotation rot2("rot2", 0., 0.,0.);
-
724  rot2.RotateY(180);
-
725  const TGeoTranslation trans_rot(0., 0., fZGas/2+fZRpcGap+fZStrip+fZRpc_outer/2);
-
726  TGeoCombiTrans *comb_1 = new TGeoCombiTrans(trans_rot, rot2);
-
727 
-
728  volRpcContainer->AddNode(volRpcShell,1, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip-fZRpc_outer/2));
-
729  volRpcContainer->AddNode(volRpcShell,2, comb_1);
-
730  volRpcContainer->AddNode(volStrip, 1, new TGeoTranslation(0., 0., fZGas/2+fZRpcGap+fZStrip/2));
-
731  volRpcContainer->AddNode(volStrip, 2, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip/2));
-
732  volRpcContainer->AddNode(volRpcGap, 1, new TGeoTranslation(0., 0., (fZGas+fZRpcGap)/2));
-
733  volRpcContainer->AddNode(volRpcGap, 2, new TGeoTranslation(0., 0., -(fZGas+fZRpcGap)/2));
-
734  volRpcContainer->AddNode(volRpc, 1, new TGeoTranslation(0., 0., 0.));
-
735 
-
736  AddSensitiveVolume(volRpc);
-
737 
-
738  for(Int_t i = 0; i < fNRpc; i++)
-
739  {
-
740  double dy = 5.*cm;
-
741  double dz = -fZtot/2 + (i+1)*fZFe + i*fZRpc + fZRpc/2;
-
742  if (i >= fNFe) dz = dz - (i + 1 - fNFe) * (fZFe - fZFethin);
-
743  if(i%2)volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -dy, dz)); //staggering
-
744  else{volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, dy, dz));}
-
745  }
-
746 
-
747  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
748  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
-
749  Pillar1Vol->SetLineColor(kGreen+3);
+
514  //********UPPER COVER***********
+
515 
+
516  TGeoBBox *UpperCover = new TGeoBBox("UpperCover",fXCov/2, fYCov/2, fZCov/2);
+
517  TGeoVolume *volUpperCover = new TGeoVolume("volUpperCover",UpperCover, Al);
+
518  volUpperCover->SetLineColor(kYellow-7);
+
519  volMudetBox->AddNode(volUpperCover, 1, new TGeoTranslation(0, fYFe/2+fYCov/2+fUpSuppY, -fZtot/2 + fZCov/2));
+
520 
+
521  //**********LATERAL COVER**********
+
522 
+
523  TGeoBBox *LateralCover = new TGeoBBox("LateralCover",fXLateral/2, fYLateral/2, fZLateral/2);
+
524  TGeoVolume *volLateralCover = new TGeoVolume("volLateralCover",LateralCover, Al);
+
525  volLateralCover->SetLineColor(kYellow-7);
+
526  volMudetBox->AddNode(volLateralCover, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low right
+
527  volMudetBox->AddNode(volLateralCover, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low left
+
528  volMudetBox->AddNode(volLateralCover, 3, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up right
+
529  volMudetBox->AddNode(volLateralCover, 4, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up left
+
530 
+
531  //*********** LATERAL CROSSES************
+
532 
+
533  Double_t Inclination =TMath::Pi()/2 - TMath::ATan(fYCross/(fZCross - fWidthArm));
+
534  TGeoRotation *Crossrot1 = new TGeoRotation("Crossrot1", 0., 0.,0.); TGeoRotation *Crossrot2 = new TGeoRotation("Crossrot2", 0., 0.,0.);
+
535  Crossrot1->RotateY(-90); Crossrot2->RotateY(90);
+
536  Crossrot1->SetName("NegativeRot"); Crossrot2->SetName("PositiveRot");
+
537  Crossrot1->RegisterYourself(); Crossrot2->RegisterYourself();
+
538 
+
539  TGeoPara *ArmCross1 = new TGeoPara ("ArmCross1", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
+
540  ArmCross1->SetName("ARMCROSS1");
+
541  TGeoPara *ArmCross2 = new TGeoPara ("ArmCross2", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
+
542  ArmCross2->SetName("ARMCROSS2");
+
543  TGeoCompositeShape *MuCross = new TGeoCompositeShape("MUFILTERCROSS", "ARMCROSS1:NegativeRot+ARMCROSS2:PositiveRot");
+
544  TGeoVolume *volMuDetCross = new TGeoVolume("volMuDetCross",MuCross, Al);
+
545  volMuDetCross->SetLineColor(kYellow-7);
+
546  volMudetBox->AddNode(volMuDetCross, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral+fXCross/2., 0., -fZtot/2 + fZCross/2)); // right
+
547  volMudetBox->AddNode(volMuDetCross, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral-fXCross/2., 0., -fZtot/2 + fZCross/2)); // left
+
548 
+
549  //***********************ADDING CUTS AT MID-LATERAL IN WALLS
+
550 
+
551  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
+
552  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fZFe+delta)/2,(fZFe+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
+
553  Model->SetName("MUDETTRIANGLE");
+
554 
+
555  TGeoRotation rot("rot",90,90,0);
+
556  TGeoRotation rot1("rot1",-90,90,0);
+
557  //cut on the right (seen from beam)
+
558  const TGeoTranslation transright("trans",-fXFe/2.+ fCutLength/2,0,0);
+
559  TGeoCombiTrans* combright = new TGeoCombiTrans(transright,rot);
+
560  combright->SetName("MuDetcombright");
+
561  combright->RegisterYourself();
+
562  //cut on the left (seen from beam)
+
563  const TGeoTranslation transleft("transleft",+fXFe/2.- fCutLength/2,0,0);
+
564  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
+
565  combleft->SetName("MuDetcombleft");
+
566  combleft->RegisterYourself();
+
567  //unique volume, we cut the triangles
+
568  TGeoCompositeShape *mudetcut = new TGeoCompositeShape("MUDETCUT", "(MUDETIRON-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
+
569  mudetcut->SetName("MUDETTRIANGCUT");
+
570  //same, for the thin layers
+
571  TGeoCompositeShape *mudetcut1 = new TGeoCompositeShape("MUDETCUT1", "(MUDETIRON1-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
+
572  mudetcut1->SetName("MUDETTRIANGCUT1");
+
573  //addition of iron support structures
+
574  //support layers, fot thick layers upstream
+
575  TGeoBBox *UpperSupport = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFe/2.);
+
576  UpperSupport->SetName("MUDETUPSUPPORT");
+
577  TGeoBBox *LowerSupport = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFe/2.);
+
578  LowerSupport->SetName("MUDETLOWSUPPORT");
+
579  TGeoBBox *LateralSupport = new TGeoBBox(fLatSuppX/2., fLatSuppY/2., fZFe/2.);
+
580  LateralSupport->SetName("MUDETLATERALSUPPORT");
+
581  //support layers, for thin layers downstream
+
582  TGeoBBox *UpperSupport1 = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFethin/2.); //The 1 shapes have less z thickness
+
583  UpperSupport1->SetName("MUDETUPSUPPORT1");
+
584  TGeoBBox *LowerSupport1 = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFethin/2.);
+
585  LowerSupport1->SetName("MUDETLOWSUPPORT1");
+
586  TGeoBBox *LateralSupport1 = new TGeoBBox(fLatSuppX/2., fLatSuppY/2.,fZFethin/2.);
+
587  LateralSupport1->SetName("MUDETLATERALSUPPORT1");
+
588  //Translations (left is considered from the beam, positive x)
+
589 
+
590  TGeoTranslation * upright = new TGeoTranslation("MuDetupright",-fXFe/2.+fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
+
591  TGeoTranslation * upleft = new TGeoTranslation("MuDetupleft",+fXFe/2.-fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
+
592  TGeoTranslation * lateralupleft = new TGeoTranslation("MuDetlateralupleft",+fXFe/2.+fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
+
593  TGeoTranslation * lateralupright = new TGeoTranslation("MuDetlateralupright",-fXFe/2.-fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
+
594  TGeoTranslation * laterallowleft = new TGeoTranslation("MuDetlaterallowleft",+fXFe/2.+fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
+
595  TGeoTranslation * laterallowright = new TGeoTranslation("MuDetlaterallowright",-fXFe/2.-fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
+
596  TGeoTranslation * lowright = new TGeoTranslation("MuDetlowright",-fXFe/2.+fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
+
597  TGeoTranslation * lowleft = new TGeoTranslation("MuDetlowleft",+fXFe/2.-fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
+
598  //necessary to put SetName, otherwise it will not find them
+
599  upright->SetName("MuDetupright");
+
600  upright->RegisterYourself();
+
601  upleft->SetName("MuDetupleft");
+
602  upleft->RegisterYourself();
+
603  lowright->SetName("MuDetlowright");
+
604  lowright->RegisterYourself();
+
605  lowleft->SetName("MuDetlowleft");
+
606  lowleft->RegisterYourself();
+
607 
+
608  lateralupleft->SetName("MuDetlateralupleft");
+
609  lateralupleft->RegisterYourself();
+
610  lateralupright->SetName("MuDetlateralupright");
+
611  lateralupright->RegisterYourself();
+
612  laterallowleft->SetName("MuDetlaterallowleft");
+
613  laterallowleft->RegisterYourself();
+
614  laterallowright->SetName("MuDetlaterallowright");
+
615  laterallowright->RegisterYourself();
+
616  //building composite shapes, writing compositions as TString first to improve readibility
+
617  TString *supportaddition = new TString("MUDETTRIANGCUT+MUDETUPSUPPORT:MuDetupright+MUDETUPSUPPORT:MuDetupleft+MUDETLOWSUPPORT:MuDetlowright+MUDETLOWSUPPORT:MuDetlowleft+MUDETLATERALSUPPORT:MuDetlateralupleft+MUDETLATERALSUPPORT:MuDetlateralupright+MUDETLATERALSUPPORT:MuDetlaterallowleft+MUDETLATERALSUPPORT:MuDetlaterallowright");
+
618  TString *supportaddition1 = new TString("MUDETTRIANGCUT1+MUDETUPSUPPORT1:MuDetupright+MUDETUPSUPPORT1:MuDetupleft+MUDETLOWSUPPORT1:MuDetlowright+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLATERALSUPPORT1:MuDetlateralupleft+MUDETLATERALSUPPORT1:MuDetlateralupright+MUDETLATERALSUPPORT1:MuDetlaterallowleft+MUDETLATERALSUPPORT1:MuDetlaterallowright");
+
619  TGeoCompositeShape * SupportedIronLayer = new TGeoCompositeShape("SupportedIronLayer",supportaddition->Data());
+
620  TGeoCompositeShape * SupportedIronLayer1 = new TGeoCompositeShape("SupportedIronLayer1",supportaddition1->Data());
+
621 
+
622  TGeoVolume *MudetIronLayer = new TGeoVolume("MudetIronLayer", SupportedIronLayer, Iron);
+
623  MudetIronLayer->SetLineColor(kRed+2);
+
624  TGeoVolume *MudetIronLayer1 = new TGeoVolume("MudetIronLayer1", SupportedIronLayer1, Iron);
+
625  MudetIronLayer1->SetLineColor(kRed+2);
+
626 
+
627  for(Int_t i = 0; i < fNFe; i++)
+
628  {
+
629  double dz = -fZtot/2+i*fZFe+fZFe/2+i*fZRpc;
+
630  volMudetBox->AddNode(MudetIronLayer,nr + 100 + i, new TGeoTranslation(0, 0, dz));
+
631  }
+
632  for(Int_t i = 0; i < fNFethin; i++)
+
633  {
+
634  double dz = -fZtot/2+fNFe*(fZRpc+fZFe)+i*fZFethin+fZFethin/2+i*fZRpc;
+
635  volMudetBox->AddNode(MudetIronLayer1,nr + 100 + fNFe + i, new TGeoTranslation(0, 0,dz));
+
636  }
+
637  //*****************************RPC LAYERS****************************************
+
638 
+
639  TGeoBBox *RpcContainer_0 = new TGeoBBox("RpcContainer", fXRpc_outer/2, fYRpc_outer/2, fZRpc/2);
+
640  RpcContainer_0->SetName("RPCCOINTAINER_0");
+
641 
+
642  /*
+
643  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
+
644  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
+
645  volStrip->SetLineColor(kGreen);
+
646  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
+
647  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
+
648  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
+
649  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
+
650  volPETinsulator->SetLineColor(kYellow);
+
651  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
+
652  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
+
653  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
+
654  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
+
655  volElectrode->SetLineColor(kGreen);
+
656  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
+
657  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
+
658  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
+
659  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
+
660  volRpc->SetLineColor(kCyan);
+
661  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
+
662  */
+
663 
+
664  TGeoBBox *RpcOuter = new TGeoBBox("RpcOuter", fXRpc_outer/2, fYRpc_outer/2, fZRpc_outer/2);
+
665  RpcOuter->SetName("RPCOUTER");
+
666  TGeoTrd2 *Indentation = new TGeoTrd2("Indentation", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc_outer+0.1*cm)/2,(fZRpc_outer+0.1*cm)/2,(15.*cm+0.1*cm)/2); // (b, B, Z_up, Z_down, h)
+
667  Indentation->SetName("INDENTATION");
+
668  const TGeoTranslation leftindent("leftindent", (fXRpc_outer-15.*cm)/2, 0, 0);
+
669  TGeoCombiTrans* left_ind = new TGeoCombiTrans(leftindent, rot);
+
670  left_ind->SetName("LEFTINDENT");
+
671  left_ind->RegisterYourself();
+
672  const TGeoTranslation rightindent("rightindent", (-fXRpc_outer+15.*cm)/2, 0, 0);
+
673  TGeoCombiTrans* right_ind = new TGeoCombiTrans(rightindent, rot1);
+
674  right_ind->SetName("RIGHTINDENT");
+
675  right_ind->RegisterYourself();
+
676  TGeoBBox *RpcInner = new TGeoBBox("RpcInner", fXRpc_inner/2, fYRpc_inner/2, fZRpc_inner/2);
+
677  RpcInner->SetName("RPCINNER");
+
678  TGeoTranslation *exclusion = new TGeoTranslation(0, 0, (-fZRpc_inner/2) -0.6*cm);
+
679  exclusion->SetName("EXCLUSION");
+
680  exclusion->RegisterYourself();
+
681  TGeoCompositeShape *RpcShell = new TGeoCompositeShape("RpcShell", "RPCOUTER-INDENTATION:RIGHTINDENT-INDENTATION:LEFTINDENT-RPCINNER:EXCLUSION");
+
682  TGeoVolume *volRpcShell = new TGeoVolume("volRpcShell", RpcShell, Al);
+
683  volRpcShell->SetLineColor(kGray);
+
684 
+
685  TGeoBBox *GasShape = new TGeoBBox("GasShape", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
+
686  GasShape->SetName("RPCGAS");
+
687  TGeoBBox *GapSpacing = new TGeoBBox("GapSpacing", fXRpcGap/2, 6./2*cm, (fZGas+0.01*cm)/2 );
+
688  GapSpacing->SetName("GAPSPACE");
+
689  TGeoTranslation *mdown = new TGeoTranslation("mdown", 0., -(fYRpcGap+6*cm)/2, 0.); // 6 cm is the spacing between two gaps
+
690  mdown->SetName("MDOWN");
+
691  mdown->RegisterYourself();
+
692  TGeoTranslation *mup = new TGeoTranslation("mup",0., (fYRpcGap+6*cm)/2, 0.);
+
693  mup->SetName("MUP");
+
694  mup->RegisterYourself();
+
695  TGeoCompositeShape *RpcGas = new TGeoCompositeShape("RpcGas", "RPCGAS-GAPSPACE:MUP-GAPSPACE:MDOWN");
+
696  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas, RPCmat);
+
697  volRpc->SetLineColor(kCyan);
+
698 
+
699  //****RPC container framing*********
+
700  TGeoTrd2 *Indentation_0 = new TGeoTrd2("Indentation_0", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc)/2,(fZRpc)/2,(15.*cm+0.1*cm)/2);
+
701  Indentation_0->SetName("INDENTATION_0");
+
702  TGeoCompositeShape *RpcContainer = new TGeoCompositeShape("RpcContainer", "RPCCOINTAINER_0-INDENTATION_0:RIGHTINDENT-INDENTATION_0:LEFTINDENT");
+
703  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
+
704  //***********************************
+
705 
+
706  TGeoBBox *GapShape = new TGeoBBox("GapShape", fXRpcGap/2, fYRpc_inner/2, fZRpcGap/2);
+
707  GapShape->SetName("RPCGAP");
+
708  TGeoBBox *GapSpacing1 = new TGeoBBox("GapSpacing1", fXRpcGap/2, 6./2*cm, (fZRpcGap+0.01*cm)/2);
+
709  GapSpacing1->SetName("GAPSPACE1");
+
710  TGeoCompositeShape *RpcGap = new TGeoCompositeShape("RpcGap", "RPCGAP-GAPSPACE1:MUP-GAPSPACE1:MDOWN");
+
711  TGeoVolume *volRpcGap = new TGeoVolume("volRpcGap",RpcGap, bakelite);
+
712  volRpcGap->SetLineColor(kOrange);
+
713 
+
714  TGeoBBox *Strip = new TGeoBBox("Strip", fXRpc_inner/2, fYRpc_inner/2, fZStrip/2);
+
715  TGeoVolume *volStrip= new TGeoVolume("volStrip", Strip, Cu);
+
716  volStrip->SetLineColor(kOrange+5);
+
717  TGeoRotation rot2("rot2", 0., 0.,0.);
+
718  rot2.RotateY(180);
+
719  const TGeoTranslation trans_rot(0., 0., fZGas/2+fZRpcGap+fZStrip+fZRpc_outer/2);
+
720  TGeoCombiTrans *comb_1 = new TGeoCombiTrans(trans_rot, rot2);
+
721 
+
722  volRpcContainer->AddNode(volRpcShell,1, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip-fZRpc_outer/2));
+
723  volRpcContainer->AddNode(volRpcShell,2, comb_1);
+
724  volRpcContainer->AddNode(volStrip, 1, new TGeoTranslation(0., 0., fZGas/2+fZRpcGap+fZStrip/2));
+
725  volRpcContainer->AddNode(volStrip, 2, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip/2));
+
726  volRpcContainer->AddNode(volRpcGap, 1, new TGeoTranslation(0., 0., (fZGas+fZRpcGap)/2));
+
727  volRpcContainer->AddNode(volRpcGap, 2, new TGeoTranslation(0., 0., -(fZGas+fZRpcGap)/2));
+
728  volRpcContainer->AddNode(volRpc, 1, new TGeoTranslation(0., 0., 0.));
+
729 
+
730  AddSensitiveVolume(volRpc);
+
731 
+
732  for(Int_t i = 0; i < fNRpc; i++)
+
733  {
+
734  double dy = 5.*cm;
+
735  double dz = -fZtot/2 + (i+1)*fZFe + i*fZRpc + fZRpc/2;
+
736  if (i >= fNFe) dz = dz - (i + 1 - fNFe) * (fZFe - fZFethin);
+
737  if(i%2)volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -dy, dz)); //staggering
+
738  else{volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, dy, dz));}
+
739  }
+
740 
+
741  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
742  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
+
743  Pillar1Vol->SetLineColor(kGreen+3);
+
744 
+
745  //tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2+fPillarZ/2));
+
746  //tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2 +fPillarZ/2));
+
747  // tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2)); //eventually two pillars at the end. Now muon det is followed by veto, so its steel pillar supports both
+
748  //tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2));
+
749 
750 
-
751  //tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2+fPillarZ/2));
-
752  //tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2 +fPillarZ/2));
-
753  // tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2)); //eventually two pillars at the end. Now muon det is followed by veto, so its steel pillar supports both
-
754  //tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2));
+
751  }
+
752 
+
753  if(fDesign==4){
+
754  //Now the filter is replaced by a magnetic spectrometer
755 
-
756 
-
757  }
-
758 
-
759  if(fDesign==4){
-
760  //Now the filter is replaced by a magnetic spectrometer
+
756  TGeoBBox *MuFilter = new TGeoBBox("MuFilter",fXtot/2., fYtot/2., fZtot/2.);
+
757  TGeoVolume *volMuFilter = new TGeoVolume("volMuFilter",MuFilter,air); //MuFilter
+
758  volMuFilter->SetLineColor(kGray);
+
759 
+
760  TGeoUniformMagField *magcheckfield = new TGeoUniformMagField(fField,0.,0.); //along x direction;
761 
-
762  TGeoBBox *MuFilter = new TGeoBBox("MuFilter",fXtot/2., fYtot/2., fZtot/2.);
-
763  TGeoVolume *volMuFilter = new TGeoVolume("volMuFilter",MuFilter,air); //MuFilter
-
764  volMuFilter->SetLineColor(kGray);
-
765 
-
766  TGeoUniformMagField *magcheckfield = new TGeoUniformMagField(fField,0.,0.); //along x direction;
-
767 
-
768  tTauNuDet->AddNode(volMuFilter,1,new TGeoTranslation(0,0,fZcenter));
+
762  tTauNuDet->AddNode(volMuFilter,1,new TGeoTranslation(0,0,fZcenter));
+
763 
+
764  //adapting code from AdvSND
+
765  //code by Daniele from ADVSND air core magnet
+
766  Double_t fOutMagX = fXtot;
+
767  Double_t fOutMagY = fYtot;
+
768  Double_t fMagZ = fZtot-0.5*2;
769 
-
770  //adapting code from AdvSND
-
771  //code by Daniele from ADVSND air core magnet
-
772  Double_t fOutMagX = fXtot;
-
773  Double_t fOutMagY = fYtot;
-
774  Double_t fMagZ = fZtot-0.5*2;
-
775 
-
776  Double_t fInMagX = fXRpc;
-
777  Double_t fInMagY = fYRpc;
+
770  Double_t fInMagX = fXRpc;
+
771  Double_t fInMagY = fYRpc;
+
772 
+
773  TGeoBBox *RPC = new TGeoBBox("RPC", fXRpc/2.,fYRpc/2.,fZRpc/2.);
+
774  TGeoVolume *volRPC = new TGeoVolume("volRPC",RPC,RPCmat); //RPC
+
775  volRPC->SetLineColor(kRed);
+
776  AddSensitiveVolume(volRPC);
+
777  //applying the values in the geometry
778 
-
779  TGeoBBox *RPC = new TGeoBBox("RPC", fXRpc/2.,fYRpc/2.,fZRpc/2.);
-
780  TGeoVolume *volRPC = new TGeoVolume("volRPC",RPC,RPCmat); //RPC
-
781  volRPC->SetLineColor(kRed);
-
782  AddSensitiveVolume(volRPC);
-
783  //applying the values in the geometry
+
779 
+
780  // Shapes creation
+
781  [[maybe_unused]] auto *CoilContainer = new TGeoBBox("CoilContainer", fOutMagX/2., fOutMagY/2., fMagZ/2.);
+
782  TGeoBBox *MagRegion = new TGeoBBox("MagRegion", fInMagX/2., fInMagY/2., fMagZ/2.+0.5);
+
783  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilW/2., fCoilH/2., fMagZ/2.+0.5);
784 
-
785 
-
786  // Shapes creation
-
787  TGeoBBox *CoilContainer = new TGeoBBox("CoilContainer", fOutMagX/2., fOutMagY/2., fMagZ/2.);
-
788  TGeoBBox *MagRegion = new TGeoBBox("MagRegion", fInMagX/2., fInMagY/2., fMagZ/2.+0.5);
-
789  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilW/2., fCoilH/2., fMagZ/2.+0.5);
+
785  // Translations
+
786  TGeoTranslation *CoilUpPos = new TGeoTranslation("CoilUpPos", 0, (fInMagY+fCoilH)/2.-0.001, 0);
+
787  TGeoTranslation *CoilDownPos = new TGeoTranslation("CoilDownPos", 0, -(fInMagY+fCoilH)/2.+0.001, 0);
+
788  CoilUpPos->RegisterYourself();
+
789  CoilDownPos->RegisterYourself();
790 
-
791  // Translations
-
792  TGeoTranslation *CoilUpPos = new TGeoTranslation("CoilUpPos", 0, (fInMagY+fCoilH)/2.-0.001, 0);
-
793  TGeoTranslation *CoilDownPos = new TGeoTranslation("CoilDownPos", 0, -(fInMagY+fCoilH)/2.+0.001, 0);
-
794  CoilUpPos->RegisterYourself();
-
795  CoilDownPos->RegisterYourself();
-
796 
-
797  // Yoke shape
-
798  TGeoCompositeShape *FeYoke = new TGeoCompositeShape("FeYoke", "CoilContainer-MagRegion-(Coil:CoilUpPos)-(Coil:CoilDownPos)");
-
799 
-
800  // Volumes
-
801  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke", FeYoke, Iron);
-
802  volFeYoke->SetLineColor(kGray);
-
803  TGeoVolume *volCoil = new TGeoVolume("volCoil", Coil, Cu);
-
804  volCoil->SetLineColor(kOrange+1);
-
805  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion", MagRegion, air);
-
806  volMagRegion->SetField(magcheckfield);
+
791  // Yoke shape
+
792  TGeoCompositeShape *FeYoke = new TGeoCompositeShape("FeYoke", "CoilContainer-MagRegion-(Coil:CoilUpPos)-(Coil:CoilDownPos)");
+
793 
+
794  // Volumes
+
795  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke", FeYoke, Iron);
+
796  volFeYoke->SetLineColor(kGray);
+
797  TGeoVolume *volCoil = new TGeoVolume("volCoil", Coil, Cu);
+
798  volCoil->SetLineColor(kOrange+1);
+
799  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion", MagRegion, air);
+
800  volMagRegion->SetField(magcheckfield);
+
801 
+
802  // Positioning
+
803  volMuFilter->AddNode(volFeYoke, 0);
+
804  volMuFilter->AddNode(volCoil, 0, new TGeoTranslation(0, (fInMagY+fCoilH)/2.-0.001, 0));
+
805  volMuFilter->AddNode(volCoil, 1, new TGeoTranslation(0, -(fInMagY+fCoilH)/2.+0.001, 0));
+
806  volMuFilter->AddNode(volMagRegion, 0, 0);
807 
-
808  // Positioning
-
809  volMuFilter->AddNode(volFeYoke, 0);
-
810  volMuFilter->AddNode(volCoil, 0, new TGeoTranslation(0, (fInMagY+fCoilH)/2.-0.001, 0));
-
811  volMuFilter->AddNode(volCoil, 1, new TGeoTranslation(0, -(fInMagY+fCoilH)/2.+0.001, 0));
-
812  volMuFilter->AddNode(volMagRegion, 0, 0);
-
813 
-
814  volMagRegion->SetField(magcheckfield);
-
815  //first two counters upstream
-
816  volMagRegion->AddNode(volRPC,1,new TGeoTranslation(0,0,-fZtot/2. + fZRpc/2.));
-
817  //magnetized region in the first quarter
-
818  volMagRegion->AddNode(volRPC,2,new TGeoTranslation(0,0,-fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
-
819  volMagRegion->AddNode(volRPC,3,new TGeoTranslation(0,0,-fZtot/4.+fGapMiddle/2. + fZRpc/2.));
-
820  //magnetized region in the middle
-
821  volMagRegion->AddNode(volRPC,4,new TGeoTranslation(0,0,-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
-
822  volMagRegion->AddNode(volRPC,5,new TGeoTranslation(0,0,+fGapMiddle/2. + fZRpc/2.));
-
823  //magnetized region in the third quarter
-
824  volMagRegion->AddNode(volRPC,6,new TGeoTranslation(0,0,+fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
-
825  volMagRegion->AddNode(volRPC,7,new TGeoTranslation(0,0,+fZtot/4.+fGapMiddle/2. + fZRpc/2.));
-
826  //last two counters downstream
-
827  volMagRegion->AddNode(volRPC,8,new TGeoTranslation(0,0,+fZtot/2. - fZRpc/2.));
-
828 
-
829  } //end option 4
-
830 
-
831 }
-
832 
-
833 
-
834 Bool_t NuTauMudet::ProcessHits(FairVolume* vol)
-
835 {
-
837  //Set parameters at entrance of volume. Reset ELoss.
-
838  if ( gMC->IsTrackEntering() ) {
-
839  fELoss = 0.;
-
840  fTime = gMC->TrackTime() * 1.0e09;
-
841  fLength = gMC->TrackLength();
-
842  gMC->TrackPosition(fPos);
-
843  gMC->TrackMomentum(fMom);
-
844  }
-
845  // Sum energy loss for all steps in the active volume
-
846  fELoss += gMC->Edep();
-
847 
-
848  // Create muonPoint at exit of active volume
-
849  if ( gMC->IsTrackExiting() ||
-
850  gMC->IsTrackStop() ||
-
851  gMC->IsTrackDisappeared() ) {
-
852  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
853  fVolumeID = vol->getMCid();
-
854  if (fELoss == 0. ) { return kFALSE; }
-
855  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
856  Int_t pdgCode = p->GetPdgCode();
-
857  Int_t detID=0;
-
858  gMC->CurrentVolID(detID);
-
859  //cutting this part, does not work in this new layout, since we only have simple planes
-
860  //cout<<"THIS HIT"<<endl;
-
861  //cout<< "detID = " << detID << endl;
-
862  /*Int_t MaxLevel = gGeoManager->GetLevel();
-
863  const Int_t MaxL = MaxLevel;
-
864  //cout << "MaxLevel = " << MaxL << endl;
-
865  //cout << gMC->CurrentVolPath()<< endl;
-
866  Int_t NRpc =0;
-
867  const char *name;
-
868  name = gMC->CurrentVolName();
-
869  //cout << name << " ";
-
870  Int_t motherID = 0;
-
871  if( strcmp(name, "volRpc")==0){motherID = gGeoManager->GetMother(1)->GetNumber();}
-
872  else{motherID = gGeoManager->GetMother(0)->GetNumber();}
-
873  // This up here is made because of a strange behaviour of the script, volRpc gets different
-
874  //Mother volume number even if it has the correct path
-
875  const char *mumname = gMC->CurrentVolOffName(1);*/
-
876  //cout<<mumname<<" "<< motherID<<endl;
-
877  //detID = motherID;
-
878  //cout<< "detID = " << detID << endl;
-
879  //cout<<endl;
-
880  fVolumeID = detID;
+
808  volMagRegion->SetField(magcheckfield);
+
809  //first two counters upstream
+
810  volMagRegion->AddNode(volRPC,1,new TGeoTranslation(0,0,-fZtot/2. + fZRpc/2.));
+
811  //magnetized region in the first quarter
+
812  volMagRegion->AddNode(volRPC,2,new TGeoTranslation(0,0,-fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
+
813  volMagRegion->AddNode(volRPC,3,new TGeoTranslation(0,0,-fZtot/4.+fGapMiddle/2. + fZRpc/2.));
+
814  //magnetized region in the middle
+
815  volMagRegion->AddNode(volRPC,4,new TGeoTranslation(0,0,-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
+
816  volMagRegion->AddNode(volRPC,5,new TGeoTranslation(0,0,+fGapMiddle/2. + fZRpc/2.));
+
817  //magnetized region in the third quarter
+
818  volMagRegion->AddNode(volRPC,6,new TGeoTranslation(0,0,+fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
+
819  volMagRegion->AddNode(volRPC,7,new TGeoTranslation(0,0,+fZtot/4.+fGapMiddle/2. + fZRpc/2.));
+
820  //last two counters downstream
+
821  volMagRegion->AddNode(volRPC,8,new TGeoTranslation(0,0,+fZtot/2. - fZRpc/2.));
+
822 
+
823  } //end option 4
+
824 
+
825 }
+
826 
+
827 
+
828 Bool_t NuTauMudet::ProcessHits(FairVolume* vol)
+
829 {
+
831  //Set parameters at entrance of volume. Reset ELoss.
+
832  if ( gMC->IsTrackEntering() ) {
+
833  fELoss = 0.;
+
834  fTime = gMC->TrackTime() * 1.0e09;
+
835  fLength = gMC->TrackLength();
+
836  gMC->TrackPosition(fPos);
+
837  gMC->TrackMomentum(fMom);
+
838  }
+
839  // Sum energy loss for all steps in the active volume
+
840  fELoss += gMC->Edep();
+
841 
+
842  // Create muonPoint at exit of active volume
+
843  if ( gMC->IsTrackExiting() ||
+
844  gMC->IsTrackStop() ||
+
845  gMC->IsTrackDisappeared() ) {
+
846  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
847  fVolumeID = vol->getMCid();
+
848  if (fELoss == 0. ) { return kFALSE; }
+
849  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
850  Int_t pdgCode = p->GetPdgCode();
+
851  Int_t detID=0;
+
852  gMC->CurrentVolID(detID);
+
853  //cutting this part, does not work in this new layout, since we only have simple planes
+
854  //cout<<"THIS HIT"<<endl;
+
855  //cout<< "detID = " << detID << endl;
+
856  /*Int_t MaxLevel = gGeoManager->GetLevel();
+
857  const Int_t MaxL = MaxLevel;
+
858  //cout << "MaxLevel = " << MaxL << endl;
+
859  //cout << gMC->CurrentVolPath()<< endl;
+
860  Int_t NRpc =0;
+
861  const char *name;
+
862  name = gMC->CurrentVolName();
+
863  //cout << name << " ";
+
864  Int_t motherID = 0;
+
865  if( strcmp(name, "volRpc")==0){motherID = gGeoManager->GetMother(1)->GetNumber();}
+
866  else{motherID = gGeoManager->GetMother(0)->GetNumber();}
+
867  // This up here is made because of a strange behaviour of the script, volRpc gets different
+
868  //Mother volume number even if it has the correct path
+
869  const char *mumname = gMC->CurrentVolOffName(1);*/
+
870  //cout<<mumname<<" "<< motherID<<endl;
+
871  //detID = motherID;
+
872  //cout<< "detID = " << detID << endl;
+
873  //cout<<endl;
+
874  fVolumeID = detID;
+
875 
+
876  TLorentzVector Pos;
+
877  gMC->TrackPosition(Pos);
+
878  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
879  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
880  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
881 
-
882  TLorentzVector Pos;
-
883  gMC->TrackPosition(Pos);
-
884  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
885  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
886  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
887 
-
888  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean), TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,fELoss, pdgCode);
-
889 
-
890  // Increment number of muon det points in TParticle
-
891  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
892  stack->AddPoint(ktauRpc);
-
893  }
-
894 
-
895  return kTRUE;
-
896 }
+
882  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean), TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,fELoss, pdgCode);
+
883 
+
884  // Increment number of muon det points in TParticle
+
885  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
886  stack->AddPoint(ktauRpc);
+
887  }
+
888 
+
889  return kTRUE;
+
890 }
+
891 
+
892 void NuTauMudet::EndOfEvent()
+
893 {
+
894  fShipRpcPointCollection->Clear();
+
895 }
+
896 
897 
-
898 void NuTauMudet::EndOfEvent()
+
898 void NuTauMudet::Register()
899 {
-
900  fShipRpcPointCollection->Clear();
-
901 }
-
902 
-
903 
-
904 void NuTauMudet::Register()
-
905 {
-
906 
-
913  FairRootManager::Instance()->Register("ShipRpcPoint", "NuTauMudet",
-
914  fShipRpcPointCollection, kTRUE);
-
915 }
-
916 
-
917 // ----- Public method to Decode volume info -------------------------------------------
-
918 // ----- returns hpt, arm, rpc numbers -----------------------------------
-
919 void NuTauMudet::DecodeVolumeID(Int_t detID,int &nARM,int &nRPC)
-
920 {
-
921  nARM = detID/1E4;
-
922  nRPC = detID - nARM*1E4;
+
900 
+
907  FairRootManager::Instance()->Register("ShipRpcPoint", "NuTauMudet",
+
908  fShipRpcPointCollection, kTRUE);
+
909 }
+
910 
+
911 // ----- Public method to Decode volume info -------------------------------------------
+
912 // ----- returns hpt, arm, rpc numbers -----------------------------------
+
913 void NuTauMudet::DecodeVolumeID(Int_t detID,int &nARM,int &nRPC)
+
914 {
+
915  nARM = detID/1E4;
+
916  nRPC = detID - nARM*1E4;
+
917 }
+
918 
+
919 TClonesArray* NuTauMudet::GetCollection(Int_t iColl) const
+
920 {
+
921  if (iColl == 0) { return fShipRpcPointCollection; }
+
922  else { return NULL; }
923 }
924 
-
925 TClonesArray* NuTauMudet::GetCollection(Int_t iColl) const
-
926 {
-
927  if (iColl == 0) { return fShipRpcPointCollection; }
-
928  else { return NULL; }
-
929 }
+
925 void NuTauMudet::Reset()
+
926 {
+
927  fShipRpcPointCollection->Clear();
+
928 }
+
929 
930 
-
931 void NuTauMudet::Reset()
-
932 {
-
933  fShipRpcPointCollection->Clear();
-
934 }
+
931 ShipRpcPoint* NuTauMudet::AddHit(Int_t trackID, Int_t detID,
+
932  TVector3 pos, TVector3 mom,
+
933  Double_t time, Double_t length,
+
934  Double_t eLoss, Int_t pdgCode)
935 
-
936 
-
937 ShipRpcPoint* NuTauMudet::AddHit(Int_t trackID, Int_t detID,
-
938  TVector3 pos, TVector3 mom,
-
939  Double_t time, Double_t length,
-
940  Double_t eLoss, Int_t pdgCode)
-
941 
-
942 {
-
943  TClonesArray& clref = *fShipRpcPointCollection;
-
944  Int_t size = clref.GetEntriesFast();
-
945  //cout << "ShipRpctau hit called"<< pos.z()<<endl;
-
946  // return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode,NArm, NRpc, NHpt);
-
947  return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
-
948 }
+
936 {
+
937  TClonesArray& clref = *fShipRpcPointCollection;
+
938  Int_t size = clref.GetEntriesFast();
+
939  //cout << "ShipRpctau hit called"<< pos.z()<<endl;
+
940  // return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode,NArm, NRpc, NHpt);
+
941  return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
+
942 }
Double_t cm
Double_t mm
@@ -1058,7 +1052,7 @@
void SetRpcOuterDimensions(Double_t X, Double_t Y, Double_t Z)
Definition: NuTauMudet.cxx:229
Double_t fYRpc_outer
Definition: NuTauMudet.h:189
virtual void Initialize()
Definition: NuTauMudet.cxx:259
-
virtual void EndOfEvent()
Definition: NuTauMudet.cxx:898
+
virtual void EndOfEvent()
Definition: NuTauMudet.cxx:892
Double_t fZStrip
Definition: NuTauMudet.h:154
Double_t fXEle
Definition: NuTauMudet.h:158
void SetCoilParameters(Double_t CoilH, Double_t CoilW, Int_t N, Double_t CoilG)
Definition: NuTauMudet.cxx:177
@@ -1086,19 +1080,19 @@
Double_t fYFe
Definition: NuTauMudet.h:129
void SetMagneticField(Double_t B)
Definition: NuTauMudet.cxx:146
Double_t fYRpc
Definition: NuTauMudet.h:130
-
void DecodeVolumeID(Int_t detID, int &nARM, int &nRPC)
Definition: NuTauMudet.cxx:919
+
void DecodeVolumeID(Int_t detID, int &nARM, int &nRPC)
Definition: NuTauMudet.cxx:913
Int_t fNCoil
Definition: NuTauMudet.h:149
Double_t fZcenter
Definition: NuTauMudet.h:121
Double_t fYRpc_inner
Definition: NuTauMudet.h:193
Double32_t fTime
momentum at entrance
Definition: NuTauMudet.h:107
-
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: NuTauMudet.cxx:834
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: NuTauMudet.cxx:828
Double_t fZtot
Definition: NuTauMudet.h:124
Double_t fGapMiddle
Definition: NuTauMudet.h:135
Double_t fLatSuppX
Definition: NuTauMudet.h:166
Double_t fXtot
Definition: NuTauMudet.h:122
Double_t fField
Definition: NuTauMudet.h:136
void SetNFeInArm(Int_t N, Int_t Nthin=0)
Definition: NuTauMudet.cxx:166
-
virtual void Reset()
Definition: NuTauMudet.cxx:931
+
virtual void Reset()
Definition: NuTauMudet.cxx:925
Double32_t fLength
time
Definition: NuTauMudet.h:108
Double_t fZLateral
Definition: NuTauMudet.h:181
Double_t fZFethin
Definition: NuTauMudet.h:131
@@ -1117,7 +1111,7 @@
Double_t fCutHeight
Definition: NuTauMudet.h:169
Double_t fUpSuppX
Definition: NuTauMudet.h:164
void SetRpcElectrodeDimensions(Double_t X, Double_t Y, Double_t Z)
Definition: NuTauMudet.cxx:118
-
virtual void Register()
Definition: NuTauMudet.cxx:904
+
virtual void Register()
Definition: NuTauMudet.cxx:898
void SetCrossDimensions(Double_t X, Double_t Y, Double_t Z, Double_t WidthArm)
Definition: NuTauMudet.cxx:221
Double_t fYSpacing
Definition: NuTauMudet.h:167
Double_t fXRyoke_s
Definition: NuTauMudet.h:142
@@ -1131,10 +1125,10 @@
Int_t fNFe
Definition: NuTauMudet.h:125
void SetUpperCoverDimensions(Double_t X, Double_t Y, Double_t Z)
Definition: NuTauMudet.cxx:208
void ConstructGeometry()
Definition: NuTauMudet.cxx:285
-
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: NuTauMudet.cxx:937
+
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: NuTauMudet.cxx:931
Double_t fZCross
Definition: NuTauMudet.h:185
Double_t fZRpc_inner
Definition: NuTauMudet.h:194
-
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: NuTauMudet.cxx:925
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: NuTauMudet.cxx:919
Double_t fXGas
Definition: NuTauMudet.h:161
void SetSupportTransverseDimensions(Double_t UpperSupportX, Double_t UpperSupportY, Double_t LowerSupportX, Double_t LowerSupportY, Double_t LateralSupportX, Double_t LateralSupportY, Double_t YSpacing)
Definition: NuTauMudet.cxx:185
Double_t fZPet
Definition: NuTauMudet.h:157
diff --git a/NuTauMudet_8h_source.html b/NuTauMudet_8h_source.html index de6706d281..f03032a42c 100644 --- a/NuTauMudet_8h_source.html +++ b/NuTauMudet_8h_source.html @@ -301,7 +301,7 @@
void SetRpcOuterDimensions(Double_t X, Double_t Y, Double_t Z)
Definition: NuTauMudet.cxx:229
Double_t fYRpc_outer
Definition: NuTauMudet.h:189
virtual void Initialize()
Definition: NuTauMudet.cxx:259
-
virtual void EndOfEvent()
Definition: NuTauMudet.cxx:898
+
virtual void EndOfEvent()
Definition: NuTauMudet.cxx:892
Double_t fZStrip
Definition: NuTauMudet.h:154
Double_t fXEle
Definition: NuTauMudet.h:158
void SetCoilParameters(Double_t CoilH, Double_t CoilW, Int_t N, Double_t CoilG)
Definition: NuTauMudet.cxx:177
@@ -332,14 +332,14 @@
void SetMagneticField(Double_t B)
Definition: NuTauMudet.cxx:146
NuTauMudet(const NuTauMudet &)
Double_t fYRpc
Definition: NuTauMudet.h:130
-
void DecodeVolumeID(Int_t detID, int &nARM, int &nRPC)
Definition: NuTauMudet.cxx:919
+
void DecodeVolumeID(Int_t detID, int &nARM, int &nRPC)
Definition: NuTauMudet.cxx:913
Int_t fNCoil
Definition: NuTauMudet.h:149
Double_t fZcenter
Definition: NuTauMudet.h:121
virtual void BeginPrimary()
Definition: NuTauMudet.h:90
Double_t fYRpc_inner
Definition: NuTauMudet.h:193
NuTauMudet & operator=(const NuTauMudet &)
Double32_t fTime
momentum at entrance
Definition: NuTauMudet.h:107
-
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: NuTauMudet.cxx:834
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: NuTauMudet.cxx:828
Double_t fZtot
Definition: NuTauMudet.h:124
Double_t fGapMiddle
Definition: NuTauMudet.h:135
Double_t fLatSuppX
Definition: NuTauMudet.h:166
@@ -347,7 +347,7 @@
virtual void FinishPrimary()
Definition: NuTauMudet.h:88
Double_t fField
Definition: NuTauMudet.h:136
void SetNFeInArm(Int_t N, Int_t Nthin=0)
Definition: NuTauMudet.cxx:166
-
virtual void Reset()
Definition: NuTauMudet.cxx:931
+
virtual void Reset()
Definition: NuTauMudet.cxx:925
Double32_t fLength
time
Definition: NuTauMudet.h:108
Double_t fZLateral
Definition: NuTauMudet.h:181
Double_t fZFethin
Definition: NuTauMudet.h:131
@@ -368,7 +368,7 @@
Double_t fUpSuppX
Definition: NuTauMudet.h:164
virtual void PostTrack()
Definition: NuTauMudet.h:91
void SetRpcElectrodeDimensions(Double_t X, Double_t Y, Double_t Z)
Definition: NuTauMudet.cxx:118
-
virtual void Register()
Definition: NuTauMudet.cxx:904
+
virtual void Register()
Definition: NuTauMudet.cxx:898
void SetCrossDimensions(Double_t X, Double_t Y, Double_t Z, Double_t WidthArm)
Definition: NuTauMudet.cxx:221
Double_t fYSpacing
Definition: NuTauMudet.h:167
Double_t fXRyoke_s
Definition: NuTauMudet.h:142
@@ -383,10 +383,10 @@
Int_t fNFe
Definition: NuTauMudet.h:125
void SetUpperCoverDimensions(Double_t X, Double_t Y, Double_t Z)
Definition: NuTauMudet.cxx:208
void ConstructGeometry()
Definition: NuTauMudet.cxx:285
-
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: NuTauMudet.cxx:937
+
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: NuTauMudet.cxx:931
Double_t fZCross
Definition: NuTauMudet.h:185
Double_t fZRpc_inner
Definition: NuTauMudet.h:194
-
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: NuTauMudet.cxx:925
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: NuTauMudet.cxx:919
Double_t fXGas
Definition: NuTauMudet.h:161
void SetSupportTransverseDimensions(Double_t UpperSupportX, Double_t UpperSupportY, Double_t LowerSupportX, Double_t LowerSupportY, Double_t LateralSupportX, Double_t LateralSupportY, Double_t YSpacing)
Definition: NuTauMudet.cxx:185
Double_t fZPet
Definition: NuTauMudet.h:157
diff --git a/TargetTracker_8cxx_source.html b/TargetTracker_8cxx_source.html index fe6903e712..e390007a8f 100644 --- a/TargetTracker_8cxx_source.html +++ b/TargetTracker_8cxx_source.html @@ -258,184 +258,182 @@
171 
172 void TargetTracker::ConstructGeometry()
173 {
-
174  InitMedium("TTmedium");
-
175  TGeoMedium *TTmedium = gGeoManager->GetMedium("TTmedium");
-
176 
-
177  InitMedium("vacuum");
-
178  TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
-
179 
-
180  InitMedium("CarbonComposite");
-
181  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
-
182 
-
183  InitMedium("SciFiMat");
-
184  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
-
185 
-
186  InitMedium("Airex");
-
187  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
-
188 
-
189  //Target Tracker
-
190  TGeoVolume *volTarget = gGeoManager->GetVolume("volTarget");
-
191 
-
192  TGeoBBox* TT_box = new TGeoBBox("TT_box", TTrackerX / 2, TTrackerY / 2, TTrackerZ / 2);
-
193  TGeoVolume* TT_volume = new TGeoVolume("TT", TT_box, vacuum);
-
194  TT_volume->SetLineColor(kBlue - 1);
-
195  //TT_volume->SetTransparency(1);
-
196  TT_volume->SetVisibility(1);
-
197  TT_volume->SetVisDaughters(1);
-
198 
-
199  //Support Carbon Composite
-
200  TGeoBBox* TT_support_box = new TGeoBBox("TT_support_box", TTrackerX / 2, TTrackerY / 2, support_z / 2);
-
201  TGeoVolume* TT_support_volume = new TGeoVolume("TT_support", TT_support_box, CarbonComposite);
-
202  TT_support_volume->SetLineColor(kGray - 2);
-
203  TT_support_volume->SetVisibility(1);
-
204 
-
205  //Honeycomb Airex (or Nomex)
-
206  TGeoBBox* TT_honeycomb_box = new TGeoBBox("TT_honeycomb_box", TTrackerX / 2, TTrackerY / 2, honeycomb_z / 2);
-
207  TGeoVolume* TT_honeycomb_volume = new TGeoVolume("TT_honeycomb", TT_honeycomb_box, Airex);
-
208  TT_honeycomb_volume->SetLineColor(kYellow);
-
209  TT_honeycomb_volume->SetVisibility(1);
-
210 
-
211  //SciFi planes
-
212  TGeoBBox* TT_scifi_plane_hor_box = new TGeoBBox("TT_scifi_plane_hor_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
-
213  TGeoVolume* TT_scifi_plane_hor_volume = new TGeoVolume("TT_scifi_plane_hor", TT_scifi_plane_hor_box, SciFiMat);
-
214  TT_scifi_plane_hor_volume->SetVisibility(1);
-
215 
-
216  TGeoBBox* TT_scifi_plane_vert_box = new TGeoBBox("TT_scifi_plane_vert_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
-
217  TGeoVolume* TT_scifi_plane_vert_volume = new TGeoVolume("TT_scifi_plane_vert", TT_scifi_plane_vert_box, SciFiMat);
-
218  TT_scifi_plane_vert_volume->SetVisibility(1);
-
219 
-
220  //SciFi mats for X and Y
-
221  TGeoBBox* TT_scifimat_hor_box = new TGeoBBox("TT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
-
222  TGeoVolume* TT_scifimat_hor_volume = new TGeoVolume("TT_scifimat_hor", TT_scifimat_hor_box, SciFiMat);
-
223  TT_scifimat_hor_volume->SetLineColor(kCyan-9);
-
224 
-
225  TGeoBBox* TT_scifimat_vert_box = new TGeoBBox("TT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
-
226  TGeoVolume* TT_scifimat_vert_volume = new TGeoVolume("TT_scifimat_vert", TT_scifimat_vert_box, SciFiMat);
-
227  TT_scifimat_vert_volume->SetLineColor(kGreen-7);
-
228 
-
229  //Add SciFi mat as sensitive unit
-
230  AddSensitiveVolume(TT_scifimat_hor_volume);
-
231  AddSensitiveVolume(TT_scifimat_vert_volume);
-
232 
-
233  //Creating physical volumes and multiply
-
234  for (int i = 0; i < n_hor_planes; i++){
-
235  TT_scifi_plane_hor_volume->AddNode(TT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
-
236  }
-
237  for (int i = 0; i < n_vert_planes; i++){
-
238  TT_scifi_plane_vert_volume->AddNode(TT_scifimat_vert_volume, 100+i+1, new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
-
239  }
-
240 
-
241  TT_volume->AddNode(TT_support_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z/2));
-
242  TT_volume->AddNode(TT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z/2));
-
243  TT_volume->AddNode(TT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z + scifimat_z/2));
-
244  TT_volume->AddNode(TT_honeycomb_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z/2));
-
245  TT_volume->AddNode(TT_support_volume, 1, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z + support_z/2));
+
174 
+
175  InitMedium("vacuum");
+
176  TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
+
177 
+
178  InitMedium("CarbonComposite");
+
179  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
+
180 
+
181  InitMedium("SciFiMat");
+
182  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
+
183 
+
184  InitMedium("Airex");
+
185  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
+
186 
+
187  //Target Tracker
+
188  TGeoVolume *volTarget = gGeoManager->GetVolume("volTarget");
+
189 
+
190  TGeoBBox* TT_box = new TGeoBBox("TT_box", TTrackerX / 2, TTrackerY / 2, TTrackerZ / 2);
+
191  TGeoVolume* TT_volume = new TGeoVolume("TT", TT_box, vacuum);
+
192  TT_volume->SetLineColor(kBlue - 1);
+
193  //TT_volume->SetTransparency(1);
+
194  TT_volume->SetVisibility(1);
+
195  TT_volume->SetVisDaughters(1);
+
196 
+
197  //Support Carbon Composite
+
198  TGeoBBox* TT_support_box = new TGeoBBox("TT_support_box", TTrackerX / 2, TTrackerY / 2, support_z / 2);
+
199  TGeoVolume* TT_support_volume = new TGeoVolume("TT_support", TT_support_box, CarbonComposite);
+
200  TT_support_volume->SetLineColor(kGray - 2);
+
201  TT_support_volume->SetVisibility(1);
+
202 
+
203  //Honeycomb Airex (or Nomex)
+
204  TGeoBBox* TT_honeycomb_box = new TGeoBBox("TT_honeycomb_box", TTrackerX / 2, TTrackerY / 2, honeycomb_z / 2);
+
205  TGeoVolume* TT_honeycomb_volume = new TGeoVolume("TT_honeycomb", TT_honeycomb_box, Airex);
+
206  TT_honeycomb_volume->SetLineColor(kYellow);
+
207  TT_honeycomb_volume->SetVisibility(1);
+
208 
+
209  //SciFi planes
+
210  TGeoBBox* TT_scifi_plane_hor_box = new TGeoBBox("TT_scifi_plane_hor_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
+
211  TGeoVolume* TT_scifi_plane_hor_volume = new TGeoVolume("TT_scifi_plane_hor", TT_scifi_plane_hor_box, SciFiMat);
+
212  TT_scifi_plane_hor_volume->SetVisibility(1);
+
213 
+
214  TGeoBBox* TT_scifi_plane_vert_box = new TGeoBBox("TT_scifi_plane_vert_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
+
215  TGeoVolume* TT_scifi_plane_vert_volume = new TGeoVolume("TT_scifi_plane_vert", TT_scifi_plane_vert_box, SciFiMat);
+
216  TT_scifi_plane_vert_volume->SetVisibility(1);
+
217 
+
218  //SciFi mats for X and Y
+
219  TGeoBBox* TT_scifimat_hor_box = new TGeoBBox("TT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
+
220  TGeoVolume* TT_scifimat_hor_volume = new TGeoVolume("TT_scifimat_hor", TT_scifimat_hor_box, SciFiMat);
+
221  TT_scifimat_hor_volume->SetLineColor(kCyan-9);
+
222 
+
223  TGeoBBox* TT_scifimat_vert_box = new TGeoBBox("TT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
+
224  TGeoVolume* TT_scifimat_vert_volume = new TGeoVolume("TT_scifimat_vert", TT_scifimat_vert_box, SciFiMat);
+
225  TT_scifimat_vert_volume->SetLineColor(kGreen-7);
+
226 
+
227  //Add SciFi mat as sensitive unit
+
228  AddSensitiveVolume(TT_scifimat_hor_volume);
+
229  AddSensitiveVolume(TT_scifimat_vert_volume);
+
230 
+
231  //Creating physical volumes and multiply
+
232  for (int i = 0; i < n_hor_planes; i++){
+
233  TT_scifi_plane_hor_volume->AddNode(TT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
+
234  }
+
235  for (int i = 0; i < n_vert_planes; i++){
+
236  TT_scifi_plane_vert_volume->AddNode(TT_scifimat_vert_volume, 100+i+1, new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
+
237  }
+
238 
+
239  TT_volume->AddNode(TT_support_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z/2));
+
240  TT_volume->AddNode(TT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z/2));
+
241  TT_volume->AddNode(TT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z + scifimat_z/2));
+
242  TT_volume->AddNode(TT_honeycomb_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z/2));
+
243  TT_volume->AddNode(TT_support_volume, 1, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z + support_z/2));
+
244 
+
245  Double_t first_tt_position = -ZDimension / 2 + TTrackerZ / 2;
246 
-
247  Double_t first_tt_position = -ZDimension / 2 + TTrackerZ / 2;
-
248 
-
249  //fNTT - number of TT walls
-
250  for (int l = 0; l < fNTT; ++l){
-
251  volTarget->AddNode(TT_volume, 1000*(l+1), new TGeoTranslation(0, 0, first_tt_position + l * (TTrackerZ + CellWidth)));
-
252  }
+
247  //fNTT - number of TT walls
+
248  for (int l = 0; l < fNTT; ++l){
+
249  volTarget->AddNode(TT_volume, 1000*(l+1), new TGeoTranslation(0, 0, first_tt_position + l * (TTrackerZ + CellWidth)));
+
250  }
+
251 
+
252 }
253 
-
254 }
-
255 
-
256 
-
257 Bool_t TargetTracker::ProcessHits(FairVolume* vol)
-
258 {
-
260  //Set parameters at entrance of volume. Reset ELoss.
-
261  if ( gMC->IsTrackEntering() ) {
-
262  fELoss = 0.;
-
263  fTime = gMC->TrackTime() * 1.0e09;
-
264  fLength = gMC->TrackLength();
-
265  gMC->TrackPosition(fPos);
-
266  gMC->TrackMomentum(fMom);
-
267  }
-
268  // Sum energy loss for all steps in the active volume
-
269  fELoss += gMC->Edep();
-
270 
-
271  // Create muonPoint at exit of active volume
-
272  if (gMC->IsTrackExiting() ||
-
273  gMC->IsTrackStop() ||
-
274  gMC->IsTrackDisappeared() ){
-
275  if (fELoss == 0. ) { return kFALSE; }
-
276  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
277  Int_t pdgCode = p->GetPdgCode();
-
278  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
279 
-
280  gMC->CurrentVolID(fVolumeID);
-
281  Int_t detID = fVolumeID;
-
282  Int_t TTstationID;
-
283  gMC->CurrentVolOffID(2, TTstationID);
-
284  fVolumeID = TTstationID + detID;
-
285 
-
286  TLorentzVector Pos;
-
287  gMC->TrackPosition(Pos);
-
288  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
289  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
290  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
291 
-
292  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
-
293  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
-
294  fTime, fLength, fELoss, pdgCode);
-
295 
-
296  // Increment number of muon det points in TParticle
-
297  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
298  stack->AddPoint(ktauTT);
-
299  }
-
300 
-
301  return kTRUE;
-
302 }
-
303 
-
304 
-
305 void TargetTracker::DecodeTTID(Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
-
306 {
-
307  NTT = detID/1000;
-
308  int idir = (detID - NTT*1000)/100;
-
309 
-
310  if (idir == 1) ishor = kFALSE;
-
311  else if (idir == 0) ishor = kTRUE;
-
312 
-
313  nplane = (detID - NTT*1000 - idir*100);
-
314 }
-
315 
-
316 
-
317 void TargetTracker::EndOfEvent()
-
318 {
-
319  fTTPointCollection->Clear();
-
320 }
-
321 
-
322 
-
323 void TargetTracker::Register()
-
324 {
-
325 
-
332  FairRootManager::Instance()->Register("TTPoint", "TargetTracker",
-
333  fTTPointCollection, kTRUE);
-
334 }
-
335 
-
336 TClonesArray* TargetTracker::GetCollection(Int_t iColl) const
-
337 {
-
338  if (iColl == 0) { return fTTPointCollection; }
-
339  else { return NULL; }
-
340 }
-
341 
-
342 void TargetTracker::Reset()
-
343 {
-
344  fTTPointCollection->Clear();
-
345 }
-
346 
-
347 
-
348 TTPoint* TargetTracker::AddHit(Int_t trackID,Int_t detID,
-
349  TVector3 pos, TVector3 mom,
-
350  Double_t time, Double_t length,
-
351  Double_t eLoss, Int_t pdgCode)
-
352 {
-
353  TClonesArray& clref = *fTTPointCollection;
-
354  Int_t size = clref.GetEntriesFast();
-
355  //cout << "brick hit called"<< pos.z()<<endl;
-
356  return new(clref[size]) TTPoint(trackID,detID, pos, mom,
-
357  time, length, eLoss, pdgCode);
-
358 }
+
254 
+
255 Bool_t TargetTracker::ProcessHits(FairVolume* vol)
+
256 {
+
258  //Set parameters at entrance of volume. Reset ELoss.
+
259  if ( gMC->IsTrackEntering() ) {
+
260  fELoss = 0.;
+
261  fTime = gMC->TrackTime() * 1.0e09;
+
262  fLength = gMC->TrackLength();
+
263  gMC->TrackPosition(fPos);
+
264  gMC->TrackMomentum(fMom);
+
265  }
+
266  // Sum energy loss for all steps in the active volume
+
267  fELoss += gMC->Edep();
+
268 
+
269  // Create muonPoint at exit of active volume
+
270  if (gMC->IsTrackExiting() ||
+
271  gMC->IsTrackStop() ||
+
272  gMC->IsTrackDisappeared() ){
+
273  if (fELoss == 0. ) { return kFALSE; }
+
274  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
275  Int_t pdgCode = p->GetPdgCode();
+
276  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
277 
+
278  gMC->CurrentVolID(fVolumeID);
+
279  Int_t detID = fVolumeID;
+
280  Int_t TTstationID;
+
281  gMC->CurrentVolOffID(2, TTstationID);
+
282  fVolumeID = TTstationID + detID;
+
283 
+
284  TLorentzVector Pos;
+
285  gMC->TrackPosition(Pos);
+
286  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
287  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
288  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
+
289 
+
290  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
+
291  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
+
292  fTime, fLength, fELoss, pdgCode);
+
293 
+
294  // Increment number of muon det points in TParticle
+
295  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
296  stack->AddPoint(ktauTT);
+
297  }
+
298 
+
299  return kTRUE;
+
300 }
+
301 
+
302 
+
303 void TargetTracker::DecodeTTID(Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
+
304 {
+
305  NTT = detID/1000;
+
306  int idir = (detID - NTT*1000)/100;
+
307 
+
308  if (idir == 1) ishor = kFALSE;
+
309  else if (idir == 0) ishor = kTRUE;
+
310 
+
311  nplane = (detID - NTT*1000 - idir*100);
+
312 }
+
313 
+
314 
+
315 void TargetTracker::EndOfEvent()
+
316 {
+
317  fTTPointCollection->Clear();
+
318 }
+
319 
+
320 
+
321 void TargetTracker::Register()
+
322 {
+
323 
+
330  FairRootManager::Instance()->Register("TTPoint", "TargetTracker",
+
331  fTTPointCollection, kTRUE);
+
332 }
+
333 
+
334 TClonesArray* TargetTracker::GetCollection(Int_t iColl) const
+
335 {
+
336  if (iColl == 0) { return fTTPointCollection; }
+
337  else { return NULL; }
+
338 }
+
339 
+
340 void TargetTracker::Reset()
+
341 {
+
342  fTTPointCollection->Clear();
+
343 }
+
344 
+
345 
+
346 TTPoint* TargetTracker::AddHit(Int_t trackID,Int_t detID,
+
347  TVector3 pos, TVector3 mom,
+
348  Double_t time, Double_t length,
+
349  Double_t eLoss, Int_t pdgCode)
+
350 {
+
351  TClonesArray& clref = *fTTPointCollection;
+
352  Int_t size = clref.GetEntriesFast();
+
353  //cout << "brick hit called"<< pos.z()<<endl;
+
354  return new(clref[size]) TTPoint(trackID,detID, pos, mom,
+
355  time, length, eLoss, pdgCode);
+
356 }
@ ktauTT
@@ -447,10 +445,10 @@
void SetNumberTT(Int_t n)
TClonesArray * fTTPointCollection
energy loss
TLorentzVector fMom
position at entrance
-
virtual Bool_t ProcessHits(FairVolume *v=0)
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Double_t ZDimension
Double_t support_z
-
void DecodeTTID(Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
+
void DecodeTTID(Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
Double_t TTrackerX
Int_t n_hor_planes
Double_t scifimat_z
@@ -462,12 +460,12 @@
virtual ~TargetTracker()
Double_t TTrackerY
Int_t InitMedium(const char *name)
-
TTPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
-
virtual TClonesArray * GetCollection(Int_t iColl) const
+
TTPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Int_t fVolumeID
track index
Definition: TargetTracker.h:99
Double_t scifimat_vert
TargetTracker()
-
virtual void EndOfEvent()
+
virtual void EndOfEvent()
Double32_t fLength
time
void SetDesign(Int_t Design)
virtual void Initialize()
@@ -478,8 +476,8 @@
Int_t fTrackID
Definition: TargetTracker.h:98
void SetBrickParam(Double_t CellW)
TLorentzVector fPos
volume id
-
virtual void Register()
-
virtual void Reset()
+
virtual void Register()
+
virtual void Reset()
Int_t n_vert_planes
Double_t scifimat_hor
void ConstructGeometry()
diff --git a/TargetTracker_8h_source.html b/TargetTracker_8h_source.html index 8cecea471c..02112f20d1 100644 --- a/TargetTracker_8h_source.html +++ b/TargetTracker_8h_source.html @@ -208,11 +208,11 @@
TClonesArray * fTTPointCollection
energy loss
virtual void FinishPrimary()
Definition: TargetTracker.h:80
TLorentzVector fMom
position at entrance
-
virtual Bool_t ProcessHits(FairVolume *v=0)
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Double_t ZDimension
ClassDef(TargetTracker, 4)
Double_t support_z
-
void DecodeTTID(Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
+
void DecodeTTID(Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
Double_t TTrackerX
Int_t n_hor_planes
Double_t scifimat_z
@@ -225,13 +225,13 @@
Double_t TTrackerY
Int_t InitMedium(const char *name)
TargetTracker & operator=(const TargetTracker &)
-
TTPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
-
virtual TClonesArray * GetCollection(Int_t iColl) const
+
TTPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Int_t fVolumeID
track index
Definition: TargetTracker.h:99
Double_t scifimat_vert
TargetTracker()
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Definition: TargetTracker.h:76
-
virtual void EndOfEvent()
+
virtual void EndOfEvent()
Double32_t fLength
time
virtual void SetSpecialPhysicsCuts()
Definition: TargetTracker.h:78
virtual void PreTrack()
Definition: TargetTracker.h:84
@@ -248,9 +248,9 @@
void SetBrickParam(Double_t CellW)
TLorentzVector fPos
volume id
virtual void BeginPrimary()
Definition: TargetTracker.h:82
-
virtual void Register()
+
virtual void Register()
virtual void BeginEvent()
Definition: TargetTracker.h:85
-
virtual void Reset()
+
virtual void Reset()
Int_t n_vert_planes
Double_t scifimat_hor
void ConstructGeometry()
diff --git a/Target_8cxx_source.html b/Target_8cxx_source.html index a9ec7897a0..e96e361af1 100644 --- a/Target_8cxx_source.html +++ b/Target_8cxx_source.html @@ -359,552 +359,518 @@
272 void Target::ConstructGeometry()
273 {
274  // cout << "Design = " << fDesign << endl;
-
275  TGeoVolume *top=gGeoManager->GetTopVolume();
-
276 
-
277  InitMedium("air");
-
278  TGeoMedium *air =gGeoManager->GetMedium("air");
-
279 
-
280  InitMedium("iron");
-
281  TGeoMedium *Fe =gGeoManager->GetMedium("iron");
-
282 
-
283  InitMedium("CoilAluminium");
-
284  TGeoMedium *Al = gGeoManager->GetMedium("CoilAluminium");
-
285 
-
286  InitMedium("CoilCopper");
-
287  TGeoMedium *Cu = gGeoManager->GetMedium("CoilCopper");
-
288 
-
289  InitMedium("PlasticBase");
-
290  TGeoMedium *PBase =gGeoManager->GetMedium("PlasticBase");
-
291 
-
292  InitMedium("NuclearEmulsion");
-
293  TGeoMedium *NEmu =gGeoManager->GetMedium("NuclearEmulsion");
+
275 
+
276  InitMedium("air");
+
277  TGeoMedium *air =gGeoManager->GetMedium("air");
+
278 
+
279  InitMedium("PlasticBase");
+
280  TGeoMedium *PBase =gGeoManager->GetMedium("PlasticBase");
+
281 
+
282  InitMedium("NuclearEmulsion");
+
283  TGeoMedium *NEmu =gGeoManager->GetMedium("NuclearEmulsion");
+
284 
+
285  TGeoMaterial *NEmuMat = NEmu->GetMaterial(); //I need the materials to build the mixture
+
286  TGeoMaterial *PBaseMat = PBase->GetMaterial();
+
287 
+
288  Double_t rho_film = (NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness)/(2* EmulsionThickness + PlasticBaseThickness);
+
289  Double_t frac_emu = NEmuMat->GetDensity() * 2 * EmulsionThickness /(NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness);
+
290 
+
291  if (fsingleemulsionfilm) cout<<"TARGET PRINTOUT: Single volume for emulsion film chosen: average density: "<<rho_film<<" fraction in mass of emulsion "<<frac_emu<<endl;
+
292 
+
293  TGeoMixture * emufilmmixture = new TGeoMixture("EmulsionFilmMixture", 2.00); // two nuclear emulsions separated by the plastic base
294 
-
295  TGeoMaterial *NEmuMat = NEmu->GetMaterial(); //I need the materials to build the mixture
-
296  TGeoMaterial *PBaseMat = PBase->GetMaterial();
+
295  emufilmmixture->AddElement(NEmuMat,frac_emu);
+
296  emufilmmixture->AddElement(PBaseMat,1. - frac_emu);
297 
-
298  Double_t rho_film = (NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness)/(2* EmulsionThickness + PlasticBaseThickness);
-
299  Double_t frac_emu = NEmuMat->GetDensity() * 2 * EmulsionThickness /(NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness);
-
300 
-
301  if (fsingleemulsionfilm) cout<<"TARGET PRINTOUT: Single volume for emulsion film chosen: average density: "<<rho_film<<" fraction in mass of emulsion "<<frac_emu<<endl;
+
298  TGeoMedium *Emufilm = new TGeoMedium("EmulsionFilm",100,emufilmmixture);
+
299 
+
300  InitMedium("lead");
+
301  TGeoMedium *lead = gGeoManager->GetMedium("lead");
302 
-
303  TGeoMixture * emufilmmixture = new TGeoMixture("EmulsionFilmMixture", 2.00); // two nuclear emulsions separated by the plastic base
-
304 
-
305  emufilmmixture->AddElement(NEmuMat,frac_emu);
-
306  emufilmmixture->AddElement(PBaseMat,1. - frac_emu);
-
307 
-
308  TGeoMedium *Emufilm = new TGeoMedium("EmulsionFilm",100,emufilmmixture);
-
309 
-
310  InitMedium("lead");
-
311  TGeoMedium *lead = gGeoManager->GetMedium("lead");
-
312 
-
313  InitMedium("tungsten");
-
314  TGeoMedium *tungsten = gGeoManager->GetMedium("tungsten");
-
315 
-
316  InitMedium("rohacell");
-
317  TGeoMedium *rohacell = gGeoManager->GetMedium("rohacell");
+
303  InitMedium("tungsten");
+
304  TGeoMedium *tungsten = gGeoManager->GetMedium("tungsten");
+
305 
+
306  InitMedium("Concrete");
+
307  TGeoMedium *Conc =gGeoManager->GetMedium("Concrete");
+
308 
+
309  InitMedium("steel");
+
310  TGeoMedium *Steel =gGeoManager->GetMedium("steel");
+
311 
+
312  Int_t NPlates = number_of_plates; //Number of doublets emulsion + Pb
+
313  Int_t NRohacellGap = 2;
+
314 
+
315  //Definition of the target box containing emulsion bricks + (CES if fDesign = 0 o 1) + target trackers (TT)
+
316  TGeoBBox *TargetBox = new TGeoBBox("TargetBox",XDimension/2, YDimension/2, ZDimension/2);
+
317  TGeoVolume *volTarget = new TGeoVolume("volTarget",TargetBox, air);
318 
-
319  InitMedium("Concrete");
-
320  TGeoMedium *Conc =gGeoManager->GetMedium("Concrete");
-
321 
-
322  InitMedium("steel");
-
323  TGeoMedium *Steel =gGeoManager->GetMedium("steel");
-
324 
-
325  Int_t NPlates = number_of_plates; //Number of doublets emulsion + Pb
-
326  Int_t NRohacellGap = 2;
-
327 
-
328  //Definition of the target box containing emulsion bricks + (CES if fDesign = 0 o 1) + target trackers (TT)
-
329  TGeoBBox *TargetBox = new TGeoBBox("TargetBox",XDimension/2, YDimension/2, ZDimension/2);
-
330  TGeoVolume *volTarget = new TGeoVolume("volTarget",TargetBox, air);
-
331 
-
332  // In both fDesign=0 & fDesign=1 the emulsion target is inserted within a magnet
-
333  if(fDesign!=2 && fDesign!=4)
-
334  {
-
335  TGeoVolume *MagnetVol;
-
336 
-
337  //magnetic field in target
-
338  TGeoUniformMagField *magField2 = new TGeoUniformMagField();
-
339 
-
340  if(fDesign==1) //TP
-
341  {
-
342  magField2->SetFieldValue(fField,0,0.);
-
343  MagnetVol=gGeoManager->GetVolume("Davide");
-
344  }
-
345  if(fDesign==0) //NEW
-
346  {
-
347  MagnetVol=gGeoManager->GetVolume("Goliath");
-
348  magField2->SetFieldValue(0.,fField,0.);
-
349  }
-
350  if(fDesign==3)
-
351  {
-
352  magField2->SetFieldValue(fField,0,0.);
-
353  MagnetVol=gGeoManager->GetVolume("NudetMagnet");
-
354  }
-
355 
-
356  //Definition of the target box containing emulsion bricks + CES + target trackers (TT)
-
357  if (fDesign != 3 && fDesign != 4) volTarget->SetField(magField2);
-
358  volTarget->SetVisibility(1);
-
359  volTarget->SetVisDaughters(1);
-
360  if(fDesign==0) //TP
-
361  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+fCoilH2+YDimension/2,0));
-
362  if(fDesign==1) //NEW
-
363  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+YDimension/2,0));
-
364  if(fDesign==3){
-
365  TGeoVolume *volMagRegion=gGeoManager->GetVolume("volMagRegion");
-
366  Double_t ZDimMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDZ() * 2.; //n.d.r. DZ is the semidimension
-
367  for (int i = 0; i < fNTarget; i++){
-
368  volMagRegion->AddNode(volTarget,i+1,new TGeoTranslation(0,0, -ZDimMagnetizedRegion/2 + ZDimension/2. + i*(ZDimension + 3 * fHpTDZ + 2* fHpTDistance)));
-
369  }
-
370  }
-
371  }
+
319  // In both fDesign=0 & fDesign=1 the emulsion target is inserted within a magnet
+
320  if(fDesign!=2 && fDesign!=4)
+
321  {
+
322  TGeoVolume *MagnetVol = nullptr;
+
323 
+
324  //magnetic field in target
+
325  TGeoUniformMagField *magField2 = new TGeoUniformMagField();
+
326 
+
327  if(fDesign==1) //TP
+
328  {
+
329  magField2->SetFieldValue(fField,0,0.);
+
330  MagnetVol=gGeoManager->GetVolume("Davide");
+
331  }
+
332  if(fDesign==0) //NEW
+
333  {
+
334  MagnetVol=gGeoManager->GetVolume("Goliath");
+
335  magField2->SetFieldValue(0.,fField,0.);
+
336  }
+
337  if(fDesign==3)
+
338  {
+
339  magField2->SetFieldValue(fField,0,0.);
+
340  MagnetVol=gGeoManager->GetVolume("NudetMagnet");
+
341  }
+
342 
+
343  //Definition of the target box containing emulsion bricks + CES + target trackers (TT)
+
344  if (fDesign != 3 && fDesign != 4) volTarget->SetField(magField2);
+
345  volTarget->SetVisibility(1);
+
346  volTarget->SetVisDaughters(1);
+
347  if(fDesign==0) //TP
+
348  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+fCoilH2+YDimension/2,0));
+
349  if(fDesign==1) //NEW
+
350  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+YDimension/2,0));
+
351  if(fDesign==3){
+
352  TGeoVolume *volMagRegion=gGeoManager->GetVolume("volMagRegion");
+
353  Double_t ZDimMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDZ() * 2.; //n.d.r. DZ is the semidimension
+
354  for (int i = 0; i < fNTarget; i++){
+
355  volMagRegion->AddNode(volTarget,i+1,new TGeoTranslation(0,0, -ZDimMagnetizedRegion/2 + ZDimension/2. + i*(ZDimension + 3 * fHpTDZ + 2* fHpTDistance)));
+
356  }
+
357  }
+
358  }
+
359 
+
360 
+
361 
+
362 
+
363 
+
364 
+
365 
+
366  //
+
367  //Volumes definition
+
368  //
+
369 
+
370  TGeoBBox *Cell = new TGeoBBox("cell", BrickX/2, BrickY/2, CellWidth/2);
+
371  TGeoVolume *volCell = new TGeoVolume("Cell",Cell,air);
372 
-
373 
-
374 
-
375 
-
376 
-
377 
-
378 
-
379  //
-
380  //Volumes definition
-
381  //
-
382 
-
383  TGeoBBox *Cell = new TGeoBBox("cell", BrickX/2, BrickY/2, CellWidth/2);
-
384  TGeoVolume *volCell = new TGeoVolume("Cell",Cell,air);
-
385 
-
386  //Brick
-
387  TGeoBBox *Brick = new TGeoBBox("brick", BrickX/2, BrickY/2, BrickZ/2);
-
388  TGeoVolume *volBrick = new TGeoVolume("Brick",Brick,air);
-
389  volBrick->SetLineColor(kCyan);
-
390  volBrick->SetTransparency(1);
-
391 
-
392  TGeoBBox *Lead, *Tungsten; //need to separate the two cases
-
393  TGeoVolume *volLead, *volTungsten;
+
373  //Brick
+
374  TGeoBBox *Brick = new TGeoBBox("brick", BrickX/2, BrickY/2, BrickZ/2);
+
375  TGeoVolume *volBrick = new TGeoVolume("Brick",Brick,air);
+
376  volBrick->SetLineColor(kCyan);
+
377  volBrick->SetTransparency(1);
+
378  //need to separate the two cases, now with a ternary operator
+
379  auto *Absorber = new TGeoBBox("Absorber", EmulsionX/2, EmulsionY/2, LeadThickness/2);
+
380  auto *volAbsorber = new TGeoVolume("volAbsorber", Absorber, (fDesign < 4) ? lead : tungsten);
+
381 
+
382  volAbsorber->SetTransparency(1);
+
383  volAbsorber->SetLineColor(kGray);
+
384 
+
385  for(Int_t n=0; n<NPlates; n++)
+
386  {
+
387  //decide to use lead or tungsten, according to fDesign
+
388  volBrick->AddNode(volAbsorber, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth + LeadThickness/2 + n*AllPlateWidth));
+
389  }
+
390  if (fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
+
391  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
+
392  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,Emufilm); //TOP
+
393  volEmulsionFilm->SetLineColor(kBlue);
394 
-
395  if (fDesign < 4){
-
396  Lead = new TGeoBBox("Pb", EmulsionX/2, EmulsionY/2, LeadThickness/2);
-
397  volLead = new TGeoVolume("Lead",Lead,lead);
-
398  volLead->SetTransparency(1);
-
399  volLead->SetLineColor(kGray);
-
400  //volLead->SetField(magField2);
-
401  }
-
402  else{
-
403  Tungsten = new TGeoBBox("W", EmulsionX/2, EmulsionY/2, LeadThickness/2);
-
404  volTungsten = new TGeoVolume("Tungsten",Tungsten,tungsten);
-
405  volTungsten->SetTransparency(1);
-
406  volTungsten->SetLineColor(kGray);
-
407  }
-
408 
-
409  for(Int_t n=0; n<NPlates; n++)
-
410  {
-
411  //decide to use lead or tungsten, according to fDesign
-
412  volBrick->AddNode(fDesign < 4 ? volLead: volTungsten, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth + LeadThickness/2 + n*AllPlateWidth));
-
413  }
-
414  if (fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
-
415  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
-
416  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,Emufilm); //TOP
-
417  volEmulsionFilm->SetLineColor(kBlue);
-
418 
-
419  if(fPassive==0)
-
420  {
-
421  AddSensitiveVolume(volEmulsionFilm);
-
422  }
-
423 
-
424  for(Int_t n=0; n<NPlates+1; n++)
-
425  {
-
426  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth/2 + n*AllPlateWidth));
-
427  }
-
428  }
-
429  else { //more accurate configuration, two emulsion films divided by a plastic base
-
430  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
-
431  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,NEmu); //TOP
-
432  TGeoVolume *volEmulsionFilm2 = new TGeoVolume("Emulsion2",EmulsionFilm,NEmu); //BOTTOM
-
433  volEmulsionFilm->SetLineColor(kBlue);
-
434  volEmulsionFilm2->SetLineColor(kBlue);
-
435 
-
436  if(fPassive==0)
-
437  {
-
438  AddSensitiveVolume(volEmulsionFilm);
-
439  AddSensitiveVolume(volEmulsionFilm2);
-
440  }
-
441  TGeoBBox *PlBase = new TGeoBBox("PlBase", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
-
442  TGeoVolume *volPlBase = new TGeoVolume("PlasticBase",PlBase,PBase);
-
443  volPlBase->SetLineColor(kYellow-4);
-
444  for(Int_t n=0; n<NPlates+1; n++)
-
445  {
-
446  volBrick->AddNode(volEmulsionFilm2, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmulsionThickness/2 + n*AllPlateWidth)); //BOTTOM
-
447  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*AllPlateWidth)); //TOP
-
448  volBrick->AddNode(volPlBase, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*AllPlateWidth)); //PLASTIC BASE
+
395  if(fPassive==0)
+
396  {
+
397  AddSensitiveVolume(volEmulsionFilm);
+
398  }
+
399 
+
400  for(Int_t n=0; n<NPlates+1; n++)
+
401  {
+
402  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth/2 + n*AllPlateWidth));
+
403  }
+
404  }
+
405  else { //more accurate configuration, two emulsion films divided by a plastic base
+
406  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
+
407  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,NEmu); //TOP
+
408  TGeoVolume *volEmulsionFilm2 = new TGeoVolume("Emulsion2",EmulsionFilm,NEmu); //BOTTOM
+
409  volEmulsionFilm->SetLineColor(kBlue);
+
410  volEmulsionFilm2->SetLineColor(kBlue);
+
411 
+
412  if(fPassive==0)
+
413  {
+
414  AddSensitiveVolume(volEmulsionFilm);
+
415  AddSensitiveVolume(volEmulsionFilm2);
+
416  }
+
417  TGeoBBox *PlBase = new TGeoBBox("PlBase", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
+
418  TGeoVolume *volPlBase = new TGeoVolume("PlasticBase",PlBase,PBase);
+
419  volPlBase->SetLineColor(kYellow-4);
+
420  for(Int_t n=0; n<NPlates+1; n++)
+
421  {
+
422  volBrick->AddNode(volEmulsionFilm2, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmulsionThickness/2 + n*AllPlateWidth)); //BOTTOM
+
423  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*AllPlateWidth)); //TOP
+
424  volBrick->AddNode(volPlBase, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*AllPlateWidth)); //PLASTIC BASE
+
425  }
+
426  }
+
427 
+
428  volBrick->SetVisibility(kTRUE);
+
429 
+
430  //The CES is required only in the option with magnet surrounding the emulsion target
+
431  if(fDesign!=2 && fDesign!=4)
+
432  {
+
433  //CES
+
434 
+
435  TGeoBBox *CES = new TGeoBBox("ces", EmulsionX/2, EmulsionY/2, CESWidth/2);
+
436  TGeoVolume *volCES = new TGeoVolume("CES", CES, air);
+
437  volCES->SetTransparency(5);
+
438  volCES->SetLineColor(kYellow-10);
+
439  volCES->SetVisibility(kTRUE);
+
440 
+
441  TGeoBBox *RohGap = new TGeoBBox("RohGap", EmulsionX/2, EmulsionY/2, RohacellGap/2);
+
442  TGeoVolume *volRohGap = new TGeoVolume("RohacellGap",RohGap,air); //using AIR for CES, not rohacell
+
443  volRohGap->SetTransparency(1);
+
444  volRohGap->SetLineColor(kYellow);
+
445 
+
446  for(Int_t n=0; n<NRohacellGap; n++)
+
447  {
+
448  volCES->AddNode(volRohGap, n, new TGeoTranslation(0,0,-CESWidth/2 +CESPackageZ/2+ EmPlateWidth + RohacellGap/2 + n*LayerCESWidth)); //ROHACELL
449  }
-
450  }
-
451 
-
452  volBrick->SetVisibility(kTRUE);
-
453 
-
454  //The CES is required only in the option with magnet surrounding the emulsion target
-
455  if(fDesign!=2 && fDesign!=4)
-
456  {
-
457  //CES
+
450  if(fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
+
451  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
+
452  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,Emufilm); //TOP
+
453  volEmulsionFilmCES->SetLineColor(kBlue);
+
454  if(fPassive==0)
+
455  {
+
456  AddSensitiveVolume(volEmulsionFilmCES);
+
457  }
458 
-
459  TGeoBBox *CES = new TGeoBBox("ces", EmulsionX/2, EmulsionY/2, CESWidth/2);
-
460  TGeoVolume *volCES = new TGeoVolume("CES", CES, air);
-
461  volCES->SetTransparency(5);
-
462  volCES->SetLineColor(kYellow-10);
-
463  volCES->SetVisibility(kTRUE);
-
464 
-
465  TGeoBBox *RohGap = new TGeoBBox("RohGap", EmulsionX/2, EmulsionY/2, RohacellGap/2);
-
466  TGeoVolume *volRohGap = new TGeoVolume("RohacellGap",RohGap,air); //using AIR for CES, not rohacell
-
467  volRohGap->SetTransparency(1);
-
468  volRohGap->SetLineColor(kYellow);
-
469 
-
470  for(Int_t n=0; n<NRohacellGap; n++)
-
471  {
-
472  volCES->AddNode(volRohGap, n, new TGeoTranslation(0,0,-CESWidth/2 +CESPackageZ/2+ EmPlateWidth + RohacellGap/2 + n*LayerCESWidth)); //ROHACELL
-
473  }
-
474  if(fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
-
475  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
-
476  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,Emufilm); //TOP
-
477  volEmulsionFilmCES->SetLineColor(kBlue);
-
478  if(fPassive==0)
-
479  {
-
480  AddSensitiveVolume(volEmulsionFilmCES);
-
481  }
-
482 
-
483  for(Int_t n=0; n<NRohacellGap+1;n++)
-
484  {
-
485  volCES->AddNode(volEmulsionFilmCES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmPlateWidth/2+n*LayerCESWidth));
-
486  }
-
487 
-
488  }
-
489  else{ //more accurate configuration, two emulsion films divided by a plastic base
-
490 
-
491  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
-
492  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,NEmu); //TOP
-
493  TGeoVolume *volEmulsionFilm2CES = new TGeoVolume("Emulsion2CES",EmulsionFilmCES,NEmu); //BOTTOM
-
494  volEmulsionFilmCES->SetLineColor(kBlue);
-
495  volEmulsionFilm2CES->SetLineColor(kBlue);
-
496  if(fPassive==0)
-
497  {
-
498  AddSensitiveVolume(volEmulsionFilmCES);
-
499  AddSensitiveVolume(volEmulsionFilm2CES);
-
500  }
-
501  //CES PLASTIC BASE
-
502  TGeoBBox *PlBaseCES = new TGeoBBox("PlBaseCES", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
-
503  TGeoVolume *volPlBaseCES = new TGeoVolume("PlasticBaseCES",PlBaseCES,PBase);
-
504  volPlBaseCES->SetLineColor(kYellow);
-
505  for(Int_t n=0; n<NRohacellGap+1;n++)
-
506  {
-
507  volCES->AddNode(volEmulsionFilm2CES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness/2+n*LayerCESWidth)); //BOTTOM
-
508  volCES->AddNode(volEmulsionFilmCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth)); //TOP
-
509  volCES->AddNode(volPlBaseCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*LayerCESWidth)); //PLASTIC BASE
-
510  // if(n == 2)
-
511  // cout << "-CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth = " << -CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth << endl;
-
512  }
+
459  for(Int_t n=0; n<NRohacellGap+1;n++)
+
460  {
+
461  volCES->AddNode(volEmulsionFilmCES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmPlateWidth/2+n*LayerCESWidth));
+
462  }
+
463 
+
464  }
+
465  else{ //more accurate configuration, two emulsion films divided by a plastic base
+
466 
+
467  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
+
468  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,NEmu); //TOP
+
469  TGeoVolume *volEmulsionFilm2CES = new TGeoVolume("Emulsion2CES",EmulsionFilmCES,NEmu); //BOTTOM
+
470  volEmulsionFilmCES->SetLineColor(kBlue);
+
471  volEmulsionFilm2CES->SetLineColor(kBlue);
+
472  if(fPassive==0)
+
473  {
+
474  AddSensitiveVolume(volEmulsionFilmCES);
+
475  AddSensitiveVolume(volEmulsionFilm2CES);
+
476  }
+
477  //CES PLASTIC BASE
+
478  TGeoBBox *PlBaseCES = new TGeoBBox("PlBaseCES", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
+
479  TGeoVolume *volPlBaseCES = new TGeoVolume("PlasticBaseCES",PlBaseCES,PBase);
+
480  volPlBaseCES->SetLineColor(kYellow);
+
481  for(Int_t n=0; n<NRohacellGap+1;n++)
+
482  {
+
483  volCES->AddNode(volEmulsionFilm2CES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness/2+n*LayerCESWidth)); //BOTTOM
+
484  volCES->AddNode(volEmulsionFilmCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth)); //TOP
+
485  volCES->AddNode(volPlBaseCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*LayerCESWidth)); //PLASTIC BASE
+
486  // if(n == 2)
+
487  // cout << "-CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth = " << -CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth << endl;
+
488  }
+
489 
+
490  }
+
491 
+
492  volCell->AddNode(volBrick,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ/2));
+
493  volCell->AddNode(volCES,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ + CESWidth/2));
+
494 
+
495  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, CellWidth/2);
+
496  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
+
497  volRow->SetLineColor(20);
+
498 
+
499  Double_t d_cl_x = -WallXDim/2;
+
500  for(int j= 0; j < fNCol; j++)
+
501  {
+
502  volRow->AddNode(volCell,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
+
503  d_cl_x += BrickX;
+
504  }
+
505 
+
506  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, CellWidth/2);
+
507  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
+
508 
+
509  Double_t d_cl_y = -WallYDim/2;
+
510  for(int k= 0; k< fNRow; k++)
+
511  {
+
512  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
513 
-
514  }
-
515 
-
516  volCell->AddNode(volBrick,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ/2));
-
517  volCell->AddNode(volCES,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ + CESWidth/2));
-
518 
-
519  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, CellWidth/2);
-
520  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
-
521  volRow->SetLineColor(20);
-
522 
-
523  Double_t d_cl_x = -WallXDim/2;
-
524  for(int j= 0; j < fNCol; j++)
-
525  {
-
526  volRow->AddNode(volCell,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
-
527  d_cl_x += BrickX;
+
514  // 2mm is the distance for the structure that holds the brick
+
515  d_cl_y += BrickY + Ydistance;
+
516  }
+
517 
+
518  //Columns
+
519 
+
520  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
+
521 
+
522  for(int l = 0; l < fNWall; l++)
+
523  {
+
524  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +CellWidth/2));
+
525 
+
526  //6 cm is the distance between 2 columns of consecutive Target for TT placement
+
527  d_cl_z += CellWidth + TTrackerZ;
528  }
-
529 
-
530  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, CellWidth/2);
-
531  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
-
532 
-
533  Double_t d_cl_y = -WallYDim/2;
-
534  for(int k= 0; k< fNRow; k++)
+
529  }
+
530 
+
531 
+
532  //in fDesign==2 and fDesign==4 the emulsion target is not surrounded by a magnet => no magnetic field inside
+
533  //In the no Magnetic field option, no CES is needed => only brick walls + TT
+
534  if(fDesign==2 || fDesign == 4)
535  {
-
536  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
+
536  EmulsionMagnet emuMag;
537 
-
538  // 2mm is the distance for the structure that holds the brick
-
539  d_cl_y += BrickY + Ydistance;
-
540  }
-
541 
-
542  //Columns
-
543 
-
544  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
-
545  Double_t d_tt = -ZDimension/2 + TTrackerZ/2;
+
538  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
+
539  cout<< "Tau Nu Detector fMagnetConfig: "<< fDesign<<endl;
+
540 
+
541  tTauNuDet->AddNode(volTarget,1,new TGeoTranslation(0,0,fCenterZ));
+
542 
+
543  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, WallZDim/2);
+
544  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
+
545  volRow->SetLineColor(20);
546 
-
547  for(int l = 0; l < fNWall; l++)
-
548  {
-
549  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +CellWidth/2));
-
550 
-
551  //6 cm is the distance between 2 columns of consecutive Target for TT placement
-
552  d_cl_z += CellWidth + TTrackerZ;
-
553  }
-
554  }
-
555 
+
547  Double_t d_cl_x = -WallXDim/2;
+
548  for(int j= 0; j < fNCol; j++)
+
549  {
+
550  volRow->AddNode(volBrick,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
+
551  d_cl_x += BrickX;
+
552  }
+
553  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, WallZDim/2);
+
554  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
+
555  volWall->SetLineColor(kGreen);
556 
-
557  //in fDesign==2 and fDesign==4 the emulsion target is not surrounded by a magnet => no magnetic field inside
-
558  //In the no Magnetic field option, no CES is needed => only brick walls + TT
-
559  if(fDesign==2 || fDesign == 4)
-
560  {
-
561  EmulsionMagnet emuMag;
-
562 
-
563  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
-
564  cout<< "Tau Nu Detector fMagnetConfig: "<< fDesign<<endl;
-
565 
-
566  tTauNuDet->AddNode(volTarget,1,new TGeoTranslation(0,0,fCenterZ));
-
567 
-
568  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, WallZDim/2);
-
569  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
-
570  volRow->SetLineColor(20);
-
571 
-
572  Double_t d_cl_x = -WallXDim/2;
-
573  for(int j= 0; j < fNCol; j++)
-
574  {
-
575  volRow->AddNode(volBrick,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
-
576  d_cl_x += BrickX;
-
577  }
-
578  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, WallZDim/2);
-
579  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
-
580  volWall->SetLineColor(kGreen);
-
581 
-
582  Double_t d_cl_y = -WallYDim/2;
-
583  for(int k= 0; k< fNRow; k++)
-
584  {
-
585  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
-
586 
-
587  // 2mm is the distance for the structure that holds the brick
-
588  d_cl_y += BrickY + Ydistance;
-
589  }
-
590  //Columns
-
591 
-
592  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
-
593  Double_t d_tt = -ZDimension/2 + TTrackerZ/2;
-
594 
-
595  for(int l = 0; l < fNWall; l++)
-
596  {
-
597  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +BrickZ/2));
-
598 
-
599  //6 cm is the distance between 2 columns of consecutive Target for TT placement
-
600  d_cl_z += BrickZ + TTrackerZ;
-
601  }
-
602  if(fDesign==2)
-
603  {
-
604  TGeoBBox *Base = new TGeoBBox("Base", fBaseX/2, fBaseY/2, fBaseZ/2);
-
605  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
-
606  volBase->SetLineColor(kYellow-3);
-
607  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-WallYDim/2 - fBaseY/2,fCenterZ));
-
608 
-
609  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
610  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
-
611  PillarVol->SetLineColor(kGreen+3);
-
612  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
-
613  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
-
614  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
-
615  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
-
616  }
-
617  }
-
618 }//end construct geometry
-
619 
-
620 Bool_t Target::ProcessHits(FairVolume* vol)
-
621 {
-
623  //Set parameters at entrance of volume. Reset ELoss.
-
624  if ( gMC->IsTrackEntering() ) {
-
625  fELoss = 0.;
-
626  fTime = gMC->TrackTime() * 1.0e09;
-
627  fLength = gMC->TrackLength();
-
628  gMC->TrackPosition(fPos);
-
629  gMC->TrackMomentum(fMom);
-
630  }
-
631  // Sum energy loss for all steps in the active volume
-
632  fELoss += gMC->Edep();
-
633 
-
634  // Create muonPoint at exit of active volume
-
635  if ( gMC->IsTrackExiting() ||
-
636  gMC->IsTrackStop() ||
-
637  gMC->IsTrackDisappeared() ) {
-
638  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
639  //Int_t fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
640  gMC->CurrentVolID(fVolumeID);
-
641  Int_t detID = fVolumeID;
-
642  //gGeoManager->PrintOverlaps();
-
643 
-
644  //cout<< "detID = " << detID << endl;
-
645  Int_t MaxLevel = gGeoManager->GetLevel();
-
646  const Int_t MaxL = MaxLevel;
-
647  //cout << "MaxLevel = " << MaxL << endl;
-
648  //cout << gMC->CurrentVolPath()<< endl;
-
649 
-
650 
-
651  Int_t motherV[MaxL];
-
652 // Bool_t EmTop = 0, EmBot = 0, EmCESTop = 0, EmCESBot = 0;
-
653  Bool_t EmBrick = 0, EmCES = 0, EmTop;
-
654  Int_t NPlate =0;
-
655  const char *name;
-
656 
-
657  name = gMC->CurrentVolName();
-
658  //cout << name << endl;
+
557  Double_t d_cl_y = -WallYDim/2;
+
558  for(int k= 0; k< fNRow; k++)
+
559  {
+
560  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
+
561 
+
562  // 2mm is the distance for the structure that holds the brick
+
563  d_cl_y += BrickY + Ydistance;
+
564  }
+
565  //Columns
+
566 
+
567  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
+
568 
+
569  for(int l = 0; l < fNWall; l++)
+
570  {
+
571  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +BrickZ/2));
+
572 
+
573  //6 cm is the distance between 2 columns of consecutive Target for TT placement
+
574  d_cl_z += BrickZ + TTrackerZ;
+
575  }
+
576  if(fDesign==2)
+
577  {
+
578  TGeoBBox *Base = new TGeoBBox("Base", fBaseX/2, fBaseY/2, fBaseZ/2);
+
579  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
+
580  volBase->SetLineColor(kYellow-3);
+
581  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-WallYDim/2 - fBaseY/2,fCenterZ));
+
582 
+
583  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
584  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
+
585  PillarVol->SetLineColor(kGreen+3);
+
586  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
+
587  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
+
588  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
+
589  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
+
590  }
+
591  }
+
592 }//end construct geometry
+
593 
+
594 Bool_t Target::ProcessHits(FairVolume* vol)
+
595 {
+
597  //Set parameters at entrance of volume. Reset ELoss.
+
598  if ( gMC->IsTrackEntering() ) {
+
599  fELoss = 0.;
+
600  fTime = gMC->TrackTime() * 1.0e09;
+
601  fLength = gMC->TrackLength();
+
602  gMC->TrackPosition(fPos);
+
603  gMC->TrackMomentum(fMom);
+
604  }
+
605  // Sum energy loss for all steps in the active volume
+
606  fELoss += gMC->Edep();
+
607 
+
608  // Create muonPoint at exit of active volume
+
609  if ( gMC->IsTrackExiting() ||
+
610  gMC->IsTrackStop() ||
+
611  gMC->IsTrackDisappeared() ) {
+
612  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
613  //Int_t fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
614  gMC->CurrentVolID(fVolumeID);
+
615  Int_t detID = fVolumeID;
+
616  //gGeoManager->PrintOverlaps();
+
617 
+
618  //cout<< "detID = " << detID << endl;
+
619  Int_t MaxLevel = gGeoManager->GetLevel();
+
620  const Int_t MaxL = MaxLevel;
+
621  //cout << "MaxLevel = " << MaxL << endl;
+
622  //cout << gMC->CurrentVolPath()<< endl;
+
623 
+
624 
+
625  Int_t motherV[MaxL];
+
626 // Bool_t EmTop = 0, EmBot = 0, EmCESTop = 0, EmCESBot = 0;
+
627  Bool_t EmBrick = false;
+
628  Bool_t EmTop = false;
+
629  Int_t NPlate =0;
+
630  const char *name;
+
631 
+
632  name = gMC->CurrentVolName();
+
633  //cout << name << endl;
+
634 
+
635  if(strcmp(name, "Emulsion") == 0)
+
636  {
+
637  EmBrick=1;
+
638  NPlate = detID;
+
639  EmTop=1;
+
640  }
+
641  if(strcmp(name, "Emulsion2") == 0)
+
642  {
+
643  EmBrick=1;
+
644  NPlate = detID;
+
645  EmTop=0;
+
646  }
+
647  if(strcmp(name, "EmulsionCES") == 0)
+
648  {
+
649  NPlate = detID;
+
650  EmTop=1;
+
651  }
+
652  if(strcmp(name, "Emulsion2CES") == 0)
+
653  {
+
654  NPlate = detID;
+
655  EmTop=0;
+
656  }
+
657 
+
658  Int_t NWall = 0, NColumn =0, NRow =0;
659 
-
660  if(strcmp(name, "Emulsion") == 0)
+
660  for(Int_t i = 0; i < MaxL;i++)
661  {
-
662  EmBrick=1;
-
663  NPlate = detID;
-
664  EmTop=1;
-
665  }
-
666  if(strcmp(name, "Emulsion2") == 0)
-
667  {
-
668  EmBrick=1;
-
669  NPlate = detID;
-
670  EmTop=0;
-
671  }
-
672  if(strcmp(name, "EmulsionCES") == 0)
-
673  {
-
674  EmCES=1;
-
675  NPlate = detID;
-
676  EmTop=1;
-
677  }
-
678  if(strcmp(name, "Emulsion2CES") == 0)
-
679  {
-
680  EmCES=1;
-
681  NPlate = detID;
-
682  EmTop=0;
-
683  }
+
662  motherV[i] = gGeoManager->GetMother(i)->GetNumber();
+
663  const char *mumname = gMC->CurrentVolOffName(i);
+
664  if(motherV[0]==1 && motherV[0]!=detID)
+
665  {
+
666  if(strcmp(mumname, "Brick") == 0 ||strcmp(mumname, "CES") == 0) NColumn = motherV[i];
+
667  if(strcmp(mumname, "Cell") == 0) NRow = motherV[i];
+
668  if(strcmp(mumname, "Row") == 0) NWall = motherV[i];
+
669  if((strcmp(mumname, "Wall") == 0)&& (motherV[i]==2)) NWall += fNWall;
+
670  }
+
671  else
+
672  {
+
673 
+
674  if(strcmp(mumname, "Cell") == 0) NColumn = motherV[i];
+
675  if(strcmp(mumname, "Row") == 0) NRow = motherV[i];
+
676  if(strcmp(mumname, "Wall") == 0) NWall = motherV[i];
+
677  if((strcmp(mumname, "volTarget") == 0) && (motherV[i]==2)) NWall += fNWall;
+
678  }
+
679  //cout << i << " " << motherV[i] << " name = " << mumname << endl;
+
680  }
+
681 
+
682  Bool_t BrickorCES = EmBrick == 1;
+
683 
684 
-
685  Int_t NWall = 0, NColumn =0, NRow =0;
+
685  detID = (NWall+1) *1E7 + (NRow+1) * 1E6 + (NColumn+1)*1E4 + BrickorCES *1E3 + (NPlate+1)*1E1 + EmTop*1 ;
686 
-
687  for(Int_t i = 0; i < MaxL;i++)
-
688  {
-
689  motherV[i] = gGeoManager->GetMother(i)->GetNumber();
-
690  const char *mumname = gMC->CurrentVolOffName(i);
-
691  if(motherV[0]==1 && motherV[0]!=detID)
-
692  {
-
693  if(strcmp(mumname, "Brick") == 0 ||strcmp(mumname, "CES") == 0) NColumn = motherV[i];
-
694  if(strcmp(mumname, "Cell") == 0) NRow = motherV[i];
-
695  if(strcmp(mumname, "Row") == 0) NWall = motherV[i];
-
696  if((strcmp(mumname, "Wall") == 0)&& (motherV[i]==2)) NWall += fNWall;
-
697  }
-
698  else
-
699  {
+
687 
+
688  fVolumeID = detID;
+
689 
+
690  if (fELoss == 0. ) { return kFALSE; }
+
691  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
692  //Int_t MotherID =gMC->GetStack()->GetCurrentParentTrackNumber();
+
693  Int_t pdgCode = p->GetPdgCode();
+
694 
+
695  TLorentzVector Pos;
+
696  gMC->TrackPosition(Pos);
+
697  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
698  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
699  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
700 
-
701  if(strcmp(mumname, "Cell") == 0) NColumn = motherV[i];
-
702  if(strcmp(mumname, "Row") == 0) NRow = motherV[i];
-
703  if(strcmp(mumname, "Wall") == 0) NWall = motherV[i];
-
704  if((strcmp(mumname, "volTarget") == 0) && (motherV[i]==2)) NWall += fNWall;
-
705  }
-
706  //cout << i << " " << motherV[i] << " name = " << mumname << endl;
-
707  }
-
708 
-
709  Bool_t BrickorCES = 0; //Brick = 1 / CES = 0;
-
710  if(EmBrick==1)
-
711  BrickorCES = 1;
-
712 
-
713  Double_t zEnd = 0, zStart =0;
+
701 
+
702  AddHit(fTrackID,fVolumeID, TVector3(xmean, ymean, zmean),
+
703  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
+
704  fELoss, pdgCode);
+
705 
+
706  // Increment number of muon det points in TParticle
+
707  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
708  stack->AddPoint(ktauTarget);
+
709  }
+
710 
+
711  return kTRUE;
+
712 }
+
713 
714 
-
715 
-
716  detID = (NWall+1) *1E7 + (NRow+1) * 1E6 + (NColumn+1)*1E4 + BrickorCES *1E3 + (NPlate+1)*1E1 + EmTop*1 ;
-
717 
+
715 void Target::DecodeBrickID(Int_t detID, Int_t &NWall, Int_t &NRow, Int_t &NColumn, Int_t &NPlate, Bool_t &EmCES, Bool_t &EmBrick, Bool_t &EmTop)
+
716 {
+
717  Bool_t BrickorCES = false;
718 
-
719  fVolumeID = detID;
-
720 
-
721  if (fELoss == 0. ) { return kFALSE; }
-
722  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
723  //Int_t MotherID =gMC->GetStack()->GetCurrentParentTrackNumber();
-
724  Int_t fMotherID =p->GetFirstMother();
-
725  Int_t pdgCode = p->GetPdgCode();
-
726 
-
727  // cout << "ID = "<< fTrackID << " pdg = " << pdgCode << "; M = " << fMotherID << " Npl = " << NPlate<<"; NCol = " << NColumn << "; NRow = " << NRow << "; NWall = " << NWall<< " P = " << fMom.Px() << ", "<< fMom.Py() << ", " << fMom.Pz() << endl;
-
728 
-
729  TLorentzVector Pos;
-
730  gMC->TrackPosition(Pos);
-
731  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
732  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
733  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
734 
-
735 
-
736  AddHit(fTrackID,fVolumeID, TVector3(xmean, ymean, zmean),
-
737  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
-
738  fELoss, pdgCode);
-
739 
-
740  // Increment number of muon det points in TParticle
-
741  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
742  stack->AddPoint(ktauTarget);
-
743  }
+
719  NWall = detID/1E7;
+
720  NRow = (detID - NWall*1E7)/1E6;
+
721  NColumn = (detID - NWall*1E7 -NRow*1E6)/1E4;
+
722  Double_t b = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4)/1.E3;
+
723  if(b < 1)
+
724  {
+
725  BrickorCES = 0;
+
726  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
+
727 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
+
728  }
+
729  if(b >= 1)
+
730  {
+
731  BrickorCES = 1;
+
732  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
+
733 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
+
734  }
+
735  EmTop = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4- BrickorCES*1E3- NPlate*1E1)/1E0;
+
736  if(BrickorCES == 0)
+
737  {
+
738  EmCES = 1; EmBrick =0;
+
739  }
+
740  if(BrickorCES == 1)
+
741  {
+
742  EmBrick = 1; EmCES =0;
+
743  }
744 
-
745  return kTRUE;
-
746 }
-
747 
-
748 
-
749 void Target::DecodeBrickID(Int_t detID, Int_t &NWall, Int_t &NRow, Int_t &NColumn, Int_t &NPlate, Bool_t &EmCES, Bool_t &EmBrick, Bool_t &EmTop)
-
750 {
-
751  Bool_t BrickorCES = 0, TopBot = 0;
-
752 
-
753  NWall = detID/1E7;
-
754  NRow = (detID - NWall*1E7)/1E6;
-
755  NColumn = (detID - NWall*1E7 -NRow*1E6)/1E4;
-
756  Double_t b = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4)/1.E3;
-
757  if(b < 1)
-
758  {
-
759  BrickorCES = 0;
-
760  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
-
761 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
-
762  }
-
763  if(b >= 1)
-
764  {
-
765  BrickorCES = 1;
-
766  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
-
767 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
-
768  }
-
769  EmTop = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4- BrickorCES*1E3- NPlate*1E1)/1E0;
-
770  if(BrickorCES == 0)
-
771  {
-
772  EmCES = 1; EmBrick =0;
-
773  }
-
774  if(BrickorCES == 1)
-
775  {
-
776  EmBrick = 1; EmCES =0;
-
777  }
-
778 
-
779  // cout << "NPlate = " << NPlate << "; NColumn = " << NColumn << "; NRow = " << NRow << "; NWall = " << NWall << endl;
-
780  // cout << "BrickorCES = " << BrickorCES <<endl;
-
781  // cout << "EmCES = " << EmCES << "; EmBrick = " << EmBick << endl;
-
782  // cout << endl;
-
783 }
-
784 
-
785 
-
786 void Target::EndOfEvent()
+
745  // cout << "NPlate = " << NPlate << "; NColumn = " << NColumn << "; NRow = " << NRow << "; NWall = " << NWall << endl;
+
746  // cout << "BrickorCES = " << BrickorCES <<endl;
+
747  // cout << "EmCES = " << EmCES << "; EmBrick = " << EmBick << endl;
+
748  // cout << endl;
+
749 }
+
750 
+
751 
+
752 void Target::EndOfEvent()
+
753 {
+
754  fTargetPointCollection->Clear();
+
755 }
+
756 
+
757 
+
758 void Target::Register()
+
759 {
+
760 
+
767  FairRootManager::Instance()->Register("TargetPoint", "Target",
+
768  fTargetPointCollection, kTRUE);
+
769 }
+
770 
+
771 TClonesArray* Target::GetCollection(Int_t iColl) const
+
772 {
+
773  if (iColl == 0) { return fTargetPointCollection; }
+
774  else { return NULL; }
+
775 }
+
776 
+
777 void Target::Reset()
+
778 {
+
779  fTargetPointCollection->Clear();
+
780 }
+
781 
+
782 
+
783 TargetPoint* Target::AddHit(Int_t trackID,Int_t detID,
+
784  TVector3 pos, TVector3 mom,
+
785  Double_t time, Double_t length,
+
786  Double_t eLoss, Int_t pdgCode)
787 {
-
788  fTargetPointCollection->Clear();
-
789 }
-
790 
-
791 
-
792 void Target::Register()
-
793 {
-
794 
-
801  FairRootManager::Instance()->Register("TargetPoint", "Target",
-
802  fTargetPointCollection, kTRUE);
-
803 }
-
804 
-
805 TClonesArray* Target::GetCollection(Int_t iColl) const
-
806 {
-
807  if (iColl == 0) { return fTargetPointCollection; }
-
808  else { return NULL; }
-
809 }
-
810 
-
811 void Target::Reset()
-
812 {
-
813  fTargetPointCollection->Clear();
-
814 }
-
815 
-
816 
-
817 TargetPoint* Target::AddHit(Int_t trackID,Int_t detID,
-
818  TVector3 pos, TVector3 mom,
-
819  Double_t time, Double_t length,
-
820  Double_t eLoss, Int_t pdgCode)
-
821 {
-
822  TClonesArray& clref = *fTargetPointCollection;
-
823  Int_t size = clref.GetEntriesFast();
-
824  //cout << "brick hit called"<< pos.z()<<endl;
-
825  return new(clref[size]) TargetPoint(trackID,detID, pos, mom,
-
826  time, length, eLoss, pdgCode);
-
827 }
+
788  TClonesArray& clref = *fTargetPointCollection;
+
789  Int_t size = clref.GetEntriesFast();
+
790  //cout << "brick hit called"<< pos.z()<<endl;
+
791  return new(clref[size]) TargetPoint(trackID,detID, pos, mom,
+
792  time, length, eLoss, pdgCode);
+
793 }
@ ktauTarget
@@ -917,7 +883,7 @@
Definition: TargetPoint.h:11
Double_t fCenterZ
Definition: Target.h:153
void SetMagnetHeight(Double_t Y)
Definition: Target.cxx:215
-
void DecodeBrickID(Int_t detID, Int_t &NWall, Int_t &NRow, Int_t &NColumn, Int_t &NPlate, Bool_t &EmCES, Bool_t &EmBrick, Bool_t &EmTop)
Definition: Target.cxx:749
+
void DecodeBrickID(Int_t detID, Int_t &NWall, Int_t &NRow, Int_t &NColumn, Int_t &NPlate, Bool_t &EmCES, Bool_t &EmBrick, Bool_t &EmTop)
Definition: Target.cxx:715
void SetHpTParam(Int_t n, Double_t dd, Double_t DZ)
Definition: Target.cxx:265
Double_t Ydistance
Definition: Target.h:194
Double_t CESWidth
Definition: Target.h:202
@@ -932,18 +898,18 @@
Double_t CESPackageZ
Definition: Target.h:192
Int_t fnHpT
Definition: Target.h:220
virtual ~Target()
Definition: Target.cxx:95
-
virtual void Reset()
Definition: Target.cxx:811
+
virtual void Reset()
Definition: Target.cxx:777
Double_t BrickX
Definition: Target.h:198
-
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: Target.cxx:620
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: Target.cxx:594
void MergeTopBot(Bool_t SingleEmFilm)
Definition: Target.cxx:141
Int_t fDesign
Definition: Target.h:150
Double_t fBaseZ
Definition: Target.h:212
Double_t LeadThickness
Definition: Target.h:184
Double_t PlasticBaseThickness
Definition: Target.h:183
void SetCoilDownHeight(Double_t H2)
Definition: Target.cxx:235
-
virtual void Register()
Definition: Target.cxx:792
+
virtual void Register()
Definition: Target.cxx:758
TClonesArray * fTargetPointCollection
energy loss
Definition: Target.h:141
-
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: Target.cxx:805
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: Target.cxx:771
virtual void Initialize()
Definition: Target.cxx:103
void SetNumberBricks(Double_t col, Double_t row, Double_t wall)
Definition: Target.cxx:148
Double_t fField
Definition: Target.h:163
@@ -965,7 +931,7 @@
void SetCenterZ(Double_t z)
Definition: Target.cxx:245
Double_t BrickPackageX
Definition: Target.h:189
Double_t WallYDim
Definition: Target.h:176
-
virtual void EndOfEvent()
Definition: Target.cxx:786
+
virtual void EndOfEvent()
Definition: Target.cxx:752
void SetDetectorDimension(Double_t xdim, Double_t ydim, Double_t zdim)
Definition: Target.cxx:167
Double_t fPillarX
Definition: Target.h:213
Int_t InitMedium(const char *name)
Definition: Target.cxx:109
@@ -987,7 +953,7 @@
void SetTTzdimension(Double_t TTZ)
Definition: Target.cxx:210
Double_t fPillarZ
Definition: Target.h:215
Double32_t fELoss
length
Definition: Target.h:138
-
TargetPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: Target.cxx:817
+
TargetPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: Target.cxx:783
Bool_t fPassive
Definition: Target.h:148
void ConstructGeometry()
Definition: Target.cxx:272
TLorentzVector fMom
position at entrance
Definition: Target.h:135
@@ -1029,7 +995,6 @@
int n
string p
a
-
top
vol
zdim
x
diff --git a/Target_8h_source.html b/Target_8h_source.html index 9df0bad396..328a90a9b0 100644 --- a/Target_8h_source.html +++ b/Target_8h_source.html @@ -294,7 +294,7 @@
Definition: Target.h:27
Double_t fCenterZ
Definition: Target.h:153
void SetMagnetHeight(Double_t Y)
Definition: Target.cxx:215
-
void DecodeBrickID(Int_t detID, Int_t &NWall, Int_t &NRow, Int_t &NColumn, Int_t &NPlate, Bool_t &EmCES, Bool_t &EmBrick, Bool_t &EmTop)
Definition: Target.cxx:749
+
void DecodeBrickID(Int_t detID, Int_t &NWall, Int_t &NRow, Int_t &NColumn, Int_t &NPlate, Bool_t &EmCES, Bool_t &EmBrick, Bool_t &EmTop)
Definition: Target.cxx:715
void SetHpTParam(Int_t n, Double_t dd, Double_t DZ)
Definition: Target.cxx:265
Double_t Ydistance
Definition: Target.h:194
Double_t CESWidth
Definition: Target.h:202
@@ -309,9 +309,9 @@
Double_t CESPackageZ
Definition: Target.h:192
Int_t fnHpT
Definition: Target.h:220
virtual ~Target()
Definition: Target.cxx:95
-
virtual void Reset()
Definition: Target.cxx:811
+
virtual void Reset()
Definition: Target.cxx:777
Double_t BrickX
Definition: Target.h:198
-
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: Target.cxx:620
+
virtual Bool_t ProcessHits(FairVolume *v=0)
Definition: Target.cxx:594
void MergeTopBot(Bool_t SingleEmFilm)
Definition: Target.cxx:141
Int_t fDesign
Definition: Target.h:150
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Definition: Target.h:110
@@ -321,9 +321,9 @@
Double_t LeadThickness
Definition: Target.h:184
Double_t PlasticBaseThickness
Definition: Target.h:183
void SetCoilDownHeight(Double_t H2)
Definition: Target.cxx:235
-
virtual void Register()
Definition: Target.cxx:792
+
virtual void Register()
Definition: Target.cxx:758
TClonesArray * fTargetPointCollection
energy loss
Definition: Target.h:141
-
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: Target.cxx:805
+
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: Target.cxx:771
virtual void Initialize()
Definition: Target.cxx:103
void SetNumberBricks(Double_t col, Double_t row, Double_t wall)
Definition: Target.cxx:148
Double_t fField
Definition: Target.h:163
@@ -348,7 +348,7 @@
void SetCenterZ(Double_t z)
Definition: Target.cxx:245
Double_t BrickPackageX
Definition: Target.h:189
Double_t WallYDim
Definition: Target.h:176
-
virtual void EndOfEvent()
Definition: Target.cxx:786
+
virtual void EndOfEvent()
Definition: Target.cxx:752
void SetDetectorDimension(Double_t xdim, Double_t ydim, Double_t zdim)
Definition: Target.cxx:167
Double_t fPillarX
Definition: Target.h:213
Int_t InitMedium(const char *name)
Definition: Target.cxx:109
@@ -372,7 +372,7 @@
void SetTTzdimension(Double_t TTZ)
Definition: Target.cxx:210
Double_t fPillarZ
Definition: Target.h:215
Double32_t fELoss
length
Definition: Target.h:138
-
TargetPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: Target.cxx:817
+
TargetPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: Target.cxx:783
void SetMagnetConfiguration(Int_t config)
Bool_t fPassive
Definition: Target.h:148
void ConstructGeometry()
Definition: Target.cxx:272
diff --git a/classEmulsionMagnet.html b/classEmulsionMagnet.html index 5e27cfe0ac..4a04c2fa16 100644 --- a/classEmulsionMagnet.html +++ b/classEmulsionMagnet.html @@ -338,462 +338,454 @@

Definition at line 158 of file EmulsionMagnet.cxx.

159 {
-
160  TGeoVolume *top=gGeoManager->GetTopVolume();
-
161 
-
162  InitMedium("air");
-
163  TGeoMedium *air =gGeoManager->GetMedium("air");
-
164 
-
165  InitMedium("iron");
-
166  TGeoMedium *Fe =gGeoManager->GetMedium("iron");
-
167 
-
168  InitMedium("CoilAluminium");
-
169  TGeoMedium *Al = gGeoManager->GetMedium("CoilAluminium");
-
170 
-
171  InitMedium("CoilCopper");
-
172  TGeoMedium *Cu = gGeoManager->GetMedium("CoilCopper");
-
173 
-
174  InitMedium("steel");
-
175  TGeoMedium *Steel = gGeoManager->GetMedium("steel");
-
176 
-
177  gGeoManager->SetVisLevel(10);
-
178 
-
179  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
-
180  cout<< "Tau Nu Detector fDesign: "<< fDesign<<endl;
-
181 
-
182  if(fDesign==0)//OLD, TP
-
183  {
-
184  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field in Magnet pillars
-
185  TGeoUniformMagField *magField2 = new TGeoUniformMagField(0.,fField,0.); //magnetic field in target
-
186 
-
187  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Goliath");
-
188  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
-
189 
-
190  //Iron basis on which the coils are placed
-
191  TGeoBBox *Base = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
-
192  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Fe);
-
193  volBase->SetLineColor(kRed);
-
194  MagnetVol->AddNode(volBase,1,new TGeoTranslation(0, fMagnetY/2 - fBaseY/2, 0)); //upper part
-
195  MagnetVol->AddNode(volBase,2,new TGeoTranslation(0, -fMagnetY/2 + fBaseY/2, 0)); //lower part
-
196 
-
197  //Coils Description: 2 volumes must be defined being the upper coil in Cu and the lower one in Al and also heghts are different
-
198  TGeoTube *CoilBoxU = new TGeoTube("C",0,fCoilR,fCoilH1/2);
-
199  TGeoVolume *CoilVolUp = new TGeoVolume("CoilVolUp",CoilBoxU, Cu);
-
200  CoilVolUp->SetLineColor(kGreen);
-
201  TGeoTube *CoilBoxD = new TGeoTube("C",0,fCoilR,fCoilH2/2);
-
202  TGeoVolume *CoilVolDown = new TGeoVolume("CoilVolDown",CoilBoxD, Al);
-
203  CoilVolDown->SetLineColor(kGreen);
-
204 
-
205  TGeoRotation *r1 = new TGeoRotation();
-
206  r1->SetAngles(0,90,0);
-
207  TGeoCombiTrans tUp(0, fMagnetY/2 - fBaseY - fCoilH1/2, 0,r1);
-
208  TGeoHMatrix *mUp = new TGeoHMatrix(tUp);
-
209  TGeoCombiTrans tDown(0, -fMagnetY/2 + fBaseY + fCoilH2/2, 0,r1);
-
210  TGeoHMatrix *mDown = new TGeoHMatrix(tDown);
-
211 
-
212  MagnetVol->AddNode(CoilVolUp,1,mUp);
-
213  MagnetVol->AddNode(CoilVolDown,1,mDown);
+
160 
+
161  InitMedium("air");
+
162  TGeoMedium *air =gGeoManager->GetMedium("air");
+
163 
+
164  InitMedium("iron");
+
165  TGeoMedium *Fe =gGeoManager->GetMedium("iron");
+
166 
+
167  InitMedium("CoilAluminium");
+
168  TGeoMedium *Al = gGeoManager->GetMedium("CoilAluminium");
+
169 
+
170  InitMedium("CoilCopper");
+
171  TGeoMedium *Cu = gGeoManager->GetMedium("CoilCopper");
+
172 
+
173  InitMedium("steel");
+
174  TGeoMedium *Steel = gGeoManager->GetMedium("steel");
+
175 
+
176  gGeoManager->SetVisLevel(10);
+
177 
+
178  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
+
179  cout<< "Tau Nu Detector fDesign: "<< fDesign<<endl;
+
180 
+
181  if(fDesign==0)//OLD, TP
+
182  {
+
183  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field in Magnet pillars
+
184 
+
185  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Goliath");
+
186  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
+
187 
+
188  //Iron basis on which the coils are placed
+
189  TGeoBBox *Base = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
+
190  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Fe);
+
191  volBase->SetLineColor(kRed);
+
192  MagnetVol->AddNode(volBase,1,new TGeoTranslation(0, fMagnetY/2 - fBaseY/2, 0)); //upper part
+
193  MagnetVol->AddNode(volBase,2,new TGeoTranslation(0, -fMagnetY/2 + fBaseY/2, 0)); //lower part
+
194 
+
195  //Coils Description: 2 volumes must be defined being the upper coil in Cu and the lower one in Al and also heghts are different
+
196  TGeoTube *CoilBoxU = new TGeoTube("C",0,fCoilR,fCoilH1/2);
+
197  TGeoVolume *CoilVolUp = new TGeoVolume("CoilVolUp",CoilBoxU, Cu);
+
198  CoilVolUp->SetLineColor(kGreen);
+
199  TGeoTube *CoilBoxD = new TGeoTube("C",0,fCoilR,fCoilH2/2);
+
200  TGeoVolume *CoilVolDown = new TGeoVolume("CoilVolDown",CoilBoxD, Al);
+
201  CoilVolDown->SetLineColor(kGreen);
+
202 
+
203  TGeoRotation *r1 = new TGeoRotation();
+
204  r1->SetAngles(0,90,0);
+
205  TGeoCombiTrans tUp(0, fMagnetY/2 - fBaseY - fCoilH1/2, 0,r1);
+
206  TGeoHMatrix *mUp = new TGeoHMatrix(tUp);
+
207  TGeoCombiTrans tDown(0, -fMagnetY/2 + fBaseY + fCoilH2/2, 0,r1);
+
208  TGeoHMatrix *mDown = new TGeoHMatrix(tDown);
+
209 
+
210  MagnetVol->AddNode(CoilVolUp,1,mUp);
+
211  MagnetVol->AddNode(CoilVolDown,1,mDown);
+
212 
+
213  //********************* Columns ****************************
214 
-
215  //********************* Columns ****************************
+
215  //Each column is made of a longer pillar (rectangle + trapezoid) and on top a shorter pillar (rectangle + trapezoid again)
216 
-
217  //Each column is made of a longer pillar (rectangle + trapezoid) and on top a shorter pillar (rectangle + trapezoid again)
-
218 
-
219  Double_t base1 = 135, base2 = 78; //basis of the trapezoid
-
220  Double_t side1 = 33, side2 = 125, side3 = 57, side4 = 90; //Sides of the columns
+
217  Double_t base1 = 135, base2 = 78; //basis of the trapezoid
+
218  Double_t side1 = 33, side2 = 125, side3 = 57, side4 = 90; //Sides of the columns
+
219 
+
220  //***** SIDE Left Front ****
221 
-
222  //***** SIDE Left Front ****
-
223 
-
224  //Shorter Pillar: rectangle
-
225  TGeoBBox *LateralS1 = new TGeoBBox("LateralS1",side1/2,fCoilH1/2,base1/2);
-
226  TGeoTranslation *tr1 = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2 + base1/2);
-
227  TGeoVolume *volLateralS1 = new TGeoVolume("volLateralS1",LateralS1,Fe);
-
228  volLateralS1->SetLineColor(kRed);
-
229  volLateralS1->SetField(magField1);
-
230  MagnetVol->AddNode(volLateralS1, 1, tr1);
+
222  //Shorter Pillar: rectangle
+
223  TGeoBBox *LateralS1 = new TGeoBBox("LateralS1",side1/2,fCoilH1/2,base1/2);
+
224  TGeoTranslation *tr1 = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2 + base1/2);
+
225  TGeoVolume *volLateralS1 = new TGeoVolume("volLateralS1",LateralS1,Fe);
+
226  volLateralS1->SetLineColor(kRed);
+
227  volLateralS1->SetField(magField1);
+
228  MagnetVol->AddNode(volLateralS1, 1, tr1);
+
229 
+
230  //Shorter Pillar: trapezoid
231 
-
232  //Shorter Pillar: trapezoid
-
233 
-
234  TGeoArb8 *LateralS2 = new TGeoArb8("LateralS2",fCoilH1/2);
-
235  LateralS2->SetVertex(0, side4, 0);
-
236  LateralS2->SetVertex(1, side1, 0);
-
237  LateralS2->SetVertex(2, side1, base1);
-
238  LateralS2->SetVertex(3, side4, base2);
-
239  LateralS2->SetVertex(4, side4, 0);
-
240  LateralS2->SetVertex(5, side1, 0);
-
241  LateralS2->SetVertex(6, side1, base1);
-
242  LateralS2->SetVertex(7, side4, base2);
-
243 
-
244  TGeoVolume *volLateralS2 = new TGeoVolume("volLateralS2",LateralS2,Fe);
-
245  volLateralS2->SetLineColor(kRed);
-
246  volLateralS2->SetField(magField1);
-
247 
-
248  TGeoRotation *r2 = new TGeoRotation();
-
249  r2->SetAngles(0,90,0);
-
250  TGeoCombiTrans tr3(-fMagnetX/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2,r2);
-
251  TGeoHMatrix *m3_a = new TGeoHMatrix(tr3);
-
252  MagnetVol->AddNode(volLateralS2, 1, m3_a);
+
232  TGeoArb8 *LateralS2 = new TGeoArb8("LateralS2",fCoilH1/2);
+
233  LateralS2->SetVertex(0, side4, 0);
+
234  LateralS2->SetVertex(1, side1, 0);
+
235  LateralS2->SetVertex(2, side1, base1);
+
236  LateralS2->SetVertex(3, side4, base2);
+
237  LateralS2->SetVertex(4, side4, 0);
+
238  LateralS2->SetVertex(5, side1, 0);
+
239  LateralS2->SetVertex(6, side1, base1);
+
240  LateralS2->SetVertex(7, side4, base2);
+
241 
+
242  TGeoVolume *volLateralS2 = new TGeoVolume("volLateralS2",LateralS2,Fe);
+
243  volLateralS2->SetLineColor(kRed);
+
244  volLateralS2->SetField(magField1);
+
245 
+
246  TGeoRotation *r2 = new TGeoRotation();
+
247  r2->SetAngles(0,90,0);
+
248  TGeoCombiTrans tr3(-fMagnetX/2, fMagnetY/2 - fBaseY - fCoilH1/2, -fMagnetZ/2,r2);
+
249  TGeoHMatrix *m3_a = new TGeoHMatrix(tr3);
+
250  MagnetVol->AddNode(volLateralS2, 1, m3_a);
+
251 
+
252  //LOWER LATERAL SURFACE
253 
-
254  //LOWER LATERAL SURFACE
-
255 
-
256  //LONGER RECTANGLE
-
257  TGeoBBox *LateralSurface1low = new TGeoBBox("LateralSurface1low",side1/2,(fCoilDist + fCoilH2)/2,side2/2);
-
258  TGeoVolume *volLateralSurface1low = new TGeoVolume("volLateralSurface1low",LateralSurface1low,Fe);
-
259  volLateralSurface1low->SetLineColor(kRed);
-
260  volLateralSurface1low->SetField(magField1);
-
261  TGeoTranslation *tr1low = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + side2/2);
-
262  MagnetVol->AddNode(volLateralSurface1low, 1, tr1low);;
-
263 
-
264 
-
265  //SHORTER RECTANGLE
-
266  TGeoBBox *LateralSurface2low = new TGeoBBox("LateralSurface2low",side3/2,(fCoilDist + fCoilH2)/2,base2/2);
-
267  TGeoVolume *volLateralSurface2low = new TGeoVolume("volLateralSurface2low",LateralSurface2low,Fe);
-
268  volLateralSurface2low->SetLineColor(kRed);
-
269  TGeoTranslation *tr2low = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY -fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + base2/2);
-
270  MagnetVol->AddNode(volLateralSurface2low, 1, tr2low);
-
271  volLateralSurface2low->SetField(magField1);
+
254  //LONGER RECTANGLE
+
255  TGeoBBox *LateralSurface1low = new TGeoBBox("LateralSurface1low",side1/2,(fCoilDist + fCoilH2)/2,side2/2);
+
256  TGeoVolume *volLateralSurface1low = new TGeoVolume("volLateralSurface1low",LateralSurface1low,Fe);
+
257  volLateralSurface1low->SetLineColor(kRed);
+
258  volLateralSurface1low->SetField(magField1);
+
259  TGeoTranslation *tr1low = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + side2/2);
+
260  MagnetVol->AddNode(volLateralSurface1low, 1, tr1low);;
+
261 
+
262 
+
263  //SHORTER RECTANGLE
+
264  TGeoBBox *LateralSurface2low = new TGeoBBox("LateralSurface2low",side3/2,(fCoilDist + fCoilH2)/2,base2/2);
+
265  TGeoVolume *volLateralSurface2low = new TGeoVolume("volLateralSurface2low",LateralSurface2low,Fe);
+
266  volLateralSurface2low->SetLineColor(kRed);
+
267  TGeoTranslation *tr2low = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY -fCoilH1 - (fCoilDist + fCoilH2)/2, -fMagnetZ/2 + base2/2);
+
268  MagnetVol->AddNode(volLateralSurface2low, 1, tr2low);
+
269  volLateralSurface2low->SetField(magField1);
+
270 
+
271  //***** SIDE Right Front ****
272 
-
273  //***** SIDE Right Front ****
-
274 
-
275  //LONGER RECTANGLE
-
276  TGeoTranslation *tr1_b = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2 - base1/2);
-
277  TGeoVolume *volLateralS1_b = new TGeoVolume("volLateralS1_b",LateralS1,Fe);
-
278  volLateralS1_b->SetLineColor(kRed);
-
279  volLateralS1_b->SetField(magField1);
-
280  MagnetVol->AddNode(volLateralS1_b, 1, tr1_b);
-
281 
-
282  //TRAPEZOID
-
283  TGeoArb8 *LateralS2_b = new TGeoArb8("LateralS2_b",fCoilH1/2);
-
284  LateralS2_b ->SetVertex(0, side4, 0);
-
285  LateralS2_b ->SetVertex(1, side1, 0);
-
286  LateralS2_b ->SetVertex(2, side1, base1);
-
287  LateralS2_b ->SetVertex(3, side4, base2);
-
288  LateralS2_b ->SetVertex(4, side4, 0);
-
289  LateralS2_b ->SetVertex(5, side1, 0);
-
290  LateralS2_b ->SetVertex(6, side1, base1);
-
291  LateralS2_b ->SetVertex(7, side4, base2);
-
292 
-
293  TGeoVolume *volLateralS2_b = new TGeoVolume("volLateralS2_b",LateralS2_b,Fe);
-
294  volLateralS2_b->SetLineColor(kRed);
-
295  volLateralS2_b->SetField(magField1);
-
296 
-
297  TGeoRotation *r2_b = new TGeoRotation();
-
298  r2_b->SetAngles(0,270,0);
-
299  TGeoCombiTrans tr2_b(-fMagnetX/2 , fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2,r2_b);
-
300  TGeoHMatrix *m3_b = new TGeoHMatrix(tr2_b);
-
301  MagnetVol->AddNode(volLateralS2_b, 1, m3_b);
-
302 
+
273  //LONGER RECTANGLE
+
274  TGeoTranslation *tr1_b = new TGeoTranslation(-fMagnetX/2 + side1/2, fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2 - base1/2);
+
275  TGeoVolume *volLateralS1_b = new TGeoVolume("volLateralS1_b",LateralS1,Fe);
+
276  volLateralS1_b->SetLineColor(kRed);
+
277  volLateralS1_b->SetField(magField1);
+
278  MagnetVol->AddNode(volLateralS1_b, 1, tr1_b);
+
279 
+
280  //TRAPEZOID
+
281  TGeoArb8 *LateralS2_b = new TGeoArb8("LateralS2_b",fCoilH1/2);
+
282  LateralS2_b ->SetVertex(0, side4, 0);
+
283  LateralS2_b ->SetVertex(1, side1, 0);
+
284  LateralS2_b ->SetVertex(2, side1, base1);
+
285  LateralS2_b ->SetVertex(3, side4, base2);
+
286  LateralS2_b ->SetVertex(4, side4, 0);
+
287  LateralS2_b ->SetVertex(5, side1, 0);
+
288  LateralS2_b ->SetVertex(6, side1, base1);
+
289  LateralS2_b ->SetVertex(7, side4, base2);
+
290 
+
291  TGeoVolume *volLateralS2_b = new TGeoVolume("volLateralS2_b",LateralS2_b,Fe);
+
292  volLateralS2_b->SetLineColor(kRed);
+
293  volLateralS2_b->SetField(magField1);
+
294 
+
295  TGeoRotation *r2_b = new TGeoRotation();
+
296  r2_b->SetAngles(0,270,0);
+
297  TGeoCombiTrans tr2_b(-fMagnetX/2 , fMagnetY/2 - fBaseY - fCoilH1/2, fMagnetZ/2,r2_b);
+
298  TGeoHMatrix *m3_b = new TGeoHMatrix(tr2_b);
+
299  MagnetVol->AddNode(volLateralS2_b, 1, m3_b);
+
300 
+
301 
+
302  //LOWER LATERAL SURFACE
303 
-
304  //LOWER LATERAL SURFACE
-
305 
-
306  //LONGER RECTANGLE
-
307  TGeoVolume *volLateralSurface1blow = new TGeoVolume("volLateralSurface1blow",LateralSurface1low,Fe);
-
308  volLateralSurface1blow->SetLineColor(kRed);
-
309  volLateralSurface1blow->SetField(magField1);
-
310  TGeoTranslation *tr1blow = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - side2/2);
-
311  MagnetVol->AddNode(volLateralSurface1blow, 1, tr1blow);;
-
312 
-
313 
-
314  //SHORTER RECTANGLE
-
315  TGeoVolume *volLateralSurface2blow = new TGeoVolume("volLateralSurface2blow",LateralSurface2low,Fe);
-
316  volLateralSurface2blow->SetLineColor(kRed);
-
317  volLateralSurface2blow->SetField(magField1);
-
318  TGeoTranslation *tr2blow = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - base2/2);
-
319  MagnetVol->AddNode(volLateralSurface2blow, 1, tr2blow);
-
320 
+
304  //LONGER RECTANGLE
+
305  TGeoVolume *volLateralSurface1blow = new TGeoVolume("volLateralSurface1blow",LateralSurface1low,Fe);
+
306  volLateralSurface1blow->SetLineColor(kRed);
+
307  volLateralSurface1blow->SetField(magField1);
+
308  TGeoTranslation *tr1blow = new TGeoTranslation(-fMagnetX/2 +side1/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - side2/2);
+
309  MagnetVol->AddNode(volLateralSurface1blow, 1, tr1blow);;
+
310 
+
311 
+
312  //SHORTER RECTANGLE
+
313  TGeoVolume *volLateralSurface2blow = new TGeoVolume("volLateralSurface2blow",LateralSurface2low,Fe);
+
314  volLateralSurface2blow->SetLineColor(kRed);
+
315  volLateralSurface2blow->SetField(magField1);
+
316  TGeoTranslation *tr2blow = new TGeoTranslation(-fMagnetX/2 +side1 + side3/2, fMagnetY/2 - fBaseY - fCoilH1 - (fCoilDist + fCoilH2)/2, fMagnetZ/2 - base2/2);
+
317  MagnetVol->AddNode(volLateralSurface2blow, 1, tr2blow);
+
318 
+
319 
+
320  //***** SIDE left Back ****
321 
-
322  //***** SIDE left Back ****
-
323 
-
324 
-
325  //LONGER RECTANGLE
-
326  TGeoBBox *LateralS1_d = new TGeoBBox("LateralS1_d",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
-
327  TGeoTranslation *tr1_d = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2 + base1/2);
-
328  TGeoVolume *volLateralS1_d = new TGeoVolume("volLateralS1_d",LateralS1_d,Fe);
-
329  volLateralS1_d->SetLineColor(kRed);
-
330  volLateralS1_d->SetField(magField1);
-
331  MagnetVol->AddNode(volLateralS1_d, 1, tr1_d);
+
322 
+
323  //LONGER RECTANGLE
+
324  TGeoBBox *LateralS1_d = new TGeoBBox("LateralS1_d",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
+
325  TGeoTranslation *tr1_d = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2 + base1/2);
+
326  TGeoVolume *volLateralS1_d = new TGeoVolume("volLateralS1_d",LateralS1_d,Fe);
+
327  volLateralS1_d->SetLineColor(kRed);
+
328  volLateralS1_d->SetField(magField1);
+
329  MagnetVol->AddNode(volLateralS1_d, 1, tr1_d);
+
330 
+
331  //TRAPEZOID
332 
-
333  //TRAPEZOID
-
334 
-
335  TGeoArb8 *LateralS2_d = new TGeoArb8("LateralS2_d",(fCoilH1 + fCoilH2 + fCoilDist)/2);
-
336  LateralS2_d->SetVertex(0, side4, 0);
-
337  LateralS2_d->SetVertex(1, side1, 0);
-
338  LateralS2_d->SetVertex(2, side1, base1);
-
339  LateralS2_d->SetVertex(3, side4, base2);
-
340  LateralS2_d->SetVertex(4, side4, 0);
-
341  LateralS2_d->SetVertex(5, side1, 0);
-
342  LateralS2_d->SetVertex(6, side1, base1);
-
343  LateralS2_d->SetVertex(7, side4, base2);
-
344 
-
345 
-
346  TGeoVolume *volLateralS2_d = new TGeoVolume("volLateralS2_d",LateralS2_d,Fe);
-
347  volLateralS2_d->SetLineColor(kRed);
-
348  volLateralS2_d->SetField(magField1);
-
349 
-
350  TGeoRotation *r2_d = new TGeoRotation();
-
351  r2_d->SetAngles(0,270,180);
-
352  TGeoCombiTrans tr2_d(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2,r2_d);
-
353  TGeoHMatrix *m3_d = new TGeoHMatrix(tr2_d);
-
354  MagnetVol->AddNode(volLateralS2_d, 1, m3_d);
+
333  TGeoArb8 *LateralS2_d = new TGeoArb8("LateralS2_d",(fCoilH1 + fCoilH2 + fCoilDist)/2);
+
334  LateralS2_d->SetVertex(0, side4, 0);
+
335  LateralS2_d->SetVertex(1, side1, 0);
+
336  LateralS2_d->SetVertex(2, side1, base1);
+
337  LateralS2_d->SetVertex(3, side4, base2);
+
338  LateralS2_d->SetVertex(4, side4, 0);
+
339  LateralS2_d->SetVertex(5, side1, 0);
+
340  LateralS2_d->SetVertex(6, side1, base1);
+
341  LateralS2_d->SetVertex(7, side4, base2);
+
342 
+
343 
+
344  TGeoVolume *volLateralS2_d = new TGeoVolume("volLateralS2_d",LateralS2_d,Fe);
+
345  volLateralS2_d->SetLineColor(kRed);
+
346  volLateralS2_d->SetField(magField1);
+
347 
+
348  TGeoRotation *r2_d = new TGeoRotation();
+
349  r2_d->SetAngles(0,270,180);
+
350  TGeoCombiTrans tr2_d(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, -fMagnetZ/2,r2_d);
+
351  TGeoHMatrix *m3_d = new TGeoHMatrix(tr2_d);
+
352  MagnetVol->AddNode(volLateralS2_d, 1, m3_d);
+
353 
+
354 //***** SIDE right Back ****
355 
-
356 //***** SIDE right Back ****
-
357 
-
358 
-
359  //LONGER RECTANGLE
-
360  TGeoBBox *LateralS1_c = new TGeoBBox("LateralS1_c",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
-
361  TGeoTranslation *tr1_c = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2 - base1/2);
-
362  TGeoVolume *volLateralS1_c = new TGeoVolume("volLateralS1_c",LateralS1_c,Fe);
-
363  volLateralS1_c->SetLineColor(kRed);
-
364  volLateralS1_c->SetField(magField1);
-
365  MagnetVol->AddNode(volLateralS1_c, 1, tr1_c);
+
356 
+
357  //LONGER RECTANGLE
+
358  TGeoBBox *LateralS1_c = new TGeoBBox("LateralS1_c",side1/2,(fCoilH1 + fCoilH2 + fCoilDist)/2,base1/2);
+
359  TGeoTranslation *tr1_c = new TGeoTranslation(fMagnetX/2 - side1/2, fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2 - base1/2);
+
360  TGeoVolume *volLateralS1_c = new TGeoVolume("volLateralS1_c",LateralS1_c,Fe);
+
361  volLateralS1_c->SetLineColor(kRed);
+
362  volLateralS1_c->SetField(magField1);
+
363  MagnetVol->AddNode(volLateralS1_c, 1, tr1_c);
+
364 
+
365  //TRAPEZOID
366 
-
367  //TRAPEZOID
-
368 
-
369  TGeoArb8 *LateralS2_c = new TGeoArb8("LateralS2_c",(fCoilH1 + fCoilH2 + fCoilDist)/2);
-
370  LateralS2_c ->SetVertex(0, side4, 0);
-
371  LateralS2_c ->SetVertex(1, side1, 0);
-
372  LateralS2_c ->SetVertex(2, side1, base1);
-
373  LateralS2_c ->SetVertex(3, side4, base2);
-
374  LateralS2_c ->SetVertex(4, side4, 0);
-
375  LateralS2_c ->SetVertex(5, side1, 0);
-
376  LateralS2_c ->SetVertex(6, side1, base1);
-
377  LateralS2_c ->SetVertex(7, side4, base2);
-
378 
-
379  TGeoVolume *volLateralS2_c = new TGeoVolume("volLateralS2_c",LateralS2_c,Fe);
-
380  volLateralS2_c->SetLineColor(kRed);
-
381  volLateralS2_c->SetField(magField1);
-
382 
-
383  TGeoRotation *r2_c = new TGeoRotation();
-
384  r2_c->SetAngles(0,90,180);
-
385  TGeoCombiTrans tr2_c(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2,r2_c);
-
386  TGeoHMatrix *m3_c = new TGeoHMatrix(tr2_c);
-
387  MagnetVol->AddNode(volLateralS2_c, 1, m3_c);
-
388 
+
367  TGeoArb8 *LateralS2_c = new TGeoArb8("LateralS2_c",(fCoilH1 + fCoilH2 + fCoilDist)/2);
+
368  LateralS2_c ->SetVertex(0, side4, 0);
+
369  LateralS2_c ->SetVertex(1, side1, 0);
+
370  LateralS2_c ->SetVertex(2, side1, base1);
+
371  LateralS2_c ->SetVertex(3, side4, base2);
+
372  LateralS2_c ->SetVertex(4, side4, 0);
+
373  LateralS2_c ->SetVertex(5, side1, 0);
+
374  LateralS2_c ->SetVertex(6, side1, base1);
+
375  LateralS2_c ->SetVertex(7, side4, base2);
+
376 
+
377  TGeoVolume *volLateralS2_c = new TGeoVolume("volLateralS2_c",LateralS2_c,Fe);
+
378  volLateralS2_c->SetLineColor(kRed);
+
379  volLateralS2_c->SetField(magField1);
+
380 
+
381  TGeoRotation *r2_c = new TGeoRotation();
+
382  r2_c->SetAngles(0,90,180);
+
383  TGeoCombiTrans tr2_c(fMagnetX/2 , fMagnetY/2 - fBaseY - (fCoilH1 + fCoilH2 + fCoilDist)/2, fMagnetZ/2,r2_c);
+
384  TGeoHMatrix *m3_c = new TGeoHMatrix(tr2_c);
+
385  MagnetVol->AddNode(volLateralS2_c, 1, m3_c);
+
386 
+
387 
+
388  }
389 
-
390  }
-
391 
-
392  if(fDesign==1) //NEW with magnet
-
393  {
-
394  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
-
395  TGeoUniformMagField *magField2 = new TGeoUniformMagField(fField,0.,0.); //magnetic field in target
+
390  if(fDesign==1) //NEW with magnet
+
391  {
+
392  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
+
393 
+
394  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Davide");
+
395  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
396 
-
397  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("Davide");
-
398  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
-
399 
-
400  //The -0.01*mm is only for drawing reasons
-
401  TGeoBBox *LateralBox = new TGeoBBox("LB",fBaseZ/2,fBaseY/2,(fBaseX-0.01*mm)/2);
-
402  TGeoTube *CoilBox = new TGeoTube("C",0,fCoilR,fCoilH1/2);
-
403 
-
404  TGeoCompositeShape *LateralSurf = new TGeoCompositeShape("LS","LB-C");
-
405 
-
406  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",CoilBox, Cu);
-
407  CoilVol->SetLineColor(kGreen);
-
408  TGeoVolume *LateralSurfVol = new TGeoVolume("LateralSurfVol",LateralSurf, Fe);
-
409  LateralSurfVol->SetLineColor(kRed);
-
410 
-
411  TGeoRotation *r1 = new TGeoRotation();
-
412  r1->RotateY(90);
-
413  //r1->RotateY(90);
-
414  //r1->RotateY(90);
-
415  r1->RegisterYourself();
-
416  TGeoTranslation *t1r = new TGeoTranslation(-fMagnetX/2+fBaseX/2,0,0);
-
417  TGeoTranslation *t1l = new TGeoTranslation(fMagnetX/2-fBaseX/2,0,0);
-
418 
-
419  TGeoCombiTrans *trans1r = new TGeoCombiTrans(-fMagnetX/2+fBaseX/2,0,0,r1);
-
420  TGeoCombiTrans *trans1l = new TGeoCombiTrans(fMagnetX/2-fBaseX/2,0,0,r1);
-
421  TGeoHMatrix *m1_r = new TGeoHMatrix("m1_r");
-
422  *m1_r = trans1r;
-
423  TGeoHMatrix *m1_l = new TGeoHMatrix("m1_l");
-
424  *m1_l = trans1l;
+
397  //The -0.01*mm is only for drawing reasons
+
398  [[maybe_unused]] auto *LateralBox = new TGeoBBox("LB",fBaseZ/2,fBaseY/2,(fBaseX-0.01*mm)/2);
+
399  TGeoTube *CoilBox = new TGeoTube("C",0,fCoilR,fCoilH1/2);
+
400 
+
401  TGeoCompositeShape *LateralSurf = new TGeoCompositeShape("LS","LB-C");
+
402 
+
403  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",CoilBox, Cu);
+
404  CoilVol->SetLineColor(kGreen);
+
405  TGeoVolume *LateralSurfVol = new TGeoVolume("LateralSurfVol",LateralSurf, Fe);
+
406  LateralSurfVol->SetLineColor(kRed);
+
407 
+
408  TGeoRotation *r1 = new TGeoRotation();
+
409  r1->RotateY(90);
+
410  //r1->RotateY(90);
+
411  //r1->RotateY(90);
+
412  r1->RegisterYourself();
+
413 
+
414  TGeoCombiTrans *trans1r = new TGeoCombiTrans(-fMagnetX/2+fBaseX/2,0,0,r1);
+
415  TGeoCombiTrans *trans1l = new TGeoCombiTrans(fMagnetX/2-fBaseX/2,0,0,r1);
+
416  TGeoHMatrix *m1_r = new TGeoHMatrix("m1_r");
+
417  *m1_r = trans1r;
+
418  TGeoHMatrix *m1_l = new TGeoHMatrix("m1_l");
+
419  *m1_l = trans1l;
+
420 
+
421  MagnetVol->AddNode(CoilVol,1, m1_r);
+
422  MagnetVol->AddNode(LateralSurfVol,1,m1_r);
+
423  MagnetVol->AddNode(CoilVol,2, m1_l);
+
424  MagnetVol->AddNode(LateralSurfVol,2,m1_l);
425 
-
426  MagnetVol->AddNode(CoilVol,1, m1_r);
-
427  MagnetVol->AddNode(LateralSurfVol,1,m1_r);
-
428  MagnetVol->AddNode(CoilVol,2, m1_l);
-
429  MagnetVol->AddNode(LateralSurfVol,2,m1_l);
-
430 
-
431  TGeoBBox *ColumnBox = new TGeoBBox(fColumnX/2, fColumnY/2, fColumnZ/2);
-
432  TGeoVolume *ColumnVol = new TGeoVolume("ColumnVol",ColumnBox,Fe);
-
433  ColumnVol->SetField(magField1);
-
434  ColumnVol->SetLineColor(kRed);
-
435  MagnetVol->AddNode(ColumnVol,1,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, -fMagnetZ/2+fColumnZ/2));
-
436  MagnetVol->AddNode(ColumnVol,2,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, fMagnetZ/2-fColumnZ/2));
-
437  MagnetVol->AddNode(ColumnVol,3,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, -fMagnetZ/2+fColumnZ/2));
-
438  MagnetVol->AddNode(ColumnVol,4,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, fMagnetZ/2-fColumnZ/2));
+
426  TGeoBBox *ColumnBox = new TGeoBBox(fColumnX/2, fColumnY/2, fColumnZ/2);
+
427  TGeoVolume *ColumnVol = new TGeoVolume("ColumnVol",ColumnBox,Fe);
+
428  ColumnVol->SetField(magField1);
+
429  ColumnVol->SetLineColor(kRed);
+
430  MagnetVol->AddNode(ColumnVol,1,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, -fMagnetZ/2+fColumnZ/2));
+
431  MagnetVol->AddNode(ColumnVol,2,new TGeoTranslation(0,fMagnetY/2-fColumnY/2, fMagnetZ/2-fColumnZ/2));
+
432  MagnetVol->AddNode(ColumnVol,3,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, -fMagnetZ/2+fColumnZ/2));
+
433  MagnetVol->AddNode(ColumnVol,4,new TGeoTranslation(0,-fMagnetY/2+fColumnY/2, fMagnetZ/2-fColumnZ/2));
+
434 
+
435  TGeoBBox *BaseBox = new TGeoBBox(fCoilDist/2,fColumnY/2, fBaseZ/2);
+
436  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
+
437  BaseVol->SetLineColor(kRed);
+
438  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fColumnY/2,0));
439 
-
440  TGeoBBox *BaseBox = new TGeoBBox(fCoilDist/2,fColumnY/2, fBaseZ/2);
-
441  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
-
442  BaseVol->SetLineColor(kRed);
-
443  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fColumnY/2,0));
-
444 
-
445  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
446  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
-
447  PillarVol->SetLineColor(kGreen+3);
-
448  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
449  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
450  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
451  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
452  }
-
453 
-
454  if(fDesign==3) //NEW with magnet
-
455  {
-
456  //Box for Magnet
-
457  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("NudetMagnet");
-
458  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
+
440  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
441  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
+
442  PillarVol->SetLineColor(kGreen+3);
+
443  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
444  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
445  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
446  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
447  }
+
448 
+
449  if(fDesign==3) //NEW with magnet
+
450  {
+
451  //Box for Magnet
+
452  TGeoVolumeAssembly *MagnetVol = new TGeoVolumeAssembly("NudetMagnet");
+
453  tTauNuDet->AddNode(MagnetVol,1,new TGeoTranslation(0,0,fCenterZ));
+
454 
+
455  TGeoBBox *BaseBox = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
+
456  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
+
457  BaseVol->SetLineColor(kRed);
+
458  TGeoBBox *LateralBox = new TGeoBBox(fColumnX/2,fColumnY/2,fColumnZ/2);
459 
-
460  TGeoBBox *BaseBox = new TGeoBBox(fBaseX/2,fBaseY/2,fBaseZ/2);
-
461  TGeoVolume *BaseVol = new TGeoVolume("BaseVol",BaseBox,Fe);
-
462  BaseVol->SetLineColor(kRed);
-
463  TGeoBBox *LateralBox = new TGeoBBox(fColumnX/2,fColumnY/2,fColumnZ/2);
-
464 
-
465  //prepare for triangolar cuts
-
466  LateralBox->SetName("L");
-
467  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
-
468  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fColumnZ+delta)/2,(fColumnZ+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
-
469  Model->SetName("T");
-
470 
-
471  const Double_t SemiLateralBoxHeight =(fColumnY - fCutHeight)/2;
-
472 
-
473  //we need different volumes to place different magnetic fields
-
474  TGeoBBox *SemiLateralBox = new TGeoBBox("SemiLateralBox",(fColumnX)/2, SemiLateralBoxHeight /2, fColumnZ/2);
-
475  TGeoVolume *volUpLateral = new TGeoVolume("volUpLateral",SemiLateralBox,Fe); //up and down refer to the magnetic field verse
+
460  //prepare for triangolar cuts
+
461  LateralBox->SetName("L");
+
462  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
+
463  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fColumnZ+delta)/2,(fColumnZ+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
+
464  Model->SetName("T");
+
465 
+
466  const Double_t SemiLateralBoxHeight =(fColumnY - fCutHeight)/2;
+
467 
+
468  //we need different volumes to place different magnetic fields
+
469  TGeoBBox *SemiLateralBox = new TGeoBBox("SemiLateralBox",(fColumnX)/2, SemiLateralBoxHeight /2, fColumnZ/2);
+
470  TGeoVolume *volUpLateral = new TGeoVolume("volUpLateral",SemiLateralBox,Fe); //up and down refer to the magnetic field verse
+
471 
+
472  TGeoVolume *volDownLateral = new TGeoVolume("volDownLateral",SemiLateralBox,Fe);
+
473  SemiLateralBox->SetName("S");
+
474  volUpLateral->SetLineColor(kRed);
+
475  volDownLateral->SetLineColor(kRed);
476 
-
477  TGeoVolume *volDownLateral = new TGeoVolume("volDownLateral",SemiLateralBox,Fe);
-
478  SemiLateralBox->SetName("S");
-
479  volUpLateral->SetLineColor(kRed);
-
480  volDownLateral->SetLineColor(kRed);
+
477  const Double_t MidBoxHeight = fCutHeight/2;
+
478 
+
479  TGeoBBox *MidLateralBox = new TGeoBBox("MidLateralBox",fColumnX/2, MidBoxHeight/2, fColumnZ/2);
+
480  MidLateralBox->SetName("M");
481 
-
482  const Double_t MidBoxHeight = fCutHeight/2;
+
482  //some boolean operations for triangular cuts
483 
-
484  TGeoBBox *MidLateralBox = new TGeoBBox("MidLateralBox",fColumnX/2, MidBoxHeight/2, fColumnZ/2);
-
485  MidLateralBox->SetName("M");
-
486 
-
487  //some boolean operations for triangular cuts
-
488 
-
489  TGeoRotation rot("rot",90,90,0);
-
490  TGeoRotation rot1("rot1",-90,90,0);
-
491  const TGeoTranslation trans("trans",-fColumnX/2.+ fCutLength/2,0,0);
-
492  TGeoCombiTrans* comb = new TGeoCombiTrans(trans,rot);
-
493  comb->SetName("comb");
-
494  comb->RegisterYourself();
-
495  TGeoCompositeShape *cut = new TGeoCompositeShape("CUT", "L-T:comb");
-
496 
+
484  TGeoRotation rot("rot",90,90,0);
+
485  TGeoRotation rot1("rot1",-90,90,0);
+
486  const TGeoTranslation trans("trans",-fColumnX/2.+ fCutLength/2,0,0);
+
487  TGeoCombiTrans* comb = new TGeoCombiTrans(trans,rot);
+
488  comb->SetName("comb");
+
489  comb->RegisterYourself();
+
490  [[maybe_unused]] auto *cut = new TGeoCompositeShape("CUT", "L-T:comb");
+
491 
+
492 
+
493  TGeoTranslation* transcuttop = new TGeoTranslation("transcuttop",0, fCutHeight/2 + SemiLateralBoxHeight/2 ,0); //top and bottom refer to their geometrical positions
+
494  TGeoTranslation* transcuttop1 = new TGeoTranslation("transcuttop1",0, MidBoxHeight/2 ,0);
+
495  TGeoTranslation* transcutbottom = new TGeoTranslation("transcutbottom",0, - fCutHeight/2 - SemiLateralBoxHeight/2 ,0);
+
496  TGeoTranslation* transcutbottom1 = new TGeoTranslation("transcutbottom1",0, -MidBoxHeight/2 ,0);
497 
-
498  TGeoTranslation* transcuttop = new TGeoTranslation("transcuttop",0, fCutHeight/2 + SemiLateralBoxHeight/2 ,0); //top and bottom refer to their geometrical positions
-
499  TGeoTranslation* transcuttop1 = new TGeoTranslation("transcuttop1",0, MidBoxHeight/2 ,0);
-
500  TGeoTranslation* transcutbottom = new TGeoTranslation("transcutbottom",0, - fCutHeight/2 - SemiLateralBoxHeight/2 ,0);
-
501  TGeoTranslation* transcutbottom1 = new TGeoTranslation("transcutbottom1",0, -MidBoxHeight/2 ,0);
+
498  transcuttop->RegisterYourself();
+
499  transcuttop1->RegisterYourself();
+
500  transcutbottom->RegisterYourself();
+
501  transcutbottom1->RegisterYourself();
502 
-
503  transcuttop->RegisterYourself();
-
504  transcuttop1->RegisterYourself();
-
505  transcutbottom->RegisterYourself();
-
506  transcutbottom1->RegisterYourself();
-
507 
-
508  TGeoCompositeShape *cuttop = new TGeoCompositeShape("CUTTOP", "CUT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the right lateral wall
-
509  TGeoVolume *volcuttop = new TGeoVolume("volcuttop", cuttop, Fe);
-
510  volcuttop->SetLineColor(kRed);
-
511 
-
512  const TGeoTranslation transleft("transleft",+fColumnX/2.- fCutLength/2,0,0);
-
513  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
-
514  combleft->SetName("combleft");
-
515  combleft->RegisterYourself();
-
516  TGeoCompositeShape *cutleft;
-
517  cutleft = new TGeoCompositeShape("CUTLEFT", "L-T:combleft");
-
518  TGeoCompositeShape *cuttopleft = new TGeoCompositeShape("CUTTOPLEFT", "CUTLEFT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the left lateral wall
-
519  TGeoVolume *volcuttopleft = new TGeoVolume("volcuttopleft", cuttopleft, Fe);
-
520  volcuttopleft->SetLineColor(kRed);
+
503  TGeoCompositeShape *cuttop = new TGeoCompositeShape("CUTTOP", "CUT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the right lateral wall
+
504  TGeoVolume *volcuttop = new TGeoVolume("volcuttop", cuttop, Fe);
+
505  volcuttop->SetLineColor(kRed);
+
506 
+
507  const TGeoTranslation transleft("transleft",+fColumnX/2.- fCutLength/2,0,0);
+
508  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
+
509  combleft->SetName("combleft");
+
510  combleft->RegisterYourself();
+
511  [[maybe_unused]] auto *cutleft = new TGeoCompositeShape("CUTLEFT", "L-T:combleft");
+
512  TGeoCompositeShape *cuttopleft = new TGeoCompositeShape("CUTTOPLEFT", "CUTLEFT - (S:transcuttop) - (S:transcutbottom)"); //triangular cut in the left lateral wall
+
513  TGeoVolume *volcuttopleft = new TGeoVolume("volcuttopleft", cuttopleft, Fe);
+
514  volcuttopleft->SetLineColor(kRed);
+
515 
+
516  //composite coil
+
517  TGeoBBox *IncoilBox = new TGeoBBox("IC", fCoilX/2,fCoilH2/2,(fMagnetZ-fCoilH1)/2);
+
518 
+
519  //circular arcs (first two options are radii, not half radii!)
+
520  Double_t OuterRadius = fCoilY + fCoilThickness;
521 
-
522  //composite coil
-
523  TGeoBBox *OutcoilBox = new TGeoBBox("OC", fCoilX/2, fCoilH1/2,fMagnetZ/2-fCoilH1/2);
-
524  TGeoBBox *IncoilBox = new TGeoBBox("IC", fCoilX/2,fCoilH2/2,(fMagnetZ-fCoilH1)/2);
-
525 
-
526  //circular arcs (first two options are radii, not half radii!)
-
527  Double_t OuterRadius = fCoilY + fCoilThickness;
-
528 
-
529  TGeoTubeSeg *Coillateraltuberightdown = new TGeoTubeSeg("Coillateraltuberightdown",fCoilThickness,OuterRadius, fCoilX/2,90,180);
-
530  TGeoTubeSeg *Coillateraltuberighttup = new TGeoTubeSeg("Coillateraltuberightup",fCoilThickness,OuterRadius, fCoilX/2,0,90);
-
531  TGeoTubeSeg *Coillateraltubeleftup = new TGeoTubeSeg("Coillateraltubeleftup",fCoilThickness,OuterRadius, fCoilX/2,270,360);
-
532  TGeoTubeSeg *Coillateraltubeleftdown = new TGeoTubeSeg("Coillateraltubeleftdown",fCoilThickness,OuterRadius, fCoilX/2,180,270);
-
533 
-
534  TGeoBBox *Coillateralcenter = new TGeoBBox("Coillateralcenter",fCoilX/2., (fCoilH2-2*fCoilThickness)/2, fCoilY/2.);
-
535 
-
536  TGeoRotation rottube("rottube",90,90,0);
-
537  //transformations to combine them
-
538  const TGeoTranslation transtube("transtube",0.,-(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
-
539  const TGeoTranslation transtube1("transtube1",0.,(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
-
540  const TGeoTranslation transtube2("transtube2",0.,-(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
-
541  const TGeoTranslation transtube3("transtube3",0.,(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
-
542  TGeoCombiTrans* combination = new TGeoCombiTrans(transtube,rottube);
-
543  TGeoCombiTrans* combination1 = new TGeoCombiTrans(transtube1,rottube);
-
544  TGeoCombiTrans* combination2 = new TGeoCombiTrans(transtube2,rottube);
-
545  TGeoCombiTrans* combination3 = new TGeoCombiTrans(transtube3,rottube);
-
546 
-
547  combination->SetName("combination");
-
548  combination->RegisterYourself();
-
549  combination1->SetName("combination1");
-
550  combination1->RegisterYourself();
-
551  combination2->SetName("combination2");
-
552  combination2->RegisterYourself();
-
553  combination3->SetName("combination3");
-
554  combination3->RegisterYourself();
-
555  //adding the shapes and making the volumes
-
556  TGeoCompositeShape * CoilRight = new TGeoCompositeShape("CoilRight","Coillateraltuberightdown:combination+Coillateraltuberightup:combination1+Coillateralcenter");
-
557  TGeoVolume *CoilVolright = new TGeoVolume("CoilVolright",CoilRight,Cu);
+
522  [[maybe_unused]] auto *Coillateraltuberightdown = new TGeoTubeSeg("Coillateraltuberightdown",fCoilThickness,OuterRadius, fCoilX/2,90,180);
+
523  [[maybe_unused]] auto *Coillateraltuberighttup = new TGeoTubeSeg("Coillateraltuberightup",fCoilThickness,OuterRadius, fCoilX/2,0,90);
+
524  [[maybe_unused]] auto *Coillateraltubeleftup = new TGeoTubeSeg("Coillateraltubeleftup",fCoilThickness,OuterRadius, fCoilX/2,270,360);
+
525  [[maybe_unused]] auto *Coillateraltubeleftdown = new TGeoTubeSeg("Coillateraltubeleftdown",fCoilThickness,OuterRadius, fCoilX/2,180,270);
+
526  [[maybe_unused]] auto *Coillateralcenter = new TGeoBBox("Coillateralcenter",fCoilX/2., (fCoilH2-2*fCoilThickness)/2, fCoilY/2.);
+
527 
+
528  TGeoRotation rottube("rottube",90,90,0);
+
529  //transformations to combine them
+
530  const TGeoTranslation transtube("transtube",0.,-(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
+
531  const TGeoTranslation transtube1("transtube1",0.,(fCoilH2-2*fCoilThickness)/2, -fCoilThickness-fCoilY/2);
+
532  const TGeoTranslation transtube2("transtube2",0.,-(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
+
533  const TGeoTranslation transtube3("transtube3",0.,(fCoilH2-2*fCoilThickness)/2,+fCoilThickness+fCoilY/2);
+
534  TGeoCombiTrans* combination = new TGeoCombiTrans(transtube,rottube);
+
535  TGeoCombiTrans* combination1 = new TGeoCombiTrans(transtube1,rottube);
+
536  TGeoCombiTrans* combination2 = new TGeoCombiTrans(transtube2,rottube);
+
537  TGeoCombiTrans* combination3 = new TGeoCombiTrans(transtube3,rottube);
+
538 
+
539  combination->SetName("combination");
+
540  combination->RegisterYourself();
+
541  combination1->SetName("combination1");
+
542  combination1->RegisterYourself();
+
543  combination2->SetName("combination2");
+
544  combination2->RegisterYourself();
+
545  combination3->SetName("combination3");
+
546  combination3->RegisterYourself();
+
547  //adding the shapes and making the volumes
+
548  TGeoCompositeShape * CoilRight = new TGeoCompositeShape("CoilRight","Coillateraltuberightdown:combination+Coillateraltuberightup:combination1+Coillateralcenter");
+
549  TGeoVolume *CoilVolright = new TGeoVolume("CoilVolright",CoilRight,Cu);
+
550 
+
551  TGeoCompositeShape * CoilLeft = new TGeoCompositeShape("CoilLeft","Coillateraltubeleftdown:combination2+Coillateraltubeleftup:combination3+Coillateralcenter");
+
552  TGeoVolume *CoilVolleft = new TGeoVolume("CoilVolleft",CoilLeft,Cu);
+
553 
+
554 
+
555 
+
556  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilX/2,fCoilY/2, (fMagnetZ-2*OuterRadius)/2); //two times the external radius
+
557  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",Coil, Cu);
558 
-
559  TGeoCompositeShape * CoilLeft = new TGeoCompositeShape("CoilLeft","Coillateraltubeleftdown:combination2+Coillateraltubeleftup:combination3+Coillateralcenter");
-
560  TGeoVolume *CoilVolleft = new TGeoVolume("CoilVolleft",CoilLeft,Cu);
-
561 
-
562 
+
559  //adding obtained volumes
+
560 
+
561  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fBaseY/2,0));
+
562  MagnetVol->AddNode(BaseVol,2, new TGeoTranslation(0,fMagnetY/2-fBaseY/2,0));
563 
-
564  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilX/2,fCoilY/2, (fMagnetZ-2*OuterRadius)/2); //two times the external radius
-
565  TGeoVolume *CoilVol = new TGeoVolume("CoilVol",Coil, Cu);
-
566 
-
567  //adding obtained volumes
-
568 
-
569  MagnetVol->AddNode(BaseVol,1, new TGeoTranslation(0,-fMagnetY/2+fBaseY/2,0));
-
570  MagnetVol->AddNode(BaseVol,2, new TGeoTranslation(0,fMagnetY/2-fBaseY/2,0));
+
564  MagnetVol->AddNode(volUpLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (fCutHeight + (fColumnY - fCutHeight)/2)/2 ,0));
+
565  MagnetVol->AddNode(volDownLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2,0));
+
566  MagnetVol->AddNode(volcuttop, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, 0, 0));
+
567 
+
568  MagnetVol->AddNode(volUpLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2 ,0));
+
569  MagnetVol->AddNode(volDownLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (+fCutHeight + (fColumnY - fCutHeight)/2)/2,0));
+
570  MagnetVol->AddNode(volcuttopleft,2, new TGeoTranslation(fMagnetX/2-fColumnX/2,0,0));
571 
-
572  MagnetVol->AddNode(volUpLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (fCutHeight + (fColumnY - fCutHeight)/2)/2 ,0));
-
573  MagnetVol->AddNode(volDownLateral, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2,0));
-
574  MagnetVol->AddNode(volcuttop, 1, new TGeoTranslation(-fMagnetX/2+fColumnX/2, 0, 0));
-
575 
-
576  MagnetVol->AddNode(volUpLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (-fCutHeight - (fColumnY - fCutHeight)/2)/2 ,0));
-
577  MagnetVol->AddNode(volDownLateral, 2, new TGeoTranslation(fMagnetX/2-fColumnX/2, (+fCutHeight + (fColumnY - fCutHeight)/2)/2,0));
-
578  MagnetVol->AddNode(volcuttopleft,2, new TGeoTranslation(fMagnetX/2-fColumnX/2,0,0));
+
572  CoilVolleft->SetLineColor(kGreen);
+
573  MagnetVol->AddNode(CoilVolleft,1,new TGeoTranslation(0,0,-fMagnetZ/2.+fCoilY/2.));
+
574  CoilVolright->SetLineColor(kGreen);
+
575  MagnetVol->AddNode(CoilVolright,1,new TGeoTranslation(0,0,+fMagnetZ/2.-fCoilY/2.));
+
576  CoilVol->SetLineColor(kGreen);
+
577  MagnetVol->AddNode(CoilVol,1,new TGeoTranslation(0,(fCoilH1+fCoilH2)/4,0));
+
578  MagnetVol->AddNode(CoilVol,2,new TGeoTranslation(0,-(fCoilH1+fCoilH2)/4,0));
579 
-
580  CoilVolleft->SetLineColor(kGreen);
-
581  MagnetVol->AddNode(CoilVolleft,1,new TGeoTranslation(0,0,-fMagnetZ/2.+fCoilY/2.));
-
582  CoilVolright->SetLineColor(kGreen);
-
583  MagnetVol->AddNode(CoilVolright,1,new TGeoTranslation(0,0,+fMagnetZ/2.-fCoilY/2.));
-
584  CoilVol->SetLineColor(kGreen);
-
585  MagnetVol->AddNode(CoilVol,1,new TGeoTranslation(0,(fCoilH1+fCoilH2)/4,0));
-
586  MagnetVol->AddNode(CoilVol,2,new TGeoTranslation(0,-(fCoilH1+fCoilH2)/4,0));
-
587 
-
588  //magnetized region
-
589 
-
590  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion",IncoilBox, air);
-
591  MagnetVol->AddNode(volMagRegion, 1, new TGeoTranslation(0,0,0));
-
592 
-
593  //pillars for the magnet
-
594  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
595  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
-
596  PillarVol->SetLineColor(kGreen+3);
-
597  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
598  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
-
599  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
600  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
-
601 
-
602 
-
603  if (fConstField){ //adding magnetic field if not implemented from nudet field map
-
604  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
-
605  TGeoUniformMagField *magField2 = new TGeoUniformMagField(fField,0.,0.); //magnetic field in target
-
606  TGeoUniformMagField *magField1y = new TGeoUniformMagField(0.,-fField,0.); //down return magnetic field along y
-
607  TGeoUniformMagField *magField2y = new TGeoUniformMagField(0.,fField,0.); //up return magnetic field along y
-
608 
-
609  BaseVol->SetField(magField1);
-
610  volUpLateral->SetField(magField2y);
-
611  volDownLateral->SetField(magField1y);
-
612  volMagRegion->SetField(magField2);
-
613  }
-
614  }
-
615 }
+
580  //magnetized region
+
581 
+
582  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion",IncoilBox, air);
+
583  MagnetVol->AddNode(volMagRegion, 1, new TGeoTranslation(0,0,0));
+
584 
+
585  //pillars for the magnet
+
586  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
587  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
+
588  PillarVol->SetLineColor(kGreen+3);
+
589  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
590  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ-fMagnetZ/2+fPillarZ/2));
+
591  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-fMagnetX/2+fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
592  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(fMagnetX/2-fPillarX/2,-fMagnetY/2-fPillarY/2, fCenterZ+fMagnetZ/2-fPillarZ/2));
+
593 
+
594 
+
595  if (fConstField){ //adding magnetic field if not implemented from nudet field map
+
596  TGeoUniformMagField *magField1 = new TGeoUniformMagField(-fField,0.,0.); //magnetic field in Magnet pillars
+
597  TGeoUniformMagField *magField2 = new TGeoUniformMagField(fField,0.,0.); //magnetic field in target
+
598  TGeoUniformMagField *magField1y = new TGeoUniformMagField(0.,-fField,0.); //down return magnetic field along y
+
599  TGeoUniformMagField *magField2y = new TGeoUniformMagField(0.,fField,0.); //up return magnetic field along y
+
600 
+
601  BaseVol->SetField(magField1);
+
602  volUpLateral->SetField(magField2y);
+
603  volDownLateral->SetField(magField1y);
+
604  volMagRegion->SetField(magField2);
+
605  }
+
606  }
+
607 }
Double_t mm
Double_t fColumnZ
@@ -823,7 +815,6 @@

r2

- diff --git a/classHpt.html b/classHpt.html index 5c4ac4fe85..e9bb0cb984 100644 --- a/classHpt.html +++ b/classHpt.html @@ -517,13 +517,13 @@

This method is an example of how to add your own point of type muonPoint to the clones array

-

Definition at line 409 of file HPT.cxx.

-
414 {
-
415  TClonesArray& clref = *fHptPointCollection;
-
416  Int_t size = clref.GetEntriesFast();
-
417 
-
418  return new(clref[size]) HptPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
-
419 }
+

Definition at line 406 of file HPT.cxx.

+
411 {
+
412  TClonesArray& clref = *fHptPointCollection;
+
413  Int_t size = clref.GetEntriesFast();
+
414 
+
415  return new(clref[size]) HptPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
+
416 }
@@ -649,85 +649,82 @@

232  if (fDesign == 3){

233  //Trackers that in design 3 follow the target --------------------------------------------------------------------------------------
234  TGeoVolume *volMagRegion=gGeoManager->GetVolume("volMagRegion");
-
235  TGeoVolume *volTarget =gGeoManager->GetVolume("volTarget");
-
236  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
-
237 
-
238  Double_t DZMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDZ() *2;
-
239  Double_t DYMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDY() *2;
-
240  Double_t DXMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDX() *2;
-
241 
-
242  Double_t DZTarget = ((TGeoBBox*) volTarget->GetShape())->GetDZ() *2;
-
243 
-
244  //HPT is DownStreamTracker
-
245  TGeoBBox *DT = new TGeoBBox("DT", DimX/2, DimY/2, DimZ/2);
-
246  TGeoVolume *volDT = new TGeoVolume("volDT",DT,HPTmat);
-
247  volDT->SetLineColor(kBlue-5);
-
248 
-
249  // Creating of SciFi modules in HPT
-
250  InitMedium("CarbonComposite");
-
251  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
+
235  TGeoVolume *volTarget =gGeoManager->GetVolume("volTarget");
+
236 
+
237  Double_t DZMagnetizedRegion = static_cast<TGeoBBox*> (volMagRegion->GetShape())->GetDZ() *2;
+
238 
+
239  Double_t DZTarget = static_cast<TGeoBBox*> (volTarget->GetShape())->GetDZ() *2;
+
240 
+
241  //HPT is DownStreamTracker
+
242  TGeoBBox *DT = new TGeoBBox("DT", DimX/2, DimY/2, DimZ/2);
+
243  TGeoVolume *volDT = new TGeoVolume("volDT",DT,HPTmat);
+
244  volDT->SetLineColor(kBlue-5);
+
245 
+
246  // Creating of SciFi modules in HPT
+
247  InitMedium("CarbonComposite");
+
248  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
+
249 
+
250  InitMedium("SciFiMat");
+
251  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
252 
-
253  InitMedium("SciFiMat");
-
254  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
+
253  InitMedium("Airex");
+
254  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
255 
-
256  InitMedium("Airex");
-
257  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
-
258 
-
259  //Support Carbon Composite
-
260  TGeoBBox* HPT_support_box = new TGeoBBox("HPT_support_box", HPTrackerX / 2, HPTrackerY / 2, support_z / 2);
-
261  TGeoVolume* HPT_support_volume = new TGeoVolume("HPT_support", HPT_support_box, CarbonComposite);
-
262  HPT_support_volume->SetLineColor(kGray - 2);
-
263  HPT_support_volume->SetVisibility(1);
-
264 
-
265  //Honeycomb Airex (or Nomex)
-
266  TGeoBBox* HPT_honeycomb_box = new TGeoBBox("HPT_honeycomb_box", HPTrackerX / 2, HPTrackerY / 2, honeycomb_z / 2);
-
267  TGeoVolume* HPT_honeycomb_volume = new TGeoVolume("HPT_honeycomb", HPT_honeycomb_box, Airex);
-
268  HPT_honeycomb_volume->SetLineColor(kYellow);
-
269  HPT_honeycomb_volume->SetVisibility(1);
-
270 
-
271  //SciFi planes
-
272  TGeoBBox* HPT_scifi_plane_hor_box = new TGeoBBox("HPT_scifi_plane_hor_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
-
273  TGeoVolume* HPT_scifi_plane_hor_volume = new TGeoVolume("HPT_scifi_plane_hor", HPT_scifi_plane_hor_box, SciFiMat);
-
274  HPT_scifi_plane_hor_volume->SetVisibility(1);
-
275 
-
276  TGeoBBox* HPT_scifi_plane_vert_box = new TGeoBBox("HPT_scifi_plane_vert_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
-
277  TGeoVolume* HPT_scifi_plane_vert_volume = new TGeoVolume("HPT_scifi_plane_vert", HPT_scifi_plane_vert_box, SciFiMat);
-
278  HPT_scifi_plane_vert_volume->SetVisibility(1);
-
279 
-
280  //SciFi mats
-
281  TGeoBBox* HPT_scifimat_hor_box = new TGeoBBox("HPT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
-
282  TGeoVolume* HPT_scifimat_hor_volume = new TGeoVolume("HPT_scifimat_hor", HPT_scifimat_hor_box, SciFiMat);
-
283  HPT_scifimat_hor_volume->SetLineColor(kCyan);
-
284 
-
285  TGeoBBox* HPT_scifimat_vert_box = new TGeoBBox("HPT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
-
286  TGeoVolume* HPT_scifimat_vert_volume = new TGeoVolume("HPT_scifimat_vert", HPT_scifimat_vert_box, SciFiMat);
-
287  HPT_scifimat_vert_volume->SetLineColor(kGreen);
+
256  //Support Carbon Composite
+
257  TGeoBBox* HPT_support_box = new TGeoBBox("HPT_support_box", HPTrackerX / 2, HPTrackerY / 2, support_z / 2);
+
258  TGeoVolume* HPT_support_volume = new TGeoVolume("HPT_support", HPT_support_box, CarbonComposite);
+
259  HPT_support_volume->SetLineColor(kGray - 2);
+
260  HPT_support_volume->SetVisibility(1);
+
261 
+
262  //Honeycomb Airex (or Nomex)
+
263  TGeoBBox* HPT_honeycomb_box = new TGeoBBox("HPT_honeycomb_box", HPTrackerX / 2, HPTrackerY / 2, honeycomb_z / 2);
+
264  TGeoVolume* HPT_honeycomb_volume = new TGeoVolume("HPT_honeycomb", HPT_honeycomb_box, Airex);
+
265  HPT_honeycomb_volume->SetLineColor(kYellow);
+
266  HPT_honeycomb_volume->SetVisibility(1);
+
267 
+
268  //SciFi planes
+
269  TGeoBBox* HPT_scifi_plane_hor_box = new TGeoBBox("HPT_scifi_plane_hor_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
+
270  TGeoVolume* HPT_scifi_plane_hor_volume = new TGeoVolume("HPT_scifi_plane_hor", HPT_scifi_plane_hor_box, SciFiMat);
+
271  HPT_scifi_plane_hor_volume->SetVisibility(1);
+
272 
+
273  TGeoBBox* HPT_scifi_plane_vert_box = new TGeoBBox("HPT_scifi_plane_vert_box", HPTrackerX / 2, HPTrackerY / 2, scifimat_z / 2);
+
274  TGeoVolume* HPT_scifi_plane_vert_volume = new TGeoVolume("HPT_scifi_plane_vert", HPT_scifi_plane_vert_box, SciFiMat);
+
275  HPT_scifi_plane_vert_volume->SetVisibility(1);
+
276 
+
277  //SciFi mats
+
278  TGeoBBox* HPT_scifimat_hor_box = new TGeoBBox("HPT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
+
279  TGeoVolume* HPT_scifimat_hor_volume = new TGeoVolume("HPT_scifimat_hor", HPT_scifimat_hor_box, SciFiMat);
+
280  HPT_scifimat_hor_volume->SetLineColor(kCyan);
+
281 
+
282  TGeoBBox* HPT_scifimat_vert_box = new TGeoBBox("HPT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
+
283  TGeoVolume* HPT_scifimat_vert_volume = new TGeoVolume("HPT_scifimat_vert", HPT_scifimat_vert_box, SciFiMat);
+
284  HPT_scifimat_vert_volume->SetLineColor(kGreen);
+
285 
+
286  AddSensitiveVolume(HPT_scifimat_hor_volume);
+
287  AddSensitiveVolume(HPT_scifimat_vert_volume);
288 
-
289  AddSensitiveVolume(HPT_scifimat_hor_volume);
-
290  AddSensitiveVolume(HPT_scifimat_vert_volume);
-
291 
-
292  // Creating physical volumes and multiply
-
293  for (int i = 0; i < n_hor_planes; i++){
-
294  HPT_scifi_plane_hor_volume->AddNode(HPT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
+
289  // Creating physical volumes and multiply
+
290  for (int i = 0; i < n_hor_planes; i++){
+
291  HPT_scifi_plane_hor_volume->AddNode(HPT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
+
292  }
+
293  for (int i = 0; i < n_vert_planes; i++){
+
294  HPT_scifi_plane_vert_volume->AddNode(HPT_scifimat_vert_volume, 100+i+1 , new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
295  }
-
296  for (int i = 0; i < n_vert_planes; i++){
-
297  HPT_scifi_plane_vert_volume->AddNode(HPT_scifimat_vert_volume, 100+i+1 , new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
-
298  }
-
299 
-
300  volDT->AddNode(HPT_support_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z / 2));
-
301  volDT->AddNode(HPT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z / 2));
-
302  volDT->AddNode(HPT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z + scifimat_z / 2));
-
303  volDT->AddNode(HPT_honeycomb_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z / 2));
-
304  volDT->AddNode(HPT_support_volume, 1, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z + support_z / 2));
-
306 
-
307  Double_t first_DT_position = -DZMagnetizedRegion/2 + DZTarget + DimZ/2;
-
308  for(int i=0;i<fnHPT;i++){
-
309  for (int j = 0; j < fntarget; j++){
-
310  volMagRegion->AddNode(volDT,(i+1)*1000+j*fnHPT,new TGeoTranslation(0,0, first_DT_position + i*(fDistance+DimZ) + j*(DZTarget+ fnHPT * DimZ + (fnHPT-1)*fDistance)));
-
311  }
-
312  }
-
313  }
-
314 }
+
296 
+
297  volDT->AddNode(HPT_support_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z / 2));
+
298  volDT->AddNode(HPT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z / 2));
+
299  volDT->AddNode(HPT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + scifimat_z + scifimat_z / 2));
+
300  volDT->AddNode(HPT_honeycomb_volume, 0, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z / 2));
+
301  volDT->AddNode(HPT_support_volume, 1, new TGeoTranslation(0, 0, - DimZ / 2 + support_z + 2 * scifimat_z + honeycomb_z + support_z / 2));
+
303 
+
304  Double_t first_DT_position = -DZMagnetizedRegion/2 + DZTarget + DimZ/2;
+
305  for(int i=0;i<fnHPT;i++){
+
306  for (int j = 0; j < fntarget; j++){
+
307  volMagRegion->AddNode(volDT,(i+1)*1000+j*fnHPT,new TGeoTranslation(0,0, first_DT_position + i*(fDistance+DimZ) + j*(DZTarget+ fnHPT * DimZ + (fnHPT-1)*fDistance)));
+
308  }
+
309  }
+
310  }
+
311 }
Double_t cm
Double_t scifimat_width
Definition: HPT.h:124
Double_t HPTrackerY
Definition: HPT.h:121
@@ -837,18 +834,18 @@

-

Definition at line 384 of file HPT.cxx.

-
385 {
-
386  nHPT = detID/1000;
-
387  int idir = (detID - nHPT*1000)/100;
+

Definition at line 381 of file HPT.cxx.

+
382 {
+
383  nHPT = detID/1000;
+
384  int idir = (detID - nHPT*1000)/100;
+
385 
+
386  if (idir == 1) ishor = kFALSE;
+
387  else if (idir == 0) ishor = kTRUE;
388 
-
389  if (idir == 1) ishor = kFALSE;
-
390  else if (idir == 0) ishor = kTRUE;
+
389  nplane = (detID - nHPT*1000 - idir*100);
+
390 
391 
-
392  nplane = (detID - nHPT*1000 - idir*100);
-
393 
-
394 
-
395 }
+
392 }
@@ -876,10 +873,10 @@

-

Definition at line 363 of file HPT.cxx.

-
364 {
-
365  fHptPointCollection->Clear();
-
366 }
+

Definition at line 360 of file HPT.cxx.

+
361 {
+
362  fHptPointCollection->Clear();
+
363 }

@@ -964,11 +961,11 @@

Gets the produced collections

-

Definition at line 397 of file HPT.cxx.

-
398 {
-
399  if (iColl == 0) { return fHptPointCollection; }
-
400  else { return NULL; }
-
401 }
+

Definition at line 394 of file HPT.cxx.

+
395 {
+
396  if (iColl == 0) { return fHptPointCollection; }
+
397  else { return NULL; }
+
398 }
@@ -1218,53 +1215,53 @@

Definition at line 316 of file HPT.cxx.

-
317 {
-
319  //Set parameters at entrance of volume. Reset ELoss.
-
320  if ( gMC->IsTrackEntering() ) {
-
321  fELoss = 0.;
-
322  fTime = gMC->TrackTime() * 1.0e09;
-
323  fLength = gMC->TrackLength();
-
324  gMC->TrackPosition(fPos);
-
325  gMC->TrackMomentum(fMom);
-
326  }
-
327  // Sum energy loss for all steps in the active volume
-
328  fELoss += gMC->Edep();
-
329 
-
330  // Create muonPoint at exit of active volume
-
331  if ( gMC->IsTrackExiting() ||
-
332  gMC->IsTrackStop() ||
-
333  gMC->IsTrackDisappeared() ){
-
334  if (fELoss == 0. ) { return kFALSE; }
-
335  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
336  Int_t pdgCode = p->GetPdgCode();
-
337  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
338 
-
339  gMC->CurrentVolID(fVolumeID);
-
340  Int_t detID = fVolumeID;
-
341  Int_t TTstationID;
-
342  gMC->CurrentVolOffID(2, TTstationID);
-
343  fVolumeID = TTstationID + detID;
-
344 
-
345  TLorentzVector Pos;
-
346  gMC->TrackPosition(Pos);
-
347  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
348  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
349  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
350 
-
351  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
-
352  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
-
353  fTime, fLength,fELoss, pdgCode);
-
354 
-
355  // Increment number of muon det points in TParticle
-
356  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
357  stack->AddPoint(ktauRpc);
-
358  }
-
359 
-
360  return kTRUE;
-
361 }
+

Definition at line 313 of file HPT.cxx.

+
314 {
+
316  //Set parameters at entrance of volume. Reset ELoss.
+
317  if ( gMC->IsTrackEntering() ) {
+
318  fELoss = 0.;
+
319  fTime = gMC->TrackTime() * 1.0e09;
+
320  fLength = gMC->TrackLength();
+
321  gMC->TrackPosition(fPos);
+
322  gMC->TrackMomentum(fMom);
+
323  }
+
324  // Sum energy loss for all steps in the active volume
+
325  fELoss += gMC->Edep();
+
326 
+
327  // Create muonPoint at exit of active volume
+
328  if ( gMC->IsTrackExiting() ||
+
329  gMC->IsTrackStop() ||
+
330  gMC->IsTrackDisappeared() ){
+
331  if (fELoss == 0. ) { return kFALSE; }
+
332  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
333  Int_t pdgCode = p->GetPdgCode();
+
334  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
335 
+
336  gMC->CurrentVolID(fVolumeID);
+
337  Int_t detID = fVolumeID;
+
338  Int_t TTstationID;
+
339  gMC->CurrentVolOffID(2, TTstationID);
+
340  fVolumeID = TTstationID + detID;
+
341 
+
342  TLorentzVector Pos;
+
343  gMC->TrackPosition(Pos);
+
344  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
345  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
346  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
+
347 
+
348  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
+
349  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
+
350  fTime, fLength,fELoss, pdgCode);
+
351 
+
352  // Increment number of muon det points in TParticle
+
353  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
354  stack->AddPoint(ktauRpc);
+
355  }
+
356 
+
357  return kTRUE;
+
358 }
@ ktauRpc
-
HptPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: HPT.cxx:409
+
HptPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: HPT.cxx:406
@@ -1298,12 +1295,12 @@

HptPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

-

Definition at line 369 of file HPT.cxx.

-
370 {
-
371 
-
378  FairRootManager::Instance()->Register("HptPoint", "Hpt",
-
379  fHptPointCollection, kTRUE);
-
380 }
+

Definition at line 366 of file HPT.cxx.

+
367 {
+
368 
+
375  FairRootManager::Instance()->Register("HptPoint", "Hpt",
+
376  fHptPointCollection, kTRUE);
+
377 }

@@ -1332,10 +1329,10 @@

Definition at line 403 of file HPT.cxx.

-
404 {
-
405  fHptPointCollection->Clear();
-
406 }
+

Definition at line 400 of file HPT.cxx.

+
401 {
+
402  fHptPointCollection->Clear();
+
403 }

diff --git a/classNuTauMudet.html b/classNuTauMudet.html index ce9494db39..71765be568 100644 --- a/classNuTauMudet.html +++ b/classNuTauMudet.html @@ -622,14 +622,14 @@

This method is an example of how to add your own point of type muonPoint to the clones array

-

Definition at line 937 of file NuTauMudet.cxx.

-
942 {
-
943  TClonesArray& clref = *fShipRpcPointCollection;
-
944  Int_t size = clref.GetEntriesFast();
-
945  //cout << "ShipRpctau hit called"<< pos.z()<<endl;
-
946  // return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode,NArm, NRpc, NHpt);
-
947  return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
-
948 }
+

Definition at line 931 of file NuTauMudet.cxx.

+
936 {
+
937  TClonesArray& clref = *fShipRpcPointCollection;
+
938  Int_t size = clref.GetEntriesFast();
+
939  //cout << "ShipRpctau hit called"<< pos.z()<<endl;
+
940  // return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode,NArm, NRpc, NHpt);
+
941  return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
+
942 }
@@ -741,520 +741,514 @@

315  TGeoUniformMagField *retFieldU = new TGeoUniformMagField(0.,0.,-fField); //magnetic field up return yoke

316  TGeoUniformMagField *retFieldL = new TGeoUniformMagField(0.,0.,fField); //magnetic field low return yoke
317 
-
318  Double_t d = 0;
-
319 
-
320  if(fDesign<3)
-
321  {
-
322  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volNuTauMudet");
-
323  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,10*cm,fZcenter));
-
324 
-
325  TGeoBBox *UpYokeBox = new TGeoBBox("UpYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
-
326  TGeoVolume *volUpYoke = new TGeoVolume("volUpYoke",UpYokeBox,air);
-
327  volMudetBox->AddNode(volUpYoke,1,new TGeoTranslation(0,fYtot/2 - fYRyoke/2,0));
-
328  volUpYoke->SetField(retFieldU);
-
329 
-
330 
-
331  TGeoBBox *FeYoke = new TGeoBBox("FeYoke",fXtot/2, fYRyoke/2, fZArm/2);
-
332  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke",FeYoke,Iron);
-
333  volFeYoke->SetLineColor(kGray+1);
-
334 
-
335  TGeoBBox *FeYoke1 = new TGeoBBox("FeYoke1",fXtot/2, fYRyoke_s/2, fZRyoke_s/2);
-
336  TGeoVolume *volFeYoke1 = new TGeoVolume("volFeYoke1",FeYoke1,Iron);
-
337  volFeYoke1->SetLineColor(kGray+1);
-
338 
-
339  TGeoBBox *CoilContainer = new TGeoBBox("CoilContainer",fXtot/2, fCoilH/2, 40*cm);
-
340  TGeoVolume *volCoilContainer = new TGeoVolume("volCoilContainer",CoilContainer,air);
-
341 
-
342  TGeoBBox *Coil = new TGeoBBox("Coil",fXtot/2, fCoilH/2, fCoilW/2);
-
343  TGeoVolume *volCoil = new TGeoVolume("volCoil",Coil,Cu);
-
344  volCoil->SetLineColor(kOrange -5);
-
345  for(int i = 0; i < fNCoil; i++)
-
346  {
-
347  volCoilContainer->AddNode(volCoil, i, new TGeoTranslation(0,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
348  }
-
349 
-
350  //vertical coils
-
351  TGeoBBox *CoilV = new TGeoBBox("CoilV",fCoilH/2, fYRyoke/2 , fCoilW/2);
-
352  TGeoVolume *volCoilV = new TGeoVolume("volCoilV",CoilV,Cu);
-
353  volCoilV->SetLineColor(kOrange -5);
-
354  for(int i = 0; i < fNCoil; i++)
-
355  {
-
356  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
357  }
-
358  for(int i = 0; i < fNCoil; i++)
-
359  {
-
360  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
361  }
+
318  if(fDesign<3)
+
319  {
+
320  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volNuTauMudet");
+
321  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,10*cm,fZcenter));
+
322 
+
323  TGeoBBox *UpYokeBox = new TGeoBBox("UpYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
+
324  TGeoVolume *volUpYoke = new TGeoVolume("volUpYoke",UpYokeBox,air);
+
325  volMudetBox->AddNode(volUpYoke,1,new TGeoTranslation(0,fYtot/2 - fYRyoke/2,0));
+
326  volUpYoke->SetField(retFieldU);
+
327 
+
328 
+
329  TGeoBBox *FeYoke = new TGeoBBox("FeYoke",fXtot/2, fYRyoke/2, fZArm/2);
+
330  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke",FeYoke,Iron);
+
331  volFeYoke->SetLineColor(kGray+1);
+
332 
+
333  TGeoBBox *FeYoke1 = new TGeoBBox("FeYoke1",fXtot/2, fYRyoke_s/2, fZRyoke_s/2);
+
334  TGeoVolume *volFeYoke1 = new TGeoVolume("volFeYoke1",FeYoke1,Iron);
+
335  volFeYoke1->SetLineColor(kGray+1);
+
336 
+
337  TGeoBBox *CoilContainer = new TGeoBBox("CoilContainer",fXtot/2, fCoilH/2, 40*cm);
+
338  TGeoVolume *volCoilContainer = new TGeoVolume("volCoilContainer",CoilContainer,air);
+
339 
+
340  TGeoBBox *Coil = new TGeoBBox("Coil",fXtot/2, fCoilH/2, fCoilW/2);
+
341  TGeoVolume *volCoil = new TGeoVolume("volCoil",Coil,Cu);
+
342  volCoil->SetLineColor(kOrange -5);
+
343  for(int i = 0; i < fNCoil; i++)
+
344  {
+
345  volCoilContainer->AddNode(volCoil, i, new TGeoTranslation(0,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
346  }
+
347 
+
348  //vertical coils
+
349  TGeoBBox *CoilV = new TGeoBBox("CoilV",fCoilH/2, fYRyoke/2 , fCoilW/2);
+
350  TGeoVolume *volCoilV = new TGeoVolume("volCoilV",CoilV,Cu);
+
351  volCoilV->SetLineColor(kOrange -5);
+
352  for(int i = 0; i < fNCoil; i++)
+
353  {
+
354  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
355  }
+
356  for(int i = 0; i < fNCoil; i++)
+
357  {
+
358  volUpYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
359  }
+
360 
+
361  //cout <<"fZArm: " << fZArm<< endl;
362 
-
363  //cout <<"fZArm: " << fZArm<< endl;
-
364 
-
365  volUpYoke->AddNode(volFeYoke,1, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
-
366  volUpYoke->AddNode(volFeYoke,2, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
-
367  volUpYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
-
368  volUpYoke->AddNode(volCoilContainer,1,new TGeoTranslation(0,fYRyoke/2 - fCoilH/2,0)); //up
-
369  volUpYoke->AddNode(volCoilContainer,2,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
-
370 
-
371  TGeoBBox *LowYokeBox = new TGeoBBox("LowYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
-
372  TGeoVolume *volLowYoke = new TGeoVolume("volLowYoke",LowYokeBox,air);
-
373  volMudetBox->AddNode(volLowYoke,1,new TGeoTranslation(0,-fYtot/2 + fYRyoke/2,0));
-
374  volLowYoke->SetField(retFieldL);
-
375 
-
376  //vertical coils
-
377  for(int i = 0; i < fNCoil; i++)
-
378  {
-
379  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
380  }
-
381  for(int i = 0; i < fNCoil; i++)
-
382  {
-
383  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
-
384  }
-
385 
-
386  volLowYoke->AddNode(volFeYoke,3, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
-
387  volLowYoke->AddNode(volFeYoke,4, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
-
388  volLowYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
-
389  volLowYoke->AddNode(volCoilContainer,3,new TGeoTranslation(0,fYRyoke/2- fCoilH/2,0)); //up
-
390  volLowYoke->AddNode(volCoilContainer,4,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
-
391 
-
392  Int_t ArmNumber = 1;
-
393  TGeoBBox *Arm1Box = new TGeoBBox("Arm1MudetBox", fXFe/2, fYFe/2, fZArm/2);
-
394  TGeoVolume *volArm1 = new TGeoVolume("volArm1Mudet", Arm1Box,air);
-
395  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field arm1
-
396  volArm1->SetField(magField1);
-
397  volMudetBox ->AddNode(volArm1,ArmNumber,new TGeoTranslation(0,0,-(fGapMiddle+fZArm)/2));
+
363  volUpYoke->AddNode(volFeYoke,1, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
+
364  volUpYoke->AddNode(volFeYoke,2, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
+
365  volUpYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
+
366  volUpYoke->AddNode(volCoilContainer,1,new TGeoTranslation(0,fYRyoke/2 - fCoilH/2,0)); //up
+
367  volUpYoke->AddNode(volCoilContainer,2,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
+
368 
+
369  TGeoBBox *LowYokeBox = new TGeoBBox("LowYokeBox", fXRyoke/2, fYRyoke/2, fZRyoke/2);
+
370  TGeoVolume *volLowYoke = new TGeoVolume("volLowYoke",LowYokeBox,air);
+
371  volMudetBox->AddNode(volLowYoke,1,new TGeoTranslation(0,-fYtot/2 + fYRyoke/2,0));
+
372  volLowYoke->SetField(retFieldL);
+
373 
+
374  //vertical coils
+
375  for(int i = 0; i < fNCoil; i++)
+
376  {
+
377  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(fXRyoke/2 - fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
378  }
+
379  for(int i = 0; i < fNCoil; i++)
+
380  {
+
381  volLowYoke->AddNode(volCoilV, i, new TGeoTranslation(-fXRyoke/2 + fCoilH/2,0, -40*cm + fCoilW/2 + i*(fCoilGap + fCoilW)));
+
382  }
+
383 
+
384  volLowYoke->AddNode(volFeYoke,3, new TGeoTranslation(0,0,- (fZArm + fGapMiddle)/2));
+
385  volLowYoke->AddNode(volFeYoke,4, new TGeoTranslation(0,0,(fZArm + fGapMiddle)/2));
+
386  volLowYoke->AddNode(volFeYoke1,1,new TGeoTranslation(0,0,0));
+
387  volLowYoke->AddNode(volCoilContainer,3,new TGeoTranslation(0,fYRyoke/2- fCoilH/2,0)); //up
+
388  volLowYoke->AddNode(volCoilContainer,4,new TGeoTranslation(0,-fYRyoke/2 + fCoilH/2,0)); //low
+
389 
+
390  Int_t ArmNumber = 1;
+
391  TGeoBBox *Arm1Box = new TGeoBBox("Arm1MudetBox", fXFe/2, fYFe/2, fZArm/2);
+
392  TGeoVolume *volArm1 = new TGeoVolume("volArm1Mudet", Arm1Box,air);
+
393  TGeoUniformMagField *magField1 = new TGeoUniformMagField(0.,-fField,0.); //magnetic field arm1
+
394  volArm1->SetField(magField1);
+
395  volMudetBox ->AddNode(volArm1,ArmNumber,new TGeoTranslation(0,0,-(fGapMiddle+fZArm)/2));
+
396 
+
397  Int_t nr = ArmNumber*1E4;
398 
-
399  Int_t nr = ArmNumber*1E4;
-
400 
-
401  TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
-
402  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
-
403  //volIron->SetField(magField1);
-
404 
-
405  for(Int_t i = 0; i < fNFe; i++)
-
406  {
-
407  volArm1->AddNode(volIron,nr + 100 + i, new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
-
408  }
-
409 
-
410 
-
411  TGeoBBox *RpcContainer = new TGeoBBox("RpcContainer", fXRpc/2, fYRpc/2, fZRpc/2);
-
412  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
-
413 
-
414  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
-
415  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
-
416  volStrip->SetLineColor(kRed);
-
417  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
-
418  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
-
419  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
-
420  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
-
421  volPETinsulator->SetLineColor(kYellow);
-
422  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
-
423  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
-
424  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
-
425  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
-
426  volElectrode->SetLineColor(kGreen);
-
427  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
-
428  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
-
429  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXGas/2, fYGas/2, fZGas/2);
-
430  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
-
431  volRpc->SetLineColor(kCyan);
-
432  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
+
399  TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
+
400  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
+
401  //volIron->SetField(magField1);
+
402 
+
403  for(Int_t i = 0; i < fNFe; i++)
+
404  {
+
405  volArm1->AddNode(volIron,nr + 100 + i, new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
+
406  }
+
407 
+
408 
+
409  TGeoBBox *RpcContainer = new TGeoBBox("RpcContainer", fXRpc/2, fYRpc/2, fZRpc/2);
+
410  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
+
411 
+
412  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
+
413  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
+
414  volStrip->SetLineColor(kRed);
+
415  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
+
416  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
+
417  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
+
418  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
+
419  volPETinsulator->SetLineColor(kYellow);
+
420  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
+
421  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
+
422  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
+
423  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
+
424  volElectrode->SetLineColor(kGreen);
+
425  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
+
426  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
+
427  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXGas/2, fYGas/2, fZGas/2);
+
428  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
+
429  volRpc->SetLineColor(kCyan);
+
430  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
+
431 
+
432  AddSensitiveVolume(volRpc);
433 
-
434  AddSensitiveVolume(volRpc);
-
435 
-
436  for(Int_t i = 0; i < fNRpc; i++)
-
437  {
-
438  volArm1->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
-
439  }
-
440 
-
441  ArmNumber = 2;
-
442  nr = ArmNumber*1E4;
-
443 
-
444  TGeoBBox *Arm2Box = new TGeoBBox("Arm2MudetBox",fXFe/2, fYFe/2, fZArm/2);
-
445  TGeoVolume *volArm2 = new TGeoVolume("volArm2Mudet", Arm2Box,air);
-
446  TGeoUniformMagField *magField2 = new TGeoUniformMagField(0.,fField,0.); //magnetic field arm2
-
447  volArm2->SetField(magField2);
-
448  volMudetBox ->AddNode(volArm2,1,new TGeoTranslation(0,0,(fGapMiddle+fZArm)/2));
-
449  TGeoVolume *volIron2 = new TGeoVolume("volIron2",IronLayer,Iron);
+
434  for(Int_t i = 0; i < fNRpc; i++)
+
435  {
+
436  volArm1->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
+
437  }
+
438 
+
439  ArmNumber = 2;
+
440  nr = ArmNumber*1E4;
+
441 
+
442  TGeoBBox *Arm2Box = new TGeoBBox("Arm2MudetBox",fXFe/2, fYFe/2, fZArm/2);
+
443  TGeoVolume *volArm2 = new TGeoVolume("volArm2Mudet", Arm2Box,air);
+
444  TGeoUniformMagField *magField2 = new TGeoUniformMagField(0.,fField,0.); //magnetic field arm2
+
445  volArm2->SetField(magField2);
+
446  volMudetBox ->AddNode(volArm2,1,new TGeoTranslation(0,0,(fGapMiddle+fZArm)/2));
+
447  TGeoVolume *volIron2 = new TGeoVolume("volIron2",IronLayer,Iron);
+
448 
+
449  //different volumes for second arm
450 
-
451  //different volumes for second arm
-
452 
-
453  TGeoVolume *volRpcContainer2 = new TGeoVolume("volRpcContainer2",RpcContainer,air);
-
454  TGeoVolume *volStrip2 = new TGeoVolume("volStrip2",Strip,Cu);
-
455 
-
456  volStrip2->SetLineColor(kRed);
-
457  volRpcContainer2->AddNode(volStrip2,1,new TGeoTranslation (0,0,-3.25*mm));
-
458  volRpcContainer2->AddNode(volStrip2,2,new TGeoTranslation (0,0,3.25*mm));
-
459 
-
460  TGeoVolume *volPETinsulator2 = new TGeoVolume("volPETinsulator2", PETinsulator, bakelite);
-
461  volPETinsulator2->SetLineColor(kYellow);
-
462  volRpcContainer2->AddNode(volPETinsulator2,1,new TGeoTranslation(0,0,-3.1*mm));
-
463  volRpcContainer2->AddNode(volPETinsulator2,2,new TGeoTranslation(0,0, 3.1*mm));
-
464 
-
465  TGeoVolume *volElectrode2 = new TGeoVolume("volElectrode2",Electrode,bakelite);
-
466  volElectrode2->SetLineColor(kGreen);
-
467  volRpcContainer2->AddNode(volElectrode2,1,new TGeoTranslation(0,0,-2*mm));
-
468  volRpcContainer2->AddNode(volElectrode2,2,new TGeoTranslation(0,0, 2*mm));
-
469 
-
470  TGeoVolume *volRpc2 = new TGeoVolume("volRpc2",RpcGas,RPCmat);
-
471  volRpc2->SetLineColor(kCyan);
-
472  volRpcContainer2->AddNode(volRpc2,1,new TGeoTranslation(0,0,0));
-
473  AddSensitiveVolume(volRpc2);
-
474 
-
475  for(Int_t i = 0; i < fNFe; i++)
-
476  {
-
477  volArm2->AddNode(volIron2,nr + 100 + i,new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
-
478  }
-
479 
-
480  for(Int_t i = 0; i < fNRpc; i++)
-
481  {
-
482  volArm2->AddNode(volRpcContainer2, nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
-
483  }
-
484 
-
485  //10 cm of Concrete on which the whole Magnetic Spectrometer volume (HPT included) will be placed
-
486  TGeoBBox *Base = new TGeoBBox("Base", fXtot/2, 10*cm/2, fZtot/2);
-
487  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
-
488  volBase->SetLineColor(kYellow-3);
+
451  TGeoVolume *volRpcContainer2 = new TGeoVolume("volRpcContainer2",RpcContainer,air);
+
452  TGeoVolume *volStrip2 = new TGeoVolume("volStrip2",Strip,Cu);
+
453 
+
454  volStrip2->SetLineColor(kRed);
+
455  volRpcContainer2->AddNode(volStrip2,1,new TGeoTranslation (0,0,-3.25*mm));
+
456  volRpcContainer2->AddNode(volStrip2,2,new TGeoTranslation (0,0,3.25*mm));
+
457 
+
458  TGeoVolume *volPETinsulator2 = new TGeoVolume("volPETinsulator2", PETinsulator, bakelite);
+
459  volPETinsulator2->SetLineColor(kYellow);
+
460  volRpcContainer2->AddNode(volPETinsulator2,1,new TGeoTranslation(0,0,-3.1*mm));
+
461  volRpcContainer2->AddNode(volPETinsulator2,2,new TGeoTranslation(0,0, 3.1*mm));
+
462 
+
463  TGeoVolume *volElectrode2 = new TGeoVolume("volElectrode2",Electrode,bakelite);
+
464  volElectrode2->SetLineColor(kGreen);
+
465  volRpcContainer2->AddNode(volElectrode2,1,new TGeoTranslation(0,0,-2*mm));
+
466  volRpcContainer2->AddNode(volElectrode2,2,new TGeoTranslation(0,0, 2*mm));
+
467 
+
468  TGeoVolume *volRpc2 = new TGeoVolume("volRpc2",RpcGas,RPCmat);
+
469  volRpc2->SetLineColor(kCyan);
+
470  volRpcContainer2->AddNode(volRpc2,1,new TGeoTranslation(0,0,0));
+
471  AddSensitiveVolume(volRpc2);
+
472 
+
473  for(Int_t i = 0; i < fNFe; i++)
+
474  {
+
475  volArm2->AddNode(volIron2,nr + 100 + i,new TGeoTranslation(0, 0, -fZArm/2+i*(fZFe +fZRpc) +fZFe/2));
+
476  }
+
477 
+
478  for(Int_t i = 0; i < fNRpc; i++)
+
479  {
+
480  volArm2->AddNode(volRpcContainer2, nr + i,new TGeoTranslation(0, -fYFe/2 + fYRpc/2, -fZArm/2+(i+1)*fZFe + i*fZRpc +fZRpc/2));
+
481  }
+
482 
+
483  //10 cm of Concrete on which the whole Magnetic Spectrometer volume (HPT included) will be placed
+
484  TGeoBBox *Base = new TGeoBBox("Base", fXtot/2, 10*cm/2, fZtot/2);
+
485  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
+
486  volBase->SetLineColor(kYellow-3);
+
487 
+
488  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-fYtot/2 + 10*cm/2,fZcenter));
489 
-
490  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-fYtot/2 + 10*cm/2,fZcenter));
-
491 
-
492 
-
493  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
494  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
-
495  Pillar1Vol->SetLineColor(kGreen+3);
-
496 
-
497  tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
-
498  tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
-
499  tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
-
500  tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
-
501  }
-
502  if(fDesign==3)
-
503  {
-
504  Double_t supportasymmetry = fUpSuppY - fLowSuppY; //upper and lower support have different dimensions, so the mother box must be large enough to contain both
-
505  Int_t nr = 1E4;
+
490 
+
491  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
492  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
+
493  Pillar1Vol->SetLineColor(kGreen+3);
+
494 
+
495  tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
+
496  tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZArm/2 - fGapMiddle/2 +fPillarZ/2));
+
497  tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
+
498  tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZArm/2+fGapMiddle/2-fPillarZ/2));
+
499  }
+
500  if(fDesign==3)
+
501  {
+
502  Int_t nr = 1E4;
+
503 
+
504  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volTauNuMudet");
+
505  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,0,fZcenter));
506 
-
507  TGeoVolumeAssembly *volMudetBox = new TGeoVolumeAssembly("volTauNuMudet");
-
508  tTauNuDet->AddNode(volMudetBox, 1, new TGeoTranslation(0,0,fZcenter));
-
509 
-
510  TGeoBBox *IronLayer = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFe/2);
-
511  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
-
512  volIron->SetLineColor(kGray);
+
507  TGeoBBox *IronLayer = new TGeoBBox("MUDETIRON",fXFe/2, fYFe/2, fZFe/2);
+
508  TGeoVolume *volIron = new TGeoVolume("volIron",IronLayer,Iron);
+
509  volIron->SetLineColor(kGray);
+
510 
+
511  auto* IronLayer1 = new TGeoBBox("MUDETIRON1",fXFe/2, fYFe/2, fZFethin/2);
+
512  //***********************ADDING EXTERNAL DETAILS TO THE MUON FILTER
513 
-
514  TGeoBBox *IronLayer1 = new TGeoBBox("Iron",fXFe/2, fYFe/2, fZFethin/2);
-
515  TGeoVolume *volIron1 = new TGeoVolume("volIron1",IronLayer1,Iron);
-
516  //***********************ADDING EXTERNAL DETAILS TO THE MUON FILTER
-
517 
-
518  //********UPPER COVER***********
-
519 
-
520  TGeoBBox *UpperCover = new TGeoBBox("UpperCover",fXCov/2, fYCov/2, fZCov/2);
-
521  TGeoVolume *volUpperCover = new TGeoVolume("volUpperCover",UpperCover, Al);
-
522  volUpperCover->SetLineColor(kYellow-7);
-
523  volMudetBox->AddNode(volUpperCover, 1, new TGeoTranslation(0, fYFe/2+fYCov/2+fUpSuppY, -fZtot/2 + fZCov/2));
-
524 
-
525  //**********LATERAL COVER**********
-
526 
-
527  TGeoBBox *LateralCover = new TGeoBBox("LateralCover",fXLateral/2, fYLateral/2, fZLateral/2);
-
528  TGeoVolume *volLateralCover = new TGeoVolume("volLateralCover",LateralCover, Al);
-
529  volLateralCover->SetLineColor(kYellow-7);
-
530  volMudetBox->AddNode(volLateralCover, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low right
-
531  volMudetBox->AddNode(volLateralCover, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low left
-
532  volMudetBox->AddNode(volLateralCover, 3, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up right
-
533  volMudetBox->AddNode(volLateralCover, 4, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up left
-
534 
-
535  //*********** LATERAL CROSSES************
-
536 
-
537  Double_t Inclination =TMath::Pi()/2 - TMath::ATan(fYCross/(fZCross - fWidthArm));
-
538  TGeoRotation *Crossrot1 = new TGeoRotation("Crossrot1", 0., 0.,0.); TGeoRotation *Crossrot2 = new TGeoRotation("Crossrot2", 0., 0.,0.);
-
539  Crossrot1->RotateY(-90); Crossrot2->RotateY(90);
-
540  Crossrot1->SetName("NegativeRot"); Crossrot2->SetName("PositiveRot");
-
541  Crossrot1->RegisterYourself(); Crossrot2->RegisterYourself();
-
542 
-
543  TGeoPara *ArmCross1 = new TGeoPara ("ArmCross1", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
-
544  ArmCross1->SetName("ARMCROSS1");
-
545  TGeoPara *ArmCross2 = new TGeoPara ("ArmCross2", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
-
546  ArmCross2->SetName("ARMCROSS2");
-
547  TGeoCompositeShape *MuCross = new TGeoCompositeShape("MUFILTERCROSS", "ARMCROSS1:NegativeRot+ARMCROSS2:PositiveRot");
-
548  TGeoVolume *volMuDetCross = new TGeoVolume("volMuDetCross",MuCross, Al);
-
549  volMuDetCross->SetLineColor(kYellow-7);
-
550  volMudetBox->AddNode(volMuDetCross, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral+fXCross/2., 0., -fZtot/2 + fZCross/2)); // right
-
551  volMudetBox->AddNode(volMuDetCross, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral-fXCross/2., 0., -fZtot/2 + fZCross/2)); // left
-
552 
-
553  //***********************ADDING CUTS AT MID-LATERAL IN WALLS
-
554  IronLayer->SetName("MUDETIRON");
-
555  IronLayer1->SetName("MUDETIRON1");
-
556 
-
557  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
-
558  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fZFe+delta)/2,(fZFe+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
-
559  Model->SetName("MUDETTRIANGLE");
-
560 
-
561  TGeoRotation rot("rot",90,90,0);
-
562  TGeoRotation rot1("rot1",-90,90,0);
-
563  //cut on the right (seen from beam)
-
564  const TGeoTranslation transright("trans",-fXFe/2.+ fCutLength/2,0,0);
-
565  TGeoCombiTrans* combright = new TGeoCombiTrans(transright,rot);
-
566  combright->SetName("MuDetcombright");
-
567  combright->RegisterYourself();
-
568  //cut on the left (seen from beam)
-
569  const TGeoTranslation transleft("transleft",+fXFe/2.- fCutLength/2,0,0);
-
570  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
-
571  combleft->SetName("MuDetcombleft");
-
572  combleft->RegisterYourself();
-
573  //unique volume, we cut the triangles
-
574  TGeoCompositeShape *mudetcut = new TGeoCompositeShape("MUDETCUT", "(MUDETIRON-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
-
575  mudetcut->SetName("MUDETTRIANGCUT");
-
576  //same, for the thin layers
-
577  TGeoCompositeShape *mudetcut1 = new TGeoCompositeShape("MUDETCUT1", "(MUDETIRON1-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
-
578  mudetcut1->SetName("MUDETTRIANGCUT1");
-
579  //addition of iron support structures
-
580  //support layers, fot thick layers upstream
-
581  TGeoBBox *UpperSupport = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFe/2.);
-
582  UpperSupport->SetName("MUDETUPSUPPORT");
-
583  TGeoBBox *LowerSupport = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFe/2.);
-
584  LowerSupport->SetName("MUDETLOWSUPPORT");
-
585  TGeoBBox *LateralSupport = new TGeoBBox(fLatSuppX/2., fLatSuppY/2., fZFe/2.);
-
586  LateralSupport->SetName("MUDETLATERALSUPPORT");
-
587  //support layers, for thin layers downstream
-
588  TGeoBBox *UpperSupport1 = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFethin/2.); //The 1 shapes have less z thickness
-
589  UpperSupport1->SetName("MUDETUPSUPPORT1");
-
590  TGeoBBox *LowerSupport1 = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFethin/2.);
-
591  LowerSupport1->SetName("MUDETLOWSUPPORT1");
-
592  TGeoBBox *LateralSupport1 = new TGeoBBox(fLatSuppX/2., fLatSuppY/2.,fZFethin/2.);
-
593  LateralSupport1->SetName("MUDETLATERALSUPPORT1");
-
594  //Translations (left is considered from the beam, positive x)
-
595 
-
596  TGeoTranslation * upright = new TGeoTranslation("MuDetupright",-fXFe/2.+fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
-
597  TGeoTranslation * upleft = new TGeoTranslation("MuDetupleft",+fXFe/2.-fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
-
598  TGeoTranslation * lateralupleft = new TGeoTranslation("MuDetlateralupleft",+fXFe/2.+fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
-
599  TGeoTranslation * lateralupright = new TGeoTranslation("MuDetlateralupright",-fXFe/2.-fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
-
600  TGeoTranslation * laterallowleft = new TGeoTranslation("MuDetlaterallowleft",+fXFe/2.+fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
-
601  TGeoTranslation * laterallowright = new TGeoTranslation("MuDetlaterallowright",-fXFe/2.-fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
-
602  TGeoTranslation * lowright = new TGeoTranslation("MuDetlowright",-fXFe/2.+fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
-
603  TGeoTranslation * lowleft = new TGeoTranslation("MuDetlowleft",+fXFe/2.-fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
-
604  //necessary to put SetName, otherwise it will not find them
-
605  upright->SetName("MuDetupright");
-
606  upright->RegisterYourself();
-
607  upleft->SetName("MuDetupleft");
-
608  upleft->RegisterYourself();
-
609  lowright->SetName("MuDetlowright");
-
610  lowright->RegisterYourself();
-
611  lowleft->SetName("MuDetlowleft");
-
612  lowleft->RegisterYourself();
-
613 
-
614  lateralupleft->SetName("MuDetlateralupleft");
-
615  lateralupleft->RegisterYourself();
-
616  lateralupright->SetName("MuDetlateralupright");
-
617  lateralupright->RegisterYourself();
-
618  laterallowleft->SetName("MuDetlaterallowleft");
-
619  laterallowleft->RegisterYourself();
-
620  laterallowright->SetName("MuDetlaterallowright");
-
621  laterallowright->RegisterYourself();
-
622  //building composite shapes, writing compositions as TString first to improve readibility
-
623  TString *supportaddition = new TString("MUDETTRIANGCUT+MUDETUPSUPPORT:MuDetupright+MUDETUPSUPPORT:MuDetupleft+MUDETLOWSUPPORT:MuDetlowright+MUDETLOWSUPPORT:MuDetlowleft+MUDETLATERALSUPPORT:MuDetlateralupleft+MUDETLATERALSUPPORT:MuDetlateralupright+MUDETLATERALSUPPORT:MuDetlaterallowleft+MUDETLATERALSUPPORT:MuDetlaterallowright");
-
624  TString *supportaddition1 = new TString("MUDETTRIANGCUT1+MUDETUPSUPPORT1:MuDetupright+MUDETUPSUPPORT1:MuDetupleft+MUDETLOWSUPPORT1:MuDetlowright+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLATERALSUPPORT1:MuDetlateralupleft+MUDETLATERALSUPPORT1:MuDetlateralupright+MUDETLATERALSUPPORT1:MuDetlaterallowleft+MUDETLATERALSUPPORT1:MuDetlaterallowright");
-
625  TGeoCompositeShape * SupportedIronLayer = new TGeoCompositeShape("SupportedIronLayer",supportaddition->Data());
-
626  TGeoCompositeShape * SupportedIronLayer1 = new TGeoCompositeShape("SupportedIronLayer1",supportaddition1->Data());
-
627 
-
628  TGeoVolume *MudetIronLayer = new TGeoVolume("MudetIronLayer", SupportedIronLayer, Iron);
-
629  MudetIronLayer->SetLineColor(kRed+2);
-
630  TGeoVolume *MudetIronLayer1 = new TGeoVolume("MudetIronLayer1", SupportedIronLayer1, Iron);
-
631  MudetIronLayer1->SetLineColor(kRed+2);
-
632 
-
633  for(Int_t i = 0; i < fNFe; i++)
-
634  {
-
635  double dz = -fZtot/2+i*fZFe+fZFe/2+i*fZRpc;
-
636  volMudetBox->AddNode(MudetIronLayer,nr + 100 + i, new TGeoTranslation(0, 0, dz));
-
637  }
-
638  for(Int_t i = 0; i < fNFethin; i++)
-
639  {
-
640  double dz = -fZtot/2+fNFe*(fZRpc+fZFe)+i*fZFethin+fZFethin/2+i*fZRpc;
-
641  volMudetBox->AddNode(MudetIronLayer1,nr + 100 + fNFe + i, new TGeoTranslation(0, 0,dz));
-
642  }
-
643  //*****************************RPC LAYERS****************************************
-
644 
-
645  TGeoBBox *RpcContainer_0 = new TGeoBBox("RpcContainer", fXRpc_outer/2, fYRpc_outer/2, fZRpc/2);
-
646  RpcContainer_0->SetName("RPCCOINTAINER_0");
-
647 
-
648  /*
-
649  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
-
650  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
-
651  volStrip->SetLineColor(kGreen);
-
652  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
-
653  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
-
654  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
-
655  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
-
656  volPETinsulator->SetLineColor(kYellow);
-
657  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
-
658  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
-
659  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
-
660  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
-
661  volElectrode->SetLineColor(kGreen);
-
662  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
-
663  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
-
664  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
-
665  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
-
666  volRpc->SetLineColor(kCyan);
-
667  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
-
668  */
-
669 
-
670  TGeoBBox *RpcOuter = new TGeoBBox("RpcOuter", fXRpc_outer/2, fYRpc_outer/2, fZRpc_outer/2);
-
671  RpcOuter->SetName("RPCOUTER");
-
672  TGeoTrd2 *Indentation = new TGeoTrd2("Indentation", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc_outer+0.1*cm)/2,(fZRpc_outer+0.1*cm)/2,(15.*cm+0.1*cm)/2); // (b, B, Z_up, Z_down, h)
-
673  Indentation->SetName("INDENTATION");
-
674  const TGeoTranslation leftindent("leftindent", (fXRpc_outer-15.*cm)/2, 0, 0);
-
675  TGeoCombiTrans* left_ind = new TGeoCombiTrans(leftindent, rot);
-
676  left_ind->SetName("LEFTINDENT");
-
677  left_ind->RegisterYourself();
-
678  const TGeoTranslation rightindent("rightindent", (-fXRpc_outer+15.*cm)/2, 0, 0);
-
679  TGeoCombiTrans* right_ind = new TGeoCombiTrans(rightindent, rot1);
-
680  right_ind->SetName("RIGHTINDENT");
-
681  right_ind->RegisterYourself();
-
682  TGeoBBox *RpcInner = new TGeoBBox("RpcInner", fXRpc_inner/2, fYRpc_inner/2, fZRpc_inner/2);
-
683  RpcInner->SetName("RPCINNER");
-
684  TGeoTranslation *exclusion = new TGeoTranslation(0, 0, (-fZRpc_inner/2) -0.6*cm);
-
685  exclusion->SetName("EXCLUSION");
-
686  exclusion->RegisterYourself();
-
687  TGeoCompositeShape *RpcShell = new TGeoCompositeShape("RpcShell", "RPCOUTER-INDENTATION:RIGHTINDENT-INDENTATION:LEFTINDENT-RPCINNER:EXCLUSION");
-
688  TGeoVolume *volRpcShell = new TGeoVolume("volRpcShell", RpcShell, Al);
-
689  volRpcShell->SetLineColor(kGray);
-
690 
-
691  TGeoBBox *GasShape = new TGeoBBox("GasShape", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
-
692  GasShape->SetName("RPCGAS");
-
693  TGeoBBox *GapSpacing = new TGeoBBox("GapSpacing", fXRpcGap/2, 6./2*cm, (fZGas+0.01*cm)/2 );
-
694  GapSpacing->SetName("GAPSPACE");
-
695  TGeoTranslation *mdown = new TGeoTranslation("mdown", 0., -(fYRpcGap+6*cm)/2, 0.); // 6 cm is the spacing between two gaps
-
696  mdown->SetName("MDOWN");
-
697  mdown->RegisterYourself();
-
698  TGeoTranslation *mup = new TGeoTranslation("mup",0., (fYRpcGap+6*cm)/2, 0.);
-
699  mup->SetName("MUP");
-
700  mup->RegisterYourself();
-
701  TGeoCompositeShape *RpcGas = new TGeoCompositeShape("RpcGas", "RPCGAS-GAPSPACE:MUP-GAPSPACE:MDOWN");
-
702  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas, RPCmat);
-
703  volRpc->SetLineColor(kCyan);
-
704 
-
705  //****RPC container framing*********
-
706  TGeoTrd2 *Indentation_0 = new TGeoTrd2("Indentation_0", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc)/2,(fZRpc)/2,(15.*cm+0.1*cm)/2);
-
707  Indentation_0->SetName("INDENTATION_0");
-
708  TGeoCompositeShape *RpcContainer = new TGeoCompositeShape("RpcContainer", "RPCCOINTAINER_0-INDENTATION_0:RIGHTINDENT-INDENTATION_0:LEFTINDENT");
-
709  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
-
710  //***********************************
-
711 
-
712  TGeoBBox *GapShape = new TGeoBBox("GapShape", fXRpcGap/2, fYRpc_inner/2, fZRpcGap/2);
-
713  GapShape->SetName("RPCGAP");
-
714  TGeoBBox *GapSpacing1 = new TGeoBBox("GapSpacing1", fXRpcGap/2, 6./2*cm, (fZRpcGap+0.01*cm)/2);
-
715  GapSpacing1->SetName("GAPSPACE1");
-
716  TGeoCompositeShape *RpcGap = new TGeoCompositeShape("RpcGap", "RPCGAP-GAPSPACE1:MUP-GAPSPACE1:MDOWN");
-
717  TGeoVolume *volRpcGap = new TGeoVolume("volRpcGap",RpcGap, bakelite);
-
718  volRpcGap->SetLineColor(kOrange);
-
719 
-
720  TGeoBBox *Strip = new TGeoBBox("Strip", fXRpc_inner/2, fYRpc_inner/2, fZStrip/2);
-
721  TGeoVolume *volStrip= new TGeoVolume("volStrip", Strip, Cu);
-
722  volStrip->SetLineColor(kOrange+5);
-
723  TGeoRotation rot2("rot2", 0., 0.,0.);
-
724  rot2.RotateY(180);
-
725  const TGeoTranslation trans_rot(0., 0., fZGas/2+fZRpcGap+fZStrip+fZRpc_outer/2);
-
726  TGeoCombiTrans *comb_1 = new TGeoCombiTrans(trans_rot, rot2);
-
727 
-
728  volRpcContainer->AddNode(volRpcShell,1, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip-fZRpc_outer/2));
-
729  volRpcContainer->AddNode(volRpcShell,2, comb_1);
-
730  volRpcContainer->AddNode(volStrip, 1, new TGeoTranslation(0., 0., fZGas/2+fZRpcGap+fZStrip/2));
-
731  volRpcContainer->AddNode(volStrip, 2, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip/2));
-
732  volRpcContainer->AddNode(volRpcGap, 1, new TGeoTranslation(0., 0., (fZGas+fZRpcGap)/2));
-
733  volRpcContainer->AddNode(volRpcGap, 2, new TGeoTranslation(0., 0., -(fZGas+fZRpcGap)/2));
-
734  volRpcContainer->AddNode(volRpc, 1, new TGeoTranslation(0., 0., 0.));
-
735 
-
736  AddSensitiveVolume(volRpc);
-
737 
-
738  for(Int_t i = 0; i < fNRpc; i++)
-
739  {
-
740  double dy = 5.*cm;
-
741  double dz = -fZtot/2 + (i+1)*fZFe + i*fZRpc + fZRpc/2;
-
742  if (i >= fNFe) dz = dz - (i + 1 - fNFe) * (fZFe - fZFethin);
-
743  if(i%2)volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -dy, dz)); //staggering
-
744  else{volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, dy, dz));}
-
745  }
-
746 
-
747  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
748  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
-
749  Pillar1Vol->SetLineColor(kGreen+3);
+
514  //********UPPER COVER***********
+
515 
+
516  TGeoBBox *UpperCover = new TGeoBBox("UpperCover",fXCov/2, fYCov/2, fZCov/2);
+
517  TGeoVolume *volUpperCover = new TGeoVolume("volUpperCover",UpperCover, Al);
+
518  volUpperCover->SetLineColor(kYellow-7);
+
519  volMudetBox->AddNode(volUpperCover, 1, new TGeoTranslation(0, fYFe/2+fYCov/2+fUpSuppY, -fZtot/2 + fZCov/2));
+
520 
+
521  //**********LATERAL COVER**********
+
522 
+
523  TGeoBBox *LateralCover = new TGeoBBox("LateralCover",fXLateral/2, fYLateral/2, fZLateral/2);
+
524  TGeoVolume *volLateralCover = new TGeoVolume("volLateralCover",LateralCover, Al);
+
525  volLateralCover->SetLineColor(kYellow-7);
+
526  volMudetBox->AddNode(volLateralCover, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low right
+
527  volMudetBox->AddNode(volLateralCover, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., -fYFe/2.+fYLateral/2.+fYSpacing+ 4.*cm, -fZtot/2 + fZLateral/2)); //low left
+
528  volMudetBox->AddNode(volLateralCover, 3, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up right
+
529  volMudetBox->AddNode(volLateralCover, 4, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral/2., +fYFe/2.-fYLateral/2.-fYSpacing- 4.*cm, -fZtot/2 + fZLateral/2)); //up left
+
530 
+
531  //*********** LATERAL CROSSES************
+
532 
+
533  Double_t Inclination =TMath::Pi()/2 - TMath::ATan(fYCross/(fZCross - fWidthArm));
+
534  TGeoRotation *Crossrot1 = new TGeoRotation("Crossrot1", 0., 0.,0.); TGeoRotation *Crossrot2 = new TGeoRotation("Crossrot2", 0., 0.,0.);
+
535  Crossrot1->RotateY(-90); Crossrot2->RotateY(90);
+
536  Crossrot1->SetName("NegativeRot"); Crossrot2->SetName("PositiveRot");
+
537  Crossrot1->RegisterYourself(); Crossrot2->RegisterYourself();
+
538 
+
539  TGeoPara *ArmCross1 = new TGeoPara ("ArmCross1", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
+
540  ArmCross1->SetName("ARMCROSS1");
+
541  TGeoPara *ArmCross2 = new TGeoPara ("ArmCross2", fWidthArm/2., fYCross/2, fXCross/2., TMath::RadToDeg()*Inclination, 0., 0.);//length and height are not x and y here, because it will be rotated!
+
542  ArmCross2->SetName("ARMCROSS2");
+
543  TGeoCompositeShape *MuCross = new TGeoCompositeShape("MUFILTERCROSS", "ARMCROSS1:NegativeRot+ARMCROSS2:PositiveRot");
+
544  TGeoVolume *volMuDetCross = new TGeoVolume("volMuDetCross",MuCross, Al);
+
545  volMuDetCross->SetLineColor(kYellow-7);
+
546  volMudetBox->AddNode(volMuDetCross, 1, new TGeoTranslation(-fXFe/2.-fLatSuppX-fXLateral+fXCross/2., 0., -fZtot/2 + fZCross/2)); // right
+
547  volMudetBox->AddNode(volMuDetCross, 2, new TGeoTranslation(+fXFe/2.+fLatSuppX+fXLateral-fXCross/2., 0., -fZtot/2 + fZCross/2)); // left
+
548 
+
549  //***********************ADDING CUTS AT MID-LATERAL IN WALLS
+
550 
+
551  Double_t delta = 0.1; //to avoid border effects in the cuts (cut is not visualized in viewer, I do not know if it can affect simulation)
+
552  TGeoTrd2 * Model= new TGeoTrd2("Model",fCutHeight/2,0, (fZFe+delta)/2,(fZFe+delta)/2,(fCutLength+delta)/2); //length and height are not x and y here, because it will be rotated!
+
553  Model->SetName("MUDETTRIANGLE");
+
554 
+
555  TGeoRotation rot("rot",90,90,0);
+
556  TGeoRotation rot1("rot1",-90,90,0);
+
557  //cut on the right (seen from beam)
+
558  const TGeoTranslation transright("trans",-fXFe/2.+ fCutLength/2,0,0);
+
559  TGeoCombiTrans* combright = new TGeoCombiTrans(transright,rot);
+
560  combright->SetName("MuDetcombright");
+
561  combright->RegisterYourself();
+
562  //cut on the left (seen from beam)
+
563  const TGeoTranslation transleft("transleft",+fXFe/2.- fCutLength/2,0,0);
+
564  TGeoCombiTrans* combleft = new TGeoCombiTrans(transleft,rot1);
+
565  combleft->SetName("MuDetcombleft");
+
566  combleft->RegisterYourself();
+
567  //unique volume, we cut the triangles
+
568  TGeoCompositeShape *mudetcut = new TGeoCompositeShape("MUDETCUT", "(MUDETIRON-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
+
569  mudetcut->SetName("MUDETTRIANGCUT");
+
570  //same, for the thin layers
+
571  TGeoCompositeShape *mudetcut1 = new TGeoCompositeShape("MUDETCUT1", "(MUDETIRON1-MUDETTRIANGLE:MuDetcombright)-MUDETTRIANGLE:MuDetcombleft");
+
572  mudetcut1->SetName("MUDETTRIANGCUT1");
+
573  //addition of iron support structures
+
574  //support layers, fot thick layers upstream
+
575  TGeoBBox *UpperSupport = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFe/2.);
+
576  UpperSupport->SetName("MUDETUPSUPPORT");
+
577  TGeoBBox *LowerSupport = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFe/2.);
+
578  LowerSupport->SetName("MUDETLOWSUPPORT");
+
579  TGeoBBox *LateralSupport = new TGeoBBox(fLatSuppX/2., fLatSuppY/2., fZFe/2.);
+
580  LateralSupport->SetName("MUDETLATERALSUPPORT");
+
581  //support layers, for thin layers downstream
+
582  TGeoBBox *UpperSupport1 = new TGeoBBox(fUpSuppX/2., fUpSuppY/2.,fZFethin/2.); //The 1 shapes have less z thickness
+
583  UpperSupport1->SetName("MUDETUPSUPPORT1");
+
584  TGeoBBox *LowerSupport1 = new TGeoBBox(fLowSuppX/2., fLowSuppY/2.,fZFethin/2.);
+
585  LowerSupport1->SetName("MUDETLOWSUPPORT1");
+
586  TGeoBBox *LateralSupport1 = new TGeoBBox(fLatSuppX/2., fLatSuppY/2.,fZFethin/2.);
+
587  LateralSupport1->SetName("MUDETLATERALSUPPORT1");
+
588  //Translations (left is considered from the beam, positive x)
+
589 
+
590  TGeoTranslation * upright = new TGeoTranslation("MuDetupright",-fXFe/2.+fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
+
591  TGeoTranslation * upleft = new TGeoTranslation("MuDetupleft",+fXFe/2.-fUpSuppX/2.,fYFe/2+fUpSuppY/2.,0);
+
592  TGeoTranslation * lateralupleft = new TGeoTranslation("MuDetlateralupleft",+fXFe/2.+fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
+
593  TGeoTranslation * lateralupright = new TGeoTranslation("MuDetlateralupright",-fXFe/2.-fLowSuppX/2.,fYFe/2-fLowSuppY/2.-fYSpacing,0);
+
594  TGeoTranslation * laterallowleft = new TGeoTranslation("MuDetlaterallowleft",+fXFe/2.+fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
+
595  TGeoTranslation * laterallowright = new TGeoTranslation("MuDetlaterallowright",-fXFe/2.-fLowSuppX/2.,-fYFe/2+fLowSuppY/2.+fYSpacing,0);
+
596  TGeoTranslation * lowright = new TGeoTranslation("MuDetlowright",-fXFe/2.+fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
+
597  TGeoTranslation * lowleft = new TGeoTranslation("MuDetlowleft",+fXFe/2.-fLowSuppX/2.,-fYFe/2-fLowSuppY/2.,0);
+
598  //necessary to put SetName, otherwise it will not find them
+
599  upright->SetName("MuDetupright");
+
600  upright->RegisterYourself();
+
601  upleft->SetName("MuDetupleft");
+
602  upleft->RegisterYourself();
+
603  lowright->SetName("MuDetlowright");
+
604  lowright->RegisterYourself();
+
605  lowleft->SetName("MuDetlowleft");
+
606  lowleft->RegisterYourself();
+
607 
+
608  lateralupleft->SetName("MuDetlateralupleft");
+
609  lateralupleft->RegisterYourself();
+
610  lateralupright->SetName("MuDetlateralupright");
+
611  lateralupright->RegisterYourself();
+
612  laterallowleft->SetName("MuDetlaterallowleft");
+
613  laterallowleft->RegisterYourself();
+
614  laterallowright->SetName("MuDetlaterallowright");
+
615  laterallowright->RegisterYourself();
+
616  //building composite shapes, writing compositions as TString first to improve readibility
+
617  TString *supportaddition = new TString("MUDETTRIANGCUT+MUDETUPSUPPORT:MuDetupright+MUDETUPSUPPORT:MuDetupleft+MUDETLOWSUPPORT:MuDetlowright+MUDETLOWSUPPORT:MuDetlowleft+MUDETLATERALSUPPORT:MuDetlateralupleft+MUDETLATERALSUPPORT:MuDetlateralupright+MUDETLATERALSUPPORT:MuDetlaterallowleft+MUDETLATERALSUPPORT:MuDetlaterallowright");
+
618  TString *supportaddition1 = new TString("MUDETTRIANGCUT1+MUDETUPSUPPORT1:MuDetupright+MUDETUPSUPPORT1:MuDetupleft+MUDETLOWSUPPORT1:MuDetlowright+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLOWSUPPORT1:MuDetlowleft+MUDETLATERALSUPPORT1:MuDetlateralupleft+MUDETLATERALSUPPORT1:MuDetlateralupright+MUDETLATERALSUPPORT1:MuDetlaterallowleft+MUDETLATERALSUPPORT1:MuDetlaterallowright");
+
619  TGeoCompositeShape * SupportedIronLayer = new TGeoCompositeShape("SupportedIronLayer",supportaddition->Data());
+
620  TGeoCompositeShape * SupportedIronLayer1 = new TGeoCompositeShape("SupportedIronLayer1",supportaddition1->Data());
+
621 
+
622  TGeoVolume *MudetIronLayer = new TGeoVolume("MudetIronLayer", SupportedIronLayer, Iron);
+
623  MudetIronLayer->SetLineColor(kRed+2);
+
624  TGeoVolume *MudetIronLayer1 = new TGeoVolume("MudetIronLayer1", SupportedIronLayer1, Iron);
+
625  MudetIronLayer1->SetLineColor(kRed+2);
+
626 
+
627  for(Int_t i = 0; i < fNFe; i++)
+
628  {
+
629  double dz = -fZtot/2+i*fZFe+fZFe/2+i*fZRpc;
+
630  volMudetBox->AddNode(MudetIronLayer,nr + 100 + i, new TGeoTranslation(0, 0, dz));
+
631  }
+
632  for(Int_t i = 0; i < fNFethin; i++)
+
633  {
+
634  double dz = -fZtot/2+fNFe*(fZRpc+fZFe)+i*fZFethin+fZFethin/2+i*fZRpc;
+
635  volMudetBox->AddNode(MudetIronLayer1,nr + 100 + fNFe + i, new TGeoTranslation(0, 0,dz));
+
636  }
+
637  //*****************************RPC LAYERS****************************************
+
638 
+
639  TGeoBBox *RpcContainer_0 = new TGeoBBox("RpcContainer", fXRpc_outer/2, fYRpc_outer/2, fZRpc/2);
+
640  RpcContainer_0->SetName("RPCCOINTAINER_0");
+
641 
+
642  /*
+
643  TGeoBBox *Strip = new TGeoBBox("Strip",fXStrip/2, fYStrip/2, fZStrip/2);
+
644  TGeoVolume *volStrip = new TGeoVolume("volStrip",Strip,Cu);
+
645  volStrip->SetLineColor(kGreen);
+
646  volRpcContainer->AddNode(volStrip,1,new TGeoTranslation (0,0,-3.25*mm));
+
647  volRpcContainer->AddNode(volStrip,2,new TGeoTranslation (0,0,3.25*mm));
+
648  TGeoBBox *PETinsulator = new TGeoBBox("PETinsulator", fXPet/2, fYPet/2, fZPet/2);
+
649  TGeoVolume *volPETinsulator = new TGeoVolume("volPETinsulator", PETinsulator, bakelite);
+
650  volPETinsulator->SetLineColor(kYellow);
+
651  volRpcContainer->AddNode(volPETinsulator,1,new TGeoTranslation(0,0,-3.1*mm));
+
652  volRpcContainer->AddNode(volPETinsulator,2,new TGeoTranslation(0,0, 3.1*mm));
+
653  TGeoBBox *Electrode = new TGeoBBox("Electrode",fXEle/2, fYEle/2, fZEle/2);
+
654  TGeoVolume *volElectrode = new TGeoVolume("volElectrode",Electrode,bakelite);
+
655  volElectrode->SetLineColor(kGreen);
+
656  volRpcContainer->AddNode(volElectrode,1,new TGeoTranslation(0,0,-2*mm));
+
657  volRpcContainer->AddNode(volElectrode,2,new TGeoTranslation(0,0, 2*mm));
+
658  TGeoBBox *RpcGas = new TGeoBBox("RpcGas", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
+
659  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas,RPCmat);
+
660  volRpc->SetLineColor(kCyan);
+
661  volRpcContainer->AddNode(volRpc,1,new TGeoTranslation(0,0,0));
+
662  */
+
663 
+
664  TGeoBBox *RpcOuter = new TGeoBBox("RpcOuter", fXRpc_outer/2, fYRpc_outer/2, fZRpc_outer/2);
+
665  RpcOuter->SetName("RPCOUTER");
+
666  TGeoTrd2 *Indentation = new TGeoTrd2("Indentation", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc_outer+0.1*cm)/2,(fZRpc_outer+0.1*cm)/2,(15.*cm+0.1*cm)/2); // (b, B, Z_up, Z_down, h)
+
667  Indentation->SetName("INDENTATION");
+
668  const TGeoTranslation leftindent("leftindent", (fXRpc_outer-15.*cm)/2, 0, 0);
+
669  TGeoCombiTrans* left_ind = new TGeoCombiTrans(leftindent, rot);
+
670  left_ind->SetName("LEFTINDENT");
+
671  left_ind->RegisterYourself();
+
672  const TGeoTranslation rightindent("rightindent", (-fXRpc_outer+15.*cm)/2, 0, 0);
+
673  TGeoCombiTrans* right_ind = new TGeoCombiTrans(rightindent, rot1);
+
674  right_ind->SetName("RIGHTINDENT");
+
675  right_ind->RegisterYourself();
+
676  TGeoBBox *RpcInner = new TGeoBBox("RpcInner", fXRpc_inner/2, fYRpc_inner/2, fZRpc_inner/2);
+
677  RpcInner->SetName("RPCINNER");
+
678  TGeoTranslation *exclusion = new TGeoTranslation(0, 0, (-fZRpc_inner/2) -0.6*cm);
+
679  exclusion->SetName("EXCLUSION");
+
680  exclusion->RegisterYourself();
+
681  TGeoCompositeShape *RpcShell = new TGeoCompositeShape("RpcShell", "RPCOUTER-INDENTATION:RIGHTINDENT-INDENTATION:LEFTINDENT-RPCINNER:EXCLUSION");
+
682  TGeoVolume *volRpcShell = new TGeoVolume("volRpcShell", RpcShell, Al);
+
683  volRpcShell->SetLineColor(kGray);
+
684 
+
685  TGeoBBox *GasShape = new TGeoBBox("GasShape", fXRpcGap/2, fYRpc_inner/2, fZGas/2);
+
686  GasShape->SetName("RPCGAS");
+
687  TGeoBBox *GapSpacing = new TGeoBBox("GapSpacing", fXRpcGap/2, 6./2*cm, (fZGas+0.01*cm)/2 );
+
688  GapSpacing->SetName("GAPSPACE");
+
689  TGeoTranslation *mdown = new TGeoTranslation("mdown", 0., -(fYRpcGap+6*cm)/2, 0.); // 6 cm is the spacing between two gaps
+
690  mdown->SetName("MDOWN");
+
691  mdown->RegisterYourself();
+
692  TGeoTranslation *mup = new TGeoTranslation("mup",0., (fYRpcGap+6*cm)/2, 0.);
+
693  mup->SetName("MUP");
+
694  mup->RegisterYourself();
+
695  TGeoCompositeShape *RpcGas = new TGeoCompositeShape("RpcGas", "RPCGAS-GAPSPACE:MUP-GAPSPACE:MDOWN");
+
696  TGeoVolume *volRpc = new TGeoVolume("volRpc",RpcGas, RPCmat);
+
697  volRpc->SetLineColor(kCyan);
+
698 
+
699  //****RPC container framing*********
+
700  TGeoTrd2 *Indentation_0 = new TGeoTrd2("Indentation_0", (fYRpc_outer- 2*(31.2*cm+15.*cm))/2, (fYRpc_outer-2*31.2*cm)/2, (fZRpc)/2,(fZRpc)/2,(15.*cm+0.1*cm)/2);
+
701  Indentation_0->SetName("INDENTATION_0");
+
702  TGeoCompositeShape *RpcContainer = new TGeoCompositeShape("RpcContainer", "RPCCOINTAINER_0-INDENTATION_0:RIGHTINDENT-INDENTATION_0:LEFTINDENT");
+
703  TGeoVolume *volRpcContainer = new TGeoVolume("volRpcContainer",RpcContainer,air);
+
704  //***********************************
+
705 
+
706  TGeoBBox *GapShape = new TGeoBBox("GapShape", fXRpcGap/2, fYRpc_inner/2, fZRpcGap/2);
+
707  GapShape->SetName("RPCGAP");
+
708  TGeoBBox *GapSpacing1 = new TGeoBBox("GapSpacing1", fXRpcGap/2, 6./2*cm, (fZRpcGap+0.01*cm)/2);
+
709  GapSpacing1->SetName("GAPSPACE1");
+
710  TGeoCompositeShape *RpcGap = new TGeoCompositeShape("RpcGap", "RPCGAP-GAPSPACE1:MUP-GAPSPACE1:MDOWN");
+
711  TGeoVolume *volRpcGap = new TGeoVolume("volRpcGap",RpcGap, bakelite);
+
712  volRpcGap->SetLineColor(kOrange);
+
713 
+
714  TGeoBBox *Strip = new TGeoBBox("Strip", fXRpc_inner/2, fYRpc_inner/2, fZStrip/2);
+
715  TGeoVolume *volStrip= new TGeoVolume("volStrip", Strip, Cu);
+
716  volStrip->SetLineColor(kOrange+5);
+
717  TGeoRotation rot2("rot2", 0., 0.,0.);
+
718  rot2.RotateY(180);
+
719  const TGeoTranslation trans_rot(0., 0., fZGas/2+fZRpcGap+fZStrip+fZRpc_outer/2);
+
720  TGeoCombiTrans *comb_1 = new TGeoCombiTrans(trans_rot, rot2);
+
721 
+
722  volRpcContainer->AddNode(volRpcShell,1, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip-fZRpc_outer/2));
+
723  volRpcContainer->AddNode(volRpcShell,2, comb_1);
+
724  volRpcContainer->AddNode(volStrip, 1, new TGeoTranslation(0., 0., fZGas/2+fZRpcGap+fZStrip/2));
+
725  volRpcContainer->AddNode(volStrip, 2, new TGeoTranslation(0., 0., -fZGas/2-fZRpcGap-fZStrip/2));
+
726  volRpcContainer->AddNode(volRpcGap, 1, new TGeoTranslation(0., 0., (fZGas+fZRpcGap)/2));
+
727  volRpcContainer->AddNode(volRpcGap, 2, new TGeoTranslation(0., 0., -(fZGas+fZRpcGap)/2));
+
728  volRpcContainer->AddNode(volRpc, 1, new TGeoTranslation(0., 0., 0.));
+
729 
+
730  AddSensitiveVolume(volRpc);
+
731 
+
732  for(Int_t i = 0; i < fNRpc; i++)
+
733  {
+
734  double dy = 5.*cm;
+
735  double dz = -fZtot/2 + (i+1)*fZFe + i*fZRpc + fZRpc/2;
+
736  if (i >= fNFe) dz = dz - (i + 1 - fNFe) * (fZFe - fZFethin);
+
737  if(i%2)volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, -dy, dz)); //staggering
+
738  else{volMudetBox->AddNode(volRpcContainer,nr + i,new TGeoTranslation(0, dy, dz));}
+
739  }
+
740 
+
741  TGeoBBox *Pillar1Box = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
742  TGeoVolume *Pillar1Vol = new TGeoVolume("Pillar1Vol",Pillar1Box,Steel);
+
743  Pillar1Vol->SetLineColor(kGreen+3);
+
744 
+
745  //tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2+fPillarZ/2));
+
746  //tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2 +fPillarZ/2));
+
747  // tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2)); //eventually two pillars at the end. Now muon det is followed by veto, so its steel pillar supports both
+
748  //tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2));
+
749 
750 
-
751  //tTauNuDet->AddNode(Pillar1Vol,1, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2+fPillarZ/2));
-
752  //tTauNuDet->AddNode(Pillar1Vol,2, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter-fZtot/2 +fPillarZ/2));
-
753  // tTauNuDet->AddNode(Pillar1Vol,3, new TGeoTranslation(-fXtot/2+fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2)); //eventually two pillars at the end. Now muon det is followed by veto, so its steel pillar supports both
-
754  //tTauNuDet->AddNode(Pillar1Vol,4, new TGeoTranslation(fXtot/2-fPillarX/2,-fYtot/2-fPillarY/2,fZcenter+fZtot/2-fPillarZ/2));
+
751  }
+
752 
+
753  if(fDesign==4){
+
754  //Now the filter is replaced by a magnetic spectrometer
755 
-
756 
-
757  }
-
758 
-
759  if(fDesign==4){
-
760  //Now the filter is replaced by a magnetic spectrometer
+
756  TGeoBBox *MuFilter = new TGeoBBox("MuFilter",fXtot/2., fYtot/2., fZtot/2.);
+
757  TGeoVolume *volMuFilter = new TGeoVolume("volMuFilter",MuFilter,air); //MuFilter
+
758  volMuFilter->SetLineColor(kGray);
+
759 
+
760  TGeoUniformMagField *magcheckfield = new TGeoUniformMagField(fField,0.,0.); //along x direction;
761 
-
762  TGeoBBox *MuFilter = new TGeoBBox("MuFilter",fXtot/2., fYtot/2., fZtot/2.);
-
763  TGeoVolume *volMuFilter = new TGeoVolume("volMuFilter",MuFilter,air); //MuFilter
-
764  volMuFilter->SetLineColor(kGray);
-
765 
-
766  TGeoUniformMagField *magcheckfield = new TGeoUniformMagField(fField,0.,0.); //along x direction;
-
767 
-
768  tTauNuDet->AddNode(volMuFilter,1,new TGeoTranslation(0,0,fZcenter));
+
762  tTauNuDet->AddNode(volMuFilter,1,new TGeoTranslation(0,0,fZcenter));
+
763 
+
764  //adapting code from AdvSND
+
765  //code by Daniele from ADVSND air core magnet
+
766  Double_t fOutMagX = fXtot;
+
767  Double_t fOutMagY = fYtot;
+
768  Double_t fMagZ = fZtot-0.5*2;
769 
-
770  //adapting code from AdvSND
-
771  //code by Daniele from ADVSND air core magnet
-
772  Double_t fOutMagX = fXtot;
-
773  Double_t fOutMagY = fYtot;
-
774  Double_t fMagZ = fZtot-0.5*2;
-
775 
-
776  Double_t fInMagX = fXRpc;
-
777  Double_t fInMagY = fYRpc;
+
770  Double_t fInMagX = fXRpc;
+
771  Double_t fInMagY = fYRpc;
+
772 
+
773  TGeoBBox *RPC = new TGeoBBox("RPC", fXRpc/2.,fYRpc/2.,fZRpc/2.);
+
774  TGeoVolume *volRPC = new TGeoVolume("volRPC",RPC,RPCmat); //RPC
+
775  volRPC->SetLineColor(kRed);
+
776  AddSensitiveVolume(volRPC);
+
777  //applying the values in the geometry
778 
-
779  TGeoBBox *RPC = new TGeoBBox("RPC", fXRpc/2.,fYRpc/2.,fZRpc/2.);
-
780  TGeoVolume *volRPC = new TGeoVolume("volRPC",RPC,RPCmat); //RPC
-
781  volRPC->SetLineColor(kRed);
-
782  AddSensitiveVolume(volRPC);
-
783  //applying the values in the geometry
+
779 
+
780  // Shapes creation
+
781  [[maybe_unused]] auto *CoilContainer = new TGeoBBox("CoilContainer", fOutMagX/2., fOutMagY/2., fMagZ/2.);
+
782  TGeoBBox *MagRegion = new TGeoBBox("MagRegion", fInMagX/2., fInMagY/2., fMagZ/2.+0.5);
+
783  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilW/2., fCoilH/2., fMagZ/2.+0.5);
784 
-
785 
-
786  // Shapes creation
-
787  TGeoBBox *CoilContainer = new TGeoBBox("CoilContainer", fOutMagX/2., fOutMagY/2., fMagZ/2.);
-
788  TGeoBBox *MagRegion = new TGeoBBox("MagRegion", fInMagX/2., fInMagY/2., fMagZ/2.+0.5);
-
789  TGeoBBox *Coil = new TGeoBBox("Coil", fCoilW/2., fCoilH/2., fMagZ/2.+0.5);
+
785  // Translations
+
786  TGeoTranslation *CoilUpPos = new TGeoTranslation("CoilUpPos", 0, (fInMagY+fCoilH)/2.-0.001, 0);
+
787  TGeoTranslation *CoilDownPos = new TGeoTranslation("CoilDownPos", 0, -(fInMagY+fCoilH)/2.+0.001, 0);
+
788  CoilUpPos->RegisterYourself();
+
789  CoilDownPos->RegisterYourself();
790 
-
791  // Translations
-
792  TGeoTranslation *CoilUpPos = new TGeoTranslation("CoilUpPos", 0, (fInMagY+fCoilH)/2.-0.001, 0);
-
793  TGeoTranslation *CoilDownPos = new TGeoTranslation("CoilDownPos", 0, -(fInMagY+fCoilH)/2.+0.001, 0);
-
794  CoilUpPos->RegisterYourself();
-
795  CoilDownPos->RegisterYourself();
-
796 
-
797  // Yoke shape
-
798  TGeoCompositeShape *FeYoke = new TGeoCompositeShape("FeYoke", "CoilContainer-MagRegion-(Coil:CoilUpPos)-(Coil:CoilDownPos)");
-
799 
-
800  // Volumes
-
801  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke", FeYoke, Iron);
-
802  volFeYoke->SetLineColor(kGray);
-
803  TGeoVolume *volCoil = new TGeoVolume("volCoil", Coil, Cu);
-
804  volCoil->SetLineColor(kOrange+1);
-
805  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion", MagRegion, air);
-
806  volMagRegion->SetField(magcheckfield);
+
791  // Yoke shape
+
792  TGeoCompositeShape *FeYoke = new TGeoCompositeShape("FeYoke", "CoilContainer-MagRegion-(Coil:CoilUpPos)-(Coil:CoilDownPos)");
+
793 
+
794  // Volumes
+
795  TGeoVolume *volFeYoke = new TGeoVolume("volFeYoke", FeYoke, Iron);
+
796  volFeYoke->SetLineColor(kGray);
+
797  TGeoVolume *volCoil = new TGeoVolume("volCoil", Coil, Cu);
+
798  volCoil->SetLineColor(kOrange+1);
+
799  TGeoVolume *volMagRegion = new TGeoVolume("volMagRegion", MagRegion, air);
+
800  volMagRegion->SetField(magcheckfield);
+
801 
+
802  // Positioning
+
803  volMuFilter->AddNode(volFeYoke, 0);
+
804  volMuFilter->AddNode(volCoil, 0, new TGeoTranslation(0, (fInMagY+fCoilH)/2.-0.001, 0));
+
805  volMuFilter->AddNode(volCoil, 1, new TGeoTranslation(0, -(fInMagY+fCoilH)/2.+0.001, 0));
+
806  volMuFilter->AddNode(volMagRegion, 0, 0);
807 
-
808  // Positioning
-
809  volMuFilter->AddNode(volFeYoke, 0);
-
810  volMuFilter->AddNode(volCoil, 0, new TGeoTranslation(0, (fInMagY+fCoilH)/2.-0.001, 0));
-
811  volMuFilter->AddNode(volCoil, 1, new TGeoTranslation(0, -(fInMagY+fCoilH)/2.+0.001, 0));
-
812  volMuFilter->AddNode(volMagRegion, 0, 0);
-
813 
-
814  volMagRegion->SetField(magcheckfield);
-
815  //first two counters upstream
-
816  volMagRegion->AddNode(volRPC,1,new TGeoTranslation(0,0,-fZtot/2. + fZRpc/2.));
-
817  //magnetized region in the first quarter
-
818  volMagRegion->AddNode(volRPC,2,new TGeoTranslation(0,0,-fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
-
819  volMagRegion->AddNode(volRPC,3,new TGeoTranslation(0,0,-fZtot/4.+fGapMiddle/2. + fZRpc/2.));
-
820  //magnetized region in the middle
-
821  volMagRegion->AddNode(volRPC,4,new TGeoTranslation(0,0,-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
-
822  volMagRegion->AddNode(volRPC,5,new TGeoTranslation(0,0,+fGapMiddle/2. + fZRpc/2.));
-
823  //magnetized region in the third quarter
-
824  volMagRegion->AddNode(volRPC,6,new TGeoTranslation(0,0,+fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
-
825  volMagRegion->AddNode(volRPC,7,new TGeoTranslation(0,0,+fZtot/4.+fGapMiddle/2. + fZRpc/2.));
-
826  //last two counters downstream
-
827  volMagRegion->AddNode(volRPC,8,new TGeoTranslation(0,0,+fZtot/2. - fZRpc/2.));
-
828 
-
829  } //end option 4
-
830 
-
831 }
+
808  volMagRegion->SetField(magcheckfield);
+
809  //first two counters upstream
+
810  volMagRegion->AddNode(volRPC,1,new TGeoTranslation(0,0,-fZtot/2. + fZRpc/2.));
+
811  //magnetized region in the first quarter
+
812  volMagRegion->AddNode(volRPC,2,new TGeoTranslation(0,0,-fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
+
813  volMagRegion->AddNode(volRPC,3,new TGeoTranslation(0,0,-fZtot/4.+fGapMiddle/2. + fZRpc/2.));
+
814  //magnetized region in the middle
+
815  volMagRegion->AddNode(volRPC,4,new TGeoTranslation(0,0,-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
+
816  volMagRegion->AddNode(volRPC,5,new TGeoTranslation(0,0,+fGapMiddle/2. + fZRpc/2.));
+
817  //magnetized region in the third quarter
+
818  volMagRegion->AddNode(volRPC,6,new TGeoTranslation(0,0,+fZtot/4.-fGapMiddle/2. - fZRpc/2.)); //these are INSIDE the magnetized region
+
819  volMagRegion->AddNode(volRPC,7,new TGeoTranslation(0,0,+fZtot/4.+fGapMiddle/2. + fZRpc/2.));
+
820  //last two counters downstream
+
821  volMagRegion->AddNode(volRPC,8,new TGeoTranslation(0,0,+fZtot/2. - fZRpc/2.));
+
822 
+
823  } //end option 4
+
824 
+
825 }
Double_t cm
Double_t mm
Double_t fXCov
Definition: NuTauMudet.h:175
@@ -1413,11 +1407,11 @@

-

Definition at line 919 of file NuTauMudet.cxx.

-
920 {
-
921  nARM = detID/1E4;
-
922  nRPC = detID - nARM*1E4;
-
923 }
+

Definition at line 913 of file NuTauMudet.cxx.

+
914 {
+
915  nARM = detID/1E4;
+
916  nRPC = detID - nARM*1E4;
+
917 }

@@ -1444,10 +1438,10 @@

-

Definition at line 898 of file NuTauMudet.cxx.

-
899 {
-
900  fShipRpcPointCollection->Clear();
-
901 }
+

Definition at line 892 of file NuTauMudet.cxx.

+
893 {
+
894  fShipRpcPointCollection->Clear();
+
895 }
@@ -1532,11 +1526,11 @@

Gets the produced collections

-

Definition at line 925 of file NuTauMudet.cxx.

-
926 {
-
927  if (iColl == 0) { return fShipRpcPointCollection; }
-
928  else { return NULL; }
-
929 }
+

Definition at line 919 of file NuTauMudet.cxx.

+
920 {
+
921  if (iColl == 0) { return fShipRpcPointCollection; }
+
922  else { return NULL; }
+
923 }
@@ -1727,69 +1721,69 @@

Definition at line 834 of file NuTauMudet.cxx.

-
835 {
-
837  //Set parameters at entrance of volume. Reset ELoss.
-
838  if ( gMC->IsTrackEntering() ) {
-
839  fELoss = 0.;
-
840  fTime = gMC->TrackTime() * 1.0e09;
-
841  fLength = gMC->TrackLength();
-
842  gMC->TrackPosition(fPos);
-
843  gMC->TrackMomentum(fMom);
-
844  }
-
845  // Sum energy loss for all steps in the active volume
-
846  fELoss += gMC->Edep();
-
847 
-
848  // Create muonPoint at exit of active volume
-
849  if ( gMC->IsTrackExiting() ||
-
850  gMC->IsTrackStop() ||
-
851  gMC->IsTrackDisappeared() ) {
-
852  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
853  fVolumeID = vol->getMCid();
-
854  if (fELoss == 0. ) { return kFALSE; }
-
855  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
856  Int_t pdgCode = p->GetPdgCode();
-
857  Int_t detID=0;
-
858  gMC->CurrentVolID(detID);
-
859  //cutting this part, does not work in this new layout, since we only have simple planes
-
860  //cout<<"THIS HIT"<<endl;
-
861  //cout<< "detID = " << detID << endl;
-
862  /*Int_t MaxLevel = gGeoManager->GetLevel();
-
863  const Int_t MaxL = MaxLevel;
-
864  //cout << "MaxLevel = " << MaxL << endl;
-
865  //cout << gMC->CurrentVolPath()<< endl;
-
866  Int_t NRpc =0;
-
867  const char *name;
-
868  name = gMC->CurrentVolName();
-
869  //cout << name << " ";
-
870  Int_t motherID = 0;
-
871  if( strcmp(name, "volRpc")==0){motherID = gGeoManager->GetMother(1)->GetNumber();}
-
872  else{motherID = gGeoManager->GetMother(0)->GetNumber();}
-
873  // This up here is made because of a strange behaviour of the script, volRpc gets different
-
874  //Mother volume number even if it has the correct path
-
875  const char *mumname = gMC->CurrentVolOffName(1);*/
-
876  //cout<<mumname<<" "<< motherID<<endl;
-
877  //detID = motherID;
-
878  //cout<< "detID = " << detID << endl;
-
879  //cout<<endl;
-
880  fVolumeID = detID;
+

Definition at line 828 of file NuTauMudet.cxx.

+
829 {
+
831  //Set parameters at entrance of volume. Reset ELoss.
+
832  if ( gMC->IsTrackEntering() ) {
+
833  fELoss = 0.;
+
834  fTime = gMC->TrackTime() * 1.0e09;
+
835  fLength = gMC->TrackLength();
+
836  gMC->TrackPosition(fPos);
+
837  gMC->TrackMomentum(fMom);
+
838  }
+
839  // Sum energy loss for all steps in the active volume
+
840  fELoss += gMC->Edep();
+
841 
+
842  // Create muonPoint at exit of active volume
+
843  if ( gMC->IsTrackExiting() ||
+
844  gMC->IsTrackStop() ||
+
845  gMC->IsTrackDisappeared() ) {
+
846  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
847  fVolumeID = vol->getMCid();
+
848  if (fELoss == 0. ) { return kFALSE; }
+
849  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
850  Int_t pdgCode = p->GetPdgCode();
+
851  Int_t detID=0;
+
852  gMC->CurrentVolID(detID);
+
853  //cutting this part, does not work in this new layout, since we only have simple planes
+
854  //cout<<"THIS HIT"<<endl;
+
855  //cout<< "detID = " << detID << endl;
+
856  /*Int_t MaxLevel = gGeoManager->GetLevel();
+
857  const Int_t MaxL = MaxLevel;
+
858  //cout << "MaxLevel = " << MaxL << endl;
+
859  //cout << gMC->CurrentVolPath()<< endl;
+
860  Int_t NRpc =0;
+
861  const char *name;
+
862  name = gMC->CurrentVolName();
+
863  //cout << name << " ";
+
864  Int_t motherID = 0;
+
865  if( strcmp(name, "volRpc")==0){motherID = gGeoManager->GetMother(1)->GetNumber();}
+
866  else{motherID = gGeoManager->GetMother(0)->GetNumber();}
+
867  // This up here is made because of a strange behaviour of the script, volRpc gets different
+
868  //Mother volume number even if it has the correct path
+
869  const char *mumname = gMC->CurrentVolOffName(1);*/
+
870  //cout<<mumname<<" "<< motherID<<endl;
+
871  //detID = motherID;
+
872  //cout<< "detID = " << detID << endl;
+
873  //cout<<endl;
+
874  fVolumeID = detID;
+
875 
+
876  TLorentzVector Pos;
+
877  gMC->TrackPosition(Pos);
+
878  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
879  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
880  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
881 
-
882  TLorentzVector Pos;
-
883  gMC->TrackPosition(Pos);
-
884  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
885  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
886  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
887 
-
888  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean), TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,fELoss, pdgCode);
-
889 
-
890  // Increment number of muon det points in TParticle
-
891  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
892  stack->AddPoint(ktauRpc);
-
893  }
-
894 
-
895  return kTRUE;
-
896 }
-
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: NuTauMudet.cxx:937
+
882  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean), TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,fELoss, pdgCode);
+
883 
+
884  // Increment number of muon det points in TParticle
+
885  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
886  stack->AddPoint(ktauRpc);
+
887  }
+
888 
+
889  return kTRUE;
+
890 }
+
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: NuTauMudet.cxx:931
@@ -1824,12 +1818,12 @@

ShipRpcPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

-

Definition at line 904 of file NuTauMudet.cxx.

-
905 {
-
906 
-
913  FairRootManager::Instance()->Register("ShipRpcPoint", "NuTauMudet",
-
914  fShipRpcPointCollection, kTRUE);
-
915 }
+

Definition at line 898 of file NuTauMudet.cxx.

+
899 {
+
900 
+
907  FairRootManager::Instance()->Register("ShipRpcPoint", "NuTauMudet",
+
908  fShipRpcPointCollection, kTRUE);
+
909 }

@@ -1858,10 +1852,10 @@

Definition at line 931 of file NuTauMudet.cxx.

-
932 {
-
933  fShipRpcPointCollection->Clear();
-
934 }
+

Definition at line 925 of file NuTauMudet.cxx.

+
926 {
+
927  fShipRpcPointCollection->Clear();
+
928 }

diff --git a/classTarget.html b/classTarget.html index 2dfb7de86d..ed4644f533 100644 --- a/classTarget.html +++ b/classTarget.html @@ -552,14 +552,14 @@

This method is an example of how to add your own point of type muonPoint to the clones array

-

Definition at line 817 of file Target.cxx.

-
821 {
-
822  TClonesArray& clref = *fTargetPointCollection;
-
823  Int_t size = clref.GetEntriesFast();
-
824  //cout << "brick hit called"<< pos.z()<<endl;
-
825  return new(clref[size]) TargetPoint(trackID,detID, pos, mom,
-
826  time, length, eLoss, pdgCode);
-
827 }
+

Definition at line 783 of file Target.cxx.

+
787 {
+
788  TClonesArray& clref = *fTargetPointCollection;
+
789  Int_t size = clref.GetEntriesFast();
+
790  //cout << "brick hit called"<< pos.z()<<endl;
+
791  return new(clref[size]) TargetPoint(trackID,detID, pos, mom,
+
792  time, length, eLoss, pdgCode);
+
793 }
@@ -641,350 +641,324 @@

Definition at line 272 of file Target.cxx.

273 {
274  // cout << "Design = " << fDesign << endl;
-
275  TGeoVolume *top=gGeoManager->GetTopVolume();
-
276 
-
277  InitMedium("air");
-
278  TGeoMedium *air =gGeoManager->GetMedium("air");
-
279 
-
280  InitMedium("iron");
-
281  TGeoMedium *Fe =gGeoManager->GetMedium("iron");
-
282 
-
283  InitMedium("CoilAluminium");
-
284  TGeoMedium *Al = gGeoManager->GetMedium("CoilAluminium");
-
285 
-
286  InitMedium("CoilCopper");
-
287  TGeoMedium *Cu = gGeoManager->GetMedium("CoilCopper");
-
288 
-
289  InitMedium("PlasticBase");
-
290  TGeoMedium *PBase =gGeoManager->GetMedium("PlasticBase");
-
291 
-
292  InitMedium("NuclearEmulsion");
-
293  TGeoMedium *NEmu =gGeoManager->GetMedium("NuclearEmulsion");
+
275 
+
276  InitMedium("air");
+
277  TGeoMedium *air =gGeoManager->GetMedium("air");
+
278 
+
279  InitMedium("PlasticBase");
+
280  TGeoMedium *PBase =gGeoManager->GetMedium("PlasticBase");
+
281 
+
282  InitMedium("NuclearEmulsion");
+
283  TGeoMedium *NEmu =gGeoManager->GetMedium("NuclearEmulsion");
+
284 
+
285  TGeoMaterial *NEmuMat = NEmu->GetMaterial(); //I need the materials to build the mixture
+
286  TGeoMaterial *PBaseMat = PBase->GetMaterial();
+
287 
+
288  Double_t rho_film = (NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness)/(2* EmulsionThickness + PlasticBaseThickness);
+
289  Double_t frac_emu = NEmuMat->GetDensity() * 2 * EmulsionThickness /(NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness);
+
290 
+
291  if (fsingleemulsionfilm) cout<<"TARGET PRINTOUT: Single volume for emulsion film chosen: average density: "<<rho_film<<" fraction in mass of emulsion "<<frac_emu<<endl;
+
292 
+
293  TGeoMixture * emufilmmixture = new TGeoMixture("EmulsionFilmMixture", 2.00); // two nuclear emulsions separated by the plastic base
294 
-
295  TGeoMaterial *NEmuMat = NEmu->GetMaterial(); //I need the materials to build the mixture
-
296  TGeoMaterial *PBaseMat = PBase->GetMaterial();
+
295  emufilmmixture->AddElement(NEmuMat,frac_emu);
+
296  emufilmmixture->AddElement(PBaseMat,1. - frac_emu);
297 
-
298  Double_t rho_film = (NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness)/(2* EmulsionThickness + PlasticBaseThickness);
-
299  Double_t frac_emu = NEmuMat->GetDensity() * 2 * EmulsionThickness /(NEmuMat->GetDensity() * 2 * EmulsionThickness + PBaseMat->GetDensity() * PlasticBaseThickness);
-
300 
-
301  if (fsingleemulsionfilm) cout<<"TARGET PRINTOUT: Single volume for emulsion film chosen: average density: "<<rho_film<<" fraction in mass of emulsion "<<frac_emu<<endl;
+
298  TGeoMedium *Emufilm = new TGeoMedium("EmulsionFilm",100,emufilmmixture);
+
299 
+
300  InitMedium("lead");
+
301  TGeoMedium *lead = gGeoManager->GetMedium("lead");
302 
-
303  TGeoMixture * emufilmmixture = new TGeoMixture("EmulsionFilmMixture", 2.00); // two nuclear emulsions separated by the plastic base
-
304 
-
305  emufilmmixture->AddElement(NEmuMat,frac_emu);
-
306  emufilmmixture->AddElement(PBaseMat,1. - frac_emu);
-
307 
-
308  TGeoMedium *Emufilm = new TGeoMedium("EmulsionFilm",100,emufilmmixture);
-
309 
-
310  InitMedium("lead");
-
311  TGeoMedium *lead = gGeoManager->GetMedium("lead");
-
312 
-
313  InitMedium("tungsten");
-
314  TGeoMedium *tungsten = gGeoManager->GetMedium("tungsten");
-
315 
-
316  InitMedium("rohacell");
-
317  TGeoMedium *rohacell = gGeoManager->GetMedium("rohacell");
+
303  InitMedium("tungsten");
+
304  TGeoMedium *tungsten = gGeoManager->GetMedium("tungsten");
+
305 
+
306  InitMedium("Concrete");
+
307  TGeoMedium *Conc =gGeoManager->GetMedium("Concrete");
+
308 
+
309  InitMedium("steel");
+
310  TGeoMedium *Steel =gGeoManager->GetMedium("steel");
+
311 
+
312  Int_t NPlates = number_of_plates; //Number of doublets emulsion + Pb
+
313  Int_t NRohacellGap = 2;
+
314 
+
315  //Definition of the target box containing emulsion bricks + (CES if fDesign = 0 o 1) + target trackers (TT)
+
316  TGeoBBox *TargetBox = new TGeoBBox("TargetBox",XDimension/2, YDimension/2, ZDimension/2);
+
317  TGeoVolume *volTarget = new TGeoVolume("volTarget",TargetBox, air);
318 
-
319  InitMedium("Concrete");
-
320  TGeoMedium *Conc =gGeoManager->GetMedium("Concrete");
-
321 
-
322  InitMedium("steel");
-
323  TGeoMedium *Steel =gGeoManager->GetMedium("steel");
-
324 
-
325  Int_t NPlates = number_of_plates; //Number of doublets emulsion + Pb
-
326  Int_t NRohacellGap = 2;
-
327 
-
328  //Definition of the target box containing emulsion bricks + (CES if fDesign = 0 o 1) + target trackers (TT)
-
329  TGeoBBox *TargetBox = new TGeoBBox("TargetBox",XDimension/2, YDimension/2, ZDimension/2);
-
330  TGeoVolume *volTarget = new TGeoVolume("volTarget",TargetBox, air);
-
331 
-
332  // In both fDesign=0 & fDesign=1 the emulsion target is inserted within a magnet
-
333  if(fDesign!=2 && fDesign!=4)
-
334  {
-
335  TGeoVolume *MagnetVol;
-
336 
-
337  //magnetic field in target
-
338  TGeoUniformMagField *magField2 = new TGeoUniformMagField();
-
339 
-
340  if(fDesign==1) //TP
-
341  {
-
342  magField2->SetFieldValue(fField,0,0.);
-
343  MagnetVol=gGeoManager->GetVolume("Davide");
-
344  }
-
345  if(fDesign==0) //NEW
-
346  {
-
347  MagnetVol=gGeoManager->GetVolume("Goliath");
-
348  magField2->SetFieldValue(0.,fField,0.);
-
349  }
-
350  if(fDesign==3)
-
351  {
-
352  magField2->SetFieldValue(fField,0,0.);
-
353  MagnetVol=gGeoManager->GetVolume("NudetMagnet");
-
354  }
-
355 
-
356  //Definition of the target box containing emulsion bricks + CES + target trackers (TT)
-
357  if (fDesign != 3 && fDesign != 4) volTarget->SetField(magField2);
-
358  volTarget->SetVisibility(1);
-
359  volTarget->SetVisDaughters(1);
-
360  if(fDesign==0) //TP
-
361  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+fCoilH2+YDimension/2,0));
-
362  if(fDesign==1) //NEW
-
363  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+YDimension/2,0));
-
364  if(fDesign==3){
-
365  TGeoVolume *volMagRegion=gGeoManager->GetVolume("volMagRegion");
-
366  Double_t ZDimMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDZ() * 2.; //n.d.r. DZ is the semidimension
-
367  for (int i = 0; i < fNTarget; i++){
-
368  volMagRegion->AddNode(volTarget,i+1,new TGeoTranslation(0,0, -ZDimMagnetizedRegion/2 + ZDimension/2. + i*(ZDimension + 3 * fHpTDZ + 2* fHpTDistance)));
-
369  }
-
370  }
-
371  }
+
319  // In both fDesign=0 & fDesign=1 the emulsion target is inserted within a magnet
+
320  if(fDesign!=2 && fDesign!=4)
+
321  {
+
322  TGeoVolume *MagnetVol = nullptr;
+
323 
+
324  //magnetic field in target
+
325  TGeoUniformMagField *magField2 = new TGeoUniformMagField();
+
326 
+
327  if(fDesign==1) //TP
+
328  {
+
329  magField2->SetFieldValue(fField,0,0.);
+
330  MagnetVol=gGeoManager->GetVolume("Davide");
+
331  }
+
332  if(fDesign==0) //NEW
+
333  {
+
334  MagnetVol=gGeoManager->GetVolume("Goliath");
+
335  magField2->SetFieldValue(0.,fField,0.);
+
336  }
+
337  if(fDesign==3)
+
338  {
+
339  magField2->SetFieldValue(fField,0,0.);
+
340  MagnetVol=gGeoManager->GetVolume("NudetMagnet");
+
341  }
+
342 
+
343  //Definition of the target box containing emulsion bricks + CES + target trackers (TT)
+
344  if (fDesign != 3 && fDesign != 4) volTarget->SetField(magField2);
+
345  volTarget->SetVisibility(1);
+
346  volTarget->SetVisDaughters(1);
+
347  if(fDesign==0) //TP
+
348  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+fCoilH2+YDimension/2,0));
+
349  if(fDesign==1) //NEW
+
350  MagnetVol->AddNode(volTarget,1,new TGeoTranslation(0,-fMagnetY/2+fColumnY+YDimension/2,0));
+
351  if(fDesign==3){
+
352  TGeoVolume *volMagRegion=gGeoManager->GetVolume("volMagRegion");
+
353  Double_t ZDimMagnetizedRegion = ((TGeoBBox*) volMagRegion->GetShape())->GetDZ() * 2.; //n.d.r. DZ is the semidimension
+
354  for (int i = 0; i < fNTarget; i++){
+
355  volMagRegion->AddNode(volTarget,i+1,new TGeoTranslation(0,0, -ZDimMagnetizedRegion/2 + ZDimension/2. + i*(ZDimension + 3 * fHpTDZ + 2* fHpTDistance)));
+
356  }
+
357  }
+
358  }
+
359 
+
360 
+
361 
+
362 
+
363 
+
364 
+
365 
+
366  //
+
367  //Volumes definition
+
368  //
+
369 
+
370  TGeoBBox *Cell = new TGeoBBox("cell", BrickX/2, BrickY/2, CellWidth/2);
+
371  TGeoVolume *volCell = new TGeoVolume("Cell",Cell,air);
372 
-
373 
-
374 
-
375 
-
376 
-
377 
-
378 
-
379  //
-
380  //Volumes definition
-
381  //
-
382 
-
383  TGeoBBox *Cell = new TGeoBBox("cell", BrickX/2, BrickY/2, CellWidth/2);
-
384  TGeoVolume *volCell = new TGeoVolume("Cell",Cell,air);
-
385 
-
386  //Brick
-
387  TGeoBBox *Brick = new TGeoBBox("brick", BrickX/2, BrickY/2, BrickZ/2);
-
388  TGeoVolume *volBrick = new TGeoVolume("Brick",Brick,air);
-
389  volBrick->SetLineColor(kCyan);
-
390  volBrick->SetTransparency(1);
-
391 
-
392  TGeoBBox *Lead, *Tungsten; //need to separate the two cases
-
393  TGeoVolume *volLead, *volTungsten;
+
373  //Brick
+
374  TGeoBBox *Brick = new TGeoBBox("brick", BrickX/2, BrickY/2, BrickZ/2);
+
375  TGeoVolume *volBrick = new TGeoVolume("Brick",Brick,air);
+
376  volBrick->SetLineColor(kCyan);
+
377  volBrick->SetTransparency(1);
+
378  //need to separate the two cases, now with a ternary operator
+
379  auto *Absorber = new TGeoBBox("Absorber", EmulsionX/2, EmulsionY/2, LeadThickness/2);
+
380  auto *volAbsorber = new TGeoVolume("volAbsorber", Absorber, (fDesign < 4) ? lead : tungsten);
+
381 
+
382  volAbsorber->SetTransparency(1);
+
383  volAbsorber->SetLineColor(kGray);
+
384 
+
385  for(Int_t n=0; n<NPlates; n++)
+
386  {
+
387  //decide to use lead or tungsten, according to fDesign
+
388  volBrick->AddNode(volAbsorber, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth + LeadThickness/2 + n*AllPlateWidth));
+
389  }
+
390  if (fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
+
391  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
+
392  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,Emufilm); //TOP
+
393  volEmulsionFilm->SetLineColor(kBlue);
394 
-
395  if (fDesign < 4){
-
396  Lead = new TGeoBBox("Pb", EmulsionX/2, EmulsionY/2, LeadThickness/2);
-
397  volLead = new TGeoVolume("Lead",Lead,lead);
-
398  volLead->SetTransparency(1);
-
399  volLead->SetLineColor(kGray);
-
400  //volLead->SetField(magField2);
-
401  }
-
402  else{
-
403  Tungsten = new TGeoBBox("W", EmulsionX/2, EmulsionY/2, LeadThickness/2);
-
404  volTungsten = new TGeoVolume("Tungsten",Tungsten,tungsten);
-
405  volTungsten->SetTransparency(1);
-
406  volTungsten->SetLineColor(kGray);
-
407  }
-
408 
-
409  for(Int_t n=0; n<NPlates; n++)
-
410  {
-
411  //decide to use lead or tungsten, according to fDesign
-
412  volBrick->AddNode(fDesign < 4 ? volLead: volTungsten, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth + LeadThickness/2 + n*AllPlateWidth));
-
413  }
-
414  if (fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
-
415  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
-
416  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,Emufilm); //TOP
-
417  volEmulsionFilm->SetLineColor(kBlue);
-
418 
-
419  if(fPassive==0)
-
420  {
-
421  AddSensitiveVolume(volEmulsionFilm);
-
422  }
-
423 
-
424  for(Int_t n=0; n<NPlates+1; n++)
-
425  {
-
426  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth/2 + n*AllPlateWidth));
-
427  }
-
428  }
-
429  else { //more accurate configuration, two emulsion films divided by a plastic base
-
430  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
-
431  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,NEmu); //TOP
-
432  TGeoVolume *volEmulsionFilm2 = new TGeoVolume("Emulsion2",EmulsionFilm,NEmu); //BOTTOM
-
433  volEmulsionFilm->SetLineColor(kBlue);
-
434  volEmulsionFilm2->SetLineColor(kBlue);
-
435 
-
436  if(fPassive==0)
-
437  {
-
438  AddSensitiveVolume(volEmulsionFilm);
-
439  AddSensitiveVolume(volEmulsionFilm2);
-
440  }
-
441  TGeoBBox *PlBase = new TGeoBBox("PlBase", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
-
442  TGeoVolume *volPlBase = new TGeoVolume("PlasticBase",PlBase,PBase);
-
443  volPlBase->SetLineColor(kYellow-4);
-
444  for(Int_t n=0; n<NPlates+1; n++)
-
445  {
-
446  volBrick->AddNode(volEmulsionFilm2, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmulsionThickness/2 + n*AllPlateWidth)); //BOTTOM
-
447  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*AllPlateWidth)); //TOP
-
448  volBrick->AddNode(volPlBase, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*AllPlateWidth)); //PLASTIC BASE
+
395  if(fPassive==0)
+
396  {
+
397  AddSensitiveVolume(volEmulsionFilm);
+
398  }
+
399 
+
400  for(Int_t n=0; n<NPlates+1; n++)
+
401  {
+
402  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmPlateWidth/2 + n*AllPlateWidth));
+
403  }
+
404  }
+
405  else { //more accurate configuration, two emulsion films divided by a plastic base
+
406  TGeoBBox *EmulsionFilm = new TGeoBBox("EmulsionFilm", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
+
407  TGeoVolume *volEmulsionFilm = new TGeoVolume("Emulsion",EmulsionFilm,NEmu); //TOP
+
408  TGeoVolume *volEmulsionFilm2 = new TGeoVolume("Emulsion2",EmulsionFilm,NEmu); //BOTTOM
+
409  volEmulsionFilm->SetLineColor(kBlue);
+
410  volEmulsionFilm2->SetLineColor(kBlue);
+
411 
+
412  if(fPassive==0)
+
413  {
+
414  AddSensitiveVolume(volEmulsionFilm);
+
415  AddSensitiveVolume(volEmulsionFilm2);
+
416  }
+
417  TGeoBBox *PlBase = new TGeoBBox("PlBase", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
+
418  TGeoVolume *volPlBase = new TGeoVolume("PlasticBase",PlBase,PBase);
+
419  volPlBase->SetLineColor(kYellow-4);
+
420  for(Int_t n=0; n<NPlates+1; n++)
+
421  {
+
422  volBrick->AddNode(volEmulsionFilm2, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+ EmulsionThickness/2 + n*AllPlateWidth)); //BOTTOM
+
423  volBrick->AddNode(volEmulsionFilm, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*AllPlateWidth)); //TOP
+
424  volBrick->AddNode(volPlBase, n, new TGeoTranslation(0,0,-BrickZ/2+BrickPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*AllPlateWidth)); //PLASTIC BASE
+
425  }
+
426  }
+
427 
+
428  volBrick->SetVisibility(kTRUE);
+
429 
+
430  //The CES is required only in the option with magnet surrounding the emulsion target
+
431  if(fDesign!=2 && fDesign!=4)
+
432  {
+
433  //CES
+
434 
+
435  TGeoBBox *CES = new TGeoBBox("ces", EmulsionX/2, EmulsionY/2, CESWidth/2);
+
436  TGeoVolume *volCES = new TGeoVolume("CES", CES, air);
+
437  volCES->SetTransparency(5);
+
438  volCES->SetLineColor(kYellow-10);
+
439  volCES->SetVisibility(kTRUE);
+
440 
+
441  TGeoBBox *RohGap = new TGeoBBox("RohGap", EmulsionX/2, EmulsionY/2, RohacellGap/2);
+
442  TGeoVolume *volRohGap = new TGeoVolume("RohacellGap",RohGap,air); //using AIR for CES, not rohacell
+
443  volRohGap->SetTransparency(1);
+
444  volRohGap->SetLineColor(kYellow);
+
445 
+
446  for(Int_t n=0; n<NRohacellGap; n++)
+
447  {
+
448  volCES->AddNode(volRohGap, n, new TGeoTranslation(0,0,-CESWidth/2 +CESPackageZ/2+ EmPlateWidth + RohacellGap/2 + n*LayerCESWidth)); //ROHACELL
449  }
-
450  }
-
451 
-
452  volBrick->SetVisibility(kTRUE);
-
453 
-
454  //The CES is required only in the option with magnet surrounding the emulsion target
-
455  if(fDesign!=2 && fDesign!=4)
-
456  {
-
457  //CES
+
450  if(fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
+
451  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
+
452  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,Emufilm); //TOP
+
453  volEmulsionFilmCES->SetLineColor(kBlue);
+
454  if(fPassive==0)
+
455  {
+
456  AddSensitiveVolume(volEmulsionFilmCES);
+
457  }
458 
-
459  TGeoBBox *CES = new TGeoBBox("ces", EmulsionX/2, EmulsionY/2, CESWidth/2);
-
460  TGeoVolume *volCES = new TGeoVolume("CES", CES, air);
-
461  volCES->SetTransparency(5);
-
462  volCES->SetLineColor(kYellow-10);
-
463  volCES->SetVisibility(kTRUE);
-
464 
-
465  TGeoBBox *RohGap = new TGeoBBox("RohGap", EmulsionX/2, EmulsionY/2, RohacellGap/2);
-
466  TGeoVolume *volRohGap = new TGeoVolume("RohacellGap",RohGap,air); //using AIR for CES, not rohacell
-
467  volRohGap->SetTransparency(1);
-
468  volRohGap->SetLineColor(kYellow);
-
469 
-
470  for(Int_t n=0; n<NRohacellGap; n++)
-
471  {
-
472  volCES->AddNode(volRohGap, n, new TGeoTranslation(0,0,-CESWidth/2 +CESPackageZ/2+ EmPlateWidth + RohacellGap/2 + n*LayerCESWidth)); //ROHACELL
-
473  }
-
474  if(fsingleemulsionfilm){ //simplified configuration, unique sensitive layer for the whole emulsion plate
-
475  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmPlateWidth/2);
-
476  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,Emufilm); //TOP
-
477  volEmulsionFilmCES->SetLineColor(kBlue);
-
478  if(fPassive==0)
-
479  {
-
480  AddSensitiveVolume(volEmulsionFilmCES);
-
481  }
-
482 
-
483  for(Int_t n=0; n<NRohacellGap+1;n++)
-
484  {
-
485  volCES->AddNode(volEmulsionFilmCES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmPlateWidth/2+n*LayerCESWidth));
-
486  }
-
487 
-
488  }
-
489  else{ //more accurate configuration, two emulsion films divided by a plastic base
-
490 
-
491  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
-
492  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,NEmu); //TOP
-
493  TGeoVolume *volEmulsionFilm2CES = new TGeoVolume("Emulsion2CES",EmulsionFilmCES,NEmu); //BOTTOM
-
494  volEmulsionFilmCES->SetLineColor(kBlue);
-
495  volEmulsionFilm2CES->SetLineColor(kBlue);
-
496  if(fPassive==0)
-
497  {
-
498  AddSensitiveVolume(volEmulsionFilmCES);
-
499  AddSensitiveVolume(volEmulsionFilm2CES);
-
500  }
-
501  //CES PLASTIC BASE
-
502  TGeoBBox *PlBaseCES = new TGeoBBox("PlBaseCES", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
-
503  TGeoVolume *volPlBaseCES = new TGeoVolume("PlasticBaseCES",PlBaseCES,PBase);
-
504  volPlBaseCES->SetLineColor(kYellow);
-
505  for(Int_t n=0; n<NRohacellGap+1;n++)
-
506  {
-
507  volCES->AddNode(volEmulsionFilm2CES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness/2+n*LayerCESWidth)); //BOTTOM
-
508  volCES->AddNode(volEmulsionFilmCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth)); //TOP
-
509  volCES->AddNode(volPlBaseCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*LayerCESWidth)); //PLASTIC BASE
-
510  // if(n == 2)
-
511  // cout << "-CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth = " << -CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth << endl;
-
512  }
+
459  for(Int_t n=0; n<NRohacellGap+1;n++)
+
460  {
+
461  volCES->AddNode(volEmulsionFilmCES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmPlateWidth/2+n*LayerCESWidth));
+
462  }
+
463 
+
464  }
+
465  else{ //more accurate configuration, two emulsion films divided by a plastic base
+
466 
+
467  TGeoBBox *EmulsionFilmCES = new TGeoBBox("EmulsionFilmCES", EmulsionX/2, EmulsionY/2, EmulsionThickness/2);
+
468  TGeoVolume *volEmulsionFilmCES = new TGeoVolume("EmulsionCES",EmulsionFilmCES,NEmu); //TOP
+
469  TGeoVolume *volEmulsionFilm2CES = new TGeoVolume("Emulsion2CES",EmulsionFilmCES,NEmu); //BOTTOM
+
470  volEmulsionFilmCES->SetLineColor(kBlue);
+
471  volEmulsionFilm2CES->SetLineColor(kBlue);
+
472  if(fPassive==0)
+
473  {
+
474  AddSensitiveVolume(volEmulsionFilmCES);
+
475  AddSensitiveVolume(volEmulsionFilm2CES);
+
476  }
+
477  //CES PLASTIC BASE
+
478  TGeoBBox *PlBaseCES = new TGeoBBox("PlBaseCES", EmulsionX/2, EmulsionY/2, PlasticBaseThickness/2);
+
479  TGeoVolume *volPlBaseCES = new TGeoVolume("PlasticBaseCES",PlBaseCES,PBase);
+
480  volPlBaseCES->SetLineColor(kYellow);
+
481  for(Int_t n=0; n<NRohacellGap+1;n++)
+
482  {
+
483  volCES->AddNode(volEmulsionFilm2CES,n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness/2+n*LayerCESWidth)); //BOTTOM
+
484  volCES->AddNode(volEmulsionFilmCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth)); //TOP
+
485  volCES->AddNode(volPlBaseCES, n, new TGeoTranslation(0,0,-CESWidth/2+CESPackageZ/2+EmulsionThickness+PlasticBaseThickness/2+n*LayerCESWidth)); //PLASTIC BASE
+
486  // if(n == 2)
+
487  // cout << "-CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth = " << -CESWidth/2+3*EmulsionThickness/2+PlasticBaseThickness+n*LayerCESWidth << endl;
+
488  }
+
489 
+
490  }
+
491 
+
492  volCell->AddNode(volBrick,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ/2));
+
493  volCell->AddNode(volCES,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ + CESWidth/2));
+
494 
+
495  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, CellWidth/2);
+
496  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
+
497  volRow->SetLineColor(20);
+
498 
+
499  Double_t d_cl_x = -WallXDim/2;
+
500  for(int j= 0; j < fNCol; j++)
+
501  {
+
502  volRow->AddNode(volCell,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
+
503  d_cl_x += BrickX;
+
504  }
+
505 
+
506  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, CellWidth/2);
+
507  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
+
508 
+
509  Double_t d_cl_y = -WallYDim/2;
+
510  for(int k= 0; k< fNRow; k++)
+
511  {
+
512  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
513 
-
514  }
-
515 
-
516  volCell->AddNode(volBrick,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ/2));
-
517  volCell->AddNode(volCES,1,new TGeoTranslation(0,0,-CellWidth/2 + BrickZ + CESWidth/2));
-
518 
-
519  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, CellWidth/2);
-
520  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
-
521  volRow->SetLineColor(20);
-
522 
-
523  Double_t d_cl_x = -WallXDim/2;
-
524  for(int j= 0; j < fNCol; j++)
-
525  {
-
526  volRow->AddNode(volCell,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
-
527  d_cl_x += BrickX;
+
514  // 2mm is the distance for the structure that holds the brick
+
515  d_cl_y += BrickY + Ydistance;
+
516  }
+
517 
+
518  //Columns
+
519 
+
520  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
+
521 
+
522  for(int l = 0; l < fNWall; l++)
+
523  {
+
524  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +CellWidth/2));
+
525 
+
526  //6 cm is the distance between 2 columns of consecutive Target for TT placement
+
527  d_cl_z += CellWidth + TTrackerZ;
528  }
-
529 
-
530  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, CellWidth/2);
-
531  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
-
532 
-
533  Double_t d_cl_y = -WallYDim/2;
-
534  for(int k= 0; k< fNRow; k++)
+
529  }
+
530 
+
531 
+
532  //in fDesign==2 and fDesign==4 the emulsion target is not surrounded by a magnet => no magnetic field inside
+
533  //In the no Magnetic field option, no CES is needed => only brick walls + TT
+
534  if(fDesign==2 || fDesign == 4)
535  {
-
536  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
+
536  EmulsionMagnet emuMag;
537 
-
538  // 2mm is the distance for the structure that holds the brick
-
539  d_cl_y += BrickY + Ydistance;
-
540  }
-
541 
-
542  //Columns
-
543 
-
544  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
-
545  Double_t d_tt = -ZDimension/2 + TTrackerZ/2;
+
538  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
+
539  cout<< "Tau Nu Detector fMagnetConfig: "<< fDesign<<endl;
+
540 
+
541  tTauNuDet->AddNode(volTarget,1,new TGeoTranslation(0,0,fCenterZ));
+
542 
+
543  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, WallZDim/2);
+
544  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
+
545  volRow->SetLineColor(20);
546 
-
547  for(int l = 0; l < fNWall; l++)
-
548  {
-
549  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +CellWidth/2));
-
550 
-
551  //6 cm is the distance between 2 columns of consecutive Target for TT placement
-
552  d_cl_z += CellWidth + TTrackerZ;
-
553  }
-
554  }
-
555 
+
547  Double_t d_cl_x = -WallXDim/2;
+
548  for(int j= 0; j < fNCol; j++)
+
549  {
+
550  volRow->AddNode(volBrick,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
+
551  d_cl_x += BrickX;
+
552  }
+
553  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, WallZDim/2);
+
554  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
+
555  volWall->SetLineColor(kGreen);
556 
-
557  //in fDesign==2 and fDesign==4 the emulsion target is not surrounded by a magnet => no magnetic field inside
-
558  //In the no Magnetic field option, no CES is needed => only brick walls + TT
-
559  if(fDesign==2 || fDesign == 4)
-
560  {
-
561  EmulsionMagnet emuMag;
-
562 
-
563  TGeoVolume *tTauNuDet = gGeoManager->GetVolume("tTauNuDet");
-
564  cout<< "Tau Nu Detector fMagnetConfig: "<< fDesign<<endl;
-
565 
-
566  tTauNuDet->AddNode(volTarget,1,new TGeoTranslation(0,0,fCenterZ));
-
567 
-
568  TGeoBBox *Row = new TGeoBBox("row",WallXDim/2, BrickY/2, WallZDim/2);
-
569  TGeoVolume *volRow = new TGeoVolume("Row",Row,air);
-
570  volRow->SetLineColor(20);
-
571 
-
572  Double_t d_cl_x = -WallXDim/2;
-
573  for(int j= 0; j < fNCol; j++)
-
574  {
-
575  volRow->AddNode(volBrick,j,new TGeoTranslation(d_cl_x+BrickX/2, 0, 0));
-
576  d_cl_x += BrickX;
-
577  }
-
578  TGeoBBox *Wall = new TGeoBBox("wall",WallXDim/2, WallYDim/2, WallZDim/2);
-
579  TGeoVolume *volWall = new TGeoVolume("Wall",Wall,air);
-
580  volWall->SetLineColor(kGreen);
-
581 
-
582  Double_t d_cl_y = -WallYDim/2;
-
583  for(int k= 0; k< fNRow; k++)
-
584  {
-
585  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
-
586 
-
587  // 2mm is the distance for the structure that holds the brick
-
588  d_cl_y += BrickY + Ydistance;
-
589  }
-
590  //Columns
-
591 
-
592  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
-
593  Double_t d_tt = -ZDimension/2 + TTrackerZ/2;
-
594 
-
595  for(int l = 0; l < fNWall; l++)
-
596  {
-
597  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +BrickZ/2));
-
598 
-
599  //6 cm is the distance between 2 columns of consecutive Target for TT placement
-
600  d_cl_z += BrickZ + TTrackerZ;
-
601  }
-
602  if(fDesign==2)
-
603  {
-
604  TGeoBBox *Base = new TGeoBBox("Base", fBaseX/2, fBaseY/2, fBaseZ/2);
-
605  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
-
606  volBase->SetLineColor(kYellow-3);
-
607  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-WallYDim/2 - fBaseY/2,fCenterZ));
-
608 
-
609  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
-
610  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
-
611  PillarVol->SetLineColor(kGreen+3);
-
612  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
-
613  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
-
614  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
-
615  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
-
616  }
-
617  }
-
618 }//end construct geometry
+
557  Double_t d_cl_y = -WallYDim/2;
+
558  for(int k= 0; k< fNRow; k++)
+
559  {
+
560  volWall->AddNode(volRow,k,new TGeoTranslation(0, d_cl_y + BrickY/2, 0));
+
561 
+
562  // 2mm is the distance for the structure that holds the brick
+
563  d_cl_y += BrickY + Ydistance;
+
564  }
+
565  //Columns
+
566 
+
567  Double_t d_cl_z = - ZDimension/2 + TTrackerZ;
+
568 
+
569  for(int l = 0; l < fNWall; l++)
+
570  {
+
571  volTarget->AddNode(volWall,l,new TGeoTranslation(0, 0, d_cl_z +BrickZ/2));
+
572 
+
573  //6 cm is the distance between 2 columns of consecutive Target for TT placement
+
574  d_cl_z += BrickZ + TTrackerZ;
+
575  }
+
576  if(fDesign==2)
+
577  {
+
578  TGeoBBox *Base = new TGeoBBox("Base", fBaseX/2, fBaseY/2, fBaseZ/2);
+
579  TGeoVolume *volBase = new TGeoVolume("volBase",Base,Conc);
+
580  volBase->SetLineColor(kYellow-3);
+
581  tTauNuDet->AddNode(volBase,1, new TGeoTranslation(0,-WallYDim/2 - fBaseY/2,fCenterZ));
+
582 
+
583  TGeoBBox *PillarBox = new TGeoBBox(fPillarX/2,fPillarY/2, fPillarZ/2);
+
584  TGeoVolume *PillarVol = new TGeoVolume("PillarVol",PillarBox,Steel);
+
585  PillarVol->SetLineColor(kGreen+3);
+
586  tTauNuDet->AddNode(PillarVol,1, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
+
587  tTauNuDet->AddNode(PillarVol,2, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ-ZDimension/2+fPillarZ/2));
+
588  tTauNuDet->AddNode(PillarVol,3, new TGeoTranslation(-XDimension/2+fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
+
589  tTauNuDet->AddNode(PillarVol,4, new TGeoTranslation(XDimension/2-fPillarX/2,-YDimension/2-fBaseY-fPillarY/2, fCenterZ+ZDimension/2-fPillarZ/2));
+
590  }
+
591  }
+
592 }//end construct geometry
Double_t fCenterZ
Definition: Target.h:153
Double_t CESWidth
Definition: Target.h:202
@@ -1034,7 +1008,6 @@

int i
Definition: ShipAna.py:86

dictionary l
-

@@ -1147,41 +1120,41 @@

-

Definition at line 749 of file Target.cxx.

-
750 {
-
751  Bool_t BrickorCES = 0, TopBot = 0;
-
752 
-
753  NWall = detID/1E7;
-
754  NRow = (detID - NWall*1E7)/1E6;
-
755  NColumn = (detID - NWall*1E7 -NRow*1E6)/1E4;
-
756  Double_t b = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4)/1.E3;
-
757  if(b < 1)
-
758  {
-
759  BrickorCES = 0;
-
760  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
-
761 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
-
762  }
-
763  if(b >= 1)
-
764  {
-
765  BrickorCES = 1;
-
766  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
-
767 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
-
768  }
-
769  EmTop = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4- BrickorCES*1E3- NPlate*1E1)/1E0;
-
770  if(BrickorCES == 0)
-
771  {
-
772  EmCES = 1; EmBrick =0;
-
773  }
-
774  if(BrickorCES == 1)
-
775  {
-
776  EmBrick = 1; EmCES =0;
-
777  }
-
778 
-
779  // cout << "NPlate = " << NPlate << "; NColumn = " << NColumn << "; NRow = " << NRow << "; NWall = " << NWall << endl;
-
780  // cout << "BrickorCES = " << BrickorCES <<endl;
-
781  // cout << "EmCES = " << EmCES << "; EmBrick = " << EmBick << endl;
-
782  // cout << endl;
-
783 }
+

Definition at line 715 of file Target.cxx.

+
716 {
+
717  Bool_t BrickorCES = false;
+
718 
+
719  NWall = detID/1E7;
+
720  NRow = (detID - NWall*1E7)/1E6;
+
721  NColumn = (detID - NWall*1E7 -NRow*1E6)/1E4;
+
722  Double_t b = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4)/1.E3;
+
723  if(b < 1)
+
724  {
+
725  BrickorCES = 0;
+
726  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
+
727 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
+
728  }
+
729  if(b >= 1)
+
730  {
+
731  BrickorCES = 1;
+
732  NPlate = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3)/1E1;
+
733 // NPlate = detID - NWall*1E7 -NRow*1E6 - NColumn*1E4 - BrickorCES*1E3;
+
734  }
+
735  EmTop = (detID - NWall*1E7 -NRow*1E6 - NColumn*1E4- BrickorCES*1E3- NPlate*1E1)/1E0;
+
736  if(BrickorCES == 0)
+
737  {
+
738  EmCES = 1; EmBrick =0;
+
739  }
+
740  if(BrickorCES == 1)
+
741  {
+
742  EmBrick = 1; EmCES =0;
+
743  }
+
744 
+
745  // cout << "NPlate = " << NPlate << "; NColumn = " << NColumn << "; NRow = " << NRow << "; NWall = " << NWall << endl;
+
746  // cout << "BrickorCES = " << BrickorCES <<endl;
+
747  // cout << "EmCES = " << EmCES << "; EmBrick = " << EmBick << endl;
+
748  // cout << endl;
+
749 }
@@ -1208,10 +1181,10 @@

-

Definition at line 786 of file Target.cxx.

-
787 {
-
788  fTargetPointCollection->Clear();
-
789 }
+

Definition at line 752 of file Target.cxx.

+
753 {
+
754  fTargetPointCollection->Clear();
+
755 }
@@ -1296,11 +1269,11 @@

Gets the produced collections

-

Definition at line 805 of file Target.cxx.

-
806 {
-
807  if (iColl == 0) { return fTargetPointCollection; }
-
808  else { return NULL; }
-
809 }
+

Definition at line 771 of file Target.cxx.

+
772 {
+
773  if (iColl == 0) { return fTargetPointCollection; }
+
774  else { return NULL; }
+
775 }
@@ -1531,134 +1504,126 @@

Definition at line 620 of file Target.cxx.

-
621 {
-
623  //Set parameters at entrance of volume. Reset ELoss.
-
624  if ( gMC->IsTrackEntering() ) {
-
625  fELoss = 0.;
-
626  fTime = gMC->TrackTime() * 1.0e09;
-
627  fLength = gMC->TrackLength();
-
628  gMC->TrackPosition(fPos);
-
629  gMC->TrackMomentum(fMom);
-
630  }
-
631  // Sum energy loss for all steps in the active volume
-
632  fELoss += gMC->Edep();
-
633 
-
634  // Create muonPoint at exit of active volume
-
635  if ( gMC->IsTrackExiting() ||
-
636  gMC->IsTrackStop() ||
-
637  gMC->IsTrackDisappeared() ) {
-
638  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
639  //Int_t fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
640  gMC->CurrentVolID(fVolumeID);
-
641  Int_t detID = fVolumeID;
-
642  //gGeoManager->PrintOverlaps();
-
643 
-
644  //cout<< "detID = " << detID << endl;
-
645  Int_t MaxLevel = gGeoManager->GetLevel();
-
646  const Int_t MaxL = MaxLevel;
-
647  //cout << "MaxLevel = " << MaxL << endl;
-
648  //cout << gMC->CurrentVolPath()<< endl;
-
649 
-
650 
-
651  Int_t motherV[MaxL];
-
652 // Bool_t EmTop = 0, EmBot = 0, EmCESTop = 0, EmCESBot = 0;
-
653  Bool_t EmBrick = 0, EmCES = 0, EmTop;
-
654  Int_t NPlate =0;
-
655  const char *name;
-
656 
-
657  name = gMC->CurrentVolName();
-
658  //cout << name << endl;
+

Definition at line 594 of file Target.cxx.

+
595 {
+
597  //Set parameters at entrance of volume. Reset ELoss.
+
598  if ( gMC->IsTrackEntering() ) {
+
599  fELoss = 0.;
+
600  fTime = gMC->TrackTime() * 1.0e09;
+
601  fLength = gMC->TrackLength();
+
602  gMC->TrackPosition(fPos);
+
603  gMC->TrackMomentum(fMom);
+
604  }
+
605  // Sum energy loss for all steps in the active volume
+
606  fELoss += gMC->Edep();
+
607 
+
608  // Create muonPoint at exit of active volume
+
609  if ( gMC->IsTrackExiting() ||
+
610  gMC->IsTrackStop() ||
+
611  gMC->IsTrackDisappeared() ) {
+
612  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
613  //Int_t fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
614  gMC->CurrentVolID(fVolumeID);
+
615  Int_t detID = fVolumeID;
+
616  //gGeoManager->PrintOverlaps();
+
617 
+
618  //cout<< "detID = " << detID << endl;
+
619  Int_t MaxLevel = gGeoManager->GetLevel();
+
620  const Int_t MaxL = MaxLevel;
+
621  //cout << "MaxLevel = " << MaxL << endl;
+
622  //cout << gMC->CurrentVolPath()<< endl;
+
623 
+
624 
+
625  Int_t motherV[MaxL];
+
626 // Bool_t EmTop = 0, EmBot = 0, EmCESTop = 0, EmCESBot = 0;
+
627  Bool_t EmBrick = false;
+
628  Bool_t EmTop = false;
+
629  Int_t NPlate =0;
+
630  const char *name;
+
631 
+
632  name = gMC->CurrentVolName();
+
633  //cout << name << endl;
+
634 
+
635  if(strcmp(name, "Emulsion") == 0)
+
636  {
+
637  EmBrick=1;
+
638  NPlate = detID;
+
639  EmTop=1;
+
640  }
+
641  if(strcmp(name, "Emulsion2") == 0)
+
642  {
+
643  EmBrick=1;
+
644  NPlate = detID;
+
645  EmTop=0;
+
646  }
+
647  if(strcmp(name, "EmulsionCES") == 0)
+
648  {
+
649  NPlate = detID;
+
650  EmTop=1;
+
651  }
+
652  if(strcmp(name, "Emulsion2CES") == 0)
+
653  {
+
654  NPlate = detID;
+
655  EmTop=0;
+
656  }
+
657 
+
658  Int_t NWall = 0, NColumn =0, NRow =0;
659 
-
660  if(strcmp(name, "Emulsion") == 0)
+
660  for(Int_t i = 0; i < MaxL;i++)
661  {
-
662  EmBrick=1;
-
663  NPlate = detID;
-
664  EmTop=1;
-
665  }
-
666  if(strcmp(name, "Emulsion2") == 0)
-
667  {
-
668  EmBrick=1;
-
669  NPlate = detID;
-
670  EmTop=0;
-
671  }
-
672  if(strcmp(name, "EmulsionCES") == 0)
-
673  {
-
674  EmCES=1;
-
675  NPlate = detID;
-
676  EmTop=1;
-
677  }
-
678  if(strcmp(name, "Emulsion2CES") == 0)
-
679  {
-
680  EmCES=1;
-
681  NPlate = detID;
-
682  EmTop=0;
-
683  }
+
662  motherV[i] = gGeoManager->GetMother(i)->GetNumber();
+
663  const char *mumname = gMC->CurrentVolOffName(i);
+
664  if(motherV[0]==1 && motherV[0]!=detID)
+
665  {
+
666  if(strcmp(mumname, "Brick") == 0 ||strcmp(mumname, "CES") == 0) NColumn = motherV[i];
+
667  if(strcmp(mumname, "Cell") == 0) NRow = motherV[i];
+
668  if(strcmp(mumname, "Row") == 0) NWall = motherV[i];
+
669  if((strcmp(mumname, "Wall") == 0)&& (motherV[i]==2)) NWall += fNWall;
+
670  }
+
671  else
+
672  {
+
673 
+
674  if(strcmp(mumname, "Cell") == 0) NColumn = motherV[i];
+
675  if(strcmp(mumname, "Row") == 0) NRow = motherV[i];
+
676  if(strcmp(mumname, "Wall") == 0) NWall = motherV[i];
+
677  if((strcmp(mumname, "volTarget") == 0) && (motherV[i]==2)) NWall += fNWall;
+
678  }
+
679  //cout << i << " " << motherV[i] << " name = " << mumname << endl;
+
680  }
+
681 
+
682  Bool_t BrickorCES = EmBrick == 1;
+
683 
684 
-
685  Int_t NWall = 0, NColumn =0, NRow =0;
+
685  detID = (NWall+1) *1E7 + (NRow+1) * 1E6 + (NColumn+1)*1E4 + BrickorCES *1E3 + (NPlate+1)*1E1 + EmTop*1 ;
686 
-
687  for(Int_t i = 0; i < MaxL;i++)
-
688  {
-
689  motherV[i] = gGeoManager->GetMother(i)->GetNumber();
-
690  const char *mumname = gMC->CurrentVolOffName(i);
-
691  if(motherV[0]==1 && motherV[0]!=detID)
-
692  {
-
693  if(strcmp(mumname, "Brick") == 0 ||strcmp(mumname, "CES") == 0) NColumn = motherV[i];
-
694  if(strcmp(mumname, "Cell") == 0) NRow = motherV[i];
-
695  if(strcmp(mumname, "Row") == 0) NWall = motherV[i];
-
696  if((strcmp(mumname, "Wall") == 0)&& (motherV[i]==2)) NWall += fNWall;
-
697  }
-
698  else
-
699  {
+
687 
+
688  fVolumeID = detID;
+
689 
+
690  if (fELoss == 0. ) { return kFALSE; }
+
691  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
692  //Int_t MotherID =gMC->GetStack()->GetCurrentParentTrackNumber();
+
693  Int_t pdgCode = p->GetPdgCode();
+
694 
+
695  TLorentzVector Pos;
+
696  gMC->TrackPosition(Pos);
+
697  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
698  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
699  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
700 
-
701  if(strcmp(mumname, "Cell") == 0) NColumn = motherV[i];
-
702  if(strcmp(mumname, "Row") == 0) NRow = motherV[i];
-
703  if(strcmp(mumname, "Wall") == 0) NWall = motherV[i];
-
704  if((strcmp(mumname, "volTarget") == 0) && (motherV[i]==2)) NWall += fNWall;
-
705  }
-
706  //cout << i << " " << motherV[i] << " name = " << mumname << endl;
-
707  }
-
708 
-
709  Bool_t BrickorCES = 0; //Brick = 1 / CES = 0;
-
710  if(EmBrick==1)
-
711  BrickorCES = 1;
-
712 
-
713  Double_t zEnd = 0, zStart =0;
-
714 
-
715 
-
716  detID = (NWall+1) *1E7 + (NRow+1) * 1E6 + (NColumn+1)*1E4 + BrickorCES *1E3 + (NPlate+1)*1E1 + EmTop*1 ;
-
717 
-
718 
-
719  fVolumeID = detID;
-
720 
-
721  if (fELoss == 0. ) { return kFALSE; }
-
722  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
723  //Int_t MotherID =gMC->GetStack()->GetCurrentParentTrackNumber();
-
724  Int_t fMotherID =p->GetFirstMother();
-
725  Int_t pdgCode = p->GetPdgCode();
-
726 
-
727  // cout << "ID = "<< fTrackID << " pdg = " << pdgCode << "; M = " << fMotherID << " Npl = " << NPlate<<"; NCol = " << NColumn << "; NRow = " << NRow << "; NWall = " << NWall<< " P = " << fMom.Px() << ", "<< fMom.Py() << ", " << fMom.Pz() << endl;
-
728 
-
729  TLorentzVector Pos;
-
730  gMC->TrackPosition(Pos);
-
731  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
732  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
733  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
734 
-
735 
-
736  AddHit(fTrackID,fVolumeID, TVector3(xmean, ymean, zmean),
-
737  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
-
738  fELoss, pdgCode);
-
739 
-
740  // Increment number of muon det points in TParticle
-
741  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
742  stack->AddPoint(ktauTarget);
-
743  }
-
744 
-
745  return kTRUE;
-
746 }
+
701 
+
702  AddHit(fTrackID,fVolumeID, TVector3(xmean, ymean, zmean),
+
703  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
+
704  fELoss, pdgCode);
+
705 
+
706  // Increment number of muon det points in TParticle
+
707  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
708  stack->AddPoint(ktauTarget);
+
709  }
+
710 
+
711  return kTRUE;
+
712 }
-
TargetPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: Target.cxx:817
+
TargetPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Definition: Target.cxx:783
@@ -1691,12 +1656,12 @@

TargetPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

-

Definition at line 792 of file Target.cxx.

-
793 {
-
794 
-
801  FairRootManager::Instance()->Register("TargetPoint", "Target",
-
802  fTargetPointCollection, kTRUE);
-
803 }
+

Definition at line 758 of file Target.cxx.

+
759 {
+
760 
+
767  FairRootManager::Instance()->Register("TargetPoint", "Target",
+
768  fTargetPointCollection, kTRUE);
+
769 }

@@ -1725,10 +1690,10 @@

Definition at line 811 of file Target.cxx.

-
812 {
-
813  fTargetPointCollection->Clear();
-
814 }
+

Definition at line 777 of file Target.cxx.

+
778 {
+
779  fTargetPointCollection->Clear();
+
780 }

diff --git a/classTargetTracker.html b/classTargetTracker.html index d09c56bcc0..cdca28d60f 100644 --- a/classTargetTracker.html +++ b/classTargetTracker.html @@ -473,14 +473,14 @@

This method is an example of how to add your own point of type muonPoint to the clones array

-

Definition at line 348 of file TargetTracker.cxx.

-
352 {
-
353  TClonesArray& clref = *fTTPointCollection;
-
354  Int_t size = clref.GetEntriesFast();
-
355  //cout << "brick hit called"<< pos.z()<<endl;
-
356  return new(clref[size]) TTPoint(trackID,detID, pos, mom,
-
357  time, length, eLoss, pdgCode);
-
358 }
+

Definition at line 346 of file TargetTracker.cxx.

+
350 {
+
351  TClonesArray& clref = *fTTPointCollection;
+
352  Int_t size = clref.GetEntriesFast();
+
353  //cout << "brick hit called"<< pos.z()<<endl;
+
354  return new(clref[size]) TTPoint(trackID,detID, pos, mom,
+
355  time, length, eLoss, pdgCode);
+
356 }
@@ -589,87 +589,85 @@

Definition at line 172 of file TargetTracker.cxx.

173 {
-
174  InitMedium("TTmedium");
-
175  TGeoMedium *TTmedium = gGeoManager->GetMedium("TTmedium");
-
176 
-
177  InitMedium("vacuum");
-
178  TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
-
179 
-
180  InitMedium("CarbonComposite");
-
181  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
-
182 
-
183  InitMedium("SciFiMat");
-
184  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
-
185 
-
186  InitMedium("Airex");
-
187  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
-
188 
-
189  //Target Tracker
-
190  TGeoVolume *volTarget = gGeoManager->GetVolume("volTarget");
-
191 
-
192  TGeoBBox* TT_box = new TGeoBBox("TT_box", TTrackerX / 2, TTrackerY / 2, TTrackerZ / 2);
-
193  TGeoVolume* TT_volume = new TGeoVolume("TT", TT_box, vacuum);
-
194  TT_volume->SetLineColor(kBlue - 1);
-
195  //TT_volume->SetTransparency(1);
-
196  TT_volume->SetVisibility(1);
-
197  TT_volume->SetVisDaughters(1);
-
198 
-
199  //Support Carbon Composite
-
200  TGeoBBox* TT_support_box = new TGeoBBox("TT_support_box", TTrackerX / 2, TTrackerY / 2, support_z / 2);
-
201  TGeoVolume* TT_support_volume = new TGeoVolume("TT_support", TT_support_box, CarbonComposite);
-
202  TT_support_volume->SetLineColor(kGray - 2);
-
203  TT_support_volume->SetVisibility(1);
-
204 
-
205  //Honeycomb Airex (or Nomex)
-
206  TGeoBBox* TT_honeycomb_box = new TGeoBBox("TT_honeycomb_box", TTrackerX / 2, TTrackerY / 2, honeycomb_z / 2);
-
207  TGeoVolume* TT_honeycomb_volume = new TGeoVolume("TT_honeycomb", TT_honeycomb_box, Airex);
-
208  TT_honeycomb_volume->SetLineColor(kYellow);
-
209  TT_honeycomb_volume->SetVisibility(1);
-
210 
-
211  //SciFi planes
-
212  TGeoBBox* TT_scifi_plane_hor_box = new TGeoBBox("TT_scifi_plane_hor_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
-
213  TGeoVolume* TT_scifi_plane_hor_volume = new TGeoVolume("TT_scifi_plane_hor", TT_scifi_plane_hor_box, SciFiMat);
-
214  TT_scifi_plane_hor_volume->SetVisibility(1);
-
215 
-
216  TGeoBBox* TT_scifi_plane_vert_box = new TGeoBBox("TT_scifi_plane_vert_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
-
217  TGeoVolume* TT_scifi_plane_vert_volume = new TGeoVolume("TT_scifi_plane_vert", TT_scifi_plane_vert_box, SciFiMat);
-
218  TT_scifi_plane_vert_volume->SetVisibility(1);
-
219 
-
220  //SciFi mats for X and Y
-
221  TGeoBBox* TT_scifimat_hor_box = new TGeoBBox("TT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
-
222  TGeoVolume* TT_scifimat_hor_volume = new TGeoVolume("TT_scifimat_hor", TT_scifimat_hor_box, SciFiMat);
-
223  TT_scifimat_hor_volume->SetLineColor(kCyan-9);
-
224 
-
225  TGeoBBox* TT_scifimat_vert_box = new TGeoBBox("TT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
-
226  TGeoVolume* TT_scifimat_vert_volume = new TGeoVolume("TT_scifimat_vert", TT_scifimat_vert_box, SciFiMat);
-
227  TT_scifimat_vert_volume->SetLineColor(kGreen-7);
-
228 
-
229  //Add SciFi mat as sensitive unit
-
230  AddSensitiveVolume(TT_scifimat_hor_volume);
-
231  AddSensitiveVolume(TT_scifimat_vert_volume);
-
232 
-
233  //Creating physical volumes and multiply
-
234  for (int i = 0; i < n_hor_planes; i++){
-
235  TT_scifi_plane_hor_volume->AddNode(TT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
-
236  }
-
237  for (int i = 0; i < n_vert_planes; i++){
-
238  TT_scifi_plane_vert_volume->AddNode(TT_scifimat_vert_volume, 100+i+1, new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
-
239  }
-
240 
-
241  TT_volume->AddNode(TT_support_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z/2));
-
242  TT_volume->AddNode(TT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z/2));
-
243  TT_volume->AddNode(TT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z + scifimat_z/2));
-
244  TT_volume->AddNode(TT_honeycomb_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z/2));
-
245  TT_volume->AddNode(TT_support_volume, 1, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z + support_z/2));
+
174 
+
175  InitMedium("vacuum");
+
176  TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
+
177 
+
178  InitMedium("CarbonComposite");
+
179  TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
+
180 
+
181  InitMedium("SciFiMat");
+
182  TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
+
183 
+
184  InitMedium("Airex");
+
185  TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
+
186 
+
187  //Target Tracker
+
188  TGeoVolume *volTarget = gGeoManager->GetVolume("volTarget");
+
189 
+
190  TGeoBBox* TT_box = new TGeoBBox("TT_box", TTrackerX / 2, TTrackerY / 2, TTrackerZ / 2);
+
191  TGeoVolume* TT_volume = new TGeoVolume("TT", TT_box, vacuum);
+
192  TT_volume->SetLineColor(kBlue - 1);
+
193  //TT_volume->SetTransparency(1);
+
194  TT_volume->SetVisibility(1);
+
195  TT_volume->SetVisDaughters(1);
+
196 
+
197  //Support Carbon Composite
+
198  TGeoBBox* TT_support_box = new TGeoBBox("TT_support_box", TTrackerX / 2, TTrackerY / 2, support_z / 2);
+
199  TGeoVolume* TT_support_volume = new TGeoVolume("TT_support", TT_support_box, CarbonComposite);
+
200  TT_support_volume->SetLineColor(kGray - 2);
+
201  TT_support_volume->SetVisibility(1);
+
202 
+
203  //Honeycomb Airex (or Nomex)
+
204  TGeoBBox* TT_honeycomb_box = new TGeoBBox("TT_honeycomb_box", TTrackerX / 2, TTrackerY / 2, honeycomb_z / 2);
+
205  TGeoVolume* TT_honeycomb_volume = new TGeoVolume("TT_honeycomb", TT_honeycomb_box, Airex);
+
206  TT_honeycomb_volume->SetLineColor(kYellow);
+
207  TT_honeycomb_volume->SetVisibility(1);
+
208 
+
209  //SciFi planes
+
210  TGeoBBox* TT_scifi_plane_hor_box = new TGeoBBox("TT_scifi_plane_hor_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
+
211  TGeoVolume* TT_scifi_plane_hor_volume = new TGeoVolume("TT_scifi_plane_hor", TT_scifi_plane_hor_box, SciFiMat);
+
212  TT_scifi_plane_hor_volume->SetVisibility(1);
+
213 
+
214  TGeoBBox* TT_scifi_plane_vert_box = new TGeoBBox("TT_scifi_plane_vert_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
+
215  TGeoVolume* TT_scifi_plane_vert_volume = new TGeoVolume("TT_scifi_plane_vert", TT_scifi_plane_vert_box, SciFiMat);
+
216  TT_scifi_plane_vert_volume->SetVisibility(1);
+
217 
+
218  //SciFi mats for X and Y
+
219  TGeoBBox* TT_scifimat_hor_box = new TGeoBBox("TT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
+
220  TGeoVolume* TT_scifimat_hor_volume = new TGeoVolume("TT_scifimat_hor", TT_scifimat_hor_box, SciFiMat);
+
221  TT_scifimat_hor_volume->SetLineColor(kCyan-9);
+
222 
+
223  TGeoBBox* TT_scifimat_vert_box = new TGeoBBox("TT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
+
224  TGeoVolume* TT_scifimat_vert_volume = new TGeoVolume("TT_scifimat_vert", TT_scifimat_vert_box, SciFiMat);
+
225  TT_scifimat_vert_volume->SetLineColor(kGreen-7);
+
226 
+
227  //Add SciFi mat as sensitive unit
+
228  AddSensitiveVolume(TT_scifimat_hor_volume);
+
229  AddSensitiveVolume(TT_scifimat_vert_volume);
+
230 
+
231  //Creating physical volumes and multiply
+
232  for (int i = 0; i < n_hor_planes; i++){
+
233  TT_scifi_plane_hor_volume->AddNode(TT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
+
234  }
+
235  for (int i = 0; i < n_vert_planes; i++){
+
236  TT_scifi_plane_vert_volume->AddNode(TT_scifimat_vert_volume, 100+i+1, new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
+
237  }
+
238 
+
239  TT_volume->AddNode(TT_support_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z/2));
+
240  TT_volume->AddNode(TT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z/2));
+
241  TT_volume->AddNode(TT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z + scifimat_z/2));
+
242  TT_volume->AddNode(TT_honeycomb_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z/2));
+
243  TT_volume->AddNode(TT_support_volume, 1, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z + support_z/2));
+
244 
+
245  Double_t first_tt_position = -ZDimension / 2 + TTrackerZ / 2;
246 
-
247  Double_t first_tt_position = -ZDimension / 2 + TTrackerZ / 2;
-
248 
-
249  //fNTT - number of TT walls
-
250  for (int l = 0; l < fNTT; ++l){
-
251  volTarget->AddNode(TT_volume, 1000*(l+1), new TGeoTranslation(0, 0, first_tt_position + l * (TTrackerZ + CellWidth)));
-
252  }
-
253 
-
254 }
+
247  //fNTT - number of TT walls
+
248  for (int l = 0; l < fNTT; ++l){
+
249  volTarget->AddNode(TT_volume, 1000*(l+1), new TGeoTranslation(0, 0, first_tt_position + l * (TTrackerZ + CellWidth)));
+
250  }
+
251 
+
252 }
Double_t ZDimension
Double_t support_z
@@ -771,16 +769,16 @@

-

Definition at line 305 of file TargetTracker.cxx.

-
306 {
-
307  NTT = detID/1000;
-
308  int idir = (detID - NTT*1000)/100;
-
309 
-
310  if (idir == 1) ishor = kFALSE;
-
311  else if (idir == 0) ishor = kTRUE;
-
312 
-
313  nplane = (detID - NTT*1000 - idir*100);
-
314 }
+

Definition at line 303 of file TargetTracker.cxx.

+
304 {
+
305  NTT = detID/1000;
+
306  int idir = (detID - NTT*1000)/100;
+
307 
+
308  if (idir == 1) ishor = kFALSE;
+
309  else if (idir == 0) ishor = kTRUE;
+
310 
+
311  nplane = (detID - NTT*1000 - idir*100);
+
312 }

@@ -807,10 +805,10 @@

-

Definition at line 317 of file TargetTracker.cxx.

-
318 {
-
319  fTTPointCollection->Clear();
-
320 }
+

Definition at line 315 of file TargetTracker.cxx.

+
316 {
+
317  fTTPointCollection->Clear();
+
318 }

@@ -895,11 +893,11 @@

Gets the produced collections

-

Definition at line 336 of file TargetTracker.cxx.

-
337 {
-
338  if (iColl == 0) { return fTTPointCollection; }
-
339  else { return NULL; }
-
340 }
+

Definition at line 334 of file TargetTracker.cxx.

+
335 {
+
336  if (iColl == 0) { return fTTPointCollection; }
+
337  else { return NULL; }
+
338 }

@@ -1082,53 +1080,53 @@

Definition at line 257 of file TargetTracker.cxx.

-
258 {
-
260  //Set parameters at entrance of volume. Reset ELoss.
-
261  if ( gMC->IsTrackEntering() ) {
-
262  fELoss = 0.;
-
263  fTime = gMC->TrackTime() * 1.0e09;
-
264  fLength = gMC->TrackLength();
-
265  gMC->TrackPosition(fPos);
-
266  gMC->TrackMomentum(fMom);
-
267  }
-
268  // Sum energy loss for all steps in the active volume
-
269  fELoss += gMC->Edep();
-
270 
-
271  // Create muonPoint at exit of active volume
-
272  if (gMC->IsTrackExiting() ||
-
273  gMC->IsTrackStop() ||
-
274  gMC->IsTrackDisappeared() ){
-
275  if (fELoss == 0. ) { return kFALSE; }
-
276  TParticle* p=gMC->GetStack()->GetCurrentTrack();
-
277  Int_t pdgCode = p->GetPdgCode();
-
278  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
-
279 
-
280  gMC->CurrentVolID(fVolumeID);
-
281  Int_t detID = fVolumeID;
-
282  Int_t TTstationID;
-
283  gMC->CurrentVolOffID(2, TTstationID);
-
284  fVolumeID = TTstationID + detID;
-
285 
-
286  TLorentzVector Pos;
-
287  gMC->TrackPosition(Pos);
-
288  Double_t xmean = (fPos.X()+Pos.X())/2. ;
-
289  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
-
290  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
-
291 
-
292  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
-
293  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
-
294  fTime, fLength, fELoss, pdgCode);
-
295 
-
296  // Increment number of muon det points in TParticle
-
297  ShipStack* stack = (ShipStack*) gMC->GetStack();
-
298  stack->AddPoint(ktauTT);
-
299  }
-
300 
-
301  return kTRUE;
-
302 }
+

Definition at line 255 of file TargetTracker.cxx.

+
256 {
+
258  //Set parameters at entrance of volume. Reset ELoss.
+
259  if ( gMC->IsTrackEntering() ) {
+
260  fELoss = 0.;
+
261  fTime = gMC->TrackTime() * 1.0e09;
+
262  fLength = gMC->TrackLength();
+
263  gMC->TrackPosition(fPos);
+
264  gMC->TrackMomentum(fMom);
+
265  }
+
266  // Sum energy loss for all steps in the active volume
+
267  fELoss += gMC->Edep();
+
268 
+
269  // Create muonPoint at exit of active volume
+
270  if (gMC->IsTrackExiting() ||
+
271  gMC->IsTrackStop() ||
+
272  gMC->IsTrackDisappeared() ){
+
273  if (fELoss == 0. ) { return kFALSE; }
+
274  TParticle* p=gMC->GetStack()->GetCurrentTrack();
+
275  Int_t pdgCode = p->GetPdgCode();
+
276  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
+
277 
+
278  gMC->CurrentVolID(fVolumeID);
+
279  Int_t detID = fVolumeID;
+
280  Int_t TTstationID;
+
281  gMC->CurrentVolOffID(2, TTstationID);
+
282  fVolumeID = TTstationID + detID;
+
283 
+
284  TLorentzVector Pos;
+
285  gMC->TrackPosition(Pos);
+
286  Double_t xmean = (fPos.X()+Pos.X())/2. ;
+
287  Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
+
288  Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
+
289 
+
290  AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
+
291  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
+
292  fTime, fLength, fELoss, pdgCode);
+
293 
+
294  // Increment number of muon det points in TParticle
+
295  ShipStack* stack = (ShipStack*) gMC->GetStack();
+
296  stack->AddPoint(ktauTT);
+
297  }
+
298 
+
299  return kTRUE;
+
300 }
-
TTPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
+
TTPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
@@ -1161,12 +1159,12 @@

TargetPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

-

Definition at line 323 of file TargetTracker.cxx.

-
324 {
-
325 
-
332  FairRootManager::Instance()->Register("TTPoint", "TargetTracker",
-
333  fTTPointCollection, kTRUE);
-
334 }
+

Definition at line 321 of file TargetTracker.cxx.

+
322 {
+
323 
+
330  FairRootManager::Instance()->Register("TTPoint", "TargetTracker",
+
331  fTTPointCollection, kTRUE);
+
332 }

@@ -1195,10 +1193,10 @@

Definition at line 342 of file TargetTracker.cxx.

-
343 {
-
344  fTTPointCollection->Clear();
-
345 }
+

Definition at line 340 of file TargetTracker.cxx.

+
341 {
+
342  fTTPointCollection->Clear();
+
343 }

diff --git a/md_CHANGELOG.html b/md_CHANGELOG.html index 3ba356b3af..002c0a7163 100644 --- a/md_CHANGELOG.html +++ b/md_CHANGELOG.html @@ -131,6 +131,7 @@

  • Remove trailing whitespace and fix line endings
  • Fix compilation warnings due to deprecations #469
  • +
  • Fix compilation warnings due to unused or uninitiliazed variables #481
  • Fix issue with SST parameters #489
  • Cleaned up Veto Implementation
  • Fix crash of event display, PID when no entrance lid present