ATLAS Offline Software
Loading...
Searching...
No Matches
ServicesLayer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "ServicesLayer.h"
6#include <iostream>
7#include <string>
8#include <sstream>
9
12 const std::string& suffix,
13 int nModulesPerStave, int nChipsPerModule) :
16 m_lastVolume(nullptr), m_suffix(suffix),
17 m_nModulesPerStave(nModulesPerStave), m_nChipsPerModule(nChipsPerModule)
18{
19 if (part == DetType::Barrel) {
20 m_zPos = 0;
21 m_rMin = radius;
22 m_rMax = radius;
23 }
24 else {
25 std::cout << "Wrong ServicesLayer constructor for barrel layer called " << std::endl;
26 }
27}
28
29ServicesLayer::ServicesLayer( double zpos, double rmin, double rmax, int nStaves,
31 const std::string& suffix,
32 int nModulesPerStave, int nChipsPerModule) :
33 m_radius(0.), m_zPos(zpos), m_rMin(rmin), m_rMax(rmax), m_halfLength(0.), m_nStaves(nStaves),
35 m_lastVolume(nullptr), m_suffix(suffix),
36 m_nModulesPerStave(nModulesPerStave), m_nChipsPerModule(nChipsPerModule)
37{
38 if (part == DetType::Endcap) {
39 m_radius = 0.5*(rmin+rmax);
40 m_halfLength = rmax - rmin;
41 }
42 else {
43 std::cout << "Wrong ServicesLayer constructor for endcap layer called " << std::endl;
44 }
45}
46
47std::string ServicesLayer::name() const
48{
49 std::ostringstream os;
50 os << number();
51 return DetType::name( type(), part()) + os.str();
52}
DetType::Type m_type
double radius() const
ServiceVolume * m_lastVolume
double m_halfLength
DetType::Part part() const
int number() const
std::string name() const
DetType::Part m_part
int nStaves() const
ServicesLayer(double radius, double halfLength, int nStaves, DetType::Type type, DetType::Part part, int num, const std::string &suffix, int nModulesPerStave, int nChipsPerModule)
constructor for barrel layers
DetType::Type type() const
std::string m_suffix
double halfLength() const
@ Endcap
Definition DetType.h:14
@ Barrel
Definition DetType.h:14
std::string name(Type t)
Definition DetType.h:16