ATLAS Offline Software
GeoPixelIBLFwdServices.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 <iostream>
20 #include <iomanip>
21 using std::max;
22 
25  GeoModelIO::ReadGeoModel* sqliteReader,
26  std::shared_ptr<std::map<std::string, GeoFullPhysVol*>> mapFPV,
27  std::shared_ptr<std::map<std::string, GeoAlignableTransform*>> mapAX,
28  int section)
29  : GeoVPixelFactory(ddmgr, mgr, sqliteReader, mapFPV, mapAX),
30  m_bFwdComplexGeometry_CAD(false),
31  m_bFwdComplexGeometry_Mod1(false),
32  m_section(section),
33  m_supportPhysA(nullptr),
34  m_supportPhysC(nullptr),
35  m_xformSupportA(nullptr),
36  m_xformSupportC(nullptr)
37 {
38 }
39 
40 
42 {
43  // check if the wavy shape option is defined in the DB (based on the definition of the material)
44 
45  bool bFwd02Defined=false;
46  int nbBarrelSvc = m_gmt_mgr->PixelServiceElements("barrel");
47  for(int i=0; i<nbBarrelSvc; i++){
48  std::string volName = m_gmt_mgr->PixelServiceName("barrel",i);
49  if(volName.substr(0,9)=="IBL_Fwd02")bFwd02Defined=true;
50  }
51  int nbSimpleSvc = m_gmt_mgr->PixelServiceElements("simple");
52  for(int i=0; i<nbSimpleSvc; i++){
53  std::string volName = m_gmt_mgr->PixelServiceName("simple",i);
54  if(volName.substr(0,9)=="IBL_Fwd02")bFwd02Defined=true;
55  }
56 
57  if(m_mat_mgr->hasMaterial("pix::IBL_Fwd02_Cable_Wvy") &&!bFwd02Defined) m_bFwdComplexGeometry_CAD = true;
58  if(m_mat_mgr->hasMaterial("pix::IBL_Fwd02_Cable_Wvy_M1") && !bFwd02Defined) m_bFwdComplexGeometry_Mod1 = true;
59 
60  m_gmt_mgr->msg(MSG::INFO) <<"Build IBL fwd services - CAD tool design / S. model1 : "<< m_bFwdComplexGeometry_CAD<<"/"<<m_bFwdComplexGeometry_Mod1<<endmsg;
61 
62 
64 
65 }
66 
67 
69 {
70 
71  m_gmt_mgr->msg(MSG::INFO) <<"GeoPixelIBLFwdService - CAD tool design / S. model1 : "<< m_bFwdComplexGeometry_CAD<<"/"<<m_bFwdComplexGeometry_Mod1<<endmsg;
72 
74 
75  m_gmt_mgr->msg(MSG::INFO) <<"Build IBL fwd services - CAD tool design"<<endmsg;
77 
78  fwdSvc.Build();
79  m_supportPhysA = fwdSvc.getSupportA();
80  m_supportPhysC = fwdSvc.getSupportC();
83 
84  if(m_supportPhysA==nullptr) {
85  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;
86  m_gmt_mgr->msg(MSG::ERROR) <<" : check that the GeoTorus object is defined in GeoModelKernel/GeoModel"<<endmsg;
87  }
88  return nullptr;
89  }
90 
91 
93 
94  m_gmt_mgr->msg(MSG::INFO) <<"Build IBL fwd services - S. Menke design"<<endmsg;
96 
97  fwdSvc.Build();
98  m_supportPhysA = fwdSvc.getSupportA();
99  m_supportPhysC = fwdSvc.getSupportC();
100  m_xformSupportA = fwdSvc.getSupportTrfA();
101  m_xformSupportC = fwdSvc.getSupportTrfC();
102 
103  return nullptr;
104  }
105 
106  return nullptr;
107 
108 }
GeoPixelIBLFwdSvcCADModel::getSupportC
GeoPhysVol * getSupportC()
Definition: GeoPixelIBLFwdSvcCADModel.h:32
GeoPixelIBLFwdSvcModel1::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelIBLFwdSvcModel1.cxx:45
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:49
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:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
GeoPixelIBLFwdServices::Build
virtual GeoVPhysVol * Build() override
Definition: GeoPixelIBLFwdServices.cxx:68
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:23
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:41
GeoPixelIBLFwdServices::m_supportPhysC
GeoPhysVol * m_supportPhysC
Definition: GeoPixelIBLFwdServices.h:42
InDetMaterialManager::hasMaterial
bool hasMaterial(const std::string &materialName) const
Definition: InDetMaterialManager.cxx:101