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
89 TGeoTranslation* transCaveTR2 = new TGeoTranslation("transTR2", 0, 30., -505. - 110.);
90 transCaveTR2->RegisterYourself();
91 TGeoCompositeShape* shCaveTR = new TGeoCompositeShape("shCaveTR", "shCaveTR1-shCaveTR2:transTR2");
92 TGeoVolume* voBarrel = new TGeoVolume("barrel", shCaveTR, kMedAir);
93 cavevol->AddNode(voBarrel, 1, new TGeoTranslation(0., -30., 0.));
94 if (mHasRB24) { // should be not true only for alice 3
95 // mother volume for RB24 side (FDD, Compensator)
96 const Float_t kRB24CL = 2. * 597.9;
97 auto shCaveRB24 = new TGeoPcon(0., 360., 6);
98 Float_t z0 = kRB24CL / 2 + 714.6;
99 shCaveRB24->DefineSection(0, -kRB24CL / 2., 0., 105.);
100 shCaveRB24->DefineSection(1, -z0 + 1705., 0., 105.);
101 shCaveRB24->DefineSection(2, -z0 + 1705., 0., 14.5);
102 shCaveRB24->DefineSection(3, -z0 + 1880., 0., 14.5);
103 shCaveRB24->DefineSection(4, -z0 + 1880., 0., 40.0);
104 shCaveRB24->DefineSection(5, kRB24CL / 2, 0., 40.0);
105
106 TGeoVolume* caveRB24 = new TGeoVolume("caveRB24", shCaveRB24, kMedAir);
107 caveRB24->SetVisibility(0);
108 cavevol->AddNode(caveRB24, 1, new TGeoTranslation(0., 0., z0));
109 } else {
110 LOGP(info, "Setting up CAVE without RB24");
111 }
112 //
113}
114
116Cave::~Cave() = default;
117Cave::Cave(const char* name, const char* Title) : FairDetector(name, Title, -1) {}
118Cave::Cave(const Cave& rhs) : FairDetector(rhs) {}
119Cave& Cave::operator=(const Cave& rhs)
120{
121 // self assignment
122 if (this == &rhs) {
123 return *this;
124 }
125
126 // base class assignment
127 FairModule::operator=(rhs);
128 return *this;
129}
130
131FairModule* Cave::CloneModule() const { return new Cave(*this); }
133{
134 LOG(debug) << "CAVE: Primary finished";
135 for (auto& f : mFinishPrimaryHooks) {
136 f();
137 }
138}
139
140// we set the random number generator for each
141// primary in order to be reproducible in a multi-processing sub-event
142// setting
144{
145 static int primcounter = 0;
146
147 // only do it, if not in pure trackSeeding mode
148 if (!o2::conf::SimCutParams::Instance().trackSeed) {
149 auto& conf = o2::conf::SimConfig::Instance();
150 auto chunks = conf.getInternalChunkSize();
151 if (chunks != -1) {
152 if (primcounter % chunks == 0) {
153 static int counter = 1;
154 auto seed = counter + 10;
155 gRandom->SetSeed(seed);
156 counter++;
157 }
158 }
159 }
160 primcounter++;
161}
162
163bool Cave::ProcessHits(FairVolume*)
164{
165 LOG(fatal) << "CAVE ProcessHits called; should never happen";
166 return false;
167}
168
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:163
void FinishPrimary() override
Definition Cave.cxx:132
void createMaterials()
Definition Cave.cxx:38
~Cave() override
void BeginPrimary() override
Definition Cave.cxx:143
void ConstructGeometry() override
Definition Cave.cxx:61
FairModule * CloneModule() const override
Clone this object (used in MT mode only)
Definition Cave.cxx:131
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"