CMS 3D CMS Logo

DDsvalues.cc File Reference

#include "DetectorDescription/Core/interface/DDsvalues.h"
#include <iostream>

Go to the source code of this file.

Functions

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 *).
bool DDfetch (const DDsvalues_type *p, DDValue &v)
 Example:.
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)


Function Documentation

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 count, DDfetch(), and it.

00115 {
00116    unsigned int count = 0;
00117    std::vector<const DDsvalues_type *>::const_iterator it(sp.begin()), ed(sp.end());
00118    for (; it != ed; ++it) {
00119      if (DDfetch(*it, toFetch)) {
00120        result.push_back(toFetch);
00121        ++count;
00122      }
00123    }    
00124    return count;
00125 }

bool DDfetch ( const DDsvalues_type p,
DDValue v 
)

Example:.

helper for retrieving DDValues from DDsvalues_type *.

   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 find(), it, and HLT_VtxMuL3::result.

Referenced by DDMapper< KeyType, ValueType >::all(), RPCGeometryBuilderFromDDD::buildGeometry(), DTGeometryBuilderFromDDD::buildGeometry(), dddGetStringRaw(), DDfetch(), HFShowerLibrary::getDDDArray(), MaterialBudgetHcalHistos::getDDDArray(), HCalSD::getDDDArray(), HFFibre::getDDDArray(), HFShowerPMT::getDDDArray(), HcalNumberingFromDDD::getDDDArray(), HFShowerParam::getDDDArray(), DDG4Builder::getDouble(), getDouble(), DDG4Builder::getInt(), MuonDDDNumbering::getInt(), CaloTrkProcessing::getNames(), CaloTrkProcessing::getNumbers(), DDG4SensitiveConverter::getString(), getString(), ExtractStringFromDDD::getString(), CocoaAnalyzer::myFetchDbl(), CocoaAnalyzer::myFetchString(), DDMapper< KeyType, ValueType >::noSpecifics(), DDMapper< KeyType, ValueType >::toDouble(), DDMapper< KeyType, ValueType >::toString(), and MagGeoBuilderFromDDD::volumeHandle::volumeHandle().

00103 {
00104   bool result = false;
00105   DDsvalues_type::const_iterator it = find(*p, v);
00106   if (it != p->end()) {
00107     result = true;
00108     v = it->second;
00109   }
00110   return result;
00111 }

void merge ( DDsvalues_type target,
DDsvalues_type const &  sv,
bool  sortit 
)

Definition at line 21 of file DDsvalues.cc.

References counter(), find(), it, and python::multivaluedict::sort().

Referenced by MixingModule::doPileUp(), edm::DataMixingModule::doPileUp(), DDI::LogicalPart::mergedSpecificsV(), and DDExpandedView::mergedSpecificsV().

00021                                                                                         {
00022   static Counter counter = {0,0,0,0,0};
00023   if (target.empty()) {
00024     ++counter.empty;
00025     target = sv; 
00026     return;
00027   }
00028   DDsvalues_type::const_iterator sit = sv.begin();
00029   DDsvalues_type::const_iterator sed = sv.end();
00030   // fast merge
00031   if (target.back()<sv.front()) {
00032     ++counter.end;
00033     target.insert(target.end(),sit,sed);
00034     return;
00035   }
00036   if (sv.back()<target.front()) {
00037     ++counter.begin;
00038     target.insert(target.begin(),sit,sed);
00039     return;
00040   }
00041   {
00042     DDsvalues_type::iterator it = std::lower_bound(target.begin(),target.end(),sv.front()); 
00043     if (it == std::lower_bound(target.begin(),target.end(),sv.back())) {
00044       ++counter.middle; 
00045       target.insert(it,sit,sed);
00046       return;
00047     }
00048   }
00049   // it nevers arrives here...
00050   ++counter.mixed;
00051   target.reserve(target.size()+sv.size());
00052   DDsvalues_type::const_iterator ted = target.end();
00053   for (; sit != sed; ++sit) {
00054     DDsvalues_type::const_iterator it = find(target.begin(),ted, (*sit).first);
00055     if (it!=ted) const_cast<DDsvalues_Content_type&>(*it).second = (*sit).second;
00056     else target.push_back(*sit);
00057   }
00058   if (sortit) std::sort(target.begin(),target.end());
00059 }

std::ostream& operator<< ( std::ostream &  os,
const std::vector< const DDsvalues_type * > &  v 
)

Definition at line 79 of file DDsvalues.cc.

References i, and v.

00080 {
00081    for (unsigned int i=0; i<v.size() ; ++i) {
00082      os << *(v[i]); // << std::endl;
00083    }
00084    
00085    return os;
00086 }

std::ostream& operator<< ( std::ostream &  os,
const DDsvalues_type s 
)

Definition at line 62 of file DDsvalues.cc.

References it.

00063 {
00064   DDsvalues_type::const_iterator it = s.begin();
00065   for(; it != s.end(); ++it)  {
00066     os << it->second; 
00067     /*
00068     os << DDValue(it->first).name() << " = ";
00069     for (unsigned int i=0; i<it->second.size(); ++i) {
00070        os << it->second[i] << ' ';
00071     }    
00072     os << std::endl;
00073     */
00074   }  
00075   return os;
00076 }


Variable Documentation

int begin

Definition at line 8 of file DDsvalues.cc.

int empty

Definition at line 7 of file DDsvalues.cc.

Referenced by LASAlignmentParameterCollection::add(), DigiCollectionFP420::add(), LASBeamProfileFitCollection::add(), IgFileManager::addPaths(), MonitorElementsDb::analyze(), L1MuDTSectorProcessor::anyTrack(), L1MuGMTMipIsoAU::assignISO(), L1MuGMTMipIsoAU::assignMIP(), TrackAssociatorBase::associateRecoToSim(), TrackAssociatorBase::associateSimToReco(), IgPluginFactoryImplTypes< R *(T1, T2)>::Info::attach(), IgModule::attach(), IgPluginFactoryImplTypes< R *(T1, T2, T3, T4)>::Info::attach(), IgPluginFactoryImplTypes< R *(T1)>::Info::attach(), IgPluginFactoryImplTypes< R *(void)>::Info::attach(), IgPluginFactoryImplTypes< R *(T1, T2, T3)>::Info::attach(), EcalHitMaker::buildGeometry(), L1MuDTChambPhContainer::bxEmpty(), L1MuDTChambThContainer::bxEmpty(), L1MuDTTrackContainer::bxEmpty(), IgModule::capabilityEntryPoint(), edm::checkAllDictionaries(), statemachine::FirstLumi::checkInvariant(), statemachine::HandleEvent::checkInvariant(), pat::JetCorrFactorsProducer::configure(), SiStripFedCabling::connection(), SiStripFedCabling::connections(), GlobalMuonTrackMatcher::convertToTSOSMuHit(), GlobalMuonTrackMatcher::convertToTSOSTk(), GlobalMuonTrackMatcher::convertToTSOSTkHit(), IgPluginFactoryImplTypes< R *(T1, T2, T3, T4)>::Info::create(), IgPluginFactoryImplTypes< R *(T1, T2, T3)>::Info::create(), IgPluginFactoryImplTypes< R *(T1, T2)>::Info::create(), IgPluginFactoryImplTypes< R *(void)>::Info::create(), IgPluginFactoryImplTypes< R *(T1)>::Info::create(), CommissioningHistograms::createSummaryHisto(), Numbers::crystals(), IgModule::detach(), IgPluginFactoryImplTypes< R *(void)>::Info::detach(), IgPluginFactoryImplTypes< R *(T1, T2, T3)>::Info::detach(), IgPluginFactoryImplTypes< R *(T1, T2, T3, T4)>::Info::detach(), IgPluginFactoryImplTypes< R *(T1)>::Info::detach(), IgPluginFactoryImplTypes< R *(T1, T2)>::Info::detach(), edm::PoolOutputModule::doOpenFile(), ProvenanceDumper::dumpParameterSetForID_(), SiStripRawToDigiUnpacker::dumpRawData(), edm::Association< C >::empty(), DDTIBLayerAlgo_MTCC::execute(), DDTIBRadCableAlgo_MTCC::execute(), IgPluginFactoryImplTypes< R *(T1, T2, T3, T4)>::Info::factory(), IgPluginFactoryImplTypes< R *(T1, T2)>::Info::factory(), IgPluginFactoryImplTypes< R *(T1)>::Info::factory(), IgPluginFactoryImplTypes< R *(T1, T2, T3)>::Info::factory(), IgPluginFactoryImplTypes< R *(void)>::Info::factory(), pfpat::fetchCollection(), reco::findMethod(), KFFittingSmoother::fit(), ApvTimingAnalysis::foundTickMark(), ApvTimingAnalysis::frameFindingThreshold(), MuonDigiCollection< IndexType, DigiType >::get(), ComCodes::getCodeName(), TrigCodes::TrigBitSetMap::getCodeName(), QTestParameterNames::getTestParamNames(), NoiseHistograms::histoAnalysis(), ApvTimingHistograms::histoAnalysis(), OptoScanHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), VpspScanHistograms::histoAnalysis(), FastFedCablingHistograms::histoAnalysis(), Ig3DShapeManager::Ig3DShapeManager(), IgServerPool::IgServerPool(), edm::BranchDescription::init(), MillePedeAlignmentAlgorithm::initialize(), MatacqTBDataFormatter::interpretRawData(), OptoScanAnalysis::isValid(), PedsOnlyAnalysis::isValid(), ApvTimingAnalysis::isValid(), NoiseAnalysis::isValid(), PedestalsAnalysis::isValid(), FastFedCablingAnalysis::isValid(), VpspScanAnalysis::isValid(), edm::loadCap(), L1MuGMTMatcher::lookup_mq(), edm::ServiceManager::manageInitMsg(), IgModule::moduleEntryPoint(), SequentialCombinationGenerator< T >::next_combi(), SequentialCombinationGenerator< T >::next_combination(), SequentialPartitionGenerator::next_partition(), SequentialCombinationGenerator< T >::next_subset(), HcalTBObjectUnpacker::parseCalib(), IO::ParseFile(), pftools::IO::ParseFile(), edm::PoolSource::PoolSource(), PedestalsAnalysis::print(), SiStripFedCabling::print(), VpspScanAnalysis::print(), csc::L1Track::Print(), FastFedCablingAnalysis::print(), NoiseAnalysis::print(), edm::pset::VPSetNode::print(), ApvTimingAnalysis::print(), FedCablingAnalysis::print(), OptoScanAnalysis::print(), PedsOnlyAnalysis::print(), TrackerOnlyConversionProducer::produce(), edm::BranchDescription::psetID(), IgModule::query(), RPCPackingModule::rawData(), edmplugin::CacheParser::read(), edm::PoolSource::readEvent_(), edm::PoolSource::readLuminosityBlock_(), PFResolutionMap::ReadMapFile(), edm::PoolSource::readRun_(), PFAlgo::reconstructParticles(), edm::ProducerBase::registerProducts(), edm::InputSource::registerProducts(), RPCFileReader::rpcDataFormatter(), RoadSearchCloudMakerAlgorithm::run(), L1MuDTEtaProcessor::runEtaTrackFinder(), splitString(), HcalQIEManager::splitString(), SiStripFedCabling::summary(), MillePedeAlignmentAlgorithm::terminate(), SiStripFedCabling::terse(), and JetTagComputer::uses().

int end

Definition at line 9 of file DDsvalues.cc.

int middle

Definition at line 10 of file DDsvalues.cc.

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), BeamHaloNavigationSchool::BeamHaloNavigationSchool(), CosmicNavigationSchool::build(), MuonCkfTrajectoryBuilder::collectMeasurement(), LHEAnalyzer::fillDJRSched(), CkfTrajectoryBuilder::findCompatibleMeasurements(), HICSimpleNavigationSchool::HICSimpleNavigationSchool(), MSLayersKeeperX0DetLayer::init(), RoadSearchTrackCandidateMakerAlgorithm::initialTrajectoryFromTriplet(), GlobalCosmicMuonTrajectoryBuilder::isTraversing(), SeedFromGenericPairOrTriplet::seedFromTriplet(), SimpleCosmicBONSeeder::seeds(), SeedGeneratorForCosmics::seeds(), SimpleBarrelNavigableLayer::setInwardLinks(), SimpleNavigationSchool::SimpleNavigationSchool(), GlobalCosmicMuonTrajectoryBuilder::sortHits(), SymmetricLayerFinder::SymmetricLayerFinder(), FP420Test::update(), BscTest::update(), and SimpleNavigableLayer::wellInside().

int mixed

Definition at line 11 of file DDsvalues.cc.


Generated on Tue Jun 9 17:52:37 2009 for CMSSW by  doxygen 1.5.4