SND@LHC Software
Loading...
Searching...
No Matches
ShipTAUMagneticSpectrometer.cxx
Go to the documentation of this file.
2
3#include "TGeoManager.h"
4#include "FairRun.h" // for FairRun
5#include "FairRuntimeDb.h" // for FairRuntimeDb
6//#include "FairGeoMedia.h"
7//#include "FairGeoBuilder.h"
8
9#include <iosfwd> // for ostream
10#include "TList.h" // for TListIter, TList (ptr only)
11#include "TObjArray.h" // for TObjArray
12#include "TString.h" // for TString
13#include "TGeoBBox.h"
14#include "TGeoCompositeShape.h"
15#include "TGeoTube.h"
16#include "TGeoMaterial.h"
17#include "TGeoElement.h"
18#include "TGeoMedium.h"
19#include "TGeoUniformMagField.h"
20#include <stddef.h> // for NULL
21#include <iostream> // for operator<<, basic_ostream, etc
22
23using namespace std;
24
28
30 : FairModule("ShipTAUMagneticSpectrometer", "")
31{
32}
33
34ShipTAUMagneticSpectrometer::ShipTAUMagneticSpectrometer(const char* name,const Double_t zLS,const Double_t FeL, const Double_t AirL, const Double_t SpectroL, const Double_t GapV, const Double_t DGap, const Double_t MGap, const Double_t mf, const char* Title)
35 : FairModule(name ,Title)
36{
37 zLastSlab = zLS;
38 IronLenght = FeL;
39 AirLenght = AirL;
40 SpectrometerLenght = SpectroL;
41 GapFromVacuum = GapV;
42 DriftGap = DGap;
43 MiddleGap = MGap;
44 MagneticField = mf;
45}
46
48{
49 Int_t NIronSlabs = 12;
50
51 TGeoVolume *top=gGeoManager->GetTopVolume();
52 TGeoMedium *Fe = gGeoManager->GetMedium("iron");
53
54 Double_t d = 0;
55
56 TGeoUniformMagField *magField = new TGeoUniformMagField(0.,-MagneticField,0.);
57 TGeoUniformMagField *RetField = new TGeoUniformMagField(0.,MagneticField,0.);
58
59 TGeoBBox *Layer = new TGeoBBox(225,400,IronLenght/2);
60 TGeoVolume *volLayer = new TGeoVolume("volLayer",Layer,Fe);
61 for(Int_t i = 0; i< NIronSlabs; i++)
62 {
63 d = zLastSlab - i*(IronLenght+AirLenght);
64 top->AddNode(volLayer,i,new TGeoTranslation(0, 0, d));
65 }
66 volLayer->SetField(magField);
67
68 cout <<"************************************" << endl;
69 cout << " IronLenght+AirLenght = " << IronLenght+AirLenght << endl;
70 cout << " NIronSlabs = " << NIronSlabs << endl;
71 cout << " zLastSlab = "<< zLastSlab << endl;
72 cout << d << endl;
73 Double_t d1 = d- (MiddleGap + IronLenght); //z coord of the center of the last layer of the first spectrometer
74 cout << d1 << endl;
75
76 TGeoVolume *volLayer2 = new TGeoVolume("volLayer2",Layer,Fe);
77 for(Int_t i = 0; i< NIronSlabs; i++)
78 {
79 Double_t d2 = d1-i*(IronLenght+AirLenght);
80 top->AddNode(volLayer2,i,new TGeoTranslation(0, 0, d2));
81 }
82 volLayer2->SetField(RetField);
83
84 cout <<"************************************" << endl;
85
86
87}
88
89
90
92
93
94
95
96
97
98
99
100
101
102
103
104
105
ClassDef(ShipTAUMagneticSpectrometer, 1) protected Double_t IronLenght
ClassImp(ecalContFact) ecalContFact