ATLAS Offline Software
GeoPixelIBLFwdServices.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 
6 // Build IBL fwd services (wavy shape)
7 // This is built one time per layer.
8 
10 
13 
14 #include "GeoModelKernel/GeoPhysVol.h"
15 #include "GeoModelKernel/GeoMaterial.h"
16 
17 
18 #include <algorithm>
19 #include <iomanip>
20 #include <iostream>
21 #include <utility>
22 using std::max;
23 
26  GeoModelIO::ReadGeoModel* sqliteReader,
27  std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
28  std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
29  int section)
30  : GeoVPixelFactory(ddmgr, mgr, sqliteReader, std::move(mapFPV), std::move(mapAX)),
31  m_bFwdComplexGeometry_CAD(false),
32  m_bFwdComplexGeometry_Mod1(false),
33  m_section(section),
34  m_supportPhysA(nullptr),
35  m_supportPhysC(nullptr),
36  m_xformSupportA(nullptr),
37  m_xformSupportC(nullptr)
38 {
39 }
40 
41 
43 {
44  // check if the wavy shape option is defined in the DB (based on the definition of the material)
45 
46  bool bFwd02Defined=false;
47  int nbBarrelSvc = m_gmt_mgr->PixelServiceElements("barrel");
48  for(int i=0; i<nbBarrelSvc; i++){
49  std::string volName = m_gmt_mgr->PixelServiceName("barrel",i);
50  if(volName.substr(0,9)=="IBL_Fwd02")bFwd02Defined=true;
51  }
52  int nbSimpleSvc = m_gmt_mgr->PixelServiceElements("simple");
53  for(int i=0; i<nbSimpleSvc; i++){
54  std::string volName = m_gmt_mgr->PixelServiceName("simple",i);
55  if(volName.substr(0,9)=="IBL_Fwd02")bFwd02Defined=true;
56  }
57 
58  if(m_mat_mgr->hasMaterial("pix::IBL_Fwd02_Cable_Wvy") &&!bFwd02Defined) m_bFwdComplexGeometry_CAD = true;
59  if(m_mat_mgr->hasMaterial("pix::IBL_Fwd02_Cable_Wvy_M1") && !bFwd02Defined) m_bFwdComplexGeometry_Mod1 = true;
60 
61  m_gmt_mgr->msg(MSG::INFO) <<"Build IBL fwd services - CAD tool design / S. model1 : "<< m_bFwdComplexGeometry_CAD<<"/"<<m_bFwdComplexGeometry_Mod1<<endmsg;
62 
63 
65 
66 }
67 
68 
70 {
71 
72  m_gmt_mgr->msg(MSG::INFO) <<"GeoPixelIBLFwdService - CAD tool design / S. model1 : "<< m_bFwdComplexGeometry_CAD<<"/"<<m_bFwdComplexGeometry_Mod1<<endmsg;
73 
75 
76  m_gmt_mgr->msg(MSG::INFO) <<"Build IBL fwd services - CAD tool design"<<endmsg;
78 
79  fwdSvc.Build();
80  m_supportPhysA = fwdSvc.getSupportA();
81  m_supportPhysC = fwdSvc.getSupportC();
84 
85  if(m_supportPhysA==nullptr) {
86  m_gmt_mgr->msg(MSG::ERROR) <<"Build IBL fwd services - CAD tool design : the PixelGeoModel package is not meant to be used to build this design"<<endmsg;
87  m_gmt_mgr->msg(MSG::ERROR) <<" : check that the GeoTorus object is defined in GeoModelKernel/GeoModel"<<endmsg;
88  }
89  return nullptr;
90  }
91 
92 
94 
95  m_gmt_mgr->msg(MSG::INFO) <<"Build IBL fwd services - S. Menke design"<<endmsg;
97 
98  fwdSvc.Build();
99  m_supportPhysA = fwdSvc.getSupportA();
100  m_supportPhysC = fwdSvc.getSupportC();
101  m_xformSupportA = fwdSvc.getSupportTrfA();
102  m_xformSupportC = fwdSvc.getSupportTrfC();
103 
104  return nullptr;
105  }
106 
107  return nullptr;
108 
109 }
GeoPixelIBLFwdSvcCADModel::getSupportC
GeoPhysVol * getSupportC()
Definition: GeoPixelIBLFwdSvcCADModel.h:32
GeoPixelIBLFwdSvcModel1::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelIBLFwdSvcModel1.cxx:46
GeoPixelIBLFwdSvcCADModel::getSupportTrfA
GeoTransform * getSupportTrfA()
Definition: GeoPixelIBLFwdSvcCADModel.h:33
max
#define max(a, b)
Definition: cfImp.cxx:41
GeoPixelIBLFwdServices::m_section
int m_section
Definition: GeoPixelIBLFwdServices.h:40
PixelGeometryManager
Definition: PixelGeometryManager.h:28
PixelGeometryManager::msg
MsgStream & msg(MSG::Level lvl) const
Definition: PixelGeometryManager.h:611
GeoPixelIBLFwdSvcCADModel::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelIBLFwdSvcCADModel.cxx:50
GeoPixelIBLFwdSvcModel1.h
GeoPixelIBLFwdSvcModel1
Definition: GeoPixelIBLFwdSvcModel1.h:19
GeoPixelIBLFwdSvcCADModel.h
GeoPixelIBLFwdSvcModel1::getSupportTrfA
GeoTransform * getSupportTrfA()
Definition: GeoPixelIBLFwdSvcModel1.h:33
GeoVPixelFactory::m_mapAX
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
Definition: GeoVPixelFactory.h:48
GeoVPixelFactory::m_sqliteReader
GeoModelIO::ReadGeoModel * m_sqliteReader
Definition: GeoVPixelFactory.h:46
GeoVPixelFactory::m_DDmgr
InDetDD::PixelDetectorManager * m_DDmgr
Definition: GeoVPixelFactory.h:45
GeoVPixelFactory::m_gmt_mgr
PixelGeometryManager * m_gmt_mgr
Definition: GeoVPixelFactory.h:43
GeoVPixelFactory::m_mapFPV
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
Definition: GeoVPixelFactory.h:47
GeoPixelIBLFwdSvcCADModel::getSupportTrfC
GeoTransform * getSupportTrfC()
Definition: GeoPixelIBLFwdSvcCADModel.h:34
GeoPixelIBLFwdSvcCADModel
Definition: GeoPixelIBLFwdSvcCADModel.h:19
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
GeoPixelIBLFwdServices::m_xformSupportA
GeoTransform * m_xformSupportA
Definition: GeoPixelIBLFwdServices.h:43
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
GeoPixelIBLFwdServices::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelIBLFwdServices.cxx:69
GeoPixelIBLFwdServices::GeoPixelIBLFwdServices
GeoPixelIBLFwdServices(InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, GeoModelIO::ReadGeoModel *sqliteReader, std::shared_ptr< std::map< std::string, GeoFullPhysVol * >> mapFPV, std::shared_ptr< std::map< std::string, GeoAlignableTransform * >> mapAX, int)
Definition: GeoPixelIBLFwdServices.cxx:24
GeoPixelIBLFwdServices::m_xformSupportC
GeoTransform * m_xformSupportC
Definition: GeoPixelIBLFwdServices.h:44
GeoPixelIBLFwdServices::m_bFwdComplexGeometry_Mod1
bool m_bFwdComplexGeometry_Mod1
Definition: GeoPixelIBLFwdServices.h:38
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
GeoPixelIBLFwdSvcModel1::getSupportA
GeoPhysVol * getSupportA()
Definition: GeoPixelIBLFwdSvcModel1.h:31
PixelGeometryManager::PixelServiceName
virtual std::string PixelServiceName(const std::string &, int)=0
GeoVPixelFactory::m_mat_mgr
InDetMaterialManager * m_mat_mgr
Definition: GeoVPixelFactory.h:44
GeoPixelIBLFwdSvcCADModel::getSupportA
GeoPhysVol * getSupportA()
Definition: GeoPixelIBLFwdSvcCADModel.h:31
PixelGeometryManager::PixelServiceElements
virtual int PixelServiceElements(const std::string &)=0
GeoPixelIBLFwdSvcModel1::getSupportTrfC
GeoTransform * getSupportTrfC()
Definition: GeoPixelIBLFwdSvcModel1.h:34
GeoPixelIBLFwdServices::m_bFwdComplexGeometry_CAD
bool m_bFwdComplexGeometry_CAD
Definition: GeoPixelIBLFwdServices.h:37
GeoPixelIBLFwdServices.h
GeoPixelIBLFwdSvcModel1::getSupportC
GeoPhysVol * getSupportC()
Definition: GeoPixelIBLFwdSvcModel1.h:32
GeoVPixelFactory
This is the base class for all the pieces of the Pixel detector.
Definition: GeoVPixelFactory.h:31
section
void section(const std::string &sec)
Definition: TestTriggerMenuAccess.cxx:22
GeoPixelIBLFwdServices::m_supportPhysA
GeoPhysVol * m_supportPhysA
Definition: GeoPixelIBLFwdServices.h:41
GeoPixelIBLFwdServices::isComplexShapeDefined
bool isComplexShapeDefined()
Definition: GeoPixelIBLFwdServices.cxx:42
GeoPixelIBLFwdServices::m_supportPhysC
GeoPhysVol * m_supportPhysC
Definition: GeoPixelIBLFwdServices.h:42
InDetMaterialManager::hasMaterial
bool hasMaterial(const std::string &materialName) const
Definition: InDetMaterialManager.cxx:101