#include "DetectorDescription/Core/interface/DDsvalues.h"
#include <iostream>
Go to the source code of this file.
Functions | |
bool | DDfetch (const DDsvalues_type *p, DDValue &v) |
helper for retrieving DDValues from DDsvalues_type *. | |
unsigned int | DDfetch (const std::vector< const DDsvalues_type * > &sp, DDValue &toFetch, std::vector< DDValue > &result) |
helper for retrieving DDValues from a std::vector of (DDsvalues_type *). | |
void | merge (DDsvalues_type &target, DDsvalues_type const &sv, bool sortit) |
std::ostream & | operator<< (std::ostream &os, const std::vector< const DDsvalues_type * > &v) |
std::ostream & | operator<< (std::ostream &os, const DDsvalues_type &s) |
bool DDfetch | ( | const DDsvalues_type * | p, |
DDValue & | v | ||
) |
helper for retrieving DDValues from DDsvalues_type *.
Example:
std::vector<std::string> myFunction(const DDsvalues_type * svalptr, const std::string & name) { static std::vector<std::string> v; // empty std::vector, for zero result DDValue val(name); if (DDfetch(svalptr,val)) { return val.std::strings(); } else { return v; } }
Definition at line 102 of file DDsvalues.cc.
References spr::find(), and query::result.
Referenced by DDMapper< KeyType, ValueType >::all(), RPCGeometryBuilderFromDDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), DTGeometryParsFromDD::buildGeometry(), RPCGeometryParsFromDD::buildGeometry(), dddGetStringRaw(), DDfetch(), HFShowerLibrary::getDDDArray(), MaterialBudgetHcalHistos::getDDDArray(), HCalSD::getDDDArray(), HFFibre::getDDDArray(), HFShower::getDDDArray(), HFShowerPMT::getDDDArray(), HcalNumberingFromDDD::getDDDArray(), HFShowerFibreBundle::getDDDArray(), HFShowerParam::getDDDArray(), ECalSD::getDDDArray(), DDG4Builder::getDouble(), DDG4Builder::getInt(), MuonDDDNumbering::getInt(), CaloTrkProcessing::getNames(), CaloTrkProcessing::getNumbers(), DDG4SensitiveConverter::getString(), ExtractStringFromDDD::getString(), ECalSD::getStringArray(), CocoaAnalyzer::myFetchDbl(), CocoaAnalyzer::myFetchString(), DDMapper< KeyType, ValueType >::noSpecifics(), DDMapper< KeyType, ValueType >::toDouble(), DDMapper< KeyType, ValueType >::toString(), and MagGeoBuilderFromDDD::volumeHandle::volumeHandle().
unsigned int DDfetch | ( | const std::vector< const DDsvalues_type * > & | sp, |
DDValue & | toFetch, | ||
std::vector< DDValue > & | result | ||
) |
helper for retrieving DDValues from a std::vector of (DDsvalues_type *).
Definition at line 114 of file DDsvalues.cc.
References prof2calltree::count, and DDfetch().
void merge | ( | DDsvalues_type & | target, |
DDsvalues_type const & | sv, | ||
bool | sortit | ||
) |
Definition at line 21 of file DDsvalues.cc.
References spr::find(), and python::multivaluedict::sort().
{ static Counter counter = {0,0,0,0,0}; if (target.empty()) { ++counter.empty; target = sv; return; } DDsvalues_type::const_iterator sit = sv.begin(); DDsvalues_type::const_iterator sed = sv.end(); // fast merge if (target.back()<sv.front()) { ++counter.end; target.insert(target.end(),sit,sed); return; } if (sv.back()<target.front()) { ++counter.begin; target.insert(target.begin(),sit,sed); return; } { DDsvalues_type::iterator it = std::lower_bound(target.begin(),target.end(),sv.front()); if (it == std::lower_bound(target.begin(),target.end(),sv.back())) { ++counter.middle; target.insert(it,sit,sed); return; } } // it nevers arrives here... ++counter.mixed; target.reserve(target.size()+sv.size()); DDsvalues_type::const_iterator ted = target.end(); for (; sit != sed; ++sit) { DDsvalues_type::const_iterator it = find(target.begin(),ted, (*sit).first); if (it!=ted) const_cast<DDsvalues_Content_type&>(*it).second = (*sit).second; else target.push_back(*sit); } if (sortit) std::sort(target.begin(),target.end()); }
std::ostream& operator<< | ( | std::ostream & | os, |
const std::vector< const DDsvalues_type * > & | v | ||
) |
std::ostream& operator<< | ( | std::ostream & | os, |
const DDsvalues_type & | s | ||
) |
Definition at line 62 of file DDsvalues.cc.