|
|
Go to the documentation of this file.
23 template <
typename ObjectType>
44 unsigned int n = ptrs.size();
48 for (
unsigned int i = 0;
i <
n; ++
i) {
49 adder.addData(
out[
i], pair.first, (*
handle)[ptrs[
i]]);
55 std::vector<std::pair<std::string, edm::EDGetTokenT<typename A::product_type>>>
labelsAndTokens_;
64 userFloats_(iConfig,
"userFloats", consumesCollector()),
65 userInts_(iConfig,
"userInts", consumesCollector()),
67 userCands_(iConfig,
"userCands", consumesCollector()) {
68 produces<std::vector<T>>();
78 for (
const std::string &what : {
"userFloats",
"userInts",
"userIntFromBools",
"userCands"}) {
84 descriptions.
add(
"muonsWithUserData", desc);
86 descriptions.
add(
"electronsWithUserData", desc);
88 descriptions.
add(
"photonsWithUserData", desc);
90 descriptions.
add(
"tausWithUserData", desc);
92 descriptions.
add(
"jetsWithUserData", desc);
106 template <
typename T>
111 std::unique_ptr<std::vector<T>>
out(
new std::vector<T>());
112 out->reserve(
src->size());
114 std::vector<edm::Ptr<T>> ptrs;
115 ptrs.reserve(
src->size());
116 for (
unsigned int i = 0,
n =
src->size();
i <
n; ++
i) {
119 ptrs.push_back(
src->ptrAt(
i));
123 userIntFromBools_.addData(
iEvent, ptrs, *
out);
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
~PATObjectUserDataEmbedder() override
pat::PATObjectUserDataEmbedder< pat::Photon > PATPhotonUserDataEmbedder
pat::PATObjectUserDataEmbedder< pat::Tau > PATTauUserDataEmbedder
Analysis-level tau class.
Analysis-level Photon class.
PATObjectUserDataEmbedder(const edm::ParameterSet &iConfig)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
ParameterWildcardBase * addWildcard(U const &pattern)
edm::EDGetTokenT< edm::View< T > > src_
Analysis-level calorimeter jet class.
edm::ValueMap< value_type > product_type
#define DEFINE_FWK_MODULE(type)
std::vector< std::pair< std::string, edm::EDGetTokenT< typename A::product_type > > > labelsAndTokens_
NamedUserDataLoader(const edm::ParameterSet &iConfig, const std::string &main, edm::ConsumesCollector &&cc)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
helper::NamedUserDataLoader< pat::helper::AddUserInt > userInts_
void addData(const edm::Event &iEvent, const std::vector< edm::Ptr< T >> &ptrs, std::vector< T > &out) const
pat::PATObjectUserDataEmbedder< pat::Jet > PATJetUserDataEmbedder
helper::NamedUserDataLoader< pat::helper::AddUserCand > userCands_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
pat::PATObjectUserDataEmbedder< pat::Muon > PATMuonUserDataEmbedder
void addData(ObjectType &obj, const std::string &key, const value_type &val)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
helper::NamedUserDataLoader< pat::helper::AddUserIntFromBool > userIntFromBools_
Analysis-level electron class.
helper::NamedUserDataLoader< pat::helper::AddUserFloat > userFloats_
pat::PATObjectUserDataEmbedder< pat::Electron > PATElectronUserDataEmbedder