4 #ifndef PhysicsTools_PatAlgos_PATUserDataMerger_h 5 #define PhysicsTools_PatAlgos_PATUserDataMerger_h 46 template <
typename ObjectType>
48 obj.addUserInt(key, val);
54 template <
typename ObjectType>
56 obj.addUserFloat(key, val);
62 template <
typename ObjectType>
64 obj.addUserDataFromPtr(key, val);
70 template <
typename ObjectType>
72 obj.addUserCand(key, val);
78 template <
typename ObjectType,
typename Operation>
94 std::vector<std::string> labelPostfixesToStrip_,
labels_;
101 template <
typename ObjectType,
typename Operation>
104 : userDataSrc_(iConfig.getParameter<
std::vector<
edm::
InputTag>>(
"src")),
105 labelPostfixesToStrip_(iConfig.existsAs<
std::vector<
std::
string>>(
"labelPostfixesToStrip")
106 ? iConfig.getParameter<
std::vector<
std::
string>>(
"labelPostfixesToStrip")
114 auto match =
tag.label().rfind(stripme);
115 if (
match == (
tag.label().length() - stripme.length())) {
139 template <
class ObjectType,
typename Operation>
143 typename std::vector<edm::EDGetTokenT<typename Operation::product_type>>::const_iterator
147 for (; token_it != token_end; ++token_it) {
161 loader_.addData(patObject, encoded, (*userData)[recoObject]);
165 template <
class ObjectType,
typename Operation>
167 iDesc.
add<std::vector<edm::InputTag>>(
"src");
168 iDesc.
addOptional<std::vector<std::string>>(
"labelPostfixesToStrip", std::vector<std::string>());
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
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
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void addData(ObjectType &obj, const std::string &key, const value_type &val)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::vector< edm::InputTag > userDataSrc_
static void fillDescription(edm::ParameterSetDescription &iDesc)
std::vector< std::string > labels_
void addData(ObjectType &obj, const std::string &key, const value_type &val)
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
edm::Ptr< UserData > value_type
std::vector< std::string > labelPostfixesToStrip_