4 #ifndef PhysicsTools_PatAlgos_PATUserDataMerger_h
5 #define PhysicsTools_PatAlgos_PATUserDataMerger_h
47 template<
typename ObjectType>
53 template<
typename ObjectType>
59 template<
typename ObjectType>
61 obj.addUserDataFromPtr(key, val);
67 template<
typename ObjectType>
73 template<
typename ObjectType,
typename Operation>
100 template<
typename ObjectType,
typename Operation>
102 userDataSrc_(iConfig.getParameter<std::vector<edm::InputTag> >(
"src"))
104 for ( std::vector<edm::InputTag>::const_iterator input_it =
userDataSrc_.begin(); input_it !=
userDataSrc_.end(); ++input_it ) {
126 template<
class ObjectType,
typename Operation>
133 typename std::vector<edm::EDGetTokenT<typename Operation::product_type> >::const_iterator token_begin = userDataSrcTokens_.begin(), token_it = userDataSrcTokens_.begin(), token_end = userDataSrcTokens_.end();
135 for ( ; token_it != token_end; ++token_it ) {
136 const std::string encoded( userDataSrc_.at(token_it - token_begin).encode() );
144 if ( encoded.size() == 0 )
continue;
148 if ( userData->contains( recoObject.
id() ) ) {
149 loader_.addData( patObject, encoded, (*userData)[recoObject]);
156 template<
class ObjectType,
typename Operation>
160 iDesc.
add<std::vector<edm::InputTag> >(
"src");
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ValueMap< value_type > product_type
std::vector< edm::EDGetTokenT< typename Operation::product_type > > userDataSrcTokens_
Assimilates pat::UserData into pat objects.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
reco::CandidatePtr value_type
void addData(ObjectType &obj, const std::string &key, const value_type &val)
edm::ValueMap< value_type > product_type
edm::ValueMap< value_type > product_type
void addData(ObjectType &obj, const std::string &key, const value_type &val)
edm::ValueMap< value_type > product_type
ProductID id() const
Accessor for product ID.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void addData(ObjectType &obj, const std::string &key, const value_type &val)
std::vector< edm::InputTag > userDataSrc_
static void fillDescription(edm::ParameterSetDescription &iDesc)
void addData(ObjectType &obj, const std::string &key, const value_type &val)
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
edm::Ptr< UserData > value_type