CMS 3D CMS Logo

ExtractStringFromDDD Class Reference

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

#include <Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h>

List of all members.

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, it, HLT_VtxMuL3::result, DDFilteredView::specificsV(), DDValue::strings(), and pyDBSRunClass::temp.

Referenced by CmsTrackerPetalBuilder::buildComponent(), CmsTrackerBuilder::buildComponent(), CmsTrackerWheelBuilder::buildComponent(), CmsTrackerSubStrctBuilder::buildComponent(), CmsTrackerLayerBuilder::buildComponent(), CmsDetConstruction::buildComponent(), CmsTrackerDiskBuilder::buildComponent(), CmsTrackerPanelBuilder::buildComponent(), CmsDetConstruction::buildSmallDets(), DDDCmsTrackerContruction::construct(), and CmsTrackerRingBuilder::sortNS().

00009                                                                                { 
00010   DDValue val(s);
00011   std::vector<const DDsvalues_type *> result;
00012   fv->specificsV(result);
00013   std::vector<const DDsvalues_type *>::iterator it = result.begin();
00014   bool foundIt = false;
00015   for (; it != result.end(); ++it)   {
00016     foundIt = DDfetch(*it,val);
00017     if (foundIt) break;
00018   }    
00019   if (foundIt)   { 
00020     std::vector<std::string> const & temp = val.strings();
00021     if (temp.size() != 1) {
00022      throw cms::Exception("Configuration")<< " ERROR: I need 1 "<< s << " tags";
00023     }
00024     return temp[0]; 
00025   }
00026   return "NotFound";
00027 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:34 2009 for CMSSW by  doxygen 1.5.4