Project
Loading...
Searching...
No Matches
Cave.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12/********************************************************************************
13 * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
14 * *
15 * This software is distributed under the terms of the *
16 * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
17 * copied verbatim in the file "LICENSE" *
18 ********************************************************************************/
19
20// -------------------------------------------------------------------------
21// ----- Cave file -----
22// ----- Created 26/03/14 by M. Al-Turany -----
23// -------------------------------------------------------------------------
27#include "SimConfig/SimConfig.h"
28#include "SimConfig/SimParams.h"
29#include <TRandom.h>
30#include <fairlogger/Logger.h>
31#include "TGeoManager.h"
32#include "TGeoVolume.h"
33#include "TGeoPgon.h"
34#include "TGeoTube.h"
35#include "TGeoCompositeShape.h"
36using namespace o2::passive;
37
39{
41 // Create materials and media
42 Int_t isxfld;
43 Float_t sxmgmx;
45 LOG(info) << "Field in CAVE: " << isxfld;
46 // AIR
47 isxfld = 1;
48 Float_t aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
49 Float_t zAir[4] = {6., 7., 8., 18.};
50 Float_t wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
51 Float_t dAir = 1.20479E-3 * 960. / 1014.;
52
53 //
54 matmgr.Mixture("CAVE", 2, "Air", aAir, zAir, dAir, 4, wAir);
55 matmgr.Mixture("CAVE", 3, "Air_NF", aAir, zAir, dAir, 4, wAir);
56 //
57 matmgr.Medium("CAVE", 2, "Air", 2, 0, isxfld, sxmgmx, 10, -1, -0.1, 0.1, -10);
58 matmgr.Medium("CAVE", 3, "Air_NF", 3, 0, 0, sxmgmx, 10, -1, -0.1, 0.1, -10);
59}
60
62{
65 auto kMedAir = gGeoManager->GetMedium("CAVE_Air");
66
67 Float_t dALIC[3];
68
69 if (mHasZDC) {
70 LOG(info) << "Setting up CAVE to host ZDC";
71 // dimensions taken from ALIROOT
72 dALIC[0] = 2500;
73 dALIC[1] = 2500;
74 dALIC[2] = 15000;
75 } else {
76 LOG(info) << "Setting up CAVE without ZDC";
77 dALIC[0] = 2000;
78 dALIC[1] = 2000;
79 dALIC[2] = 3000;
80 }
81 auto cavevol = gGeoManager->MakeBox("cave", kMedAir, dALIC[0], dALIC[1], dALIC[2]);
82 gGeoManager->SetTopVolume(cavevol);
83
84 TGeoPgon* shCaveTR1 = new TGeoPgon("shCaveTR1", 22.5, 360., 8., 2);
85 shCaveTR1->DefineSection(0, -706. - 8.6, 0., 790.5);
86 shCaveTR1->DefineSection(1, 707. + 7.6, 0., 790.5);
87 TGeoTube* shCaveTR2 = new TGeoTube("shCaveTR2", 0., 150., 110.);
88 TGeoTube* shCaveTR3 = new TGeoTube("shCaveTR3", 0., 80., 75.);
89
90 TGeoTranslation* transCaveTR2 = new TGeoTranslation("transTR2", 0, 30., -505. - 110.);
91 TGeoTranslation* transCaveTR3 = new TGeoTranslation("transTR3", 0, 30., 714.6 + 75.);
92 transCaveTR2->RegisterYourself();
93 transCaveTR3->RegisterYourself();
94
95 TGeoCompositeShape* shCaveTR = new TGeoCompositeShape("shCaveTR", "shCaveTR1-shCaveTR2:transTR2+shCaveTR3:transTR3");
96 TGeoVolume* voBarrel = new TGeoVolume("barrel", shCaveTR, kMedAir);
97 cavevol->AddNode(voBarrel, 1, new TGeoTranslation(0., -30., 0.));
98 if (mHasRB24) { // should be not true only for alice 3
99 // mother volume for RB24 side (FDD, Compensator)
100 const Float_t kRB24CL = 2. * 597.9 - 150.;
101 auto shCaveRB24 = new TGeoPcon(0., 360., 6);
102 Float_t z0 = kRB24CL / 2 + 714.6 + 150.;
103 shCaveRB24->DefineSection(0, -kRB24CL / 2., 0., 105.);
104 shCaveRB24->DefineSection(1, -z0 + 1705., 0., 105.);
105 shCaveRB24->DefineSection(2, -z0 + 1705., 0., 14.5);
106 shCaveRB24->DefineSection(3, -z0 + 1878, 0., 14.5);
107 shCaveRB24->DefineSection(4, -z0 + 1878., 0., 40.0);
108 shCaveRB24->DefineSection(5, kRB24CL / 2., 0., 40.0);
109
110 TGeoVolume* caveRB24 = new TGeoVolume("caveRB24", shCaveRB24, kMedAir);
111 caveRB24->SetVisibility(0);
112 cavevol->AddNode(caveRB24, 1, new TGeoTranslation(0., 0., z0));
113 } else {
114 LOGP(info, "Setting up CAVE without RB24");
115 }
116 //
117}
118
120Cave::~Cave() = default;
121Cave::Cave(const char* name, const char* Title) : FairDetector(name, Title, -1) {}
122Cave::Cave(const Cave& rhs) : FairDetector(rhs) {}
123Cave& Cave::operator=(const Cave& rhs)
124{
125 // self assignment
126 if (this == &rhs) {
127 return *this;
128 }
129
130 // base class assignment
131 FairModule::operator=(rhs);
132 return *this;
133}
134
135FairModule* Cave::CloneModule() const { return new Cave(*this); }
137{
138 LOG(debug) << "CAVE: Primary finished";
139 for (auto& f : mFinishPrimaryHooks) {
140 f();
141 }
142}
143
144// we set the random number generator for each
145// primary in order to be reproducible in a multi-processing sub-event
146// setting
148{
149 static int primcounter = 0;
150
151 // only do it, if not in pure trackSeeding mode
152 if (!o2::conf::SimCutParams::Instance().trackSeed) {
153 auto& conf = o2::conf::SimConfig::Instance();
154 auto chunks = conf.getInternalChunkSize();
155 if (chunks != -1) {
156 if (primcounter % chunks == 0) {
157 static int counter = 1;
158 auto seed = counter + 10;
159 gRandom->SetSeed(seed);
160 counter++;
161 }
162 }
163 }
164 primcounter++;
165}
166
167bool Cave::ProcessHits(FairVolume*)
168{
169 LOG(fatal) << "CAVE ProcessHits called; should never happen";
170 return false;
171}
172
Definition of the Detector class.
ClassImp(IdPath)
std::ostringstream debug
static void initFieldTrackingParams(int &mode, float &maxfield)
Definition Detector.cxx:143
static MaterialManager & Instance()
static SimConfig & Instance()
Definition SimConfig.h:111
Bool_t ProcessHits(FairVolume *v=nullptr) override
Definition Cave.cxx:167
void FinishPrimary() override
Definition Cave.cxx:136
void createMaterials()
Definition Cave.cxx:38
~Cave() override
void BeginPrimary() override
Definition Cave.cxx:147
void ConstructGeometry() override
Definition Cave.cxx:61
FairModule * CloneModule() const override
Clone this object (used in MT mode only)
Definition Cave.cxx:135
GLuint const GLchar * name
Definition glcorearb.h:781
GLdouble f
Definition glcorearb.h:310
GLuint counter
Definition glcorearb.h:3987
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"