![]() |
![]() |
#include <DDFilteredView.h>
Public Types | |
enum | log_op { AND, OR } |
typedef DDExpandedView::nav_type | nav_type |
Public Member Functions | |
void | addFilter (const DDFilter &, log_op op=AND) |
void | clearScope () |
clears the scope; the full tree is available, depth=0 | |
int | copyno () const |
Copy number associated with the current node. | |
nav_type | copyNumbers () const |
return the stack of copy numbers | |
DDFilteredView (const DDCompactView &) | |
bool | firstChild () |
set the current node to the first child ... | |
const DDGeoHistory & | geoHistory () const |
The list of ancestors up to the root-node of the current node. | |
bool | goTo (const nav_type &) |
const std::vector< DDGeoHistory > & | history () const |
const DDLogicalPart & | logicalPart () const |
The logical-part of the current node in the filtered-view. | |
DDsvalues_type | mergedSpecifics () const |
void | mergedSpecificsV (DDsvalues_type &merged) const |
nav_type | navPos () const |
return the stack of sibling numbers | |
bool | next () |
set current node to the next node in the filtered tree | |
bool | nextSibling () |
set the current node to the next sibling ... | |
bool | parent () |
set the current node to the parent node ... | |
void | print () |
void | reset () |
clears the scope and sets the filtered view to its root-node | |
const DDRotationMatrix & | rotation () const |
The absolute rotation of the current node. | |
const DDGeoHistory & | scope () const |
The scope of the expanded-view. | |
bool | setScope (const DDGeoHistory &hist) |
sets the scope of the expanded view | |
std::vector< const DDsvalues_type * > | specifics () const |
void | specificsV (std::vector< const DDsvalues_type * > &result) const |
User specific data attached to the current node. | |
const DDTranslation & | translation () const |
The absolute translation of the current node. | |
~DDFilteredView () | |
Private Types | |
typedef std::vector < criterion_type > | criteria_type |
typedef DDFilter const * | criterion_type |
typedef std::vector< log_op > | logops_type |
Private Member Functions | |
bool | filter () |
Private Attributes | |
criteria_type | criteria_ |
DDExpandedView | epv_ |
logops_type | logOps_ |
std::vector< DDGeoHistory > | parents_ |
const DDScope * | scope_ |
Definition at line 11 of file DDFilteredView.h.
typedef std::vector<criterion_type> DDFilteredView::criteria_type [private] |
Definition at line 89 of file DDFilteredView.h.
typedef DDFilter const* DDFilteredView::criterion_type [private] |
Definition at line 88 of file DDFilteredView.h.
typedef std::vector<log_op> DDFilteredView::logops_type [private] |
Definition at line 90 of file DDFilteredView.h.
Definition at line 14 of file DDFilteredView.h.
DDFilteredView::DDFilteredView | ( | const DDCompactView & | cpv | ) |
Definition at line 7 of file DDFilteredView.cc.
References epv_, DDExpandedView::geoHistory(), and parents_.
: epv_(cpv) { parents_.push_back(epv_.geoHistory()); }
DDFilteredView::~DDFilteredView | ( | ) |
Definition at line 14 of file DDFilteredView.cc.
{ }
Definition at line 24 of file DDFilteredView.cc.
References criteria_, and logOps_.
Referenced by ListGroups::analyze(), ListIds::analyze(), RPCGeometryParsFromDD::build(), DTGeometryBuilderFromDDD::build(), CSCGeometryParsFromDD::build(), DTGeometryParsFromDD::build(), RPCGeometryBuilderFromDDD::build(), CaloTrkProcessing::CaloTrkProcessing(), DDDCmsTrackerContruction::construct(), DTGeometryParserFromDDD::DTGeometryParserFromDDD(), ECalSD::ECalSD(), MaterialBudgetHcalHistos::fillBeginJob(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), HFFibre::HFFibre(), HFShower::HFShower(), HFShowerFibreBundle::HFShowerFibreBundle(), HFShowerLibrary::HFShowerLibrary(), HFShowerParam::HFShowerParam(), HFShowerPMT::HFShowerPMT(), HcalNumberingFromDDD::initialize(), HcalTB02SD::initMap(), ECalSD::initMap(), DreamSD::initMap(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), MaterialAccountingGroup::MaterialAccountingGroup(), MuonDDDConstants::MuonDDDConstants(), CocoaAnalyzer::ReadXMLFile(), and PrintGeomInfoAction::update().
void DDFilteredView::clearScope | ( | ) |
clears the scope; the full tree is available, depth=0
Definition at line 96 of file DDFilteredView.cc.
References DDExpandedView::clearScope(), epv_, DDExpandedView::geoHistory(), and parents_.
{ epv_.clearScope(); parents_.clear(); parents_.push_back(epv_.geoHistory()); }
int DDFilteredView::copyno | ( | void | ) | const |
Copy number associated with the current node.
Definition at line 73 of file DDFilteredView.cc.
References DDExpandedView::copyno(), and epv_.
Referenced by MuonRPCDetLayerGeometryBuilder::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), and DTGeometryParsFromDD::insertLayer().
DDFilteredView::nav_type DDFilteredView::copyNumbers | ( | ) | const |
return the stack of copy numbers
Definition at line 282 of file DDFilteredView.cc.
References DDExpandedView::copyNumbers(), and epv_.
Referenced by HcalNumberingFromDDD::loadGeometry(), and PrintGeomInfoAction::update().
{ return epv_.copyNumbers(); }
bool DDFilteredView::filter | ( | ) | [private] |
Definition at line 249 of file DDFilteredView.cc.
References AND, criteria_, epv_, logOps_, OR, and query::result.
Referenced by next(), and nextSibling().
{ bool result = true; //DCOUT('Q', "Filter: " << epv_.history_); criteria_type::const_iterator it = criteria_.begin(); logops_type::const_iterator logOpIt = logOps_.begin(); // loop over all user-supplied criteria (==filters) for (; it != criteria_.end(); ++it, ++logOpIt) { // avoid useless evaluations if ( ( result &&(*logOpIt)==OR ) || ( (!result)&&(*logOpIt)==AND) ) continue; bool locres = (*it)->accept(epv_); // need correction DCOUT('F', " Filter(" << criteria_.end()-it << ") accepted: " << epv_.geoHistory().back()); // now do the logical-operations on the results encountered so far: if (*logOpIt==AND) { // AND result &= locres; } else { // OR result |= locres; } } // <-- loop over filters return result; }
bool DDFilteredView::firstChild | ( | ) |
set the current node to the first child ...
Algorithm:
Definition at line 131 of file DDFilteredView.cc.
References DDExpandedView::depth_, epv_, DDExpandedView::geoHistory(), DDExpandedView::goToHistory(), next(), parents_, query::result, and DDExpandedView::scope_.
Referenced by ListIds::analyze(), CmsTrackerLevelBuilder::build(), CSCGeometryParsFromDD::build(), CmsDetConstruction::buildComponent(), RPCGeometryBuilderFromDDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), DTGeometryParsFromDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), MuonRPCDetLayerGeometryBuilder::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), CaloTrkProcessing::CaloTrkProcessing(), DDDCmsTrackerContruction::construct(), ECalSD::ECalSD(), MaterialBudgetHcalHistos::fillBeginJob(), HcalTB06BeamSD::getNames(), MaterialBudgetHcalHistos::getNames(), HCalSD::getNames(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), HFFibre::HFFibre(), HFShower::HFShower(), HFShowerFibreBundle::HFShowerFibreBundle(), HFShowerLibrary::HFShowerLibrary(), HFShowerParam::HFShowerParam(), HFShowerPMT::HFShowerPMT(), HcalNumberingFromDDD::initialize(), HcalTB02SD::initMap(), ECalSD::initMap(), DreamSD::initMap(), DTGeometryParsFromDD::insertLayer(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), MuonDDDConstants::MuonDDDConstants(), nextSibling(), DTGeometryParserFromDDD::parseGeometry(), CocoaAnalyzer::ReadXMLFile(), CmsTrackerRingBuilder::sortNS(), and PrintGeomInfoAction::update().
{ bool result = false; // save the current position DDGeoHistory savedPos = epv_.geoHistory(); // save the current scope DDGeoHistory savedScope = epv_.scope_; int savedDepth = epv_.depth_; // set current node to be the scope epv_.scope_ = epv_.geoHistory(); epv_.depth_ = 0; // search the subtree for the first matching node if (next()) { result = true; epv_.scope_ = savedScope; epv_.depth_ = savedDepth; } else { // restore the starting point epv_.scope_ = savedScope; epv_.depth_ = savedDepth; epv_.goToHistory(savedPos); } if (result) { parents_.push_back(epv_.geoHistory()); } return result; }
const DDGeoHistory & DDFilteredView::geoHistory | ( | ) | const |
The list of ancestors up to the root-node of the current node.
Definition at line 44 of file DDFilteredView.cc.
References epv_, and DDExpandedView::geoHistory().
Referenced by ListGroups::analyze(), ListIds::analyze(), CSCGeometryParsFromDD::build(), DTGeometryBuilderFromDDD::buildChamber(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), MuonRPCDetLayerGeometryBuilder::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryBuilderFromDDD::buildSuperLayer(), EcalTBHodoscopeGeometryLoaderFromDDD::getDetIdForDDDNode(), DTGeometryParsFromDD::insertChamber(), DTGeometryParsFromDD::insertLayer(), DTGeometryParsFromDD::insertSuperLayer(), and CocoaAnalyzer::ReadXMLFile().
{ return epv_.geoHistory(); }
bool DDFilteredView::goTo | ( | const nav_type & | n | ) |
Definition at line 288 of file DDFilteredView.cc.
References query::result.
Referenced by TouchableToHistory::getFilteredView(), and DDDefaultNumberingScheme::node().
const std::vector< DDGeoHistory > & DDFilteredView::history | ( | ) | const |
const DDLogicalPart & DDFilteredView::logicalPart | ( | ) | const |
The logical-part of the current node in the filtered-view.
Definition at line 18 of file DDFilteredView.cc.
References epv_, and DDExpandedView::logicalPart().
Referenced by ListIds::analyze(), CSCGeometryParsFromDD::build(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), DTGeometryParsFromDD::extractParameters(), DTGeometryBuilderFromDDD::extractParameters(), HcalTB06BeamSD::getNames(), MaterialBudgetHcalHistos::getNames(), HCalSD::getNames(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), HcalTB02SD::initMap(), ECalSD::initMap(), DreamSD::initMap(), HcalNumberingFromDDD::loadGeometry(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), CocoaAnalyzer::ReadXMLFile(), and PrintGeomInfoAction::update().
{ return epv_.logicalPart(); }
DDsvalues_type DDFilteredView::mergedSpecifics | ( | ) | const |
Definition at line 66 of file DDFilteredView.cc.
References epv_, and DDExpandedView::mergedSpecificsV().
Referenced by DTGeometryParsFromDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), CaloTrkProcessing::CaloTrkProcessing(), ECalSD::ECalSD(), MaterialBudgetHcalHistos::fillBeginJob(), HCalSD::HCalSD(), HFFibre::HFFibre(), HFShower::HFShower(), HFShowerFibreBundle::HFShowerFibreBundle(), HFShowerLibrary::HFShowerLibrary(), HFShowerParam::HFShowerParam(), HFShowerPMT::HFShowerPMT(), HcalNumberingFromDDD::loadSpecPars(), MuonDDDConstants::MuonDDDConstants(), and CocoaAnalyzer::ReadXMLFile().
{ DDsvalues_type merged;epv_.mergedSpecificsV(merged); return merged; }
void DDFilteredView::mergedSpecificsV | ( | DDsvalues_type & | merged | ) | const |
Definition at line 61 of file DDFilteredView.cc.
References epv_, and DDExpandedView::mergedSpecificsV().
{ epv_.mergedSpecificsV(merged); }
DDFilteredView::nav_type DDFilteredView::navPos | ( | ) | const |
return the stack of sibling numbers
Definition at line 276 of file DDFilteredView.cc.
References epv_, and DDExpandedView::navPos().
Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme(), GeometricDet::GeometricDet(), and DDDefaultNumberingScheme::id().
bool DDFilteredView::next | ( | void | ) |
set current node to the next node in the filtered tree
Definition at line 104 of file DDFilteredView.cc.
References epv_, filter(), i, DDExpandedView::next(), and query::result.
Referenced by ListGroups::analyze(), ListIds::analyze(), CSCGeometryParsFromDD::build(), DDDefaultNumberingScheme::DDDefaultNumberingScheme(), firstChild(), HcalTB06BeamSD::getNames(), MaterialBudgetHcalHistos::getNames(), HCalSD::getNames(), HCalSD::HCalSD(), HcalTB06BeamSD::HcalTB06BeamSD(), HcalTB02SD::initMap(), ECalSD::initMap(), DreamSD::initMap(), HcalNumberingFromDDD::loadGeometry(), MaterialAccountingGroup::MaterialAccountingGroup(), CocoaAnalyzer::ReadXMLFile(), and PrintGeomInfoAction::update().
{ bool result = false; int i=0; //epv_.scope_.clear(); //DCOUT('F', "DDFilteredView::next(): scope of ExpandedView = " << epv_.scope_ ); while(epv_.next()) { //DCOUT('F', " node " << i << " " << epv_.logicalPart().ddname() ); ++i; //DCOUT('F', "DDFilteredView::next() at " << epv_.geoHistory().back() ); if ( filter() ) { result = true; //DCOUT('F', "DDFilteredView::next(): filter()==true at " << epv_.geoHistory() ); break; } } //DCOUT('F', "DDFilteredView::next(): just iterated over " << i << " nodes."); return result; }
bool DDFilteredView::nextSibling | ( | ) |
set the current node to the next sibling ...
Algorithm:
Definition at line 172 of file DDFilteredView.cc.
References epv_, filter(), firstChild(), DDExpandedView::geoHistory(), DDExpandedView::goToHistory(), DDExpandedView::nextSibling(), DDExpandedView::parent(), parents_, and query::result.
Referenced by CmsTrackerLevelBuilder::build(), CmsDetConstruction::buildComponent(), RPCGeometryBuilderFromDDD::buildGeometry(), DTGeometryParsFromDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), MuonRPCDetLayerGeometryBuilder::buildLayer(), DTGeometryBuilderFromDDD::buildLayer(), DTGeometryParsFromDD::insertLayer(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), and DTGeometryParserFromDDD::parseGeometry().
{ //PRE: the current node A is one matching the filter or the (scoped) root //POST: current node is A if no filter has matched, or B with matching filter // B is the firstChild matching the filter in the subtrees of A's siblings bool result = false; DDGeoHistory savedPos = epv_.geoHistory(); //DDGeoHistory::size_type level = parents_.back().size(); bool flag = true; //bool shuffleParent = false; while (flag) { if (epv_.nextSibling()) { if ( filter() ) { result = true; break; } else if (firstChild()) { result = true; // firstChild increases parents! parents_.pop_back(); break; } } // <-- epv_.nextSibling else if (!epv_.parent()) { flag = false; } if (epv_.geoHistory().size() == parents_[parents_.size()-2].size()) { flag = false; } } if (!result) epv_.goToHistory(savedPos); else parents_.back() = epv_.geoHistory(); return result; }
bool DDFilteredView::parent | ( | ) |
set the current node to the parent node ...
Definition at line 214 of file DDFilteredView.cc.
References epv_, DDExpandedView::goToHistory(), parents_, and query::result.
Referenced by CmsTrackerLevelBuilder::build(), CmsDetConstruction::buildComponent(), DTGeometryBuilderFromDDD::buildGeometry(), DTGeometryParsFromDD::buildGeometry(), DDDCmsTrackerContruction::construct(), DTGeometryParsFromDD::insertLayer(), DTGeometryParserFromDDD::parseGeometry(), and CmsTrackerRingBuilder::sortNS().
{ bool result = false; if (parents_.size()==1) { result = false; } else { parents_.pop_back(); epv_.goToHistory(parents_.back()); result = true; } // =====> CHECK WHETHER THE FOLLOWING REMARKS STILL REPRESENT THE IMPLEMENTATION ABOVE <=== // case 1: we've reached the (scoped) root of the underlying expanded-view // from the first child of the fitered-view; result must be true // case 2: we've reached a parent-node where the filter said 'yes'; // result must be true // case 3: we are already at the (scoped) root of the underlying expanded-view // result must be false return result; }
void DDFilteredView::print | ( | void | ) |
Definition at line 297 of file DDFilteredView.cc.
References epv_, i, parents_, and DDExpandedView::scope_.
{ edm::LogInfo("DDFliteredView") << "FilteredView Status" << std::endl << "-------------------" << std::endl << "scope = " << epv_.scope_ << std::endl << "parents:" << std::endl; for (unsigned int i=0; i<parents_.size(); ++i) edm::LogInfo("DDFliteredView") << " " << parents_[i] << std::endl; }
void DDFilteredView::reset | ( | void | ) |
clears the scope and sets the filtered view to its root-node
Definition at line 239 of file DDFilteredView.cc.
References epv_, DDExpandedView::geoHistory(), parents_, and DDExpandedView::reset().
Referenced by DDDefaultNumberingScheme::DDDefaultNumberingScheme().
const DDRotationMatrix & DDFilteredView::rotation | ( | void | ) | const |
The absolute rotation of the current node.
Definition at line 38 of file DDFilteredView.cc.
References epv_, and DDExpandedView::rotation().
Referenced by CSCGeometryParsFromDD::build(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), DTGeometryParsFromDD::plane(), DTGeometryBuilderFromDDD::plane(), and CocoaAnalyzer::ReadXMLFile().
const DDGeoHistory & DDFilteredView::scope | ( | ) | const |
The scope of the expanded-view.
Definition at line 79 of file DDFilteredView.cc.
References epv_, and DDExpandedView::scope().
bool DDFilteredView::setScope | ( | const DDGeoHistory & | hist | ) |
sets the scope of the expanded view
Definition at line 85 of file DDFilteredView.cc.
References epv_, parents_, query::result, and DDExpandedView::setScope().
std::vector< const DDsvalues_type * > DDFilteredView::specifics | ( | ) | const |
Definition at line 50 of file DDFilteredView.cc.
References epv_, query::result, and DDExpandedView::specificsV().
Referenced by CSCGeometryParsFromDD::build(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), and CocoaAnalyzer::ReadXMLFile().
{ std::vector<const DDsvalues_type * > result; epv_.specificsV(result); return result; }
void DDFilteredView::specificsV | ( | std::vector< const DDsvalues_type * > & | result | ) | const |
User specific data attached to the current node.
Definition at line 56 of file DDFilteredView.cc.
References epv_, and DDExpandedView::specificsV().
Referenced by dddGetStringRaw(), and ExtractStringFromDDD::getString().
{ epv_.specificsV(result); }
const DDTranslation & DDFilteredView::translation | ( | void | ) | const |
The absolute translation of the current node.
Definition at line 32 of file DDFilteredView.cc.
References epv_, and DDExpandedView::translation().
Referenced by ListGroups::analyze(), ListIds::analyze(), CSCGeometryParsFromDD::build(), RPCGeometryBuilderFromDDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), TouchableToHistory::getNavStory(), HcalNumberingFromDDD::loadGeometry(), EcalTBHodoscopeGeometryLoaderFromDDD::makeGeometry(), MaterialAccountingGroup::MaterialAccountingGroup(), DTGeometryParsFromDD::plane(), DTGeometryBuilderFromDDD::plane(), CocoaAnalyzer::ReadXMLFile(), and PrintGeomInfoAction::update().
{ return epv_.translation(); }
criteria_type DDFilteredView::criteria_ [private] |
Definition at line 92 of file DDFilteredView.h.
Referenced by addFilter(), and filter().
DDExpandedView DDFilteredView::epv_ [private] |
Definition at line 86 of file DDFilteredView.h.
Referenced by clearScope(), copyno(), copyNumbers(), DDFilteredView(), filter(), firstChild(), geoHistory(), logicalPart(), mergedSpecifics(), mergedSpecificsV(), navPos(), next(), nextSibling(), parent(), print(), reset(), rotation(), scope(), setScope(), specifics(), specificsV(), and translation().
logops_type DDFilteredView::logOps_ [private] |
Definition at line 93 of file DDFilteredView.h.
Referenced by addFilter(), and filter().
std::vector<DDGeoHistory> DDFilteredView::parents_ [private] |
Definition at line 94 of file DDFilteredView.h.
Referenced by clearScope(), DDFilteredView(), firstChild(), history(), nextSibling(), parent(), print(), reset(), and setScope().
const DDScope* DDFilteredView::scope_ [private] |
Definition at line 87 of file DDFilteredView.h.