8 #include "DD4hep/Filter.h"
16 : name1_(name1), name2_(name2), type_(type) {
18 for (
const auto& lvname : names)
20 G4cout <<
" Type: " << type <<
" Depth Names " <<
name1_ <<
":" <<
name2_ <<
" with " << names.size()
21 <<
" LVs: " << ss.str() << G4endl;
22 for (
const auto&
name : names) {
25 names_.emplace_back(namex);
27 G4cout <<
"EcalDumpGeometry:: dump geometry information for detector of type " <<
type_ <<
" with " <<
names_.size()
28 <<
" elements:" << G4endl;
29 for (
unsigned int k = 0;
k <
names_.size(); ++
k)
30 G4cout <<
"[" <<
k <<
"] : " <<
names_[
k] << G4endl;
34 G4VPhysicalVolume* theTopPV =
35 G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
36 G4cout <<
"EcalDumpGeometry entered with entry of top PV at " << theTopPV << G4endl;
40 G4cout <<
"EcalDumpGeometry finds " <<
infoVec_.size() <<
" touchables" << G4endl;
44 G4cout <<
"[" << k <<
"] " <<
info << G4endl;
45 if (
info.flag() && (
info.solid() !=
nullptr)) {
46 info.solid()->DumpInfo();
57 fHistory_.NewLevel(pv, kNormal, pv->GetCopyNo());
59 G4ThreeVector globalpoint =
fHistory_.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0, 0, 0));
60 G4LogicalVolume* lv = pv->GetLogicalVolume();
62 bool flag = ((
type_ / 10) % 10 > 0);
66 for (
unsigned int k = 0;
k <
names_.size(); ++
k) {
71 theBaseNumber.
reset();
73 theBaseNumber.
setSize(theSize + 1);
75 for (
int ii = theSize;
ii >= 0; --
ii) {
76 std::string_view
name = dd4hep::dd::noNamespace(
fHistory_.GetVolume(
ii)->GetName());
77 theBaseNumber.
addLevel(static_cast<std::string>(name),
fHistory_.GetVolume(
ii)->GetCopyNo());
78 ss <<
" " <<
ii <<
" " << name <<
":" <<
fHistory_.GetVolume(
ii)->GetCopyNo();
88 double r = globalpoint.rho();
89 G4cout <<
" Field: " << ss.str() <<
" ID " << std::hex <<
id <<
std::dec <<
":" << depth <<
":" << r << G4endl;
90 G4VSolid* solid = (lv->GetSolid());
91 if (((
type_ / 100) % 10) != 0)
100 int NoDaughters = lv->GetNoDaughters();
101 while ((NoDaughters--) > 0) {
102 G4VPhysicalVolume* pvD = lv->GetDaughter(NoDaughters);
103 if (!pvD->IsReplicated())
112 if (name.find(
"_refl") == std::string::npos) {
115 size_t n = name.size();
116 return name.substr(0, n - 5);
std::string noRefl(const std::string &name)
EcalPreshowerNumberingScheme esNumbering_
EcalDumpGeometry(const std::vector< std::string_view > &, const std::string &, const std::string &, int)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const std::string names[nVars_]
void addLevel(const std::string &name, const int ©Number)
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth)
std::vector< CaloDetInfo > infoVec_
std::vector< std::string > names_
EcalEndcapNumberingScheme eeNumbering_
G4NavigationHistory fHistory_
uint32_t getUnitID(const EcalBaseNumber &baseNumber) const override
EcalBarrelNumberingScheme ebNumbering_
void setSize(const int &size)