![]() |
![]() |
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs. More...
#include <DDFilter.h>
Classes | |
struct | SpecificCriterion |
Public Types | |
enum | comp_op { equals, matches, not_equals, not_matches, smaller, bigger, smaller_equals, bigger_equals } |
enum | log_op { AND, OR } |
logical operations to obtain one result from two filter comparisons More... | |
Public Member Functions | |
bool | accept (const DDExpandedView &) const |
true, if the DDExpandedNode fulfills the filter criteria | |
DDSpecificsFilter () | |
void | setCriteria (const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true) |
~DDSpecificsFilter () | |
Protected Types | |
typedef std::vector < criterion_type > | criteria_type |
typedef SpecificCriterion | criterion_type |
typedef std::vector< log_op > | logops_type |
Protected Member Functions | |
bool | accept_impl (const DDExpandedView &) const |
Protected Attributes | |
criteria_type | criteria_ |
logops_type | logOps_ |
Friends | |
std::ostream & | operator<< (std::ostream &os, const DDSpecificsFilter &f) |
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition at line 37 of file DDFilter.h.
typedef std::vector<criterion_type> DDSpecificsFilter::criteria_type [protected] |
Definition at line 86 of file DDFilter.h.
typedef SpecificCriterion DDSpecificsFilter::criterion_type [protected] |
Definition at line 85 of file DDFilter.h.
typedef std::vector<log_op> DDSpecificsFilter::logops_type [protected] |
Definition at line 87 of file DDFilter.h.
comparison operators to be used with this filter
Definition at line 45 of file DDFilter.h.
{ equals, matches, not_equals, not_matches, smaller, bigger, smaller_equals, bigger_equals };
logical operations to obtain one result from two filter comparisons
Definition at line 48 of file DDFilter.h.
DDSpecificsFilter::DDSpecificsFilter | ( | ) |
Definition at line 278 of file DDFilter.cc.
: DDFilter() { }
DDSpecificsFilter::~DDSpecificsFilter | ( | ) |
Definition at line 282 of file DDFilter.cc.
{}
bool DDSpecificsFilter::accept | ( | const DDExpandedView & | ) | const [virtual] |
true, if the DDExpandedNode fulfills the filter criteria
Implements DDFilter.
Definition at line 296 of file DDFilter.cc.
References accept_impl().
{ return accept_impl(node); }
bool DDSpecificsFilter::accept_impl | ( | const DDExpandedView & | node | ) | const [protected] |
Definition at line 302 of file DDFilter.cc.
References AND, criteria_, DDLogicalPart::hasDDValue(), DDExpandedView::logicalPart(), logOps_, DDExpandedView::mergedSpecificsV(), OR, query::result, and DDExpandedView::specificsV().
Referenced by accept().
{ bool result = true; criteria_type::const_iterator it = criteria_.begin(); criteria_type::const_iterator crEnd = criteria_.end(); logops_type::const_iterator logOpIt = logOps_.begin(); //logops_type::iterator logOpEnd = logOps_.end(); const DDLogicalPart & logp = node.logicalPart(); DDsvalues_type sv; std::vector<const DDsvalues_type *> specs; for (; it != crEnd; ++it, ++logOpIt) { // avoid useless evaluations if ( ( result &&(*logOpIt)==OR ) || ( (!result)&&(*logOpIt)==AND) ) continue; bool locres=false; if (logp.hasDDValue(it->nameVal_)) { if (it->merged_) { if (sv.empty()) node.mergedSpecificsV(sv); if (it->asString_) { // merged specifics & compare std::strings locres = sfs_compare(*it,sv); } else { // merged specifics & compare doubles locres = sfd_compare(*it,sv); } } else { if (specs.empty()) node.specificsV(specs); if (it->asString_) { // non-merged specifics & compare std::strings locres = sfs_compare_nm(*it, specs); } else { // non-merged specifics & compare doubles locres = sfd_compare_nm(*it, specs); } } } if (*logOpIt==AND) { result &= locres; } else { result |= locres; } } return result; }
void DDSpecificsFilter::setCriteria | ( | const DDValue & | nameVal, |
comp_op | op, | ||
log_op | l = AND , |
||
bool | asString = true , |
||
bool | merged = true |
||
) |
Definition at line 285 of file DDFilter.cc.
References criteria_, and logOps_.
Referenced by ListGroups::analyze(), ListIds::analyze(), DTGeometryBuilderFromDDD::build(), RPCGeometryParsFromDD::build(), CSCGeometryParsFromDD::build(), DTGeometryParsFromDD::build(), RPCGeometryBuilderFromDDD::build(), CaloTrkProcessing::CaloTrkProcessing(), DDDCmsTrackerContruction::construct(), DTGeometryParserFromDDD::DTGeometryParserFromDDD(), ECalSD::ECalSD(), MaterialBudgetHcalHistos::fillBeginJob(), EcalTBHodoscopeGeometryLoaderFromDDD::getDDFilter(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), HFFibre::HFFibre(), HFShower::HFShower(), HFShowerFibreBundle::HFShowerFibreBundle(), HFShowerLibrary::HFShowerLibrary(), HFShowerParam::HFShowerParam(), HFShowerPMT::HFShowerPMT(), HcalNumberingFromDDD::initialize(), HcalTB02SD::initMap(), ECalSD::initMap(), DreamSD::initMap(), MaterialAccountingGroup::MaterialAccountingGroup(), MuonDDDConstants::MuonDDDConstants(), CocoaAnalyzer::ReadXMLFile(), and PrintGeomInfoAction::update().
std::ostream& operator<< | ( | std::ostream & | os, |
const DDSpecificsFilter & | f | ||
) | [friend] |
criteria_type DDSpecificsFilter::criteria_ [protected] |
Definition at line 89 of file DDFilter.h.
Referenced by accept_impl(), and setCriteria().
logops_type DDSpecificsFilter::logOps_ [protected] |
Definition at line 90 of file DDFilter.h.
Referenced by accept_impl(), and setCriteria().