45 produces<edm::ValueMap<float> >(
"puppiMultiplicity");
46 produces<edm::ValueMap<float> >(
"neutralPuppiMultiplicity");
47 produces<edm::ValueMap<float> >(
"neutralHadronPuppiMultiplicity");
48 produces<edm::ValueMap<float> >(
"photonPuppiMultiplicity");
49 produces<edm::ValueMap<float> >(
"HFHadronPuppiMultiplicity");
50 produces<edm::ValueMap<float> >(
"HFEMPuppiMultiplicity");
58 std::vector<float> puppiMultiplicities;
59 std::vector<float> neutralPuppiMultiplicities;
60 std::vector<float> neutralHadronPuppiMultiplicities;
61 std::vector<float> photonPuppiMultiplicities;
62 std::vector<float> HFHadronPuppiMultiplicities;
63 std::vector<float> HFEMPuppiMultiplicities;
65 for(
auto const&
c : *jets ) {
66 float puppiMultiplicity = 0;
67 float neutralPuppiMultiplicity = 0;
68 float neutralHadronPuppiMultiplicity = 0;
69 float photonPuppiMultiplicity = 0;
70 float HFHadronPuppiMultiplicity = 0;
71 float HFEMPuppiMultiplicity = 0;
73 for (
unsigned i = 0;
i <
c.numberOfDaughters();
i++) {
76 puppiMultiplicity +=
weight;
80 neutralHadronPuppiMultiplicity +=
weight;
81 neutralPuppiMultiplicity +=
weight;
84 photonPuppiMultiplicity +=
weight;
85 neutralPuppiMultiplicity +=
weight;
88 HFHadronPuppiMultiplicity +=
weight;
89 neutralPuppiMultiplicity +=
weight;
92 HFEMPuppiMultiplicity +=
weight;
93 neutralPuppiMultiplicity +=
weight;
98 puppiMultiplicities.push_back(puppiMultiplicity);
99 neutralPuppiMultiplicities.push_back(neutralPuppiMultiplicity);
100 neutralHadronPuppiMultiplicities.push_back(neutralHadronPuppiMultiplicity);
101 photonPuppiMultiplicities.push_back(photonPuppiMultiplicity);
102 HFHadronPuppiMultiplicities.push_back(HFHadronPuppiMultiplicity);
103 HFEMPuppiMultiplicities.push_back(HFEMPuppiMultiplicity);
108 puppiMultiplicities_filler.
insert(jets,puppiMultiplicities.begin(),puppiMultiplicities.end());
109 puppiMultiplicities_filler.
fill();
110 evt.
put(
std::move(puppiMultiplicities_out),
"puppiMultiplicity");
112 std::unique_ptr<edm::ValueMap<float> > neutralPuppiMultiplicities_out(
new edm::ValueMap<float>());
114 neutralPuppiMultiplicities_filler.
insert(jets,neutralPuppiMultiplicities.begin(),neutralPuppiMultiplicities.end());
115 neutralPuppiMultiplicities_filler.
fill();
116 evt.
put(
std::move(neutralPuppiMultiplicities_out),
"neutralPuppiMultiplicity");
118 std::unique_ptr<edm::ValueMap<float> > neutralHadronPuppiMultiplicities_out(
new edm::ValueMap<float>());
120 neutralHadronPuppiMultiplicities_filler.
insert(jets,neutralHadronPuppiMultiplicities.begin(),neutralHadronPuppiMultiplicities.end());
121 neutralHadronPuppiMultiplicities_filler.
fill();
122 evt.
put(
std::move(neutralHadronPuppiMultiplicities_out),
"neutralHadronPuppiMultiplicity");
124 std::unique_ptr<edm::ValueMap<float> > photonPuppiMultiplicities_out(
new edm::ValueMap<float>());
126 photonPuppiMultiplicities_filler.
insert(jets,photonPuppiMultiplicities.begin(),photonPuppiMultiplicities.end());
127 photonPuppiMultiplicities_filler.
fill();
128 evt.
put(
std::move(photonPuppiMultiplicities_out),
"photonPuppiMultiplicity");
130 std::unique_ptr<edm::ValueMap<float> > HFHadronPuppiMultiplicities_out(
new edm::ValueMap<float>());
132 HFHadronPuppiMultiplicities_filler.
insert(jets,HFHadronPuppiMultiplicities.begin(),HFHadronPuppiMultiplicities.end());
133 HFHadronPuppiMultiplicities_filler.
fill();
134 evt.
put(
std::move(HFHadronPuppiMultiplicities_out),
"HFHadronPuppiMultiplicity");
138 HFEMPuppiMultiplicities_filler.
insert(jets,HFEMPuppiMultiplicities.begin(),HFEMPuppiMultiplicities.end());
139 HFEMPuppiMultiplicities_filler.
fill();
140 evt.
put(
std::move(HFEMPuppiMultiplicities_out),
"HFEMPuppiMultiplicity");
146 descriptions.
add(
"patPuppiJetSpecificProducer", desc);
float puppiWeight() const
Set both weights at once (with option for only full PUPPI)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< pat::Jet > > jets_token
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
int pdgId() const override
PDG identifier.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
~PATPuppiJetSpecificProducer()
void insert(const H &h, I begin, I end)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
PATPuppiJetSpecificProducer(const edm::ParameterSet &cfg)
Abs< T >::type abs(const T &t)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)