ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtPipe.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 // ----- AtPipe file -----
11 // ----- Created by M. Al-Turany June 2014 -----
12 // -------------------------------------------------------------------------
13 
14 #include "AtPipe.h"
15 
16 #include <FairModule.h>
17 
18 #include <TGeoManager.h>
19 #include <TGeoMaterial.h>
20 #include <TGeoMedium.h>
21 #include <TGeoPcon.h>
22 #include <TGeoVolume.h>
23 
24 AtPipe::~AtPipe() = default;
25 AtPipe::AtPipe() : FairModule() {}
26 
27 AtPipe::AtPipe(const char *name, const char *title) : FairModule(name, title) {}
28 
29 // ----- ConstructGeometry --------------------------------------------------
31 {
32  TGeoVolume *top = gGeoManager->GetTopVolume();
33 
34  // define some materials
35  auto *matCarbon = new TGeoMaterial("C", 12.011, 6.0, 2.265);
36  auto *matVacuum = new TGeoMaterial("Vacuum", 0, 0, 0);
37 
38  // define some media
39  auto *Carbon = new TGeoMedium("C", 50, matCarbon);
40  auto *Vacuum = new TGeoMedium("Vacuum", 60, matVacuum);
41 
42  Int_t nSects = 2;
43  Double_t z[] = {-50, 0}; // in cm
44  Double_t r[] = {2.5, 2.5}; // in cm
45  Double_t Thickness = 0.05; // thickness of beam pipe [cm]
46  auto *shape = new TGeoPcon(0., 360., nSects);
47  for (Int_t iSect = 0; iSect < nSects; iSect++) {
48  shape->DefineSection(iSect, z[iSect], r[iSect], r[iSect] + Thickness);
49  }
50 
51  // ---> Voluwme
52  auto *pipe = new TGeoVolume("AtPipe", shape, Carbon);
53 
54  // --Now create the same but diameter less by Thikness and vacuum instead of Carbon
55  auto *Vshape = new TGeoPcon(0., 360., nSects);
56  for (Int_t iSect = 0; iSect < nSects; iSect++) {
57  Vshape->DefineSection(iSect, z[iSect], 0, r[iSect]);
58  }
59 
60  // ---> Volume
61  auto *Vpipe = new TGeoVolume("AtPipe", Vshape, Vacuum);
62 
63  // TGeoVolume *TPipe=gGeoManager->MakeTubs("TPipe",Vacuum,0,2.5,3.0,10,0);
64 
65  top->AddNode(pipe, 1);
66  top->AddNode(Vpipe, 1);
67  // top->AddNode(TPipe,1);
68  // top->AddNodeOverlap(TPipe,1,new TGeoCombiTrans(0,0,0,new TGeoRotation("TPipe",0,-7,0)));
69 }
70 // ----------------------------------------------------------------------------
71 
AtPipe::AtPipe
AtPipe()
Definition: AtPipe.cxx:25
AtPipe::ConstructGeometry
virtual void ConstructGeometry()
Definition: AtPipe.cxx:30
ClassImp
ClassImp(AtFindVertex)
AtPipe.h
AtPipe::~AtPipe
virtual ~AtPipe()
AtPipe
Definition: AtPipe.h:25