ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtMagnet.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 // -------------------------------------------------------------------------
10 // ----- AtMagnet file -----
11 // ----- Created 26/03/14 by M. Al-Turany -----
12 // -------------------------------------------------------------------------
13 
14 #include "AtMagnet.h"
15 
16 #include <FairModule.h>
17 
18 #include <Rtypes.h>
19 #include <TGeoBBox.h>
20 #include <TGeoCompositeShape.h>
21 #include <TGeoManager.h>
22 #include <TGeoMaterial.h>
23 #include <TGeoMatrix.h>
24 #include <TGeoMedium.h>
25 #include <TGeoTube.h>
26 #include <TGeoVolume.h>
27 
28 AtMagnet::~AtMagnet() = default;
29 AtMagnet::AtMagnet() : FairModule("AtMagnet", "") {}
30 
31 AtMagnet::AtMagnet(const char *name, const char *Title) : FairModule(name, Title) {}
32 
34 {
35 
36  TGeoVolume *top = gGeoManager->GetTopVolume();
37 
38  // define some materials
39  auto *matFe = new TGeoMaterial("Fe", 55.84, 26, 7.9);
40 
41  // define some media
42  auto *Fe = new TGeoMedium("Fe", 100, matFe);
43 
44  // magnet yoke
45  new TGeoBBox("magyoke1", 261 / 2.0, 221 / 2.0, 278 / 2.0);
46  new TGeoBBox("magyoke2", 242 / 2.0, 202 / 2.0, 279 / 2.0);
47 
48  auto *magyokec = new TGeoCompositeShape("magyokec", "magyoke1-magyoke2");
49  auto *magyoke = new TGeoVolume("magyoke", magyokec, Fe);
50  magyoke->SetLineColor(kViolet + 2);
51  magyoke->SetTransparency(50);
52  top->AddNode(magyoke, 1, new TGeoTranslation(0, 6.079, 90));
53 
54  // magnet
55  auto *SolenoidGeo = new TGeoTube("SolenoidGeo", 125. / 4.0, 274. / 4.0, 229.0 / 2.0); // Radius divided by 2.0
56  auto *SolenoidVol = new TGeoVolume("SolenoidVol", SolenoidGeo, Fe);
57  SolenoidVol->SetLineColor(kWhite);
58  SolenoidVol->SetTransparency(50);
59  top->AddNode(SolenoidVol, 1, new TGeoTranslation(0, 6.079, 110));
60 
61  /* TGeoTubeSeg *magnet1a = new TGeoTubeSeg("magnet1a", 250, 300, 35, 45, 135);
62  TGeoTubeSeg *magnet1b = new TGeoTubeSeg("magnet1b", 250, 300, 35, 45, 135);
63  TGeoTubeSeg *magnet1c = new TGeoTubeSeg("magnet1c", 250, 270, 125, 45, 60);
64  TGeoTubeSeg *magnet1d = new TGeoTubeSeg("magnet1d", 250, 270, 125, 120, 135);
65 
66  // magnet composite shape matrices
67  TGeoTranslation *m1 = new TGeoTranslation(0, 0, 160);
68  m1->SetName("m1");
69  m1->RegisterYourself();
70  TGeoTranslation *m2 = new TGeoTranslation(0, 0, -160);
71  m2->SetName("m2");
72  m2->RegisterYourself();
73 
74  TGeoCompositeShape *magcomp1 = new TGeoCompositeShape("magcomp1", "magnet1a:m1+magnet1b:m2+magnet1c+magnet1d");
75  TGeoVolume *magnet1 = new TGeoVolume("magnet1", magcomp1, Fe);
76  magnet1->SetLineColor(kYellow);
77  top->AddNode(magnet1, 1, new TGeoTranslation(0, 0, 0));
78 
79  TGeoRotation m3;
80  m3.SetAngles(180, 0, 0);
81  TGeoTranslation m4(0, 0, 0);
82  TGeoCombiTrans m5(m4, m3);
83  TGeoHMatrix *m6 = new TGeoHMatrix(m5);
84  top->AddNode(magnet1, 2, m6);*/
85 }
86 
AtMagnet::~AtMagnet
virtual ~AtMagnet()
AtMagnet::ConstructGeometry
void ConstructGeometry()
Definition: AtMagnet.cxx:33
ClassImp
ClassImp(AtFindVertex)
AtMagnet::AtMagnet
AtMagnet()
Definition: AtMagnet.cxx:29
AtMagnet.h
AtMagnet
Definition: AtMagnet.h:25