CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes

edm::helper::Filler< Map > Class Template Reference

#include <ValueMap.h>

List of all members.

Public Member Functions

void add (const Map &map)
void fill ()
 Filler (Map &map)
template<typename H , typename I >
void insert (const H &h, I begin, I end)

Protected Attributes

Map & map_

Private Types

typedef Map::id_offset_vector id_offset_vector
typedef std::vector< size_t > index_vector
typedef Map::offset offset
typedef std::map< ProductID,
value_vector
value_map
typedef std::vector< typename
Map::value_type > 
value_vector

Private Member Functions

void throwAdd () const
void throwFillID (ProductID id) const
void throwFillSize () const

Private Attributes

value_map values_

Detailed Description

template<typename Map>
class edm::helper::Filler< Map >

Definition at line 22 of file ValueMap.h.


Member Typedef Documentation

template<typename Map>
typedef Map::id_offset_vector edm::helper::Filler< Map >::id_offset_vector [private]

Definition at line 28 of file ValueMap.h.

template<typename Map>
typedef std::vector<size_t> edm::helper::Filler< Map >::index_vector [private]

Definition at line 24 of file ValueMap.h.

template<typename Map>
typedef Map::offset edm::helper::Filler< Map >::offset [private]

Definition at line 27 of file ValueMap.h.

template<typename Map>
typedef std::map<ProductID, value_vector> edm::helper::Filler< Map >::value_map [private]

Definition at line 26 of file ValueMap.h.

template<typename Map>
typedef std::vector<typename Map::value_type> edm::helper::Filler< Map >::value_vector [private]

Definition at line 25 of file ValueMap.h.


Constructor & Destructor Documentation

template<typename Map>
edm::helper::Filler< Map >::Filler ( Map &  map) [inline, explicit]

Reimplemented in edm::Association< C >::Filler.

Definition at line 30 of file ValueMap.h.

                                 : 
        map_(map) { 
        add(map);
      }

Member Function Documentation

template<typename Map>
void edm::helper::Filler< Map >::add ( const Map &  map) [inline]

Reimplemented in edm::Association< C >::Filler.

Definition at line 34 of file ValueMap.h.

Referenced by edm::ValueMap< reco::MuonMETCorrectionData >::add(), and edm::helper::Filler< Association< C > >::Filler().

                                {
        if (map.empty()) return;
        typename id_offset_vector::const_iterator j = map.ids_.begin();
        const typename id_offset_vector::const_iterator end = map.ids_.end();
        size_t i = 0;
        const size_t size = map.values_.size();
        std::pair<ProductID, offset> id = *j;
        do {
          ProductID id = j->first;
          ++j;
          size_t max = (j == end ? size : j->second);
          typename value_map::iterator f = values_.find(id);
          if(f!=values_.end()) throwAdd();
          value_vector & values = values_.insert(std::make_pair(id, value_vector())).first->second;
          while(i!=max)
            values.push_back( map.values_[i++] );
        } while(j != end);
      }
template<typename Map>
void edm::helper::Filler< Map >::fill ( void  ) [inline]

Definition at line 62 of file ValueMap.h.

Referenced by edm::Association< C >::add(), edm::ValueMap< reco::MuonMETCorrectionData >::add(), HLTMuonIsoFilter::filter(), CosmicsMuonIdProducer::produce(), pat::JetCorrFactorsProducer::produce(), MCTrackMatcher::produce(), DeDxEstimatorProducer::produce(), IsolationProducerForTracks::produce(), pat::PATVertexAssociationProducer::produce(), MuonIdProducer::produce(), L2MuonIsolationProducer::produce(), SoftElectronCandProducer::produce(), GoodSeedProducer::produce(), reco::PhysObjectMatcher< C1, C2, S, D, Q >::produce(), AssociationVector2ValueMap< KeyRefProd, CVal >::produce(), cms::MuonMETValueMapProducer::produce(), EgammaPhotonTkIsolationProducer::produce(), L3MuonIsolationProducer::produce(), CandIsoDepositProducer::produce(), EgammaElectronTkIsolationProducer::produce(), GlobalTrackQualityProducer::produce(), AlignmentPrescaler::produce(), GenTrackMatcher::produce(), reco::modulesNew::Matcher< C1, C2, S, D >::produce(), CandIsolatorFromDeposits::produce(), MuIsoDepositProducer::produce(), AssociationMapOneToOne2Association< CKey, CVal >::produce(), ProduceIsolationMap::produce(), TkAlCaOverlapTagger::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), CastorJetIDProducer::produce(), RecoTauJetRegionProducer::produce(), PFElectronTranslator::produce(), MuonSelectionTypeValueMapProducer::produce(), cms::MuonTCMETValueMapProducer::produce(), ElectronIDExternalProducer< algo >::produce(), pat::PATTriggerEventProducer::produce(), EgammaElectronTkNumIsolationProducer::produce(), JetIDProducer::produce(), MuonTimingProducer::produce(), EgammaPhotonTkNumIsolationProducer::produce(), TrackProducerWithSCAssociation::produce(), EnergyLossProducer::produce(), EgammaEcalRecHitIsolationProducer::produce(), PhotonIDProducer::produce(), DeDxEstimatorProducerPixelTripplet::produce(), DeDxDiscriminatorProducer::produce(), MuonShowerInformationProducer::produce(), EgammaTowerIsolationProducer::produce(), ConversionTrackCandidateProducer::produce(), and MuIsolatorResultProducer< BT >::writeOutImpl().

                  {
        map_.clear();
        offset off = 0;
        for(typename value_map::const_iterator i = values_.begin(); i != values_.end(); ++i) {
          ProductID id = i->first;
          map_.ids_.push_back(std::make_pair(id, off));
          const value_vector & values = i->second;
          for(typename value_vector::const_iterator j = values.begin(); j != values.end(); ++j) {
            map_.values_.push_back( *j );
            ++off;
          }
        }
      }
template<typename Map>
template<typename H , typename I >
void edm::helper::Filler< Map >::insert ( const H &  h,
begin,
end 
) [inline]

Definition at line 53 of file ValueMap.h.

Referenced by EcalHaloAlgo::Calculate(), PFElectronTranslator::fillMVAValueMap(), GoodSeedProducer::fillPreIdRefValueMap(), PFElectronTranslator::fillSCRefValueMap(), GsfElectronLinker::fillValueMap(), HLTMuonIsoFilter::filter(), pat::JetCorrFactorsProducer::produce(), CosmicsMuonIdProducer::produce(), MCTrackMatcher::produce(), DeDxEstimatorProducer::produce(), pat::PATVertexAssociationProducer::produce(), IsolationProducerForTracks::produce(), SoftElectronCandProducer::produce(), L2MuonIsolationProducer::produce(), MuonIdProducer::produce(), AssociationVector2ValueMap< KeyRefProd, CVal >::produce(), reco::PhysObjectMatcher< C1, C2, S, D, Q >::produce(), EgammaPhotonTkIsolationProducer::produce(), cms::MuonMETValueMapProducer::produce(), EgammaElectronTkIsolationProducer::produce(), CandIsoDepositProducer::produce(), L3MuonIsolationProducer::produce(), AlignmentPrescaler::produce(), GlobalTrackQualityProducer::produce(), GenTrackMatcher::produce(), CandIsolatorFromDeposits::produce(), reco::modulesNew::Matcher< C1, C2, S, D >::produce(), AssociationMapOneToOne2Association< CKey, CVal >::produce(), MuIsoDepositProducer::produce(), ProduceIsolationMap::produce(), CastorJetIDProducer::produce(), reco::modulesNew::MCTruthCompositeMatcher::produce(), TkAlCaOverlapTagger::produce(), ElectronIDExternalProducer< algo >::produce(), cms::MuonTCMETValueMapProducer::produce(), MuonSelectionTypeValueMapProducer::produce(), RecoTauJetRegionProducer::produce(), JetIDProducer::produce(), EgammaElectronTkNumIsolationProducer::produce(), pat::PATTriggerEventProducer::produce(), TrackProducerWithSCAssociation::produce(), EgammaPhotonTkNumIsolationProducer::produce(), MuonTimingProducer::produce(), PhotonIDProducer::produce(), EgammaEcalRecHitIsolationProducer::produce(), EnergyLossProducer::produce(), MuonShowerInformationProducer::produce(), DeDxDiscriminatorProducer::produce(), DeDxEstimatorProducerPixelTripplet::produce(), ConversionTrackCandidateProducer::produce(), EgammaTowerIsolationProducer::produce(), and MuIsolatorResultProducer< BT >::writeOutImpl().

                                               {
        ProductID id = h.id();
        size_t size = h->size(), sizeIt = end - begin;
        if(sizeIt!=size) throwFillSize();
        typename value_map::const_iterator f = values_.find(id);
        if(f != values_.end()) throwFillID(id);
        value_vector & values = values_.insert(make_pair(id, value_vector(size))).first->second;
        std::copy(begin, end, values.begin());
      }
template<typename Map>
void edm::helper::Filler< Map >::throwAdd ( ) const [inline, private]

Definition at line 91 of file ValueMap.h.

Referenced by edm::helper::Filler< Association< C > >::add().

                            {
        Exception::throwThis(errors::InvalidReference,
          "ValueMap: trying to add entries for an already existing product\n");
      }
template<typename Map>
void edm::helper::Filler< Map >::throwFillID ( ProductID  id) const [inline, private]

Definition at line 86 of file ValueMap.h.

Referenced by edm::helper::Filler< Association< C > >::insert().

                                           {
        Exception e(errors::InvalidReference);
        e << "index map has already been filled for id: " << id << "\n";
        e.raise();
      }
template<typename Map>
void edm::helper::Filler< Map >::throwFillSize ( ) const [inline, private]

Definition at line 81 of file ValueMap.h.

Referenced by edm::helper::Filler< Association< C > >::insert().

                                 {
        Exception::throwThis(errors::InvalidReference,
          "ValueMap::Filler: handle and reference "
          "collections should the same size\n");        
      }

Member Data Documentation

template<typename Map>
Map& edm::helper::Filler< Map >::map_ [protected]

Definition at line 77 of file ValueMap.h.

Referenced by edm::helper::Filler< Association< C > >::fill().

template<typename Map>
value_map edm::helper::Filler< Map >::values_ [private]