Commit 4dadea0e authored by Mehulkumar Shiroya's avatar Mehulkumar Shiroya Committed by Florian Uhlig
Browse files

STS geometry version v21[h-i]

STS v21h: The geometry has the target positioned at -4 cm. It can be used with the beampipe 40mm diameter upstream side
and 104mm diameter downstream side. It has a beampipe flange on the back-side of the STS wall.
In addition, the geometry has a sensor thickness 320 um which is similar thickness of the real silicon sensors purchased from the Hamamatsu Photonics
for the use in the real experiment.
Furthermore,the mico-cable is defined as a single volume attached to the silicon sensors. Micro-cable thickness (320 um) is choosen and
the material Manganese is taken based on the calculation done by taking the current microcable design, thickness and its material.

STS v21i: The geometry has the target positioned at -44 cm from the center of the magnet. It can be used with the beampipe 40mm diameter upstream side
and 104mm diameter downstream side. It doesn't have a beam-pipe flange on the back-side of the wall.
In addition, the geometry has a sensor thickness 320 um which is similar thickness of the real silicon sensors purchased from the Hamamatsu >
for the use in the real experiment.
Furthermore,the mico-cable is defined as a single volume attached to the silicon sensors. Micro-cable thickness (320 um) is choosen and
the material Manganese is taken based on the calculation done by taking the current microcable design, thickness and its material.
parent b606f002
/* Copyright (C) 2012-2021 Goethe-Universitaet Frankfurt, Frankfurt
SPDX-License-Identifier: GPL-3.0-only
Authors: Mehul Shiroya [committer], Volker Friese, Evgeny Lavrik*/
/******************************************************************************
** Creation of STS geometry in ROOT format (TGeo).
**
** @file create_stsgeo_v21h.C
** @author Volker Friese <v.friese@gsi.de>
** @since 15 June 2012
** @date 09.05.2014
** @author Tomas Balog <T.Balog@gsi.de>
**
** v21h: Similar to the STS geometry version v21f
* [ Airex foam in the front and back side wall (Solid).
* New beam pipe R = 2.0 cm upstream-side with thickness 1 mm.
* Central ladders adjusted 5mm away from the beampipe.
* Nomenclature for the Halfladders has been changed from the upside(u) to top (t)
* and from downside(d) to bottom (b). ]
* Another difference is that it includes beampipe flange in the back side of the wall,
* which is considered to be made of carbon fiber(70%) and epoxy resin(30%).
* Furthermore, the sensor thickness 0.032 cm is taken in consideration
* (The actual thickness of the sensor from Hamamatsu is 320 um to be used in the experiment)
*
** v19r: bugfix of v19q - align all halfladders
** v19q: based on v19l - align ladders to virtual plane in station center, closing the gaps in z
** v19p: based on v19k - parameters : delta Z prime = 0.70 cm - delta Z pitch = 0.20 cm
** v19o: based on v19k - parameters : delta Z prime = 0.30 cm - delta Z pitch = 0.20 cm
** v19n: based on v19k - parameters : delta Z prime = 0.50 cm - delta Z pitch = 0.20 cm (bug fix of v19m)
** v19m: based on v19k - parameters : delta Z prime = 0.55 cm - delta Z pitch = 0.20 cm (bug)
** v19l: based on v19k - parameters : delta Z prime = 0.50 cm - delta Z pitch = 0.15 cm
** v19k: ladders on upstream side of units get upper half ladders installed first,
** ladders on downstream side of units get lower half ladders installed first,
** this saves 1.5 mm space in z per station, 12 mm in total (LadderType went from 3 to 4 digits)
** parameters : delta Z prime = 1.00 cm - delta Z pitch = 0.15 cm
** v19j: use overlap and distance parameters from CAD model
** v19h: put STS stations from v19d at z-positions = 260; 365; 470; 575; 680; 785; 890; 995 mm
** v19g: place a box with services around v19e
** v19f: place a box with services around v19d
** v19e: increase spacing between stations by +10 mm from 100 mm
** v19d: increase spacing between stations by + 5 mm from 100 mm
** v19c: drop station 8 and increase spacing between remaining 7 stations from 10 cm to 12 c
** v19b: introduce FEB orientation in ladder numbering (LadderType went from 2 to 3 digits)
** v19a: import passive materials from gdml file
** extend CF ladder structures and cables towards FEE plane
** change CF ladder frame shape
** v18d: increases thickness of sensors within a 7.5 degree cone from 300 mu to 400 mu (based on v18b)
** v18c: fixed cut-out windows in cooling plates, improve the box shape/materials
** v18b: increases thickness of sensors within a 7.5 degree cone from 300 mu to 400 mu
** v18a: adds 9 cooling/holding plates and a box around the setup
** v16g: v16g is the new standard geometry from November 2017
** v16g: switch from stations to units - left / right ("Unit01L", "Unit01R")
** v16f: switch from stations to units
** - split in upstream / downstream and left / right parts
** - named Unit0xUR, Unit0xUL, Unit0xDR, Unit0xDL
** v16e: switch from stations to units - upstream / downstream ("Unit01U", "Unit01D")
** v16d: skip keeping volumes of sts and stations
** v16c: like v16b, but senors of ladders beampipe next to beampipe
** shifted closer to the pipe, like in the CAD model
** v16b: like v16a, but yellow sensors removed
** v16a: derived from v15c (no cones), but with sensor types renamed:
** 2 -> 1, 3 -> 2, 4 -> 3, 5 -> 4, 1 -> 5
**
** v15c: as v15b without cones
** v15b: introduce modified carbon ladders from v13z
** v15a: with flipped ladder orientation for stations 0,2,4,6 to match CAD design
**
** TODO:
**
** DONE:
** v15b - use carbon macaroni as ladder support
** v15b - introduce a small gap between lowest sensor and carbon ladder
** v15b - build small cones for the first 2 stations
** v15b - within a station the ladders of adjacent units should not touch eachother - set gkLadderGapZ to 10 mm
** v15b - for all ladders set an even number of ladder elements
** v15b - z offset of cones to ladders should not be 0.3 by default, but 0.26
** v15b - within a station the ladders should be aligned in z, defined either by the unit or the ladder with most sensors
** v15b - get rid of cone overlap in stations 7 and 8 - done by adapting rHole size
**
** The geometry hierarachy is:
**
** 1. Sensors (see function CreateSensors)
** The sensors are the active volumes and the lowest geometry level.
** They are built as TGeoVolumes, shape box, material silicon.
** x size is determined by strip pitch 58 mu and 1024 strips
** plus guard ring of 1.3 mm at each border -> 6.1992 cm.
** Sensor type 1 is half of that (3.0792 cm).
** y size is determined by strip length (2.2 / 4.2 / 6.3 cm) plus
** guard ring of 1.3 mm at top and bottom -> 2.46 / 4.46 / 6.46 cm.
** z size is a parameter, to be set by gkSensorThickness.
**
** 2. Sectors (see function CreateSectors)
** Sectors consist of several chained sensors. These are arranged
** vertically on top of each other with a gap to be set by
** gkChainGapY. Sectors are constructed as TGeoVolumeAssembly.
** The sectors are auxiliary volumes used for proper placement
** of the sensor(s) in the module. They do not show up in the
** final geometry.
**
** 3. Modules (see function ConstructModule)
** A module is a readout unit, consisting of one sensor or
** a chain of sensors (see sector) and a cable.
** The cable extends from the top of the sector vertically to the
** top of the halfladder the module is placed in. The cable and module
** volume thus depend on the vertical position of the sector in
** the halfladder. The cables consist of silicon with a thickness to be
** set by gkCableThickness.
** Modules are constructed as TGeoVolume, shape box, medium gStsMedium.
** The module construction can be switched off (gkConstructCables)
** to reproduce older geometries.
**
** 4. Halfladders (see function ConstructHalfLadder)
** A halfladder is a vertical assembly of several modules. The modules
** are placed vertically such that their sectors overlap by
** gkSectorOverlapY. They are displaced in z direction to allow for the
** overlap in y by gkSectorGapZ.
** The horizontal placement of modules in the halfladder can be choosen
** to left aligned or right aligned, which only matters if sensors of
** different x size are involved.
** Halfladders are constructed as TGeoVolumeAssembly.
**
** 5. Ladders (see function CreateLadders and ConstructLadder)
** A ladder is a vertical assembly of two halfladders, and is such the
** vertical building block of a station. The second (bottom) half ladder
** is rotated upside down. The vertical arrangement is such that the
** inner sectors of the two halfladders have the overlap gkSectorOverlapY
** (function CreateLadder) or that there is a vertical gap for the beam
** hole (function CreateLadderWithGap).
** Ladders are constructed as TGeoVolumeAssembly.
**
** 6. Stations (see function ConstructStation)
** A station represents one layer of the STS geometry: one measurement
** at (approximately) a given z position. It consist of several ladders
** arranged horizontally to cover the acceptance.
** The ladders are arranged such that there is a horizontal overlap
** between neighbouring ladders (gkLadderOverLapX) and a vertical gap
** to allow for this overlap (gkLadderGapZ). Each second ladder is
** rotated around its y axis to face away from or into the beam.
** Stations are constructed as TGeoVolumes, shape box minus tube (for
** the beam hole), material gStsMedium.
**
** 7. STS
** The STS is a volume hosting the entire detectors system. It consists
** of several stations located at different z positions.
** The STS is constructed as TGeoVolume, shape box minus cone (for the
** beam pipe), material gStsMedium. The size of the box is computed to
** enclose all stations.
*****************************************************************************/
// Remark: With the proper steering variables, this should exactly reproduce
// the geometry version v11b of A. Kotynia's described in the ASCII format.
// The only exception is a minimal difference in the z position of the
// sectors/sensors. This is because of ladder types 2 and 4 containing the half
// sensors around the beam hole (stations 1,2 and 3). In v11b, the two ladders
// covering the beam hole cannot be transformed into each other by rotations,
// but only by a reflection. This means they are constructionally different.
// To avoid introducing another two ladder types, the difference in z position
// was accepted.
// Differences to v12:
// gkChainGap reduced from 1 mm to 0
// gkCableThickness increased from 100 mum to 200 mum (2 cables per module)
// gkSectorOverlapY reduced from 3 mm to 2.4 mm
// New sensor types 05 and 06
// New sector types 07 and 08
// Re-definiton of ladders (17 types instead of 8)
// Re-definiton of station from new ladders
#include "TGeoCompositeShape.h"
#include "TGeoCone.h"
#include "TGeoManager.h"
#include "TGeoPara.h"
#include "TGeoPhysicalNode.h"
#include "TGeoTrd2.h"
#include "TGeoTube.h"
#include "TGeoXtru.h"
#include <iomanip>
#include <iostream>
// forward declarations
Int_t CreateSensors();
Int_t CreateSectors();
Int_t CreateLadders();
TGeoVolume* ConstructModule(const char* name, TGeoVolume* sector, Double_t cableLength);
TGeoVolume* ConstructHalfLadder(const TString& name, Int_t nSectors, Int_t* sectorTypes, char align,
Double_t ladderLength, Double_t offsetY);
TGeoVolume* ConstructLadder(Int_t LadderIndex, TGeoVolume* halfLadderU, TGeoVolume* halfLadderD, Double_t gapY,
Double_t shiftZ, Double_t pitchZ, Int_t nSectors);
TGeoVolume* ConstructUnit(Int_t iSide, Int_t iUnit, Int_t nLadders, Int_t* ladderTypes, Int_t iStation);
void ImportPassive(TGeoVolume* stsVolume, TString geoTag, fstream& infoFile);
void PostProcessGdml(TGeoVolume* gdmlTop);
void CheckVolume(TGeoVolume* volume);
void CheckVolume(TGeoVolume* volume, fstream& file, Bool_t listChildren = kTRUE);
Double_t BeamPipeRadius(Double_t z);
TGeoVolume* ConstructFrameElement(const TString& name, TGeoVolume* frameBoxVol, Double_t x);
TGeoVolume* ConstructSmallCone(Double_t coneDz);
TGeoVolume* ConstructBigCone(Double_t coneDz);
// ------------- Version highlight -----------------------------------
const std::string gVersionHighlight = R"(
Summary:
This version adds passive materials imported from GDML model to the STS geometry:
* Taken from and largely correspond to mechanical CAD drawings of the detector
* Thermal insulation box:
- made out of carbon sandwitch panel (2mm carbon fiber sheet + layer of carbon foam + 2mm carbon fiber sheet)
- front window of complex shape with interface to MVD / target chamber
- back window with large aperture (2000 x 1200 mm) square cut into carbon foam
* Structural units:
- made of 2 complex shape aluminum C-Frames, 15mm thick
- placed at 25, 35, ... ,105 cm absolute Z
- contain front-end and power distribution boxes with equivalent X_0 values
Scripted geometry tweaks:
* Ladders and cables are extended towards the read-out planes having same lengths in respective rows
* Adjusted form and shape of carbon ladder structures from L-type to X-type
* Reduced verbosity of this file
Sensor arrangement is the same as in version v16g
!! Important for this version is the discrepancy from the mechanical CAD w.r.t. front wall.
The square window was replaced by a round one to avoid overlaps with present beam pipe designs, e.g. pipe_v16b_1e
)";
// ------------- Steering variables -----------------------------------
// ---> Horizontal width of sensors [cm]
const Double_t gkSensorSizeX = 6.2; // was 6.2092; // 6.2 - Oleg CAD 15/05/2020
// ---> Thickness of sensors [cm]
const Double_t gkSensorThickness = 0.032;
// ---> Vertical gap between chained sensors [cm]
const Double_t gkChainGapY = 0.00;
// ---> Thickness of cables [cm]
const Double_t gkCableThickness = 0.032;
// ---> Horizontal overlap of neighbouring ladders [cm]
const Double_t gkLadderOverlapX = 0.25; // delta X - Oleg CAD 14/05/2020
// ---> Vertical overlap of neighbouring sectors in a ladder [cm]
const Double_t gkSectorOverlapY = 0.46; // delta Y - Oleg CAD 14/05/2020
// ---> Gap in z between neighbouring sectors in a ladder [cm]
const Double_t gkSectorGapZ = 0.12; // gap + thickness = pitch // delta Z pitch = 0.15 - Oleg CAD 14/05/2020
// ---> Gap in z between neighbouring ladders [cm]
const Double_t gkLadderGapZ = 0.50 - 0.152; // for asym // 0.5 for sym // delta Z prime
// ---> Gap in z between lowest sector to carbon support structure [cm]
const Double_t gkSectorGapZFrame =
0.280
- 0.025; // Oleg CAD 05/05/2020 // there is a 2.8 mm gap between the bottom side of the sensor and the top ledge of the carbon ladder
// ---> Switch to construct / not to construct readout cables
const Bool_t gkConstructCables = kTRUE;
// ---> Switch to construct / not to construct frames
const Bool_t gkConstructCones = kFALSE; // kTRUE; // switch this false by default for v15c and v16x
const Bool_t gkConstructFrames = kTRUE; // kFALSE; // switch this true by default for v15c and v16x
const Bool_t gkConstructSmallFrames = kTRUE; // kFALSE;
const Bool_t gkCylindricalFrames = kTRUE; // kFALSE;
// ---> Size of the frame
const Double_t gkFrameThickness = 0.2;
const Double_t gkThinFrameThickness = 0.05;
const Double_t gkFrameStep = 4.0; // size of frame cell along y direction
const Double_t gkCylinderDiaInner =
0.07; // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
const Double_t gkCylinderDiaOuter =
0.15; // properties of cylindrical carbon supports, see CBM-STS Integration Meeting (10 Jul 2015)
// ---> Switch to import / not to import the Passive materials from GDML file
const Bool_t gkImportPassive = kTRUE;
// ----------------------------------------------------------------------------
// -------------- Parameters of beam pipe in the STS region --------------
// ---> Needed to compute stations and STS such as to avoid overlaps
const Double_t gkPipeZ1 = 18.0;
const Double_t gkPipeR1 = 2.0;
const Double_t gkPipeZ2 = 125.0;
const Double_t gkPipeR2 = 5.0;
//const Double_t gkPipeZ3 = 125.0;
//const Double_t gkPipeR3 = 5.5;
//const Double_t gkPipeZ2 = 50.0;
//const Double_t gkPipeR2 = 1.8;
//DE const Double_t gkPipeZ1 = 27.0;
//DE const Double_t gkPipeR1 = 1.05;
//DE const Double_t gkPipeZ2 = 160.0;
//DE const Double_t gkPipeR2 = 3.25;
// ----------------------------------------------------------------------------
//TString unitName[16] = // names of units for v16e
// { "Unit00D",
// "Unit01U", "Unit01D",
// "Unit02U", "Unit02D",
// "Unit03U", "Unit03D",
// "Unit04U", "Unit04D",
// "Unit05U", "Unit05D",
// "Unit06U", "Unit06D",
// "Unit07U", "Unit07D",
// "Unit08U" };
//TString unitName[32] = // names of units for v16f
// { "Unit00DR", "Unit00DL",
// "Unit01UR", "Unit01UL", "Unit01DR", "Unit01DL",
// "Unit02UR", "Unit02UL", "Unit02DR", "Unit02DL",
// "Unit03UR", "Unit03UL", "Unit03DR", "Unit03DL",
// "Unit04UR", "Unit04UL", "Unit04DR", "Unit04DL",
// "Unit05UR", "Unit05UL", "Unit05DR", "Unit05DL",
// "Unit06UR", "Unit06UL", "Unit06DR", "Unit06DL",
// "Unit07UR", "Unit07UL", "Unit07DR", "Unit07DL",
// "Unit08UR", "Unit08UL" };
TString unitName[32] = // names of units for v16g - while merging D and U parts
{"Unit00R", "Unit00L", "Unit01R", "Unit01L", "Unit01R", "Unit01L", "Unit02R", "Unit02L",
"Unit02R", "Unit02L", "Unit03R", "Unit03L", "Unit03R", "Unit03L", "Unit04R", "Unit04L",
"Unit04R", "Unit04L", "Unit05R", "Unit05L", "Unit05R", "Unit05L", "Unit06R", "Unit06L",
"Unit06R", "Unit06L", "Unit07R", "Unit07L", "Unit07R", "Unit07L", "Unit08R", "Unit08L"};
TString unitName18[18] = // names of units for v16g
{"Unit00R", "Unit00L", "Unit01R", "Unit01L", "Unit02R", "Unit02L", "Unit03R", "Unit03L", "Unit04R",
"Unit04L", "Unit05R", "Unit05L", "Unit06R", "Unit06L", "Unit07R", "Unit07L", "Unit08R", "Unit08L"};
// ------------- Other global variables -----------------------------------
// ---> STS medium (for every volume except silicon)
TGeoMedium* gStsMedium = NULL; // will be set later
// ---> TGeoManager (too lazy to write out 'Manager' all the time
TGeoManager* gGeoMan = NULL; // will be set later
// ----------------------------------------------------------------------------
// ============================================================================
// ====== Main function =====
// ============================================================================
void create_stsgeo_v21h(const char* geoTag = "v21h")
{
// ------- Geometry file name (output) ----------------------------------
TString geoFileName = "sts_";
geoFileName = geoFileName + geoTag + ".geo.root";
// --------------------------------------------------------------------------
// ------- Open info file -----------------------------------------------
TString infoFileName = geoFileName;
infoFileName.ReplaceAll("root", "info");
fstream infoFile;
infoFile.open(infoFileName.Data(), fstream::out);
infoFile << "STS geometry created with create_stsgeo_v21h.C" << endl;
infoFile << gVersionHighlight << endl;
infoFile << "Global variables: " << endl;
infoFile << "Sensor thickness = " << gkSensorThickness << " cm" << endl;
infoFile << "Vertical gap in sensor chain = " << gkChainGapY << " cm" << endl;
infoFile << "Vertical overlap of sensors = " << gkSectorOverlapY << " cm" << endl;
infoFile << "Gap in z between neighbour sensors = " << gkSectorGapZ << " cm" << endl;
infoFile << "Horizontal overlap of sensors = " << gkLadderOverlapX << " cm" << endl;
infoFile << "Gap in z between neighbour ladders = " << gkLadderGapZ << " cm" << endl;
if (gkConstructCables) infoFile << "Cable thickness = " << gkCableThickness << " cm" << endl;
else
infoFile << "No cables" << endl;
infoFile << endl;
infoFile << "Beam pipe: R1 = " << gkPipeR1 << " cm at z = " << gkPipeZ1 << " cm" << endl;
infoFile << "Beam pipe: R2 = " << gkPipeR2 << " cm at z = " << gkPipeZ2 << " cm" << endl;
//infoFile << "Beam pipe: R3 = " << gkPipeR3 << " cm at z = " << gkPipeZ3
// << " cm" << endl;
// --------------------------------------------------------------------------
// ------- Load media from media file -----------------------------------
FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
FairGeoInterface* geoFace = geoLoad->getGeoInterface();
TString geoPath = gSystem->Getenv("VMCWORKDIR");
TString medFile = geoPath + "/geometry/media.geo";
geoFace->setMediaFile(medFile);
geoFace->readMedia();
gGeoMan = gGeoManager;
gSystem->Load("libGeom");
// --------------------------------------------------------------------------
// ----------------- Get and create the required media -----------------
FairGeoMedia* geoMedia = geoFace->getMedia();
FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
// ---> air
FairGeoMedium* mAir = geoMedia->getMedium("air");
if (!mAir) Fatal("Main", "FairMedium air not found");
geoBuild->createMedium(mAir);
TGeoMedium* air = gGeoMan->GetMedium("air");
if (!air) Fatal("Main", "Medium air not found");
// ---> air
FairGeoMedium* mvacuum = geoMedia->getMedium("vacuum");
if (!mvacuum) Fatal("Main", "FairMedium vacuum not found");
geoBuild->createMedium(mvacuum);
TGeoMedium* Vacuum = gGeoMan->GetMedium("vacuum");
if (!Vacuum) Fatal("Main", "Medium vacuum not found");
// ---> silicon
FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
if (!mSilicon) Fatal("Main", "FairMedium silicon not found");
geoBuild->createMedium(mSilicon);
TGeoMedium* silicon = gGeoMan->GetMedium("silicon");
if (!silicon) Fatal("Main", "Medium silicon not found");
// ---> carbon
FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
if (!mCarbon) Fatal("Main", "FairMedium carbon not found");
geoBuild->createMedium(mCarbon);
TGeoMedium* carbon = gGeoMan->GetMedium("carbon");
if (!carbon) Fatal("Main", "Medium carbon not found");
// ---> STSBoxCarbonFoam
FairGeoMedium* mSTSBoxCarbonFoam = geoMedia->getMedium("STSBoxCarbonFoam");
if (!mSTSBoxCarbonFoam) Fatal("Main", "FairMedium STSBoxCarbonFoam not found");
geoBuild->createMedium(mSTSBoxCarbonFoam);
TGeoMedium* STSBoxCarbonFoam = gGeoMan->GetMedium("STSBoxCarbonFoam");
if (!STSBoxCarbonFoam) Fatal("Main", "Medium STSBoxCarbonFoam not found");
// ---> STSBoxCarbonFibre
FairGeoMedium* mSTSBoxCarbonFibre = geoMedia->getMedium("STSBoxCarbonFibre");
if (!mSTSBoxCarbonFibre) Fatal("Main", "FairMedium STSBoxCarbonFibre not found");
geoBuild->createMedium(mSTSBoxCarbonFibre);
TGeoMedium* STSBoxCarbonFibre = gGeoMan->GetMedium("STSBoxCarbonFibre");
if (!STSBoxCarbonFibre) Fatal("Main", "Medium STSBoxCarbonFibre not found");
// ---> STScable
FairGeoMedium* mSTScable = geoMedia->getMedium("STScable");
if (!mSTScable) Fatal("Main", "FairMedium STScable not found");
geoBuild->createMedium(mSTScable);
TGeoMedium* STScable = gGeoMan->GetMedium("STScable");
if (!STScable) Fatal("Main", "Medium STScable not found");
// ---> STS_cable_21
FairGeoMedium* mSTS_Cable_21 = geoMedia->getMedium("STS_Cable_21");
if (!mSTS_Cable_21) Fatal("Main", "FairMedium STS_Cable_21 not found");
geoBuild->createMedium(mSTS_Cable_21);
TGeoMedium* STS_Cable_21 = gGeoMan->GetMedium("STS_Cable_21");
if (!STS_Cable_21) Fatal("Main", "Medium STS_Cable_21 not found");
// ---> Aluminium
FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
if (!mAluminium) Fatal("Main", "FairMedium aluminium not found");
geoBuild->createMedium(mAluminium);
TGeoMedium* aluminium = gGeoMan->GetMedium("aluminium");
if (!aluminium) Fatal("Main", "Medium aluminium not found");
// ---
//gStsMedium = air;
gStsMedium = gGeoMan->GetMedium("air");
if (!gStsMedium) Fatal("Main", "medium sts_air not found");
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// -------------- Create geometry and top volume -------------------------
gGeoMan = (TGeoManager*) gROOT->FindObject("FAIRGeom");
//gGeoMan->SetName("STSgeom");
TGeoVolume* top = new TGeoVolumeAssembly("top");
// TGeoBBox* topbox= new TGeoBBox("", 120., 120., 120.);
// TGeoVolume* top = new TGeoVolume("top", topbox, gGeoMan->GetMedium("air"));
gGeoMan->SetTopVolume(top);
// --------------------------------------------------------------------------
// -------------- Create media ------------------------------------------
/*
cout << endl;
cout << "===> Creating media....";
cout << CreateMedia();
cout << " media created" << endl;
TList* media = gGeoMan->GetListOfMedia();
for (Int_t iMedium = 0; iMedium < media->GetSize(); iMedium++ ) {
cout << "Medium " << iMedium << ": "
<< ((TGeoMedium*) media->At(iMedium))->GetName() << endl;
}
gStsMedium = gGeoMan->GetMedium("air");
if ( ! gStsMedium ) Fatal("Main", "medium sts_air not found");
*/
// --------------------------------------------------------------------------
// --------------- Create sensors ---------------------------------------
cout << endl << endl;
cout << "===> Creating sensors...." << endl << endl;
infoFile << endl << "Sensors: " << endl;
Int_t nSensors = CreateSensors();
for (Int_t iSensor = 1; iSensor <= nSensors; iSensor++) {
TString name = Form("Sensor%02d", iSensor);
TGeoVolume* sensor = gGeoMan->GetVolume(name);
// add color to sensors
if (iSensor == 1) sensor->SetLineColor(kRed);
if (iSensor == 2) sensor->SetLineColor(kGreen + 3);
if (iSensor == 3) sensor->SetLineColor(kBlue + 3);
if (iSensor == 4) sensor->SetLineColor(kAzure - 7);
if (iSensor == 5) sensor->SetLineColor(kYellow);
if (iSensor == 6) sensor->SetLineColor(kYellow);
if (iSensor == 7) sensor->SetLineColor(kYellow);
CheckVolume(sensor);
CheckVolume(sensor, infoFile);
}
// --------------------------------------------------------------------------
// ---------------- Create sectors --------------------------------------
cout << endl << endl;
cout << "===> Creating sectors...." << endl;
// infoFile << endl << "Sectors: " << endl;
Int_t nSectors = CreateSectors();
for (Int_t iSector = 1; iSector <= nSectors; iSector++) {
// cout << endl;
TString name = Form("Sector%02d", iSector);
TGeoVolume* sector = gGeoMan->GetVolume(name);
CheckVolume(sector);
// CheckVolume(sector, infoFile);
}
// --------------------------------------------------------------------------
// ---------------- Create ladders --------------------------------------
cout << endl << endl;
cout << "===> Creating ladders...." << endl;
infoFile << endl << "Ladders:" << endl;
TString name = "";
TGeoVolume* ladder;
Int_t nLadders = CreateLadders();
for (Int_t iLadder = 1; iLadder <= nLadders; iLadder++) {
cout << endl;
// name = Form("LadderType%02d", iLadder); // v19a
// name = Form("LadderType0%02d", iLadder); // v19b
name = Form("LadderType00%02d", iLadder); // v19k
ladder = gGeoMan->GetVolume(name);
CheckVolume(ladder);
CheckVolume(ladder, infoFile, kFALSE);
cout << "DF1: ladder name: " << name << endl << endl;
// name = Form("LadderType%02d", iLadder); // v19a
// name = Form("LadderType1%02d", iLadder); // v19b
name = Form("LadderType01%02d", iLadder); // v19k
ladder = gGeoMan->GetVolume(name);
CheckVolume(ladder);
CheckVolume(ladder, infoFile, kFALSE);
cout << "DF2: ladder name: " << name << endl << endl;
// name = Form("LadderType%02d", iLadder); // v19a
name = Form("LadderType10%02d", iLadder); // v19k
ladder = gGeoMan->GetVolume(name);
CheckVolume(ladder);
CheckVolume(ladder, infoFile, kFALSE);
cout << "DF3: ladder name: " << name << endl << endl;
// name = Form("LadderType%02d", iLadder); // v19a
name = Form("LadderType11%02d", iLadder); // v19k
ladder = gGeoMan->GetVolume(name);
CheckVolume(ladder);
CheckVolume(ladder, infoFile, kFALSE);
cout << "DF4: ladder name: " << name << endl << endl;
}
// --------------------------------------------------------------------------
// ---------------- Create cones ----------------------------------------
Double_t coneDz = 1.64;
TGeoVolume* coneSmallVolum = ConstructSmallCone(coneDz);
if (!coneSmallVolum) Fatal("ConstructSmallCone", "Volume Cone not found");
TGeoVolume* coneBigVolum = ConstructBigCone(coneDz);
if (!coneBigVolum) Fatal("ConstructBigCone", "Volume Cone not found");
// --------------------------------------------------------------------------
// ---------------- Create stations -------------------------------------
cout << endl << endl;
cout << "===> Creating stations...." << endl;
infoFile << endl << "Stations: " << endl;
Int_t angle = 0;
nLadders = 0;
Int_t ladderTypes[16]; // there are max 16 ladders in one layer
TGeoTranslation* statTrans = NULL;
TGeoVolume* myunit[32]; // units
// Int_t statPos[16] = { 30, 30, 40, 40, 50, 50, 60, 60,