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

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

Definition at line 17 of file DDVolumeProcessor.h.

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

Definition at line 18 of file DDVolumeProcessor.h.

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

Definition at line 16 of file DDVolumeProcessor.h.

Constructor & Destructor Documentation

cms::DDVolumeProcessor::DDVolumeProcessor ( )
default
cms::DDVolumeProcessor::~DDVolumeProcessor ( )
overridedefault

Member Function Documentation

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  }
int cms::DDVolumeProcessor::count ( void  ) const
inline

Definition at line 81 of file DDVolumeProcessor.h.

References m_count.

81 { return m_count; }
int cms::DDVolumeProcessor::operator() ( PlacedVolume  pv,
int  level 
)
inlineoverride

Volume callback.

Definition at line 70 of file DDVolumeProcessor.h.

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

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  }
def pv(vc)
Definition: MetAnalyzer.py:7
LogVerbatim & log(F &&iF)
std::vector< std::string_view > m_volumes
int cms::DDVolumeProcessor::process ( PlacedVolume  pv,
int  level,
bool  recursive 
)
inlineoverride
std::vector<std::string_view> cms::DDVolumeProcessor::split ( std::string_view  str,
const char *  delims 
)
inline

Definition at line 37 of file DDVolumeProcessor.h.

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

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  }
Definition: start.py:1
ret
prodAgent to be discontinued
uint16_t size_type
#define str(s)
std::string_view cms::DDVolumeProcessor::stripCopyNo ( std::string_view  v)
inline

Definition at line 29 of file DDVolumeProcessor.h.

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

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  }
std::string_view cms::DDVolumeProcessor::stripNamespace ( std::string_view  v)
inline

Definition at line 23 of file DDVolumeProcessor.h.

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

23  {
24  auto first = v.find_first_of(":");
25  v.remove_prefix(std::min(first + 1, v.size()));
26  return v;
27  }
T min(T a, T b)
Definition: MathUtil.h:58

Member Data Documentation

int cms::DDVolumeProcessor::m_count = 0
private

Definition at line 84 of file DDVolumeProcessor.h.

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

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

Definition at line 85 of file DDVolumeProcessor.h.

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