CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDSpecificsHasNamedValueFilter Class Reference

#include <DDFilter.h>

Inheritance diagram for DDSpecificsHasNamedValueFilter:
DDFilter

Public Member Functions

bool accept (const DDExpandedView &) const final
 true, if the DDExpandedNode fulfills the filter criteria More...
 
 DDSpecificsHasNamedValueFilter (const std::string &iAttribute)
 
- Public Member Functions inherited from DDFilter
 DDFilter ()
 
virtual ~DDFilter ()
 

Private Attributes

DDValue attribute_
 

Detailed Description

Definition at line 70 of file DDFilter.h.

Constructor & Destructor Documentation

DDSpecificsHasNamedValueFilter::DDSpecificsHasNamedValueFilter ( const std::string &  iAttribute)
inlineexplicit

Definition at line 72 of file DDFilter.h.

References accept().

72  :
73  attribute_(iAttribute,"",0 )
74  {}

Member Function Documentation

bool DDSpecificsHasNamedValueFilter::accept ( const DDExpandedView ) const
finalvirtual

true, if the DDExpandedNode fulfills the filter criteria

Implements DDFilter.

Definition at line 104 of file DDFilter.cc.

References DDLogicalPart::attachedSpecifics(), DDExpandedView::geoHistory(), DDLogicalPart::hasDDValue(), create_public_lumi_plots::hist, DDExpandedView::logicalPart(), SiPixelPhase1DigisV_cfi::specs, and findQualityFiles::v.

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply(), and esMonitoring.FDJsonServer::handle_accept().

104  {
105  const DDLogicalPart & logp = node.logicalPart();
106 
107  if (logp.hasDDValue(attribute_)) {
108 
109  const auto& specs = logp.attachedSpecifics();
110 
111  const auto& hist = node.geoHistory();
112  for(auto const& spec: specs) {
113  for(auto const& v: *(spec.second) ) {
114  if(attribute_.id() == v.first) {
115  //DDCompareEqual is slow so only call
116  // when needed
117  if(DDCompareEqual(hist,*spec.first)()) {
118  return true;
119  } else {
120  //since we know this isn't in the correct
121  // geometry path we do not have to check
122  // anymore attributes
123  break;
124  }
125  }
126  }
127  }
128  }
129  return false;
130 }
bool hasDDValue(const DDValue &) const
compares a given geometrical-history whether it corresponds to the given part-selector ...
Definition: DDComparator.h:16
unsigned int id(void) const
returns the ID of the DDValue
Definition: DDValue.h:48
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
const std::vector< std::pair< const DDPartSelection *, const DDsvalues_type * > > & attachedSpecifics(void) const

Member Data Documentation

DDValue DDSpecificsHasNamedValueFilter::attribute_
private

Definition at line 79 of file DDFilter.h.