ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PixelDetectorFactorySR1 Class Reference

#include <PixelDetectorFactorySR1.h>

Inheritance diagram for PixelDetectorFactorySR1:
Collaboration diagram for PixelDetectorFactorySR1:

Public Member Functions

 PixelDetectorFactorySR1 (PixelGeoModelAthenaComps *athenaComps, const PixelSwitches &switches)
 
 ~PixelDetectorFactorySR1 ()
 
virtual void create (GeoPhysVol *world)
 
virtual const InDetDD::PixelDetectorManagergetDetectorManager () const
 
StoreGateSvcdetStore ()
 
const StoreGateSvcdetStore () const
 
const IGeoDbTagSvcgeoDbTagSvc () const
 
IRDBAccessSvcrdbAccessSvc ()
 
const IGeometryDBSvcgeomDB () const
 
MsgStream & msg (MSG::Level lvl) const
 
bool msgLvl (MSG::Level lvl)
 
InDetDD::AthenaCompsgetAthenaComps ()
 

Private Member Functions

const PixelDetectorFactorySR1operator= (const PixelDetectorFactorySR1 &right)
 
 PixelDetectorFactorySR1 (const PixelDetectorFactorySR1 &right)
 

Private Attributes

InDetDD::PixelDetectorManagerm_detectorManager
 
PixelGeometryManagerm_geometryManager
 
InDetDD::AthenaCompsm_athenaComps
 

Detailed Description

Definition at line 18 of file PixelDetectorFactorySR1.h.

Constructor & Destructor Documentation

◆ PixelDetectorFactorySR1() [1/2]

PixelDetectorFactorySR1::PixelDetectorFactorySR1 ( PixelGeoModelAthenaComps athenaComps,
const PixelSwitches switches 
)

Definition at line 34 of file PixelDetectorFactorySR1.cxx.

36  : InDetDD::DetectorFactoryBase(athenaComps),
37  m_detectorManager(nullptr)
38 {
39  // Create the detector manager
41 
42  // Create the geometry manager.
43  m_geometryManager = new DBPixelGeoManager(athenaComps);
44 
45  // Pass the switches
51 
52 
53  // Create SiCommonItems ans store it in geometry manager.
54  // These are items that are shared by all elements
55  std::unique_ptr<SiCommonItems> commonItems{std::make_unique<SiCommonItems>(athenaComps->getIdHelper())};
56  m_geometryManager->setCommonItems(commonItems.get());
57 
58  m_detectorManager->setCommonItems(std::move(commonItems));
59 
60  // Determine if initial layer and tag from the id dict are consistent
61  bool initialLayoutIdDict = (m_detectorManager->tag() == "initial_layout");
62  if (m_geometryManager->InitialLayout() != initialLayoutIdDict ) {
63  if(msgLvl(MSG::WARNING))
64  msg(MSG::WARNING) << "IdDict tag is \"" << m_detectorManager->tag()
65  << "\" which is inconsistent with the layout choosen!"
66  << endmsg;
67  }
68 
69 
70  //
71  // Set Version information
72  //
73  std::string versionTag = m_geometryManager->versionTag();
74  std::string versionName = "SR1";
75  std::string layout = "SR1";
76  std::string description = "SR1 Geometry";
77  int versionMajorNumber = 4;
78  int versionMinorNumber = 0;
79  int versionPatchNumber = 0;
80 
82  layout = "Initial";
83  }
84 
85  InDetDD::Version version(versionTag,
86  versionName,
87  layout,
88  description,
89  versionMajorNumber,
90  versionMinorNumber,
91  versionPatchNumber);
93 
94 }

◆ ~PixelDetectorFactorySR1()

PixelDetectorFactorySR1::~PixelDetectorFactorySR1 ( )

Definition at line 97 of file PixelDetectorFactorySR1.cxx.

98 {
99  delete m_geometryManager;
100 }

◆ PixelDetectorFactorySR1() [2/2]

PixelDetectorFactorySR1::PixelDetectorFactorySR1 ( const PixelDetectorFactorySR1 right)
private

Member Function Documentation

◆ create()

void PixelDetectorFactorySR1::create ( GeoPhysVol *  world)
virtual

Definition at line 105 of file PixelDetectorFactorySR1.cxx.

106 {
109  if(msgLvl(MSG::INFO)) {
110  msg(MSG::INFO) << "Building Pixel Detector" << endmsg;
111  msg(MSG::INFO) << " " << m_detectorManager->getVersion().fullDescription() << endmsg;
112 
113  // Printout the parameters that are different in DC1 and DC2.
114  msg(MSG::INFO) << " B-Layer basic eta pitch: " << m_geometryManager->DesignPitchZ()/Gaudi::Units::micrometer << "um" << endmsg;
115  msg(MSG::INFO) << " B-Layer sensor thickness: " << m_geometryManager->PixelBoardThickness()/Gaudi::Units::micrometer << "um" << endmsg;
116  }
117 
118  bool barrelPresent = m_geometryManager->partPresent("Barrel");
119  bool endcapAPresent = m_geometryManager->partPresent("EndcapA");
120  bool endcapCPresent = m_geometryManager->partPresent("EndcapC");
121 
122  // Check that there is one and only one part built.
123  // Could have more than one part but then need to decide
124  // what to do about top level alignable transform.
125 
126  if ((barrelPresent && endcapAPresent) ||
127  (barrelPresent && endcapCPresent) ||
128  (endcapAPresent && endcapCPresent)) {
129  msg(MSG::ERROR) << "SR1 geometry can only have 1 part" << endmsg;
130  }
131 
132  if (!barrelPresent && !endcapAPresent && !endcapCPresent) {
133  msg(MSG::ERROR) << "SR1 geometry must have 1 part" << endmsg;
134  }
135 
136  GeoVPhysVol* physVol = nullptr;
137  GeoAlignableTransform * transform = nullptr;
138 
139  GeoPixelServices * pixServices = nullptr;
140  if(m_geometryManager->DoServices() ) {
141  pixServices = new GeoPixelServices(m_detectorManager, m_geometryManager, nullptr, nullptr, nullptr, nullptr);
142  }
143 
144  // Top level transform
145  GeoTrf::Transform3D topTransform = m_geometryManager->partTransform("Pixel");
146 
147  if (barrelPresent) {
148  //
149  // Add the Barrel:
150  //
152  GeoPixelBarrel brl(m_detectorManager, m_geometryManager, nullptr, nullptr, nullptr,pixServices);
153  physVol = brl.Build();
154 
155  GeoTrf::Transform3D barrelTransform = m_geometryManager->partTransform("Barrel");
156  transform = new GeoAlignableTransform(topTransform*barrelTransform);
157 
158  // Add this to the world
159  GeoNameTag* tag = new GeoNameTag("Pixel");
160  world->add(tag);
161  world->add(new GeoIdentifierTag(0));
162  world->add(physVol);
163  world->add(transform);
164 
165  }
166 
167  //
168  // Add the EndCaps
169  if (endcapAPresent || endcapCPresent) {
171 
172  GeoPixelEndCap pec(m_detectorManager, m_geometryManager, nullptr, nullptr, nullptr, pixServices);
174 
175 
176  // EndCap A
177  if (endcapAPresent) {
178 
180  physVol = pec.Build();
181 
182  GeoTrf::Transform3D endcapATransform = m_geometryManager->partTransform("EndcapA");
183  transform = new GeoAlignableTransform(topTransform * endcapATransform * GeoTrf::TranslateZ3D(zpos));
184 
185  GeoNameTag* tag = new GeoNameTag("Pixel");
186  world->add(tag);
187  world->add(new GeoIdentifierTag(2));
188  world->add(transform);
189  world->add(physVol);
190  }
191 
192  // EndCap C
193  if (endcapCPresent) {
194 
196  physVol = pec.Build();
197 
198  GeoTrf::Transform3D endcapCTransform = m_geometryManager->partTransform("EndcapC");
199  transform = new GeoAlignableTransform(topTransform * endcapCTransform * GeoTrf::TranslateZ3D(-zpos) * GeoTrf::RotateY3D(180*Gaudi::Units::deg));
200 
201  GeoNameTag* tag = new GeoNameTag("Pixel");
202  world->add(tag);
203  world->add(new GeoIdentifierTag(-2));
204  world->add(transform);
205  world->add(physVol);
206  }
207 
208  }
209 
210  // Delete pixServices
211  if(pixServices) delete pixServices;
212 
213  // Should not happen as we check before that we have at least one part built.
214  if (!physVol) {
215  msg(MSG::ERROR) << "Unexpected condition. Top level volume has zero pointer" << endmsg;
216  }
217 
218  // Store alignable transform
221 
222  //
223  // Add this to the list of top level physical volumes:
224  //
225  m_detectorManager->addTreeTop(physVol);
226 
227  // Initialize the neighbours
229 
230  // Set maximum rows/columns in numerology
231  for (int iDesign = 0; iDesign < m_detectorManager->numDesigns(); iDesign++) {
234  }
235 
236  // Register the callbacks and keys and the level corresponding to the key.
237  if (m_geometryManager->Alignable()) {
238  m_detectorManager->addFolder("/Indet/Align");
239  m_detectorManager->addChannel("/Indet/Align/ID", 2, InDetDD::global);
240  m_detectorManager->addChannel("/Indet/Align/PIX", 1, InDetDD::global);
241  if (barrelPresent) {
242  m_detectorManager->addChannel("/Indet/Align/PIXB1", 0, InDetDD::local);
243  m_detectorManager->addChannel("/Indet/Align/PIXB2", 0, InDetDD::local);
244  m_detectorManager->addChannel("/Indet/Align/PIXB3", 0, InDetDD::local);
245  }
246  if (endcapAPresent) {
247  m_detectorManager->addChannel("/Indet/Align/PIXEA1", 0, InDetDD::local);
248  m_detectorManager->addChannel("/Indet/Align/PIXEA2", 0, InDetDD::local);
249  m_detectorManager->addChannel("/Indet/Align/PIXEA3", 0, InDetDD::local);
250  }
251  if (endcapCPresent) {
252  m_detectorManager->addChannel("/Indet/Align/PIXEC1", 0, InDetDD::local);
253  m_detectorManager->addChannel("/Indet/Align/PIXEC2", 0, InDetDD::local);
254  m_detectorManager->addChannel("/Indet/Align/PIXEC3", 0, InDetDD::local);
255  }
256  }
257 }

◆ detStore() [1/2]

StoreGateSvc* InDetDD::DetectorFactoryBase::detStore ( )
inlineinherited

Definition at line 27 of file InDetDetectorFactoryBase.h.

27 {return m_athenaComps->detStore();}

◆ detStore() [2/2]

const StoreGateSvc* InDetDD::DetectorFactoryBase::detStore ( ) const
inlineinherited

Definition at line 28 of file InDetDetectorFactoryBase.h.

28 {return std::as_const(*m_athenaComps).detStore();}

◆ geoDbTagSvc()

const IGeoDbTagSvc* InDetDD::DetectorFactoryBase::geoDbTagSvc ( ) const
inlineinherited

Definition at line 30 of file InDetDetectorFactoryBase.h.

30 {return std::as_const(*m_athenaComps).geoDbTagSvc();}

◆ geomDB()

const IGeometryDBSvc* InDetDD::DetectorFactoryBase::geomDB ( ) const
inlineinherited

Definition at line 34 of file InDetDetectorFactoryBase.h.

34 {return m_athenaComps->geomDB();}

◆ getAthenaComps()

InDetDD::AthenaComps* InDetDD::DetectorFactoryBase::getAthenaComps ( )
inlineinherited

Definition at line 42 of file InDetDetectorFactoryBase.h.

42 {return m_athenaComps;}

◆ getDetectorManager()

const PixelDetectorManager * PixelDetectorFactorySR1::getDetectorManager ( ) const
virtual

Definition at line 259 of file PixelDetectorFactorySR1.cxx.

260 {
261  return m_detectorManager;
262 }

◆ msg()

MsgStream& InDetDD::DetectorFactoryBase::msg ( MSG::Level  lvl) const
inlineinherited

Definition at line 37 of file InDetDetectorFactoryBase.h.

37 { return m_athenaComps->msg(lvl); }

◆ msgLvl()

bool InDetDD::DetectorFactoryBase::msgLvl ( MSG::Level  lvl)
inlineinherited

Definition at line 40 of file InDetDetectorFactoryBase.h.

40 { return m_athenaComps->msgLvl(lvl); }

◆ operator=()

const PixelDetectorFactorySR1& PixelDetectorFactorySR1::operator= ( const PixelDetectorFactorySR1 right)
private

◆ rdbAccessSvc()

IRDBAccessSvc* InDetDD::DetectorFactoryBase::rdbAccessSvc ( )
inlineinherited

Definition at line 32 of file InDetDetectorFactoryBase.h.

32 {return m_athenaComps->rdbAccessSvc();}

Member Data Documentation

◆ m_athenaComps

InDetDD::AthenaComps* InDetDD::DetectorFactoryBase::m_athenaComps
privateinherited

Definition at line 46 of file InDetDetectorFactoryBase.h.

◆ m_detectorManager

InDetDD::PixelDetectorManager* PixelDetectorFactorySR1::m_detectorManager
private

Definition at line 42 of file PixelDetectorFactorySR1.h.

◆ m_geometryManager

PixelGeometryManager* PixelDetectorFactorySR1::m_geometryManager
private

Definition at line 43 of file PixelDetectorFactorySR1.h.


The documentation for this class was generated from the following files:
InDetDD::DetectorFactoryBase
Definition: InDetDetectorFactoryBase.h:20
InDetDD::SiDetectorManager::numerology
const SiNumerology & numerology() const
Access Numerology.
Definition: SiDetectorManager.h:126
PixelGeometryManager::PixelEndcapZMax
virtual double PixelEndcapZMax()=0
PixelGeometryManager::InitialLayout
virtual bool InitialLayout() const =0
InDetDD::PixelModuleDesign::columns
int columns() const
Number of cell columns per module:
Definition: PixelModuleDesign.h:340
PixelGeometryManager::SetServices
virtual void SetServices(bool isservice)=0
PixelDetectorFactorySR1::m_geometryManager
PixelGeometryManager * m_geometryManager
Definition: PixelDetectorFactorySR1.h:43
PixelGeometryManager::SetEndcap
virtual void SetEndcap()=0
PixelSwitches::dc1Geometry
bool dc1Geometry() const
Definition: PixelSwitches.cxx:34
InDetDD::SiDetectorManager::numDesigns
int numDesigns() const
Definition: SiDetectorManager.cxx:140
PixelSwitches::servicesOnLadder
bool servicesOnLadder() const
Definition: PixelSwitches.cxx:23
DBPixelGeoManager
Definition: DBPixelGeoManager.h:33
InDetDD::PixelModuleDesign::rows
int rows() const
Number of cell rows per module:
Definition: PixelModuleDesign.h:345
GeoPixelBarrel
Definition: GeoPixelBarrel.h:11
InDetDD::SiNumerology::setMaxNumEtaCells
void setMaxNumEtaCells(int cells)
Definition: SiNumerology.cxx:91
deg
#define deg
Definition: SbPolyhedron.cxx:17
InDetDD::InDetDetectorManager::setVersion
void setVersion(const Version &version)
Definition: InDetDetectorManager.cxx:43
InDetDD::Version
Definition: Version.h:24
PixelGeometryManager::DoServices
virtual bool DoServices()=0
InDetDD::global
@ global
Definition: InDetDD_Defs.h:16
InDetDD::DetectorFactoryBase::msg
MsgStream & msg(MSG::Level lvl) const
Definition: InDetDetectorFactoryBase.h:37
PixelGeometryManager::SetServicesOnLadder
virtual void SetServicesOnLadder(bool isservice)=0
InDetDD::SiDetectorManager::setCommonItems
void setCommonItems(std::unique_ptr< const SiCommonItems > &&commonItems)
Set SiCommonItems.
Definition: SiDetectorManager.cxx:151
PixelGeometryManager::DesignPitchZ
virtual double DesignPitchZ(bool isModule3D=false)=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
PixelSwitches::initialLayout
bool initialLayout() const
Definition: PixelSwitches.cxx:30
PixelGeometryManager::Alignable
virtual bool Alignable() const =0
AthMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level.
Definition: AthMessaging.h:151
InDetDD::DetectorFactoryBase::detStore
StoreGateSvc * detStore()
Definition: InDetDetectorFactoryBase.h:27
PixelGeometryManager::SetBarrel
virtual void SetBarrel()=0
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
GeoPixelServices
Definition: GeoPixelServices.h:17
InDetDD::InDetDetectorManager::addFolder
void addFolder(const std::string &key)
Definition: InDetDetectorManager.cxx:66
PixelGeometryManager::PixelBoardThickness
virtual double PixelBoardThickness(bool isModule3D=false)=0
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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
PixelDetectorFactorySR1::m_detectorManager
InDetDD::PixelDetectorManager * m_detectorManager
Definition: PixelDetectorFactorySR1.h:42
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
InDetDD::PixelDetectorManager::addAlignableTransform
virtual void addAlignableTransform(int level, const Identifier &id, GeoAlignableTransform *xf, const GeoVFullPhysVol *child)
Add alignable transforms.
Definition: PixelDetectorManager.cxx:262
PixelGeometryManager::partTransform
virtual const GeoTrf::Transform3D & partTransform(const std::string &partName) const =0
PixelGeometryManager::versionTag
virtual std::string versionTag() const =0
InDetDD::local
@ local
Definition: InDetDD_Defs.h:16
InDetDD::DetectorFactoryBase::msgLvl
bool msgLvl(MSG::Level lvl)
Definition: InDetDetectorFactoryBase.h:40
PixelGeometryManager::SetPos
virtual void SetPos()=0
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
InDetDD::SiDetectorManager::tag
const std::string & tag() const
Get tag used in dictionary.
Definition: SiDetectorManager.cxx:34
PixelGeometryManager::SetNeg
virtual void SetNeg()=0
GeoPixelEndCap
Definition: GeoPixelEndCap.h:11
PixelGeometryManager::SetCurrentLD
virtual void SetCurrentLD(int i)=0
PixelGeometryManager::SetDC1Geometry
virtual void SetDC1Geometry(bool flag)=0
get_generator_info.version
version
Definition: get_generator_info.py:33
PixelGeometryManager::PixelEndcapZMin
virtual double PixelEndcapZMin()=0
PixelGeometryManager::SetInitialLayout
virtual void SetInitialLayout(bool flag)=0
InDetDD::AthenaComps::geomDB
const IGeometryDBSvc * geomDB() const
Definition: InDetDDAthenaComps.h:63
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::DetectorFactoryBase::m_athenaComps
InDetDD::AthenaComps * m_athenaComps
Definition: InDetDetectorFactoryBase.h:46
PixelGeometryManager::SetAlignable
virtual void SetAlignable(bool flag)=0
PixelGeometryManager::getIdHelper
virtual const PixelID * getIdHelper()=0
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
PixelSwitches::services
bool services() const
Definition: PixelSwitches.cxx:20
InDetDD::AthenaComps::detStore
const StoreGateSvc * detStore() const
Definition: InDetDDAthenaComps.h:53
InDetDD::InDetDetectorManager::addChannel
void addChannel(const std::string &key, int level, FrameType frame)
Alignment access.
Definition: InDetDetectorManager.cxx:56
InDetDD::AthenaComps::rdbAccessSvc
IRDBAccessSvc * rdbAccessSvc()
Definition: InDetDDAthenaComps.h:74
PixelGeometryManager::partPresent
virtual bool partPresent(const std::string &partName) const =0
PixelGeometryManager::setCommonItems
virtual void setCommonItems(InDetDD::SiCommonItems *commonItems)=0
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
Identifier
Definition: IdentifierFieldParser.cxx:14