ATLAS Offline Software
PixelDetectorFactoryDC2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 
8 // Envelope, as a starting point of the geometry
9 //#include "GeoPixelEnvelope.h"
10 #include "PixelDetectorDC1DC2.h"
11 #include "PixelSwitches.h"
12 
13 // GeoModel includes
14 #include "GeoModelKernel/GeoNameTag.h"
15 #include "GeoModelKernel/GeoPhysVol.h"
16 #include "GeoModelKernel/GeoAlignableTransform.h"
17 
18 // InDetReadoutGeometry
22 
24 
26 
29 
30 using namespace PixelGeoDC2;
31 
32 
34  const PixelSwitches & switches)
35  : InDetDD::DetectorFactoryBase(athenaComps),
36  m_detectorManager(nullptr)
37 {
38  // Create the detector manager
40 
41  // Create the geometry manager.
43 
44  // Pass the switches
50 
51  // Create SiCommonItems ans store it in geometry manager.
52  // These are items that are shared by all elements
53  std::unique_ptr<SiCommonItems> commonItems{std::make_unique<SiCommonItems>(athenaComps->getIdHelper())};
54  m_geometryManager->setCommonItems(commonItems.get());
55 
56  m_detectorManager->setCommonItems(std::move(commonItems));
57 
58  bool initialLayoutIdDict = (m_detectorManager->tag() == "initial_layout");
59  if (m_geometryManager->InitialLayout() != initialLayoutIdDict ) {
60  if(msgLvl(MSG::WARNING))
61  msg(MSG::WARNING) << "IdDict tag is \"" << m_detectorManager->tag()
62  << "\" which is inconsistent with the layout choosen!"
63  << endmsg;
64  }
65 
66 
67  //
68  // Set Version information
69  //
70  std::string versionTag = m_geometryManager->versionTag();
71  std::string versionName = "DC2";
72  std::string layout = "Final";
73  std::string description = "DC2 Geometry";
74  int versionMajorNumber = 2;
75  int versionMinorNumber = 2;
76  int versionPatchNumber = 0;
77 
79  description += ", G3 Compatible Digits";
80  versionMinorNumber = 1;
81  }
82 
84  layout = "Initial";
85  }
86 
87  // We determine if we are running DC1 geoemtry via
88  // Barrel version number in NOVA
90  versionName = "DC1";
91  description = "DC1 Geometry (300um B-Layer pixels)";
92  versionMajorNumber = 1;
93  versionMinorNumber = 2;
95  description += ", G3 Compatible Digits";
96  versionMinorNumber = 1;
97  }
98  }
99 
100  InDetDD::Version version(versionTag,
101  versionName,
102  layout,
103  description,
104  versionMajorNumber,
105  versionMinorNumber,
106  versionPatchNumber);
108 
109 }
110 
111 
113 {
114 
115 }
116 
117 
118 
119 //## Other Operations (implementation)
120 void PixelDetectorFactoryDC2::create(GeoPhysVol *world)
121 {
122  if(msgLvl(MSG::INFO)) {
123  msg(MSG::INFO) << "Building Pixel Detector" << endmsg;
124  msg(MSG::INFO) << " " << m_detectorManager->getVersion().fullDescription() << endmsg;
125 
126  // Printout the parameters that are different in DC1 and DC2.
127  msg(MSG::INFO) << " B-Layer basic eta pitch: " << m_geometryManager->DesignPitchZ(true)/Gaudi::Units::micrometer << "um" << endmsg;
128  }
131  if(msgLvl(MSG::INFO))
132  msg(MSG::INFO) << " B-Layer sensor thickness: " << m_geometryManager->PixelBoardThickness()/Gaudi::Units::micrometer << "um" << endmsg;
133 
134  //
135  // Create the Pixel Envelope...
137  GeoVPhysVol* pephys = pe.Build() ;
138  GeoAlignableTransform * transform = new GeoAlignableTransform(GeoTrf::Transform3D::Identity());
139 
140  //
141  // Add this to the world
142  //
143  GeoNameTag *tag = new GeoNameTag("Pixel");
144  world->add(tag);
145  world->add(transform);
146  world->add(pephys);
147 
148  // Store alignable transform
151 
152  //
153  // Add this to the list of top level physical volumes:
154  //
155  m_detectorManager->addTreeTop(pephys);
156 
157 
158  // Initialize the neighbours
160 
161  // Set maximum rows/columns in numerology
162  for (int iDesign = 0; iDesign < m_detectorManager->numDesigns(); iDesign++) {
165  }
166 
167  // Register the callbacks and keys and the level corresponding to the key.
168  if (m_geometryManager->Alignable()) {
169  m_detectorManager->addFolder("/Indet/Align");
170  m_detectorManager->addChannel("/Indet/Align/ID", 2, InDetDD::global);
171  m_detectorManager->addChannel("/Indet/Align/PIX", 1, InDetDD::global);
172  m_detectorManager->addChannel("/Indet/Align/PIXB1", 0, InDetDD::local);
173  m_detectorManager->addChannel("/Indet/Align/PIXB2", 0, InDetDD::local);
174  m_detectorManager->addChannel("/Indet/Align/PIXB3", 0, InDetDD::local);
175  m_detectorManager->addChannel("/Indet/Align/PIXEA1", 0, InDetDD::local);
176  m_detectorManager->addChannel("/Indet/Align/PIXEA2", 0, InDetDD::local);
177  m_detectorManager->addChannel("/Indet/Align/PIXEA3", 0, InDetDD::local);
178  m_detectorManager->addChannel("/Indet/Align/PIXEC1", 0, InDetDD::local);
179  m_detectorManager->addChannel("/Indet/Align/PIXEC2", 0, InDetDD::local);
180  m_detectorManager->addChannel("/Indet/Align/PIXEC3", 0, InDetDD::local);
181  }
182 }
183 
185 {
186  return m_detectorManager;
187 }
188 
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
InDetDD::SiDetectorManager::numerology
const SiNumerology & numerology() const
Access Numerology.
Definition: SiDetectorManager.h:126
PixelGeoDC2::PixelGeometryManager::InitialLayout
virtual bool InitialLayout() const =0
InDetDD::PixelModuleDesign::columns
int columns() const
Number of cell columns per module:
Definition: PixelModuleDesign.h:322
PixelSwitches
Definition: PixelSwitches.h:13
PixelDetectorFactoryDC2.h
PixelSwitches::dc1Geometry
bool dc1Geometry() const
Definition: PixelSwitches.cxx:34
PixelGeoDC2
Definition: PixelDetectorDC1DC2.h:31
InDetDD::SiDetectorManager::numDesigns
int numDesigns() const
Definition: SiDetectorManager.cxx:140
PixelDetectorDC1DC2.h
InDetDD::PixelModuleDesign::rows
int rows() const
Number of cell rows per module:
Definition: PixelModuleDesign.h:327
PixelGeoDC2::PixelGeometryManager::SetInitialLayout
virtual void SetInitialLayout(bool flag)=0
InDetDD::SiNumerology::setMaxNumEtaCells
void setMaxNumEtaCells(int cells)
Definition: SiNumerology.cxx:91
InDetDD::InDetDetectorManager::setVersion
void setVersion(const Version &version)
Definition: InDetDetectorManager.cxx:43
InDetDD::Version
Definition: Version.h:24
PixelGeoDC2::PixelGeometryManager::setCommonItems
virtual void setCommonItems(InDetDD::SiCommonItems *commonItems)=0
InDetDD::global
@ global
Definition: InDetDD_Defs.h:16
InDetDD::DetectorFactoryBase::msg
MsgStream & msg(MSG::Level lvl) const
Definition: InDetDetectorFactoryBase.h:37
LArG4AODNtuplePlotter.pe
pe
Definition: LArG4AODNtuplePlotter.py:116
InDetDD::SiDetectorManager::setCommonItems
void setCommonItems(std::unique_ptr< const SiCommonItems > &&commonItems)
Set SiCommonItems.
Definition: SiDetectorManager.cxx:151
PixelGeoDC2::PixelGeometryManager::SetCurrentLD
virtual void SetCurrentLD(int i)=0
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
PixelGeoDC2::GeoPixelEnvelope
Definition: PixelDetectorDC1DC2.h:188
PixelGeoDC2::PixelGeometryManager::versionTag
virtual std::string versionTag() const =0
PixelDetectorFactoryDC2::m_geometryManager
PixelGeoDC2::PixelGeometryManager * m_geometryManager
Definition: PixelDetectorFactoryDC2.h:46
PixelSwitches::initialLayout
bool initialLayout() const
Definition: PixelSwitches.cxx:30
PixelGeoModelAthenaComps.h
InDetDD_Defs.h
InDetDD::DetectorFactoryBase::detStore
StoreGateSvc * detStore()
Definition: InDetDetectorFactoryBase.h:27
PixelSwitches::g3CompatibleDigits
bool g3CompatibleDigits() const
Definition: PixelSwitches.cxx:26
PixelDetectorFactoryDC2::m_detectorManager
InDetDD::PixelDetectorManager * m_detectorManager
Definition: PixelDetectorFactoryDC2.h:45
InDetDD::PixelDetectorManager::initNeighbours
virtual void initNeighbours() override
Initialize the neighbours.
Definition: PixelDetectorManager.cxx:129
PixelGeoModelAthenaComps::getIdHelper
const PixelID * getIdHelper() const
Definition: PixelGeoModelAthenaComps.cxx:59
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
SiCommonItems.h
PixelGeoDC2::PixelGeometryManager::getIdHelper
virtual const PixelID * getIdHelper()=0
InDetDD::InDetDetectorManager::addFolder
void addFolder(const std::string &key)
Definition: InDetDetectorManager.cxx:66
PixelGeoDC2::PixelGeometryManager::SetBarrel
virtual void SetBarrel()=0
InDetDD::SiNumerology::setMaxNumPhiCells
void setMaxNumPhiCells(int cells)
Definition: SiNumerology.cxx:86
PixelSwitches::alignable
bool alignable() const
Definition: PixelSwitches.cxx:38
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
InDetDD::InDetDetectorManager::getVersion
const Version & getVersion() const
Get version information.
Definition: InDetDetectorManager.cxx:33
InDetDD::PixelDetectorManager::addTreeTop
void addTreeTop(const PVConstLink &vol)
Add a Tree top:
Definition: PixelDetectorManager.cxx:76
PixelGeoDC2::PixelGeometryManager::SetServices
virtual void SetServices(bool isservice)=0
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
PixelGeoDC2::PixelGeometryManager::SetDC1Geometry
virtual void SetDC1Geometry(bool flag)=0
PixelGeoDC2::PixelGeometryManager::SetG3CompatibleDigits
virtual void SetG3CompatibleDigits(bool flag)=0
InDetDD::PixelDetectorManager::addAlignableTransform
virtual void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *xf, const GeoVFullPhysVol *child)
Add alignable transforms.
Definition: PixelDetectorManager.cxx:262
PixelDetectorFactoryDC2::getDetectorManager
virtual const InDetDD::PixelDetectorManager * getDetectorManager() const
Definition: PixelDetectorFactoryDC2.cxx:184
InDetDD::local
@ local
Definition: InDetDD_Defs.h:16
InDetDD::DetectorFactoryBase::msgLvl
bool msgLvl(MSG::Level lvl)
Definition: InDetDetectorFactoryBase.h:40
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
InDetDD::SiDetectorManager::tag
const std::string & tag() const
Get tag used in dictionary.
Definition: SiDetectorManager.cxx:34
PixelSwitches.h
InDetDD::SiCommonItems
Definition: SiCommonItems.h:45
PixelGeoDC2::OraclePixGeoManager
Definition: PixelDetectorDC1DC2.h:611
PixelDetectorFactoryDC2::PixelDetectorFactoryDC2
PixelDetectorFactoryDC2(PixelGeoModelAthenaComps *athenaComps, const PixelSwitches &switches)
Definition: PixelDetectorFactoryDC2.cxx:33
get_generator_info.version
version
Definition: get_generator_info.py:33
PixelGeoModelAthenaComps
Class to hold various Athena components.
Definition: PixelGeoModelAthenaComps.h:16
PixelGeoDC2::PixelGeometryManager::PixelBoardThickness
virtual double PixelBoardThickness()=0
InDetDD::Version::fullDescription
std::string fullDescription() const
Full Description For example, Version: SCT-DC1-00, Name: DC1, Layout: Final, Code Version: 2....
Definition: Version.cxx:90
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
PixelModuleDesign.h
PixelGeoDC2::PixelGeometryManager::Alignable
virtual bool Alignable() const =0
PixelGeoDC2::PixelGeometryManager::SetAlignable
virtual void SetAlignable(bool flag)=0
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
PixelGeoDC2::PixelGeometryManager::DC1Geometry
virtual bool DC1Geometry() const =0
PixelSwitches::services
bool services() const
Definition: PixelSwitches.cxx:20
PixelDetectorFactoryDC2::~PixelDetectorFactoryDC2
~PixelDetectorFactoryDC2()
Definition: PixelDetectorFactoryDC2.cxx:112
InDetDD::InDetDetectorManager::addChannel
void addChannel(const std::string &key, int level, FrameType frame)
Alignment access.
Definition: InDetDetectorManager.cxx:56
PixelDetectorFactoryDC2::create
virtual void create(GeoPhysVol *world)
Definition: PixelDetectorFactoryDC2.cxx:120
InDetDD::PixelDetectorManager::getPixelDesign
virtual const PixelModuleDesign * getPixelDesign(int i) const
Access to module design, Casts to PixelModuleDesign.
Definition: PixelDetectorManager.cxx:290
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88
PixelGeoDC2::PixelGeometryManager::G3CompatibleDigits
virtual bool G3CompatibleDigits() const =0
PixelGeoDC2::PixelGeometryManager::DesignPitchZ
virtual double DesignPitchZ(bool isBLayer)=0
Identifier
Definition: IdentifierFieldParser.cxx:14