Skip to content

Commit

Permalink
Merge pull request #40739 from bsunanda/Run3-gex150
Browse files Browse the repository at this point in the history
Run3-gex150 Avoid using cout in Geometry/CMSCommonData
  • Loading branch information
cmsbuild authored Feb 14, 2023
2 parents 53938f2 + 1ec6594 commit b302ca2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Geometry/CMSCommonData/test/DDFilteredViewAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DetectorDescription/Core/interface/DDFilteredView.h"
#include "DetectorDescription/Core/interface/DDCompactView.h"
Expand Down Expand Up @@ -46,17 +47,17 @@ void DDFilteredViewAnalyzer::analyze(const edm::Event&, const edm::EventSetup& i
m_comp);
DDFilteredView fv(*cpv, filter);
if (fv.firstChild()) {
std::cout << "Found attribute " << m_attribute.c_str() << " with value " << m_value.c_str() << std::endl;
edm::LogVerbatim("CMSGeom") << "Found attribute " << m_attribute.c_str() << " with value " << m_value.c_str();
bool dodet = true;
int i = 0;
while (dodet) {
dodet = fv.next();
if (m_shouldPrint) {
std::cout << i++ << ": " << fv.logicalPart().name() << std::endl;
edm::LogVerbatim("CMSGeom") << i++ << ": " << fv.logicalPart().name();
}
}
} else
std::cout << "No luck..." << std::endl;
edm::LogVerbatim("CMSGeom") << "No luck...";
}

DEFINE_FWK_MODULE(DDFilteredViewAnalyzer);
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
from Configuration.AlCa.autoCond import autoCond
process.GlobalTag.globaltag = autoCond['mc']
process.load('FWCore.MessageService.MessageLogger_cfi')
process.MessageLogger.CMSGeom=dict()

process.source = cms.Source("EmptySource")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

process = cms.Process("DDFilteredViewTest")

process.load('Configuration.Geometry.GeometryExtended2015_cff')
process.load('Configuration.Geometry.GeometryExtended2021Reco_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.MessageLogger.CMSGeom=dict()

process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
Expand Down
2 changes: 2 additions & 0 deletions Geometry/CMSCommonData/test/runDDFilteredViewAnalyzer_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
)
)

process.load('FWCore.MessageService.MessageLogger_cfi')
process.MessageLogger.CMSGeom=dict()
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
Expand Down

0 comments on commit b302ca2

Please sign in to comment.