CMS 3D CMS Logo

Functions
DDVectorGetter Namespace Reference

Functions

void beginWith (const std::string &, std::vector< std::string > &)
 
bool check (const std::string &)
 
std::vector< double > get (const std::string &)
 

Function Documentation

void DDVectorGetter::beginWith ( const std::string &  str,
std::vector< std::string > &  vstring 
)
inline

Definition at line 58 of file DDVectorGetter.h.

References DDBase< DDName, std::vector< double > * >::end(), and harvestTrackValidationPlots::str.

59  {
60  DDVector::iterator<DDVector> vit;
61  DDVector::iterator<DDVector> ved( DDVector::end());
62 
63  for(; vit != ved; ++vit )
64  {
65  if( vit->isDefined().second )
66  {
67  DDName vname( vit->name());
68  if( vname.name().compare( 0, str.size(), str ) == 0 )
69  vstring.push_back( vname.name());
70  }
71  }
72  }
vector< string > vstring
Definition: ExoticaDQM.cc:8
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
bool DDVectorGetter::check ( const std::string &  str)
inline

Definition at line 15 of file DDVectorGetter.h.

References DDBase< DDName, std::vector< double > * >::end(), and harvestTrackValidationPlots::str.

Referenced by HcalParametersFromDD::build(), and TrackerParametersFromDD::build().

16  {
17  DDVector::iterator<DDVector> vit;
18  DDVector::iterator<DDVector> ved( DDVector::end());
19 
20  for(; vit != ved; ++vit )
21  {
22  if( vit->isDefined().second )
23  {
24  DDName vname( vit->name());
25  if( vname.name() == str )
26  return true;
27  }
28  }
29 
30  return false;
31  }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::vector< double > DDVectorGetter::get ( const std::string &  str)
inline

Definition at line 34 of file DDVectorGetter.h.

References DDBase< DDName, std::vector< double > * >::end(), Exception, and harvestTrackValidationPlots::str.

Referenced by HcalParametersFromDD::build(), TrackerParametersFromDD::build(), HGCalGeomParameters::loadCellParsHexagon(), and TrackerGeometricDetESModule::produce().

35  {
36  DDVector::iterator<DDVector> vit;
37  DDVector::iterator<DDVector> ved( DDVector::end());
38  if( vit == ved )
39  throw cms::Exception( "DDException" ) << "DDVectorGetter: vectors are empty, cannot get array " << str;
40 
41  for (; vit != ved; ++vit )
42  {
43  if( vit->isDefined().second )
44  {
45  DDName vname( vit->name());
46  if( vname.name() == str )
47  {
48  const std::vector<double> & fvec = vit->values();
49  return fvec;
50  }
51  }
52  }
53 
54  throw cms::Exception( "DDException" ) << "DDVectorGetter: cannot get array " << str;
55  }
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15