#include <View.h>
Public Types | |
typedef boost::indirect_iterator < typename seq_t::const_iterator > | const_iterator |
typedef T const * | const_pointer |
typedef T const & | const_reference |
typedef boost::indirect_iterator < typename seq_t::const_reverse_iterator > | const_reverse_iterator |
typedef seq_t::difference_type | difference_type |
typedef T const * | pointer |
typedef T const & | reference |
typedef unsigned int | size_type |
typedef T | value_type |
Public Member Functions | |
const_reference | at (size_type pos) const |
const_reference | back () const |
const_iterator | begin () const |
size_type | capacity () const |
bool | empty () const |
const_iterator | end () const |
const_reference | front () const |
ProductID | id () const |
size_type | max_size () const |
View & | operator= (View const &rhs) |
const_reference | operator[] (size_type pos) const |
void | pop_back () |
void const * | product () const |
EDProductGetter const * | productGetter () const |
Ptr< value_type > | ptrAt (size_type i) const |
PtrVector< T > const & | ptrVector () const |
const_reverse_iterator | rbegin () const |
RefToBase< value_type > | refAt (size_type i) const |
RefToBaseVector< T > const & | refVector () const |
const_reverse_iterator | rend () const |
size_type | size () const |
void | swap (View &other) |
View (std::vector< void const * > const &pointers, helper_vector_ptr const &helpers) | |
View () | |
virtual | ~View () |
Static Public Member Functions | |
static void | fill_from_range (T *first, T *last, View &output) |
Private Types | |
typedef std::vector< T const * > | seq_t |
Private Member Functions | |
ViewBase * | doClone () const |
Private Attributes | |
seq_t | items_ |
PtrVector< T > | ptrs_ |
RefToBaseVector< T > | refs_ |
Class template View<T>
View<T> provides a way to allow reference to the elements (of type T) of some collection in an Event, without knowing about the type of the collection itself. For example, View<int> can refer to the ints in either a vector<int> or a list<int>, without the client code knowing about which type of container manages the ints.
View<T> is not persistable.
View<T> can be used to reference objects of any type that has T as a public base.
Description: Provide access to the collected elements contained by any EDProduct that is a sequence.
typedef boost::indirect_iterator<typename seq_t::const_iterator> edm::View< T >::const_iterator |
typedef T const* edm::View< T >::const_pointer |
typedef T const& edm::View< T >::const_reference |
typedef boost::indirect_iterator<typename seq_t::const_reverse_iterator> edm::View< T >::const_reverse_iterator |
typedef seq_t::difference_type edm::View< T >::difference_type |
edm::View< T >::View | ( | std::vector< void const * > const & | pointers, |
helper_vector_ptr const & | helpers | ||
) |
Definition at line 170 of file View.h.
References compareJSON::const, i, edm::View< T >::items_, AlCaHLTBitMon_ParallelJobs::p, edm::View< T >::ptrs_, edm::View< T >::refs_, and cond::rpcobtemp::temp.
: items_(), refs_(), ptrs_() { size_type numElements = pointers.size(); // If the two input vectors are not of the same size, there is a // logic error in the framework code that called this. // constructor. if(helpers.get() != 0) { assert(numElements == helpers->size()); items_.reserve(numElements); ptrs_.reserve(refs_.size()); for(std::vector<void const*>::size_type i = 0; i < pointers.size(); ++i) { void const* p = pointers[i]; items_.push_back(static_cast<pointer>(p)); if(0!=p) { ptrs_.push_back(Ptr<T>(helpers->id(), static_cast<T const*>(p), helpers->keyForIndex(i))); } else if(helpers->productGetter() != 0) { ptrs_.push_back(Ptr<T>(helpers->id(), helpers->keyForIndex(i), helpers->productGetter())); } else { ptrs_.push_back(Ptr<T>(helpers->id(), 0, helpers->keyForIndex(i))); } } RefToBaseVector<T> temp(helpers); refs_.swap(temp); } }
View< T >::const_reference edm::View< T >::back | ( | ) | const [inline] |
View< T >::const_iterator edm::View< T >::begin | ( | void | ) | const [inline] |
Definition at line 225 of file View.h.
Referenced by TtSemiLepSignalSelMVATrainer::analyze(), RecoMuonValidatorPF::analyze(), RecoMuonValidator::analyze(), TrackAssociatorByHits::associateRecoToSim(), TrackAssociatorByHits::associateSimToReco(), CaloRecoTauDiscriminationByFlightPathSignificance::beginEvent(), pat::TrackerIsolationPt::calculate(), EventShapeVariables::EventShapeVariables(), pat::PATMHTProducer::getElectrons(), pat::PATMHTProducer::getJets(), pat::PATMHTProducer::getMuons(), egammaisolation::EgammaTrackSelector::operator()(), edm::operator==(), TtSemiLepSignalSelMVAComputer::produce(), pat::PATJetProducer::produce(), CandIsolatorFromDeposits::produce(), MuonTrackFinder::reconstruct(), and TtSemiLepSignalSel::TtSemiLepSignalSel().
{ return items_.begin(); }
View< T >::const_iterator edm::View< T >::end | ( | void | ) | const [inline] |
Definition at line 232 of file View.h.
Referenced by CaloSpecificAlgo::addInfo(), TtSemiLepSignalSelMVATrainer::analyze(), RecoMuonValidatorPF::analyze(), RecoMuonValidator::analyze(), TrackAssociatorByHits::associateRecoToSim(), TrackAssociatorByHits::associateSimToReco(), pat::TrackerIsolationPt::calculate(), CaloMETAnalyzer::computeEmHaMET(), EventShapeVariables::EventShapeVariables(), pat::PATMHTProducer::getElectrons(), pat::PATMHTProducer::getJets(), pat::PATMHTProducer::getMuons(), SignCaloSpecificAlgo::makeVectorOutOfCaloTowers(), egammaisolation::EgammaTrackSelector::operator()(), edm::operator==(), TtSemiLepSignalSelMVAComputer::produce(), pat::PATJetProducer::produce(), MuonTrackFinder::reconstruct(), and CaloMETAnalyzer::validateMET().
{ return items_.end(); }
void edm::View< T >::fill_from_range | ( | T * | first, |
T * | last, | ||
View< T > & | output | ||
) | [inline, static] |
Definition at line 338 of file View.h.
References edm::first(), i, edm::View< T >::items_, and prof2calltree::last.
View< T >::const_reference edm::View< T >::front | ( | ) | const [inline] |
Definition at line 303 of file View.h.
Referenced by MuonMETAlgo::MuonMETAlgo_run().
{ return *items_.front(); }
Definition at line 138 of file View.h.
References edm::View< T >::refs_.
{ return refs_.product(); }
EDProductGetter const * edm::View< T >::productGetter | ( | ) | const [inline] |
Definition at line 295 of file View.h.
References edm::RefToBase< T >::get(), edm::RefToBase< T >::id(), edm::RefToBase< T >::isAvailable(), edm::RefToBase< T >::key(), and MultipleCompare::ref.
Referenced by pat::PATJetProducer::produce().
{ RefToBase<T> ref = refAt(i); return Ptr<T>(ref.id(), (ref.isAvailable() ? ref.get(): 0), ref.key()); }
View< T >::const_reverse_iterator edm::View< T >::rbegin | ( | ) | const [inline] |
Definition at line 288 of file View.h.
References i.
Referenced by helper::SimpleJetTrackAssociator::associate(), pat::ElectronSelector::electronID_(), pat::helper::MultiIsolator::fill(), MuonMETAlgo::MuonMETAlgo_run(), CandIsolatorFromDeposits::produce(), edm::GenericSelectorByValueMap< T, C >::produce(), and pat::helper::MultiIsolator::test().
RefToBaseVector<T> const& edm::View< T >::refVector | ( | ) | const [inline] |
View< T >::const_reverse_iterator edm::View< T >::rend | ( | ) | const [inline] |
Definition at line 253 of file View.h.
Referenced by HLTBJet::analyseCorrectedJets(), HLTBJet::analyseJets(), HLTBJet::analyseLifetime(), HLTBJet::analyseLifetimeSingleTrack(), HLTBJet::analysePerformance(), ValidationMisalignedTracker::analyze(), RecoMuonValidatorPF::analyze(), TrackingMonitor::analyze(), RecoMuonValidator::analyze(), HLTHiggsTruth::analyzeA2mu(), HLTHiggsTruth::analyzeH2tau(), HLTHiggsTruth::analyzeHtaunu(), helper::SimpleJetTrackAssociator::associate(), CandCombinerBase< OutputCollection, CandPtr >::combine(), EventShapeVariables::EventShapeVariables(), PatBTagCommonHistos::Fill(), CSCEfficiency::filter(), PrimaryVertexAnalyzer4PU::getSimEvents(), MuonMETAlgo::MuonMETAlgo_run(), edm::operator==(), PatJetAnalyzer::print(), pat::PATJetProducer::produce(), edm::GenericSelectorByValueMap< T, C >::produce(), BeamFitter::readEvent(), and pat::CandidateSummaryTable::Record::update().
{ return items_.size(); }
Definition at line 208 of file View.h.
References edm::View< T >::items_, edm::View< T >::ptrs_, edm::View< T >::refs_, and edm::ViewBase::swap().
Referenced by edm::swap().
{ this->ViewBase::swap(other); items_.swap(other.items_); refs_.swap(other.refs_); ptrs_.swap(other.ptrs_); }
Definition at line 143 of file View.h.
Referenced by edm::View< T >::fill_from_range(), edm::View< T >::swap(), and edm::View< T >::View().
Definition at line 145 of file View.h.
Referenced by edm::View< T >::ptrVector(), edm::View< T >::swap(), and edm::View< T >::View().
RefToBaseVector<T> edm::View< T >::refs_ [private] |
Definition at line 144 of file View.h.
Referenced by edm::View< T >::product(), edm::View< T >::refVector(), edm::View< T >::swap(), and edm::View< T >::View().