ATLAS Offline Software
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 
10 ServicesLayer::ServicesLayer( double radius, double halfLength, int nStaves,
12  const std::string& suffix,
13  int nModulesPerStave, int nChipsPerModule) :
14  m_radius(radius), m_zPos(0.), m_rMin(0.), m_rMax(0.), m_halfLength(halfLength), m_nStaves(nStaves),
15  m_type(type), m_part(part), m_number(num),
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 
29 ServicesLayer::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),
34  m_type(type), m_part(part), m_number(num),
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 
47 std::string ServicesLayer::name() const
48 {
49  std::ostringstream os;
50  os << number();
51  return DetType::name( type(), part()) + os.str();
52 }
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
DetType::Endcap
@ Endcap
Definition: DetType.h:14
ServicesLayer::radius
double radius() const
Definition: ServicesLayer.h:32
ServicesLayer::ServicesLayer
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
Definition: ServicesLayer.cxx:10
DetType::Barrel
@ Barrel
Definition: DetType.h:14
ServicesLayer::m_rMax
double m_rMax
Definition: ServicesLayer.h:60
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
ServicesLayer.h
DetType::name
std::string name(Type t)
Definition: DetType.h:16
ServicesLayer::part
DetType::Part part() const
Definition: ServicesLayer.h:41
ServicesLayer::m_zPos
double m_zPos
Definition: ServicesLayer.h:58
ServicesLayer::m_rMin
double m_rMin
Definition: ServicesLayer.h:59
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
ServicesLayer::m_halfLength
double m_halfLength
Definition: ServicesLayer.h:61
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
DetType::Type
Type
Definition: DetType.h:13
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
ServicesLayer::m_radius
double m_radius
Definition: ServicesLayer.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DetType::Part
Part
Definition: DetType.h:14
ServicesLayer::name
std::string name() const
Definition: ServicesLayer.cxx:47
ServicesLayer::number
int number() const
Definition: ServicesLayer.h:43
ServicesLayer::type
DetType::Type type() const
Definition: ServicesLayer.h:40