#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 () |
const void * | product () const |
EDProductGetter const * | productGetter () const |
Ptr< value_type > | ptrAt (size_type i) const |
const PtrVector< T > & | ptrVector () const |
const_reverse_iterator | rbegin () const |
RefToBase< value_type > | refAt (size_type i) const |
const RefToBaseVector< T > & | 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 |
typedef T edm::View< T >::value_type |
edm::View< T >::View | ( | std::vector< void const * > const & | pointers, |
helper_vector_ptr const & | helpers | ||
) |
Definition at line 176 of file View.h.
References i, edm::View< T >::items_, L1TEmulatorMonitor_cff::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<const T*> (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 >::at | ( | size_type | pos | ) | const [inline] |
View< T >::const_reference edm::View< T >::back | ( | ) | const [inline] |
View< T >::const_iterator edm::View< T >::begin | ( | void | ) | const [inline] |
Definition at line 233 of file View.h.
Referenced by TtSemiLepSignalSelMVATrainer::analyze(), RecoMuonValidator::analyze(), TrackAssociatorByHits::associateRecoToSim(), TrackAssociatorByHits::associateSimToReco(), CaloRecoTauDiscriminationByFlightPathSignificance::beginEvent(), PFRecoTauDiscriminationByFlightPathSignificance::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(); }
bool edm::View< T >::empty | ( | ) | const [inline] |
View< T >::const_iterator edm::View< T >::end | ( | void | ) | const [inline] |
Definition at line 241 of file View.h.
Referenced by CaloSpecificAlgo::addInfo(), TtSemiLepSignalSelMVATrainer::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 360 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 322 of file View.h.
Referenced by MuonMETAlgo::MuonMETAlgo_run().
{ return *items_.front(); }
Definition at line 377 of file View.h.
References edm::swap(), and cond::rpcobtemp::temp.
View< T >::const_reference edm::View< T >::operator[] | ( | size_type | pos | ) | const [inline] |
void edm::View< T >::pop_back | ( | ) | [inline] |
const void* edm::View< T >::product | ( | ) | const [inline] |
Definition at line 144 of file View.h.
References edm::View< T >::refs_.
{ return refs_.product(); }
EDProductGetter const * edm::View< T >::productGetter | ( | ) | const [inline] |
Definition at line 313 of file View.h.
References edm::RefToBase< T >::get(), edm::RefToBase< T >::id(), edm::RefToBase< T >::isAvailable(), and edm::RefToBase< T >::key().
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 305 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().
const RefToBaseVector<T>& edm::View< T >::refVector | ( | ) | const [inline] |
View< T >::const_reverse_iterator edm::View< T >::rend | ( | ) | const [inline] |
Definition at line 265 of file View.h.
Referenced by HLTBJet::analyseCorrectedJets(), HLTBJet::analyseJets(), HLTBJet::analyseLifetime(), HLTBJet::analysePerformance(), HLTBJet::analyseSoftmuon(), ValidationMisalignedTracker::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 214 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 149 of file View.h.
Referenced by edm::View< T >::fill_from_range(), edm::View< T >::swap(), and edm::View< T >::View().
Definition at line 151 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 150 of file View.h.
Referenced by edm::View< T >::product(), edm::View< T >::refVector(), edm::View< T >::swap(), and edm::View< T >::View().