ATLAS Offline Software
Loading...
Searching...
No Matches
Csc.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "MuonGeoModel/Csc.h"
6
8#include "GaudiKernel/MsgStream.h"
10#include "GeoModelKernel/GeoFullPhysVol.h"
11#include "GeoModelKernel/GeoLogVol.h"
12#include "GeoModelKernel/GeoShapeShift.h"
13#include "GeoModelKernel/GeoShapeUnion.h"
14#include "GeoModelKernel/GeoTrd.h"
19
20#include <GaudiKernel/IMessageSvc.h>
21#include <GeoModelKernel/GeoDefinitions.h>
22#include <GeoModelKernel/GeoShape.h>
23#include <GeoModelKernel/GeoVPhysVol.h>
24#include <string>
25#include <utility>
26
27class GeoMaterial;
28
29#define skip_csc false
30
31namespace MuonGM {
32
34 CscComponent *s = static_cast<CscComponent *>(ss);
35 m_component = s;
36 width = s->dx1;
37 longWidth = s->dx2;
38 thickness = s->GetThickness(mysql);
39 maxwLength = s->maxwdy;
40 excent = s->excent;
41 physicalLength = s->dy;
43 double num = longWidth * (excent - physicalLength);
44 if (std::abs(num) < 1e-10) {
45 upWidth = 0;
46 } else {
47 upWidth = num / (excent - maxwLength);
48 }
49
50 layer = std::make_unique<CscMultiLayer>(mysql, s->name);
51 layer->width = width;
52 layer->longWidth = longWidth;
53 layer->upWidth = upWidth;
54 layer->excent = excent;
55 layer->length = length;
56 layer->physicalLength = physicalLength;
57 layer->maxwLength = maxwLength;
58
59 index = s->index;
60 }
61
62
63 GeoFullPhysVol *Csc::build(StoredMaterialManager& matManager,
64 const MYSQL& mysql,
65 int minimalgeo) {
66 std::vector<Cutout *> vcutdef;
67 int cutoutson = 0;
68 return build(matManager, mysql, minimalgeo, cutoutson, vcutdef);
69 }
70
71 GeoFullPhysVol *Csc::build(StoredMaterialManager& matManager,
72 const MYSQL& mysql,
73 int minimalgeo, int cutoutson,
74 const std::vector<Cutout *>& vcutdef) {
75 GeoFullPhysVol *pcsc = nullptr;
76 GeoLogVol *lcsc = nullptr;
77 const GeoMaterial *mcsc = matManager.getMaterial("std::Air");
78
79 if (excent == length) {
80 // CSC is a simple traezoid
81 const GeoShape *sCSS = new GeoTrd(thickness / 2., thickness / 2., width / 2., longWidth / 2., length / 2.);
82 lcsc = new GeoLogVol(logVolName, sCSS, mcsc);
83
84 } else {
85 // CSC is a union of two trapezoids
86 GeoTrd *downTrd = new GeoTrd(thickness / 2., thickness / 2., width / 2., longWidth / 2., maxwLength / 2.);
87 GeoTrd *upTrd = new GeoTrd(thickness / 2., thickness / 2., longWidth / 2., upWidth / 2., (physicalLength - maxwLength) / 2.);
88 const GeoShape *sCSL = &((downTrd->add((*upTrd) << GeoTrf::TranslateZ3D(physicalLength / 2.))) << GeoTrf::TranslateZ3D((maxwLength - physicalLength) / 2.));
89 lcsc = new GeoLogVol(logVolName, sCSL, mcsc);
90 }
91
92 pcsc = new GeoFullPhysVol(lcsc);
93 if (minimalgeo == 1)
94 return pcsc;
95
96 GeoVPhysVol *lay = layer->build(matManager, mysql, cutoutson, vcutdef);
97 if (!skip_csc)
98 pcsc->add(lay);
99
100 return pcsc;
101 }
102
103 void Csc::print() const {
104 MsgStream log(Athena::getMessageSvc(), "MuonGM::Csc");
105 log << MSG::INFO << " Csc:: Csc " << name << " : " << endmsg;
106 }
107
108} // namespace MuonGM
#define endmsg
#define skip_csc
Definition Csc.cxx:29
static Double_t ss
double maxwLength
Definition Csc.h:32
double length
Definition Csc.h:27
double upWidth
Definition Csc.h:33
double excent
Definition Csc.h:30
virtual void print() const override
Definition Csc.cxx:103
GeoFullPhysVol * build(StoredMaterialManager &matManager, const MYSQL &mysql, int minimalgeo)
Definition Csc.cxx:63
double thickness
Definition Csc.h:28
double width
Definition Csc.h:26
double longWidth
Definition Csc.h:29
CscComponent * m_component
Definition Csc.h:52
Csc(const MYSQL &mysql, Component *s)
Definition Csc.cxx:33
double physicalLength
Definition Csc.h:31
std::unique_ptr< CscMultiLayer > layer
Definition Csc.h:37
DetectorElement(const std::string &n)
This class holds one or more material managers and makes them storeable, under StoreGate.
virtual const GeoMaterial * getMaterial(const std::string &name)=0
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27
Definition index.py:1