Assimilates pat::UserData into pat objects. More...
#include <PhysicsTools/PatAlgos/interface/PATUserDataMerger.h>
Public Member Functions | |
void | add (ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup) |
PATUserDataMerger (const edm::ParameterSet &iConfig) | |
PATUserDataMerger () | |
~PATUserDataMerger () | |
Static Public Member Functions | |
static void | fillDescription (edm::ParameterSetDescription &iDesc) |
Private Attributes | |
Operation | loader_ |
std::vector< edm::InputTag > | userDataSrc_ |
Assimilates pat::UserData into pat objects.
This expects one input: src: The data to add to the objects that get passed to this object, which are ValueMaps to some type (like UserData or double).
This will be called from PATUserDataHelper to handle the templated cases like UserData or double. PATUserDataHelper will then add all the instantiated cases.
Definition at line 73 of file PATUserDataMerger.h.
pat::PATUserDataMerger< ObjectType, Operation >::PATUserDataMerger | ( | ) | [inline] |
Definition at line 77 of file PATUserDataMerger.h.
{}
pat::PATUserDataMerger< ObjectType, Operation >::PATUserDataMerger | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 99 of file PATUserDataMerger.h.
: userDataSrc_(iConfig.getParameter<std::vector<edm::InputTag> >("src") ) { }
pat::PATUserDataMerger< ObjectType, Operation >::~PATUserDataMerger | ( | ) | [inline] |
Definition at line 79 of file PATUserDataMerger.h.
{}
void pat::PATUserDataMerger< ObjectType, Operation >::add | ( | ObjectType & | patObject, |
edm::Event const & | iEvent, | ||
edm::EventSetup const & | iSetup | ||
) |
Definition at line 123 of file PATUserDataMerger.h.
References edm::Event::getByLabel(), and edm::Ptr< T >::id().
{ std::vector<edm::InputTag>::const_iterator input_it = userDataSrc_.begin(), input_begin = userDataSrc_.begin(), input_end = userDataSrc_.end(); for ( ; input_it != input_end; ++input_it ) { // Declare the object handles: // ValueMap containing the values, or edm::Ptr's to the UserData that // is associated to those PAT Objects edm::Handle<typename Operation::product_type> userData; // Get the objects by label if ( input_it->encode().size() == 0 ) continue; iEvent.getByLabel( *input_it, userData ); edm::Ptr<reco::Candidate> recoObject = patObject.originalObjectRef(); if ( userData->contains( recoObject.id() ) ) { loader_.addData( patObject, input_it->encode(), (*userData)[recoObject]); } } }
void pat::PATUserDataMerger< ObjectType, Operation >::fillDescription | ( | edm::ParameterSetDescription & | iDesc | ) | [static] |
Definition at line 154 of file PATUserDataMerger.h.
References edm::ParameterSetDescription::add().
{ iDesc.add<std::vector<edm::InputTag> >("src"); }
Operation pat::PATUserDataMerger< ObjectType, Operation >::loader_ [private] |
Definition at line 91 of file PATUserDataMerger.h.
std::vector<edm::InputTag> pat::PATUserDataMerger< ObjectType, Operation >::userDataSrc_ [private] |
Definition at line 90 of file PATUserDataMerger.h.