CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
cms::DDVolumeProcessor Class Reference

#include <DDVolumeProcessor.h>

Inheritance diagram for cms::DDVolumeProcessor:

Public Types

using PlacedVolume = dd4hep::PlacedVolume
 
using PlacedVolumeProcessor = dd4hep::PlacedVolumeProcessor
 
using Volume = dd4hep::Volume
 

Public Member Functions

bool compare (std::string_view s1, std::string_view s2)
 
int count () const
 
 DDVolumeProcessor ()=default
 
int operator() (PlacedVolume pv, int level) override
 Volume callback. More...
 
int process (PlacedVolume pv, int level, bool recursive) override
 Callback to retrieve PlacedVolume information of an entire Placement. More...
 
std::vector< std::string_view > split (std::string_view str, const char *delims)
 
std::string_view stripCopyNo (std::string_view v)
 
std::string_view stripNamespace (std::string_view v)
 
 ~DDVolumeProcessor () override=default
 

Private Attributes

int m_count = 0
 
std::vector< std::string_view > m_volumes
 

Detailed Description

Definition at line 14 of file DDVolumeProcessor.h.

Member Typedef Documentation

◆ PlacedVolume

using cms::DDVolumeProcessor::PlacedVolume = dd4hep::PlacedVolume

Definition at line 17 of file DDVolumeProcessor.h.

◆ PlacedVolumeProcessor

using cms::DDVolumeProcessor::PlacedVolumeProcessor = dd4hep::PlacedVolumeProcessor

Definition at line 18 of file DDVolumeProcessor.h.

◆ Volume

using cms::DDVolumeProcessor::Volume = dd4hep::Volume

Definition at line 16 of file DDVolumeProcessor.h.

Constructor & Destructor Documentation

◆ DDVolumeProcessor()

cms::DDVolumeProcessor::DDVolumeProcessor ( )
default

◆ ~DDVolumeProcessor()

cms::DDVolumeProcessor::~DDVolumeProcessor ( )
overridedefault

Member Function Documentation

◆ compare()

bool cms::DDVolumeProcessor::compare ( std::string_view  s1,
std::string_view  s2 
)
inline

Definition at line 54 of file DDVolumeProcessor.h.

54  {
55  if (s1 == s2)
56  return true;
57  edm::LogVerbatim("Geometry") << '\"' << s1 << "\" does not match \"" << s2 << "\"\n";
58  return false;
59  }

References indexGen::s2.

◆ count()

int cms::DDVolumeProcessor::count ( void  ) const
inline

Definition at line 81 of file DDVolumeProcessor.h.

81 { return m_count; }

References m_count.

◆ operator()()

int cms::DDVolumeProcessor::operator() ( PlacedVolume  pv,
int  level 
)
inlineoverride

Volume callback.

Definition at line 70 of file DDVolumeProcessor.h.

70  {
71  Volume vol = pv.volume();
72  edm::LogVerbatim("Geometry").log([&level, &vol, this](auto& log) {
73  log << "\nHierarchical level:" << level << " Placement:";
74  for (const auto& i : m_volumes)
75  log << "/" << i << ", \n";
76  log << "\n\tMaterial:" << vol.material().name() << "\tSolid: " << vol.solid().name() << "\n";
77  });
78  ++m_count;
79  return 1;
80  }

References mps_fire::i, personalPlayback::level, dqm-mbProfile::log, edm::LogVerbatim::log(), m_count, m_volumes, and MetAnalyzer::pv().

◆ process()

int cms::DDVolumeProcessor::process ( PlacedVolume  pv,
int  level,
bool  recursive 
)
inlineoverride

Callback to retrieve PlacedVolume information of an entire Placement.

Definition at line 62 of file DDVolumeProcessor.h.

62  {
63  m_volumes.emplace_back(pv.name());
65  m_volumes.pop_back();
66  return ret;
67  }

References personalPlayback::level, m_volumes, LaserDQM_cfg::process, MetAnalyzer::pv(), postprocess-scan-build::recursive, and runTheMatrix::ret.

◆ split()

std::vector<std::string_view> cms::DDVolumeProcessor::split ( std::string_view  str,
const char *  delims 
)
inline

Definition at line 37 of file DDVolumeProcessor.h.

37  {
38  std::vector<std::string_view> ret;
39 
41  auto pos = str.find_first_of(delims, start);
42  while (pos != std::string_view::npos) {
43  if (pos != start) {
44  ret.emplace_back(str.substr(start, pos - start));
45  }
46  start = pos + 1;
47  pos = str.find_first_of(delims, start);
48  }
49  if (start < str.length())
50  ret.emplace_back(str.substr(start, str.length() - start));
51  return ret;
52  }

References runTheMatrix::ret, command_line::start, and str.

◆ stripCopyNo()

std::string_view cms::DDVolumeProcessor::stripCopyNo ( std::string_view  v)
inline

Definition at line 29 of file DDVolumeProcessor.h.

29  {
30  auto found = v.find_last_of("_");
31  if (found != v.npos) {
32  v.remove_suffix(v.size() - found);
33  }
34  return v;
35  }

References newFWLiteAna::found, and findQualityFiles::v.

◆ stripNamespace()

std::string_view cms::DDVolumeProcessor::stripNamespace ( std::string_view  v)
inline

Definition at line 23 of file DDVolumeProcessor.h.

23  {
24  auto first = v.find_first_of(":");
25  v.remove_prefix(std::min(first + 1, v.size()));
26  return v;
27  }

References dqmdumpme::first, min(), and findQualityFiles::v.

Member Data Documentation

◆ m_count

int cms::DDVolumeProcessor::m_count = 0
private

Definition at line 84 of file DDVolumeProcessor.h.

Referenced by count(), and operator()().

◆ m_volumes

std::vector<std::string_view> cms::DDVolumeProcessor::m_volumes
private

Definition at line 85 of file DDVolumeProcessor.h.

Referenced by operator()(), and process().

personalPlayback.level
level
Definition: personalPlayback.py:22
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
mps_fire.i
i
Definition: mps_fire.py:355
start
Definition: start.py:1
cms::DDVolumeProcessor::m_volumes
std::vector< std::string_view > m_volumes
Definition: DDVolumeProcessor.h:85
cms::DDVolumeProcessor::m_count
int m_count
Definition: DDVolumeProcessor.h:84
min
T min(T a, T b)
Definition: MathUtil.h:58
pos
Definition: PixelAliasList.h:18
indexGen.s2
s2
Definition: indexGen.py:107
findQualityFiles.v
v
Definition: findQualityFiles.py:179
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
dqmdumpme.first
first
Definition: dqmdumpme.py:55
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
str
#define str(s)
Definition: TestProcessor.cc:48
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
edm::LogVerbatim::log
LogVerbatim & log(F &&iF)
Definition: MessageLogger.h:327
edm::LogVerbatim
Definition: MessageLogger.h:297
cms::DDVolumeProcessor::Volume
dd4hep::Volume Volume
Definition: DDVolumeProcessor.h:16
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
postprocess-scan-build.recursive
recursive
Definition: postprocess-scan-build.py:10
command_line.start
start
Definition: command_line.py:167