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"
37using namespace o2::passive;
38
40{
42 // Create materials and media
43 Int_t isxfld;
44 Float_t sxmgmx;
46 LOG(info) << "Field in CAVE: " << isxfld;
47 // AIR
48 isxfld = 1;
49 Float_t aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
50 Float_t zAir[4] = {6., 7., 8., 18.};
51 Float_t wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
52 Float_t dAir = 1.20479E-3 * 960. / 1014.;
53
54 //
55 matmgr.Mixture("CAVE", 2, "Air", aAir, zAir, dAir, 4, wAir);
56 matmgr.Mixture("CAVE", 3, "Air_NF", aAir, zAir, dAir, 4, wAir);
57 //
58 matmgr.Medium("CAVE", 2, "Air", 2, 0, isxfld, sxmgmx, 10, -1, -0.1, 0.1, -10);
59 matmgr.Medium("CAVE", 3, "Air_NF", 3, 0, 0, sxmgmx, 10, -1, -0.1, 0.1, -10);
60}
61
63{
66 auto kMedAir = gGeoManager->GetMedium("CAVE_Air");
67
68 Float_t dALIC[3];
69
70 if (mHasZDC) {
71 LOG(info) << "Setting up CAVE to host ZDC";
72 // dimensions taken from ALIROOT
73 dALIC[0] = 2500;
74 dALIC[1] = 2500;
75 dALIC[2] = 15000;
76 } else {
77 LOG(info) << "Setting up CAVE without ZDC";
78 dALIC[0] = 2000;
79 dALIC[1] = 2000;
80 dALIC[2] = 3000;
81 }
82 auto cavevol = gGeoManager->MakeBox("cave", kMedAir, dALIC[0], dALIC[1], dALIC[2]);
83 gGeoManager->SetTopVolume(cavevol);
84
85 TGeoPgon* shCaveTR1 = new TGeoPgon("shCaveTR1", 22.5, 360., 8., 2);
86 shCaveTR1->DefineSection(0, -706. - 8.6, 0., 790.5);
87 shCaveTR1->DefineSection(1, 707. + 7.6, 0., 790.5);
88 TGeoTube* shCaveTR2 = new TGeoTube("shCaveTR2", 0., 150., 110.);
89 TGeoTube* shCaveTR3 = new TGeoTube("shCaveTR3", 0., 105., 75.);
90
91 TGeoTranslation* transCaveTR2 = new TGeoTranslation("transTR2", 0, 30., -505. - 110.);
92 TGeoTranslation* transCaveTR3 = new TGeoTranslation("transTR3", 0, 30., 714.6 + 75.);
93 transCaveTR2->RegisterYourself();
94 transCaveTR3->RegisterYourself();
95
96 TGeoCompositeShape* shCaveTR = new TGeoCompositeShape("shCaveTR", "shCaveTR1-shCaveTR2:transTR2+shCaveTR3:transTR3");
97 TGeoVolume* voBarrel = new TGeoVolume("barrel", shCaveTR, kMedAir);
98 cavevol->AddNode(voBarrel, 1, new TGeoTranslation(0., -30., 0.));
99 if (mHasRB24) { // should be not true only for alice 3
100 // mother volume for RB24 side (FDD, Compensator)
101 const Float_t kRB24CL = 2. * 597.9 - 150.;
102 auto shCaveRB24 = new TGeoPcon(0., 360., 6);
103 Float_t z0 = kRB24CL / 2 + 714.6 + 150.;
104 shCaveRB24->DefineSection(0, -kRB24CL / 2., 0., 105.);
105 shCaveRB24->DefineSection(1, -z0 + 1705., 0., 105.);
106 shCaveRB24->DefineSection(2, -z0 + 1705., 0., 14.5);
107 shCaveRB24->DefineSection(3, -z0 + 1878, 0., 14.5);
108 shCaveRB24->DefineSection(4, -z0 + 1878., 0., 40.0);
109 shCaveRB24->DefineSection(5, kRB24CL / 2., 0., 40.0);
110
111 TGeoVolume* caveRB24 = new TGeoVolume("caveRB24", shCaveRB24, kMedAir);
112 caveRB24->SetVisibility(0);
113 cavevol->AddNode(caveRB24, 1, new TGeoTranslation(0., 0., z0));
114 } else {
115 LOGP(info, "Setting up CAVE without RB24");
116 }
117 //
118}
119
121Cave::~Cave() = default;
122Cave::Cave(const char* name, const char* Title) : FairDetector(name, Title, -1) {}
123Cave::Cave(const Cave& rhs) : FairDetector(rhs) {}
124Cave& Cave::operator=(const Cave& rhs)
125{
126 // self assignment
127 if (this == &rhs) {
128 return *this;
129 }
130
131 // base class assignment
133 return *this;
134}
135
136FairModule* Cave::CloneModule() const { return new Cave(*this); }
138{
139 LOG(debug) << "CAVE: Primary finished";
140 for (auto& f : mFinishPrimaryHooks) {
141 f();
142 }
143}
144
145// we set the random number generator for each
146// primary in order to be reproducible in a multi-processing sub-event
147// setting
149{
150 // only do it, if not in pure trackSeeding mode
151 if (!o2::conf::SimCutParams::Instance().trackSeed) {
152 auto& conf = o2::conf::SimConfig::Instance();
153 auto chunks = conf.getInternalChunkSize();
154 if (chunks != -1) {
155 if (mPrimaryCounter % chunks == 0) {
156 auto seed = mChunkSeedCounter + 10;
157 o2::base::simRandom()->SetSeed(seed);
158 mChunkSeedCounter++;
159 }
160 }
161 }
162 mPrimaryCounter++;
163}
164
166{
167 LOG(fatal) << "CAVE ProcessHits called; should never happen";
168 return false;
169}
170
Definition of the Detector class.
std::ostringstream debug
ClassImp(IdPath)
XrdCl::ChunkList chunks
FairModule & operator=(const FairModule &)
static void initFieldTrackingParams(int &mode, float &maxfield)
Definition Detector.cxx:143
static MaterialManager & Instance()
static SimConfig & Instance()
Definition SimConfig.h:112
Bool_t ProcessHits(FairVolume *v=nullptr) override
Definition Cave.cxx:165
void FinishPrimary() override
Definition Cave.cxx:137
void createMaterials()
Definition Cave.cxx:39
~Cave() override
void BeginPrimary() override
Definition Cave.cxx:148
void ConstructGeometry() override
Definition Cave.cxx:62
FairModule * CloneModule() const override
Clone this object (used in MT mode only)
Definition Cave.cxx:136
GLuint const GLchar * name
Definition glcorearb.h:781
GLdouble f
Definition glcorearb.h:310
TRandom * simRandom()
Definition SimRandom.cxx:22
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"