CMS 3D CMS Logo

List of all members | Static Public Member Functions
ExtractStringFromDDD Class Reference

#include <ExtractStringFromDDD.h>

Static Public Member Functions

static std::string getString (std::string const &, DDFilteredView *)
 

Detailed Description

Helper function to extract a string from a SpecPar; only returns the first one and complains if more than 1 is found.

Definition at line 14 of file ExtractStringFromDDD.h.

Member Function Documentation

std::string ExtractStringFromDDD::getString ( std::string const &  s,
DDFilteredView fv 
)
static

Definition at line 9 of file ExtractStringFromDDD.cc.

References DDfetch(), Exception, mps_fire::result, DDFilteredView::specificsV(), DDValue::strings(), groupFilesInBlocks::temp, and heppy_batch::val.

Referenced by CmsTrackerLevelBuilder::build(), CmsDetConstruction::buildComponent(), CmsTrackerOTLayerBuilder::buildComponent(), CmsTrackerPanelBuilder::buildComponent(), CmsTrackerPetalBuilder::buildComponent(), CmsTrackerLayerBuilder::buildComponent(), CmsTrackerWheelBuilder::buildComponent(), CmsTrackerDiskBuilder::buildComponent(), CmsTrackerOTDiscBuilder::buildComponent(), CmsTrackerPhase1DiskBuilder::buildComponent(), CmsTrackerPhase2TPDiskBuilder::buildComponent(), CmsTrackerPixelPhase2DiskBuilder::buildComponent(), CmsTrackerPixelPhase2EndcapBuilder::buildComponent(), CmsTrackerPixelPhase1EndcapBuilder::buildComponent(), CmsTrackerSubStrctBuilder::buildComponent(), CmsTrackerBuilder::buildComponent(), CmsDetConstruction::buildSmallDetsforGlued(), CmsDetConstruction::buildSmallDetsforStack(), DDDCmsTrackerContruction::construct(), and CmsTrackerRingBuilder::sortNS().

9  {
10  DDValue val(s);
11  std::vector<const DDsvalues_type *> result;
12  fv->specificsV(result);
13  std::vector<const DDsvalues_type *>::iterator it = result.begin();
14  bool foundIt = false;
15  for (; it != result.end(); ++it) {
16  foundIt = DDfetch(*it,val);
17  if (foundIt) break;
18  }
19  if (foundIt) {
20  std::vector<std::string> const & temp = val.strings();
21  if (temp.size() != 1) {
22  throw cms::Exception("Configuration")<< " ERROR: I need 1 "<< s << " tags";
23  }
24  return temp[0];
25  }
26  return "NotFound";
27 }
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:81
void specificsV(std::vector< const DDsvalues_type * > &result) const
User specific data attached to the current node.