CMS 3D CMS Logo

Functions
cms::dd Namespace Reference

Functions

bool accepted (vector< string_view > const &names, string_view node)
 
bool accepted (std::vector< std::string_view > const &, std::string_view)
 
bool compareEqual (string_view node, string_view name)
 
bool compareEqual (std::string_view, std::string_view)
 
int contains (string_view input, string_view needle)
 
int contains (std::string_view, std::string_view)
 
bool isRegex (std::string_view)
 
bool isRegex (string_view input)
 
std::string_view realTopName (std::string_view input)
 
string_view realTopName (string_view input)
 
std::vector< std::string_view > split (std::string_view, const char *)
 
vector< string_view > split (string_view str, const char *delims)
 

Function Documentation

bool cms::dd::accepted ( vector< string_view > const &  names,
string_view  node 
)

Definition at line 22 of file Filter.cc.

References begin, compareEqual(), end, and gen::n.

22  {
23  return (find_if(begin(names), end(names),
24  [&](const auto& n) -> bool { return compareEqual(node, n); })
25  != end(names));
26  }
const std::string names[nVars_]
#define end
Definition: vmac.h:39
bool compareEqual(string_view node, string_view name)
Definition: Filter.cc:11
#define begin
Definition: vmac.h:32
bool cms::dd::accepted ( std::vector< std::string_view > const &  ,
std::string_view   
)

Referenced by cms::DDFilteredView::accept(), ValidationMisalignedTracker::analyze(), EmDQM::analyze(), gen::Cascade2Hadronizer::cascadeReadParameters(), FWTriggerTableViewTableManager::cellRenderer(), cms::DDFilteredView::checkChild(), PFRecoTauDiscriminationByNProngs::discriminate(), EmissionVetoHook1::doVetoFSREmission(), EmissionVetoHook1::doVetoISREmission(), EmissionVetoHook1::doVetoMPIStep(), CaloTowersCreationAlgo::ecalChanStatusForCaloTower(), DetStatus::filter(), HepMCFilterDriver::filter(), PythiaFilterMultiMother::filter(), PythiaHepMCFilterGammaGamma::filter(), RecoDiMuon::filter(), PythiaFilterEMJet::filter(), PythiaFilterZgamma::filter(), PythiaFilterGammaJet::filter(), PythiaFilterGammaJetIsoPi0::filter(), PythiaFilterGammaJetWithBg::filter(), PythiaFilterGammaJetWithOutBg::filter(), PythiaFilterZJet::filter(), LHEDYdecayFilter::filter(), PythiaFilterZJetWithOutBg::filter(), HiggsToWW2LeptonsSkim::filter(), HeavyChHiggsToTauNuSkim::filter(), FilterOutLowPt::filter(), BeamSplash::filter(), ECALActivity::filter(), JGJFilter::filter(), FilterOutScraping::filter(), PhysDecl::filter(), MCSingleParticleYPt::filter(), HighMultiplicityGenFilter::filter(), MCSmartSingleParticleFilter::filter(), MCZll::filter(), PythiaFilter::filter(), PythiaFilterHT::filter(), MCDecayingPionKaonFilter::filter(), ZgMassFilter::filter(), PythiaHLTSoupFilter::filter(), DJpsiFilter::filter(), FourLepFilter::filter(), MCProcessRangeFilter::filter(), HZZ4lFilter::filter(), MCSingleParticleFilter::filter(), MCParticlePairFilter::filter(), PythiaDauFilter::filter(), ZgammaMassFilter::filter(), PythiaProbeFilter::filter(), PythiaDauVFilter::filter(), MCProcessFilter::filter(), EcalSkim::filter(), PythiaMomDauFilter::filter(), FilterScrapingPixelProbability::filter(), HerwigMaxPtPartonFilter::filter(), EcalRecHitsFilter::filter(), PythiaDauVFilterMatchID::filter(), cms::DDFilteredView::firstSibling(), cms::DDFilteredView::nextSibling(), EvtPlaneProducer::produce(), cms::DDFilteredView::sibling(), and cms::DDFilteredView::siblingNoCheck().

bool cms::dd::compareEqual ( string_view  node,
string_view  name 
)

Definition at line 11 of file Filter.cc.

References begin, end, isRegex(), and listBenchmarks::pattern.

Referenced by accepted().

11  {
12  if(!isRegex(name)) {
13  return (name == node);
14  } else {
15  if(name.front() != node.front())
16  return false;
17  regex pattern({name.data(), name.size()});
18  return regex_match(begin(node), end(node), pattern);
19  }
20  }
bool isRegex(string_view input)
Definition: Filter.cc:37
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
bool cms::dd::compareEqual ( std::string_view  ,
std::string_view   
)
int cms::dd::contains ( string_view  input,
string_view  needle 
)

Definition at line 28 of file Filter.cc.

References begin, end, and cond::persistency::search().

Referenced by isRegex().

28  {
29  auto const& it = search(begin(input), end(input),
30  default_searcher(begin(needle), end(needle)));
31  if(it != end(input)) {
32  return (it - begin(input));
33  }
34  return -1;
35  }
std::vector< T >::const_iterator search(const cond::Time_t &val, const std::vector< T > &container)
Definition: IOVProxy.cc:314
static std::string const input
Definition: EdmProvDump.cc:48
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
int cms::dd::contains ( std::string_view  ,
std::string_view   
)
bool cms::dd::isRegex ( std::string_view  )
bool cms::dd::isRegex ( string_view  input)

Definition at line 37 of file Filter.cc.

References contains().

Referenced by compareEqual().

37  {
38  return ((contains(input, "*") != -1) ||
39  (contains(input, ".") != -1));
40  }
static std::string const input
Definition: EdmProvDump.cc:48
int contains(string_view input, string_view needle)
Definition: Filter.cc:28
std::string_view cms::dd::realTopName ( std::string_view  input)
string_view cms::dd::realTopName ( string_view  input)

Definition at line 42 of file Filter.cc.

References plotBeamSpotDB::first, input, min(), and findQualityFiles::v.

42  {
43  string_view v = input;
44  auto first = v.find_first_of("//");
45  v.remove_prefix(min(first+2, v.size()));
46  return v;
47  }
static std::string const input
Definition: EdmProvDump.cc:48
T min(T a, T b)
Definition: MathUtil.h:58
std::vector<std::string_view> cms::dd::split ( std::string_view  ,
const char *   
)
vector<string_view> cms::dd::split ( string_view  str,
const char *  delims 
)

Definition at line 50 of file Filter.cc.

References command_line::start.

50  {
51  vector<string_view> ret;
52 
54  auto pos = str.find_first_of(delims, start);
55  while(pos != string_view::npos) {
56  if(pos != start) {
57  ret.emplace_back(str.substr(start, pos - start));
58  }
59  start = pos + 1;
60  pos = str.find_first_of(delims, start);
61  }
62  if(start < str.length())
63  ret.emplace_back(str.substr(start, str.length() - start));
64  return ret;
65  }
Definition: start.py:1
uint16_t size_type
#define str(s)