From 330f2f44db169d9f9f2515037f8b0f299725b405 Mon Sep 17 00:00:00 2001 From: Andres Vargas Date: Wed, 2 Sep 2020 11:19:55 -0500 Subject: [PATCH 1/7] Change ddd/dd4hep filenames --- SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py | 5 ++++- SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py | 4 ++-- SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step3_cfg.py | 4 ++-- SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py | 5 ++++- SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py | 4 ++-- SimG4Core/Configuration/test/ddd_ZMM_Run3_Step3_cfg.py | 4 ++-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py index 1f22f98fd786a..a5b485bae7f7a 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py @@ -19,6 +19,9 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') # there w +process.MessageLogger.categories.append("TrackerGeometryBuilder"); + + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10), output = cms.optional.untracked.allowed(cms.int32,cms.PSet) @@ -72,7 +75,7 @@ dataTier = cms.untracked.string('GEN-SIM'), filterName = cms.untracked.string('') ), - fileName = cms.untracked.string('file:step1_ZMM.root'), + fileName = cms.untracked.string('file:step1_ZMM_dd4hep.root'), outputCommands = process.FEVTDEBUGEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py index 04aa1396c8b94..845c8d16ee8a0 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step2_cfg.py @@ -27,7 +27,7 @@ # Input source process.source = cms.Source("PoolSource", dropDescendantsOfDroppedBranches = cms.untracked.bool(False), - fileNames = cms.untracked.vstring('file:step1_ZMM.root'), + fileNames = cms.untracked.vstring('file:step1_ZMM_dd4hep.root'), inputCommands = cms.untracked.vstring( 'keep *', 'drop *_genParticles_*_*', @@ -91,7 +91,7 @@ dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), filterName = cms.untracked.string('') ), - fileName = cms.untracked.string('file:step2_ZMM.root'), + fileName = cms.untracked.string('file:step2_ZMM_dd4hep.root'), outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step3_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step3_cfg.py index b21267492e0ed..7e37934a62517 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step3_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step3_cfg.py @@ -33,7 +33,7 @@ # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('file:step2_ZMM.root'), + fileNames = cms.untracked.vstring('file:step2_ZMM_dd4hep.root'), secondaryFileNames = cms.untracked.vstring() ) @@ -78,7 +78,7 @@ dataTier = cms.untracked.string('GEN-SIM-RECO'), filterName = cms.untracked.string('') ), - fileName = cms.untracked.string('file:step3_ZMM.root'), + fileName = cms.untracked.string('file:step3_ZMM_dd4hep.root'), outputCommands = process.RECOSIMEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) diff --git a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py index 6ef1a43746fd0..2cac97a2a2c5a 100644 --- a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py @@ -19,6 +19,9 @@ process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') process.load('Configuration.Geometry.GeometryExtended2021_cff') # there w +process.MessageLogger.categories.append("TrackerGeometryBuilder"); + + process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(10), output = cms.optional.untracked.allowed(cms.int32,cms.PSet) @@ -72,7 +75,7 @@ dataTier = cms.untracked.string('GEN-SIM'), filterName = cms.untracked.string('') ), - fileName = cms.untracked.string('file:step1_ZMM.root'), + fileName = cms.untracked.string('file:step1_ZMM_ddd.root'), outputCommands = process.FEVTDEBUGEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) diff --git a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py index 5a7a04c03af48..981400f1d6f1d 100644 --- a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py +++ b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step2_cfg.py @@ -27,7 +27,7 @@ # Input source process.source = cms.Source("PoolSource", dropDescendantsOfDroppedBranches = cms.untracked.bool(False), - fileNames = cms.untracked.vstring('file:step1_ZMM.root'), + fileNames = cms.untracked.vstring('file:step1_ZMM_ddd.root'), inputCommands = cms.untracked.vstring( 'keep *', 'drop *_genParticles_*_*', @@ -91,7 +91,7 @@ dataTier = cms.untracked.string('GEN-SIM-DIGI-RAW'), filterName = cms.untracked.string('') ), - fileName = cms.untracked.string('file:step2_ZMM.root'), + fileName = cms.untracked.string('file:step2_ZMM_ddd.root'), outputCommands = process.FEVTDEBUGHLTEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) diff --git a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step3_cfg.py b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step3_cfg.py index b607d4d62a966..c0b1745e84da3 100644 --- a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step3_cfg.py +++ b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step3_cfg.py @@ -33,7 +33,7 @@ # Input source process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring('file:step2_ZMM.root'), + fileNames = cms.untracked.vstring('file:step2_ZMM_ddd.root'), secondaryFileNames = cms.untracked.vstring() ) @@ -78,7 +78,7 @@ dataTier = cms.untracked.string('GEN-SIM-RECO'), filterName = cms.untracked.string('') ), - fileName = cms.untracked.string('file:step3_ZMM.root'), + fileName = cms.untracked.string('file:step3_ZMM_ddd.root'), outputCommands = process.RECOSIMEventContent.outputCommands, splitLevel = cms.untracked.int32(0) ) From 28609c6a0d2ab4fcefc78e1a6df76921e0bb5b94 Mon Sep 17 00:00:00 2001 From: Andres Vargas Date: Wed, 2 Sep 2020 11:20:50 -0500 Subject: [PATCH 2/7] Fix Geometry navigation under dd4hep --- .../plugins/CmsTrackerLevelBuilder.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index d1c8df4527365..76054babc3726 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -141,7 +141,12 @@ template void CmsTrackerLevelBuilder::build(FilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - LogTrace("GeometricDetBuilding") //<< std::string(3 * fv.history().size(), '-') << "+ " + + edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelBuilder::build " + << " Building: " + << fv.name(); + + edm::LogVerbatim("TrackerGeometryBuilder") << ExtractStringFromDDD::getString(attribute, &fv) << " " << tracker->type() << " " << tracker->name() << std::endl; @@ -149,10 +154,9 @@ void CmsTrackerLevelBuilder::build(FilteredView& fv, while (doLayers) { buildComponent(fv, tracker, attribute); - doLayers = fv.nextSibling(); // go to next layer if constexpr (std::is_same_v) { edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); - + doLayers = fv.nextSibling(); } else if constexpr (std::is_same_v) { edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build"; std::vector hst = fv.geoHistory(); @@ -161,6 +165,7 @@ void CmsTrackerLevelBuilder::build(FilteredView& fv, path += "/" + std::string((*nd)->GetName()); } edm::LogVerbatim("TrackerGeometryBuilder") << path; + doLayers = fv.firstChild(); } } From a1acd1e92ab0c8a08779be39b87343d8126edd98 Mon Sep 17 00:00:00 2001 From: Andres Vargas Date: Wed, 2 Sep 2020 11:42:51 -0500 Subject: [PATCH 3/7] Define cms::FilteredView stream insertion Prev implementation: https://github.com/cms-sw/cmssw/blob/master/DetectorDescription/Core/interface/DDExpandedView.h#L154 --- DetectorDescription/DDCMS/interface/DDFilteredView.h | 3 +++ DetectorDescription/DDCMS/src/DDFilteredView.cc | 5 +++++ .../plugins/CmsTrackerLevelBuilder.cc | 10 ++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 9512c7681f8d1..9c4bf9942a879 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -252,4 +252,7 @@ namespace cms { }; } // namespace cms +//stream geoHistory +std::ostream &operator<<(std::ostream& os, const std::vector& hst); + #endif diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index b56aee6684629..086601e58419f 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -612,3 +612,8 @@ dd4hep::Solid DDFilteredView::solid() const { return (volume().volume().solid()) unsigned short DDFilteredView::copyNum() const { return (volume().copyNumber()); } std::string_view DDFilteredView::materialName() const { return (volume().material().name()); } + +std::ostream& operator<<(std::ostream& os, const std::vector& hst) { + for (auto nd = hst.rbegin(); nd != hst.rend(); ++nd) os << "/" << (*nd)->GetName(); + return os; +} diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index 76054babc3726..778fd45fbfc45 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -144,7 +144,7 @@ void CmsTrackerLevelBuilder::build(FilteredView& fv, edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelBuilder::build " << " Building: " - << fv.name(); + << fv.geoHistory(); edm::LogVerbatim("TrackerGeometryBuilder") << ExtractStringFromDDD::getString(attribute, &fv) << " " << tracker->type() << " " @@ -158,13 +158,7 @@ void CmsTrackerLevelBuilder::build(FilteredView& fv, edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); doLayers = fv.nextSibling(); } else if constexpr (std::is_same_v) { - edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build"; - std::vector hst = fv.geoHistory(); - std::string path; - for (auto nd = hst.rbegin(); nd != hst.rend(); ++nd) { - path += "/" + std::string((*nd)->GetName()); - } - edm::LogVerbatim("TrackerGeometryBuilder") << path; + edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); doLayers = fv.firstChild(); } } From 43e60b543b16b65e6add05707532bec957a1c879 Mon Sep 17 00:00:00 2001 From: Andres Vargas Date: Wed, 2 Sep 2020 12:30:09 -0500 Subject: [PATCH 4/7] code-format --- DetectorDescription/DDCMS/interface/DDFilteredView.h | 2 +- DetectorDescription/DDCMS/src/DDFilteredView.cc | 3 ++- .../plugins/CmsTrackerLevelBuilder.cc | 12 +++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/DetectorDescription/DDCMS/interface/DDFilteredView.h b/DetectorDescription/DDCMS/interface/DDFilteredView.h index 9c4bf9942a879..0ed351b0581ce 100644 --- a/DetectorDescription/DDCMS/interface/DDFilteredView.h +++ b/DetectorDescription/DDCMS/interface/DDFilteredView.h @@ -253,6 +253,6 @@ namespace cms { } // namespace cms //stream geoHistory -std::ostream &operator<<(std::ostream& os, const std::vector& hst); +std::ostream& operator<<(std::ostream& os, const std::vector& hst); #endif diff --git a/DetectorDescription/DDCMS/src/DDFilteredView.cc b/DetectorDescription/DDCMS/src/DDFilteredView.cc index 086601e58419f..4a21c2052a53a 100644 --- a/DetectorDescription/DDCMS/src/DDFilteredView.cc +++ b/DetectorDescription/DDCMS/src/DDFilteredView.cc @@ -614,6 +614,7 @@ unsigned short DDFilteredView::copyNum() const { return (volume().copyNumber()); std::string_view DDFilteredView::materialName() const { return (volume().material().name()); } std::ostream& operator<<(std::ostream& os, const std::vector& hst) { - for (auto nd = hst.rbegin(); nd != hst.rend(); ++nd) os << "/" << (*nd)->GetName(); + for (auto nd = hst.rbegin(); nd != hst.rend(); ++nd) + os << "/" << (*nd)->GetName(); return os; } diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc index 778fd45fbfc45..c440fb587dac2 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLevelBuilder.cc @@ -141,14 +141,11 @@ template void CmsTrackerLevelBuilder::build(FilteredView& fv, GeometricDet* tracker, const std::string& attribute) { - edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelBuilder::build " - << " Building: " - << fv.geoHistory(); + << " Building: " << fv.geoHistory(); - edm::LogVerbatim("TrackerGeometryBuilder") - << ExtractStringFromDDD::getString(attribute, &fv) << " " << tracker->type() << " " - << tracker->name() << std::endl; + edm::LogVerbatim("TrackerGeometryBuilder") << ExtractStringFromDDD::getString(attribute, &fv) << " " + << tracker->type() << " " << tracker->name() << std::endl; bool doLayers = fv.firstChild(); // descend to the first Layer @@ -158,7 +155,8 @@ void CmsTrackerLevelBuilder::build(FilteredView& fv, edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); doLayers = fv.nextSibling(); } else if constexpr (std::is_same_v) { - edm::LogVerbatim("TrackerGeometryBuilder") << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); + edm::LogVerbatim("TrackerGeometryBuilder") + << "CmsTrackerLevelbuilder::build" << fv.geoHistory(); doLayers = fv.firstChild(); } } From 0d24ecfe996695868487ff445f52ae15536b04b6 Mon Sep 17 00:00:00 2001 From: Andres Vargas Date: Thu, 3 Sep 2020 16:23:57 -0500 Subject: [PATCH 5/7] nextSibling navigation needs to be replaced in dd4hep --- .../TrackerNumberingBuilder/plugins/CmsDetConstruction.cc | 4 ++-- Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index b41f215b80b57..5f3ab9ed04291 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -65,7 +65,7 @@ void CmsDetConstruction::buildComponent(FilteredView& fv, bool dodets = fv.firstChild(); // descend to the first Layer while (dodets) { buildSmallDetsforGlued(fv, det, attribute); - dodets = fv.nextSibling(); // go to next layer + dodets = setNext(fv); /* Add algo to sort the merged DET */ @@ -80,7 +80,7 @@ void CmsDetConstruction::buildComponent(FilteredView& fv, bool dodets = fv.firstChild(); while (dodets) { buildSmallDetsforStack(fv, det, attribute); - dodets = fv.nextSibling(); + dodets = setNext(fv); } fv.parent(); } diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h index 2e61ed508faca..ae3e11468155b 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h @@ -17,6 +17,9 @@ class CmsDetConstruction : public CmsTrackerLevelBuilder { void buildDets(const FilteredView&, GeometricDet*, const std::string&); void buildSmallDetsforGlued(FilteredView&, GeometricDet*, const std::string&); void buildSmallDetsforStack(FilteredView&, GeometricDet*, const std::string&); + bool setNext(cms::DDFilteredView& fv){ return fv.firstChild(); } + bool setNext(DDFilteredView& fv){ return fv.nextSibling(); } + }; #endif // Geometry_TrackerNumberingBuilder_CmsDetConstruction_H From 10db664e05720166306691d1d156fb4d26f60953 Mon Sep 17 00:00:00 2001 From: Andres Vargas Date: Thu, 3 Sep 2020 16:30:48 -0500 Subject: [PATCH 6/7] Additional logs for Validation purposes --- .../src/TrackerG4SimHitNumberingScheme.cc | 31 ++++++++++--------- .../test/dd4hep_ZMM_Run3_Step1_cfg.py | 1 + .../test/ddd_ZMM_Run3_Step1_cfg.py | 1 + 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc index f4c052759ef53..4dac6508d657b 100644 --- a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc +++ b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc @@ -30,11 +30,17 @@ void TrackerG4SimHitNumberingScheme::buildAll() { for (auto& theSD : allSensitiveDets) { auto const& t = theSD->translation(); + edm::LogVerbatim("TrackerSimInfoNumbering") + << "::buildAll" << theSD->geographicalID().rawId() << "\t" << t; theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(), t.y(), t.z())); G4TouchableHistory* hist = theNavigator.CreateTouchableHistory(); + assert(!!hist); TrackerG4SimHitNumberingScheme::Nav_Story st; touchToNavStory(hist, st); + for(const std::pair& p: st) + edm::LogVerbatim("TrackerSimInfoNumbering") << "Nav_Story\t" << p.first << "\t" << p.second; + directMap_[st] = theSD->geographicalID(); LogDebug("TrackerSimDebugNumbering") << " INSERTING LV " << hist->GetVolume()->GetLogicalVolume()->GetName() @@ -55,27 +61,26 @@ void TrackerG4SimHitNumberingScheme::buildAll() { void TrackerG4SimHitNumberingScheme::touchToNavStory(const G4VTouchable* v, TrackerG4SimHitNumberingScheme::Nav_Story& st) { -#ifdef DEBUG + std::vector debugint; std::vector debugstring; -#endif + int levels = v->GetHistoryDepth(); for (int k = 0; k <= levels; ++k) { if (v->GetVolume(k)->GetLogicalVolume()->GetName() != "TOBInactive") { st.emplace_back( std::pair(v->GetVolume(k)->GetCopyNo(), v->GetVolume(k)->GetLogicalVolume()->GetName())); -#ifdef DEBUG debugint.emplace_back(v->GetVolume(k)->GetCopyNo()); debugstring.emplace_back(v->GetVolume(k)->GetLogicalVolume()->GetName()); -#endif } } -#ifdef DEBUG - LogDebug("TrackerSimDebugNumbering") << " G4 TrackerG4SimHitNumberingScheme " << debugint; - for (u_int32_t jj = 0; jj < debugstring.size(); jj++) - LogDebug("TrackerSimDebugNumbering") << " " << debugstring[jj]; -#endif + + for (const int& i: debugint) + edm::LogVerbatim("TrackerSimInfoNumbering") << " G4 TrackerG4SimHitNumberingScheme " << i; + for (const std::string& s: debugstring) + edm::LogVerbatim("TrackerSimInfoNumbering") << " " << s; + } unsigned int TrackerG4SimHitNumberingScheme::g4ToNumberingScheme(const G4VTouchable* v) { @@ -85,10 +90,8 @@ unsigned int TrackerG4SimHitNumberingScheme::g4ToNumberingScheme(const G4VToucha TrackerG4SimHitNumberingScheme::Nav_Story st; touchToNavStory(v, st); -#ifdef DEBUG dumpG4VPV(v); - LogDebug("TrackerSimDebugNumbering") << " Returning: " << directMap_[st]; -#endif + edm::LogVerbatim("TrackerSimInfoNumbering") << " Returning: " << directMap_[st]; return directMap_[st]; } @@ -96,9 +99,9 @@ unsigned int TrackerG4SimHitNumberingScheme::g4ToNumberingScheme(const G4VToucha void TrackerG4SimHitNumberingScheme::dumpG4VPV(const G4VTouchable* v) { int levels = v->GetHistoryDepth(); - LogDebug("TrackerSimDebugNumbering") << " NAME : " << v->GetVolume()->GetLogicalVolume()->GetName(); + edm::LogVerbatim("TrackerSimInfoNumbering") << " NAME : " << v->GetVolume()->GetLogicalVolume()->GetName(); for (int k = 0; k <= levels; k++) { - LogDebug("TrackerSimInfoNumbering") << " Hist: " << v->GetVolume(k)->GetLogicalVolume()->GetName() << " Copy " + edm::LogVerbatim("TrackerSimInfoNumbering") << " Hist: " << v->GetVolume(k)->GetLogicalVolume()->GetName() << " Copy " << v->GetVolume(k)->GetCopyNo(); } } diff --git a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py index a5b485bae7f7a..bedce9fdc04a2 100644 --- a/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/dd4hep_ZMM_Run3_Step1_cfg.py @@ -20,6 +20,7 @@ process.load('Configuration.Geometry.GeometryDD4hepExtended2021_cff') # there w process.MessageLogger.categories.append("TrackerGeometryBuilder"); +process.MessageLogger.categories.append("TrackerSimInfoNumbering"); process.maxEvents = cms.untracked.PSet( diff --git a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py index 2cac97a2a2c5a..b51379bd99970 100644 --- a/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py +++ b/SimG4Core/Configuration/test/ddd_ZMM_Run3_Step1_cfg.py @@ -20,6 +20,7 @@ process.load('Configuration.Geometry.GeometryExtended2021_cff') # there w process.MessageLogger.categories.append("TrackerGeometryBuilder"); +process.MessageLogger.categories.append("TrackerSimInfoNumbering"); process.maxEvents = cms.untracked.PSet( From e39cdcfff0cdd8f1a0f05632adbff77a1c0e7ca9 Mon Sep 17 00:00:00 2001 From: Andres Vargas Date: Thu, 3 Sep 2020 16:34:58 -0500 Subject: [PATCH 7/7] code-format --- .../plugins/CmsDetConstruction.cc | 2 +- .../plugins/CmsDetConstruction.h | 5 ++--- .../src/TrackerG4SimHitNumberingScheme.cc | 17 +++++++---------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc index 5f3ab9ed04291..1ce32c7a0cf63 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.cc @@ -66,7 +66,7 @@ void CmsDetConstruction::buildComponent(FilteredView& fv, while (dodets) { buildSmallDetsforGlued(fv, det, attribute); dodets = setNext(fv); - /* + /* Add algo to sort the merged DET */ } diff --git a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h index ae3e11468155b..1149c0525e547 100644 --- a/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h +++ b/Geometry/TrackerNumberingBuilder/plugins/CmsDetConstruction.h @@ -17,9 +17,8 @@ class CmsDetConstruction : public CmsTrackerLevelBuilder { void buildDets(const FilteredView&, GeometricDet*, const std::string&); void buildSmallDetsforGlued(FilteredView&, GeometricDet*, const std::string&); void buildSmallDetsforStack(FilteredView&, GeometricDet*, const std::string&); - bool setNext(cms::DDFilteredView& fv){ return fv.firstChild(); } - bool setNext(DDFilteredView& fv){ return fv.nextSibling(); } - + bool setNext(cms::DDFilteredView& fv) { return fv.firstChild(); } + bool setNext(DDFilteredView& fv) { return fv.nextSibling(); } }; #endif // Geometry_TrackerNumberingBuilder_CmsDetConstruction_H diff --git a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc index 4dac6508d657b..c8ba6a229d08c 100644 --- a/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc +++ b/SimG4CMS/Tracker/src/TrackerG4SimHitNumberingScheme.cc @@ -30,16 +30,15 @@ void TrackerG4SimHitNumberingScheme::buildAll() { for (auto& theSD : allSensitiveDets) { auto const& t = theSD->translation(); - edm::LogVerbatim("TrackerSimInfoNumbering") - << "::buildAll" << theSD->geographicalID().rawId() << "\t" << t; + edm::LogVerbatim("TrackerSimInfoNumbering") << "::buildAll" << theSD->geographicalID().rawId() << "\t" << t; theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(), t.y(), t.z())); G4TouchableHistory* hist = theNavigator.CreateTouchableHistory(); assert(!!hist); TrackerG4SimHitNumberingScheme::Nav_Story st; touchToNavStory(hist, st); - for(const std::pair& p: st) - edm::LogVerbatim("TrackerSimInfoNumbering") << "Nav_Story\t" << p.first << "\t" << p.second; + for (const std::pair& p : st) + edm::LogVerbatim("TrackerSimInfoNumbering") << "Nav_Story\t" << p.first << "\t" << p.second; directMap_[st] = theSD->geographicalID(); @@ -61,7 +60,6 @@ void TrackerG4SimHitNumberingScheme::buildAll() { void TrackerG4SimHitNumberingScheme::touchToNavStory(const G4VTouchable* v, TrackerG4SimHitNumberingScheme::Nav_Story& st) { - std::vector debugint; std::vector debugstring; @@ -76,11 +74,10 @@ void TrackerG4SimHitNumberingScheme::touchToNavStory(const G4VTouchable* v, } } - for (const int& i: debugint) + for (const int& i : debugint) edm::LogVerbatim("TrackerSimInfoNumbering") << " G4 TrackerG4SimHitNumberingScheme " << i; - for (const std::string& s: debugstring) + for (const std::string& s : debugstring) edm::LogVerbatim("TrackerSimInfoNumbering") << " " << s; - } unsigned int TrackerG4SimHitNumberingScheme::g4ToNumberingScheme(const G4VTouchable* v) { @@ -101,7 +98,7 @@ void TrackerG4SimHitNumberingScheme::dumpG4VPV(const G4VTouchable* v) { edm::LogVerbatim("TrackerSimInfoNumbering") << " NAME : " << v->GetVolume()->GetLogicalVolume()->GetName(); for (int k = 0; k <= levels; k++) { - edm::LogVerbatim("TrackerSimInfoNumbering") << " Hist: " << v->GetVolume(k)->GetLogicalVolume()->GetName() << " Copy " - << v->GetVolume(k)->GetCopyNo(); + edm::LogVerbatim("TrackerSimInfoNumbering") + << " Hist: " << v->GetVolume(k)->GetLogicalVolume()->GetName() << " Copy " << v->GetVolume(k)->GetCopyNo(); } }