SND@LHC Software
Loading...
Searching...
No Matches
NuTauMudet.cxx
Go to the documentation of this file.
1#include "NuTauMudet.h"
2#include "ShipRpcPoint.h"
3#include "TGeoManager.h"
4#include "FairRun.h" // for FairRun
5#include "FairRuntimeDb.h" // for FairRuntimeDb
6#include <iosfwd> // for ostream
7#include "TList.h" // for TListIter, TList (ptr only)
8#include "TObjArray.h" // for TObjArray
9#include "TString.h" // for TString
10#include "TClonesArray.h"
11#include "TVirtualMC.h"
12
13#include "TGeoPara.h"
14#include "TGeoBBox.h"
15#include "TGeoTrd1.h"
16#include "TGeoTrd2.h"
17#include "TGeoCompositeShape.h"
18#include "TGeoTube.h"
19#include "TGeoMaterial.h"
20#include "TGeoMedium.h"
21#include "TParticle.h"
22#include "TVector3.h"
23
24#include "FairVolume.h"
25#include "FairGeoVolume.h"
26#include "FairGeoNode.h"
27#include "FairRootManager.h"
28#include "FairGeoLoader.h"
29#include "FairGeoInterface.h"
30#include "FairGeoMedia.h"
31#include "FairGeoBuilder.h"
32#include "FairRun.h"
33#include "FairRuntimeDb.h"
34
35#include "ShipDetectorList.h"
36#include "ShipUnit.h"
37#include "ShipStack.h"
38
39#include "TGeoUniformMagField.h"
40#include <stddef.h> // for NULL
41#include <iostream> // for operator<<, basic_ostream, etc
42
43using std::cout;
44using std::endl;
45using namespace ShipUnit;
46
48 : FairDetector("NuTauMudet",kTRUE, ktauRpc),
49 fTrackID(-1),
50 fPdgCode(),
51 fVolumeID(-1),
52 fPos(),
53 fMom(),
54 fTime(-1.),
55 fLength(-1.),
56 fELoss(-1),
57 fShipRpcPointCollection(new TClonesArray("ShipRpcPoint"))
58{
59}
60
61NuTauMudet::NuTauMudet(const char* name, const Double_t Zcenter,Bool_t Active,const char* Title)
62 : FairDetector(name, Active, ktauRpc),
63 fTrackID(-1),
64 fPdgCode(),
65 fVolumeID(-1),
66 fPos(),
67 fMom(),
68 fTime(-1.),
69 fLength(-1.),
70 fELoss(-1),
71 fShipRpcPointCollection(new TClonesArray("ShipRpcPoint"))
72{
73 fZcenter = Zcenter;
74}
75
76void NuTauMudet::SetDesign(Int_t Design)
77{
78 fDesign = Design;
79 cout <<" Mag Spectro Design "<< fDesign<<endl;
80}
81
82void NuTauMudet::SetTotDimensions(Double_t X, Double_t Y, Double_t Z)
83{
84 fXtot = X;
85 fYtot = Y;
86 fZtot = Z;
87}
88
89void NuTauMudet::SetFeDimensions(Double_t X, Double_t Y, Double_t Z, Double_t Zthin)
90{
91 fXFe = X;
92 fYFe = Y;
93 fZFe = Z;
94 fZFethin = Zthin;
95}
96
97void NuTauMudet::SetRpcDimensions(Double_t X, Double_t Y, Double_t Z)
98{
99 fXRpc = X;
100 fYRpc = Y;
101 fZRpc = Z;
102}
103
104void NuTauMudet::SetRpcGasDimensions(Double_t X, Double_t Y, Double_t Z)
105{
106 fXGas = X;
107 fYGas = Y;
108 fZGas = Z;
109}
110
111void NuTauMudet::SetRpcPETDimensions(Double_t X, Double_t Y, Double_t Z)
112{
113 fXPet = X;
114 fYPet = Y;
115 fZPet = Z;
116}
117
118void NuTauMudet::SetRpcElectrodeDimensions(Double_t X, Double_t Y, Double_t Z)
119{
120 fXEle = X;
121 fYEle = Y;
122 fZEle = Z;
123}
124
125void NuTauMudet::SetRpcStripDimensions(Double_t X, Double_t Y, Double_t Z)
126{
127 fXStrip = X;
128 fYStrip = Y;
129 fZStrip = Z;
130}
131
132void NuTauMudet::SetReturnYokeDimensions(Double_t X, Double_t Y, Double_t Z)
133{
134 fXRyoke = X;
135 fYRyoke = Y;
136 fZRyoke = Z;
137}
138
139void NuTauMudet::SetSmallerYokeDimensions(Double_t X, Double_t Y, Double_t Z)
140{
141 fXRyoke_s = X;
142 fYRyoke_s = Y;
143 fZRyoke_s = Z;
144}
145
147{
148 fField =B;
149}
150
152{
153 fGapDown = Gap;
154}
155
156void NuTauMudet::SetGapMiddle(Double_t Gap)
157{
158 fGapMiddle = Gap;
159}
160
162{
163 fZArm = Z;
164}
165
166void NuTauMudet::SetNFeInArm(Int_t N, Int_t Nthin)
167{
168 fNFe = N;
169 fNFethin = Nthin;
170}
171
173{
174 fNRpc = N;
175}
176
177void NuTauMudet::SetCoilParameters(Double_t CoilH, Double_t CoilW, Int_t N, Double_t CoilG)
178{
179 fCoilH = CoilH;
180 fCoilW = CoilW;
181 fCoilGap = CoilG;
182 fNCoil = N;
183}
184
185void NuTauMudet::SetSupportTransverseDimensions(Double_t UpperSupportX, Double_t UpperSupportY, Double_t LowerSupportX, Double_t LowerSupportY, Double_t LateralSupportX, Double_t LateralSupportY, Double_t YSpacing)
186{
187 fUpSuppX = UpperSupportX;
188 fUpSuppY = UpperSupportY;
189 fLowSuppX = LowerSupportX;
190 fLowSuppY = LowerSupportY;
191 fLatSuppX = LateralSupportX;
192 fLatSuppY = LateralSupportY;
193 fYSpacing = YSpacing;
194}
195
196void NuTauMudet::SetLateralCutSize(Double_t CutHeight , Double_t CutLength){
197 fCutHeight = CutHeight;
198 fCutLength = CutLength;
199}
200
201void NuTauMudet::SetPillarDimensions(Double_t X, Double_t Y, Double_t Z)
202{
203 fPillarX = X;
204 fPillarY = Y;
205 fPillarZ = Z;
206}
207
208void NuTauMudet::SetUpperCoverDimensions(Double_t X, Double_t Y, Double_t Z)
209{
210 fXCov = X;
211 fYCov = Y;
212 fZCov = Z;
213}
214void NuTauMudet::SetLateralCoverDimensions(Double_t X, Double_t Y, Double_t Z)
215{
216 fXLateral = X;
217 fYLateral = Y;
218 fZLateral = Z;
219}
220
221void NuTauMudet::SetCrossDimensions(Double_t X, Double_t Y, Double_t Z, Double_t WidthArm)
222{
223 fXCross = X;
224 fYCross = Y;
225 fZCross = Z;
226 fWidthArm = WidthArm;
227}
228
229void NuTauMudet::SetRpcOuterDimensions(Double_t X, Double_t Y, Double_t Z)
230{
231 fXRpc_outer = X;
232 fYRpc_outer = Y;
233 fZRpc_outer = Z;
234}
235
236void NuTauMudet::SetRpcInnerDimensions(Double_t X, Double_t Y, Double_t Z)
237{
238 fXRpc_inner = X;
239 fYRpc_inner = Y;
240 fZRpc_inner = Z;
241}
242
243void NuTauMudet::SetRpcGapDimensions(Double_t X, Double_t Y, Double_t Z)
244{
245 fXRpcGap = X;
246 fYRpcGap = Y;
247 fZRpcGap = Z;
248}
249
250
258
260{
261 FairDetector::Initialize();
262}
263
264// ----- Private method InitMedium
265Int_t NuTauMudet::InitMedium(const char* name)
266{
267 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
268 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
269 static FairGeoMedia *media=geoFace->getMedia();
270 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
271
272 FairGeoMedium *ShipMedium=media->getMedium(name);
273
274 if (!ShipMedium)
275 {
276 Fatal("InitMedium","Material %s not defined in media file.", name);
277 return -1111;
278 }
279 TGeoMedium* medium=gGeoManager->GetMedium(name);
280 if (medium!=NULL)
281 return ShipMedium->getMediumIndex();
282 return geoBuild->createMedium(ShipMedium);
283}
284
286{
287 TGeoVolume *top = gGeoManager->GetTopVolume();
288 TGeoVolumeAssembly *tTauNuDet = new TGeoVolumeAssembly("tTauNuDet");
289 top->AddNode(tTauNuDet, 1, new TGeoTranslation(0, 0, 0));
290
291 InitMedium("RPCgas");
292 TGeoMedium *RPCmat =gGeoManager->GetMedium("RPCgas");
293
294 InitMedium("Bakelite");
295 TGeoMedium *bakelite =gGeoManager->GetMedium("Bakelite");
296
297 InitMedium("iron");
298 TGeoMedium *Iron =gGeoManager->GetMedium("iron");
299
300 InitMedium("steel");
301 TGeoMedium *Steel =gGeoManager->GetMedium("steel");
302
303 InitMedium("copper");
304 TGeoMedium *Cu =gGeoManager->GetMedium("copper");
305
306 InitMedium("Concrete");
307 TGeoMedium *Conc =gGeoManager->GetMedium("Concrete");
308
309 InitMedium("air");
310 TGeoMedium *air =gGeoManager->GetMedium("air");
311
312 InitMedium("Aluminum"); //new
313 TGeoMedium *Al =gGeoManager->GetMedium("Aluminum"); //new
314
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 }
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));
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));
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);
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);
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;
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);
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);
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));
755
756
757 }
758
759}
760
761
762Bool_t NuTauMudet::ProcessHits(FairVolume* vol)
763{
765 //Set parameters at entrance of volume. Reset ELoss.
766 if ( gMC->IsTrackEntering() ) {
767 fELoss = 0.;
768 fTime = gMC->TrackTime() * 1.0e09;
769 fLength = gMC->TrackLength();
770 gMC->TrackPosition(fPos);
771 gMC->TrackMomentum(fMom);
772 }
773 // Sum energy loss for all steps in the active volume
774 fELoss += gMC->Edep();
775
776 // Create muonPoint at exit of active volume
777 if ( gMC->IsTrackExiting() ||
778 gMC->IsTrackStop() ||
779 gMC->IsTrackDisappeared() ) {
780 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
781 fVolumeID = vol->getMCid();
782 if (fELoss == 0. ) { return kFALSE; }
783 TParticle* p=gMC->GetStack()->GetCurrentTrack();
784 Int_t pdgCode = p->GetPdgCode();
785 Int_t detID=0;
786 gMC->CurrentVolID(detID);
787 //cout<<"THIS HIT"<<endl;
788 //cout<< "detID = " << detID << endl;
789 Int_t MaxLevel = gGeoManager->GetLevel();
790 const Int_t MaxL = MaxLevel;
791 //cout << "MaxLevel = " << MaxL << endl;
792 //cout << gMC->CurrentVolPath()<< endl;
793 Int_t NRpc =0;
794 const char *name;
795 name = gMC->CurrentVolName();
796 //cout << name << " ";
797 Int_t motherID = 0;
798 if( strcmp(name, "volRpc")==0){motherID = gGeoManager->GetMother(1)->GetNumber();}
799 else{motherID = gGeoManager->GetMother(0)->GetNumber();}
800 /* This up here is made because of a strange behaviour of the script, volRpc gets different
801 Mother volume number even if it has the correct path */
802 const char *mumname = gMC->CurrentVolOffName(1);
803 //cout<<mumname<<" "<< motherID<<endl;
804 detID = motherID;
805 //cout<< "detID = " << detID << endl;
806 //cout<<endl;
807 fVolumeID = detID;
808
809 TLorentzVector Pos;
810 gMC->TrackPosition(Pos);
811 Double_t xmean = (fPos.X()+Pos.X())/2. ;
812 Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
813 Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
814
815 AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean), TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,fELoss, pdgCode);
816
817 // Increment number of muon det points in TParticle
818 ShipStack* stack = (ShipStack*) gMC->GetStack();
819 stack->AddPoint(ktauRpc);
820 }
821
822 return kTRUE;
823}
824
826{
828}
829
830
832{
833
840 FairRootManager::Instance()->Register("ShipRpcPoint", "NuTauMudet",
842}
843
844// ----- Public method to Decode volume info -------------------------------------------
845// ----- returns hpt, arm, rpc numbers -----------------------------------
846void NuTauMudet::DecodeVolumeID(Int_t detID,int &nARM,int &nRPC)
847{
848 nARM = detID/1E4;
849 nRPC = detID - nARM*1E4;
850}
851
852TClonesArray* NuTauMudet::GetCollection(Int_t iColl) const
853{
854 if (iColl == 0) { return fShipRpcPointCollection; }
855 else { return NULL; }
856}
857
859{
861}
862
863
864ShipRpcPoint* NuTauMudet::AddHit(Int_t trackID, Int_t detID,
865 TVector3 pos, TVector3 mom,
866 Double_t time, Double_t length,
867 Double_t eLoss, Int_t pdgCode)
868
869{
870 TClonesArray& clref = *fShipRpcPointCollection;
871 Int_t size = clref.GetEntriesFast();
872 //cout << "ShipRpctau hit called"<< pos.z()<<endl;
873 // return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode,NArm, NRpc, NHpt);
874 return new(clref[size]) ShipRpcPoint(trackID, detID, pos, mom,time, length, eLoss, pdgCode);
875}
876
877
Double_t cm
Double_t mm
@ ktauRpc
void SetRpcDimensions(Double_t X, Double_t Y, Double_t Z)
void SetRpcGapDimensions(Double_t X, Double_t Y, Double_t Z)
void SetTotDimensions(Double_t X, Double_t Y, Double_t Z)
Double_t fXCov
Definition NuTauMudet.h:175
Double_t fXLateral
Definition NuTauMudet.h:179
Double_t fYRyoke_s
Definition NuTauMudet.h:143
Double_t fLatSuppY
Definition NuTauMudet.h:166
Double_t fXRyoke
Definition NuTauMudet.h:137
Double_t fYCross
Definition NuTauMudet.h:184
void SetRpcStripDimensions(Double_t X, Double_t Y, Double_t Z)
TLorentzVector fMom
position at entrance
Definition NuTauMudet.h:106
Double_t fZGas
Definition NuTauMudet.h:163
void SetFeDimensions(Double_t X, Double_t Y, Double_t Z, Double_t Zthin=0.)
Int_t fTrackID
Definition NuTauMudet.h:102
Double_t fZEle
Definition NuTauMudet.h:160
Double_t fZCov
Definition NuTauMudet.h:177
Double32_t fELoss
length
Definition NuTauMudet.h:109
Double_t fPillarZ
Definition NuTauMudet.h:173
Double_t fXPet
Definition NuTauMudet.h:155
Double_t fZRpcGap
Definition NuTauMudet.h:198
void SetRpcOuterDimensions(Double_t X, Double_t Y, Double_t Z)
Double_t fYRpc_outer
Definition NuTauMudet.h:189
virtual void Initialize()
virtual void EndOfEvent()
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)
Int_t InitMedium(const char *name)
Double_t fZFe
Definition NuTauMudet.h:131
Int_t fNFethin
Definition NuTauMudet.h:125
Double_t fZRpc
Definition NuTauMudet.h:132
Double_t fCoilH
Definition NuTauMudet.h:147
void SetReturnYokeDimensions(Double_t X, Double_t Y, Double_t Z)
void SetLateralCoverDimensions(Double_t X, Double_t Y, Double_t Z)
void SetRpcGasDimensions(Double_t X, Double_t Y, Double_t Z)
Int_t fVolumeID
pdg code
Definition NuTauMudet.h:104
Double_t fGapDown
Definition NuTauMudet.h:134
void SetPillarDimensions(Double_t X, Double_t Y, Double_t Z)
Double_t fPillarY
Definition NuTauMudet.h:172
Double_t fZRyoke_s
Definition NuTauMudet.h:144
Double_t fXRpc_inner
Definition NuTauMudet.h:192
TClonesArray * fShipRpcPointCollection
energy loss
Definition NuTauMudet.h:112
Double_t fLowSuppX
Definition NuTauMudet.h:165
void SetLateralCutSize(Double_t CutHeight, Double_t CutLength)
Double_t fXStrip
Definition NuTauMudet.h:152
Double_t fYRyoke
Definition NuTauMudet.h:138
Double_t fXFe
Definition NuTauMudet.h:127
void SetNRpcInArm(Int_t N)
Double_t fYFe
Definition NuTauMudet.h:129
void SetMagneticField(Double_t B)
Double_t fYRpc
Definition NuTauMudet.h:130
void DecodeVolumeID(Int_t detID, int &nARM, int &nRPC)
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)
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)
virtual void Reset()
Double32_t fLength
time
Definition NuTauMudet.h:108
Double_t fZLateral
Definition NuTauMudet.h:181
Double_t fZFethin
Definition NuTauMudet.h:131
Double_t fZArm
Definition NuTauMudet.h:133
Double_t fYEle
Definition NuTauMudet.h:159
Double_t fYCov
Definition NuTauMudet.h:176
Double_t fUpSuppY
Definition NuTauMudet.h:164
Double_t fLowSuppY
Definition NuTauMudet.h:165
Double_t fCutLength
Definition NuTauMudet.h:169
void SetRpcInnerDimensions(Double_t X, Double_t Y, Double_t Z)
Double_t fXCross
Definition NuTauMudet.h:183
Double_t fXRpc_outer
Definition NuTauMudet.h:188
void SetDesign(Int_t Design)
Int_t fDesign
Definition NuTauMudet.h:120
void SetSmallerYokeDimensions(Double_t X, Double_t Y, Double_t Z)
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)
virtual void Register()
void SetCrossDimensions(Double_t X, Double_t Y, Double_t Z, Double_t WidthArm)
Double_t fYSpacing
Definition NuTauMudet.h:167
Double_t fXRyoke_s
Definition NuTauMudet.h:142
Double_t fPillarX
Definition NuTauMudet.h:171
void SetGapMiddle(Double_t Gap)
TLorentzVector fPos
volume id
Definition NuTauMudet.h:105
void SetGapDownstream(Double_t Gap)
Double_t fCoilW
Definition NuTauMudet.h:148
Double_t fYStrip
Definition NuTauMudet.h:153
Double_t fYLateral
Definition NuTauMudet.h:180
void SetUpperCoverDimensions(Double_t X, Double_t Y, Double_t Z)
void ConstructGeometry()
ShipRpcPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
Double_t fZCross
Definition NuTauMudet.h:185
Double_t fZRpc_inner
Definition NuTauMudet.h:194
virtual TClonesArray * GetCollection(Int_t iColl) const
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)
Double_t fZPet
Definition NuTauMudet.h:157
Double_t fZRyoke
Definition NuTauMudet.h:139
Double_t fYGas
Definition NuTauMudet.h:162
Int_t fNRpc
Definition NuTauMudet.h:126
Double_t fYPet
Definition NuTauMudet.h:156
Double_t fWidthArm
Definition NuTauMudet.h:186
void SetZDimensionArm(Double_t Z)
Double_t fXRpc
Definition NuTauMudet.h:128
Double_t fZRpc_outer
Definition NuTauMudet.h:190
Double_t fXRpcGap
Definition NuTauMudet.h:196
virtual ~NuTauMudet()
Double_t fYtot
Definition NuTauMudet.h:123
Double_t fYRpcGap
Definition NuTauMudet.h:197
Double_t fCoilGap
Definition NuTauMudet.h:146
void SetRpcPETDimensions(Double_t X, Double_t Y, Double_t Z)
ClassImp(ecalContFact) ecalContFact