77 rho_(consumes<double>(iConfig.getParameter<edm::
InputTag>(
"rho"))),
78 pfJetPtCut(iConfig.getParameter<double>(
"pfJetPtCut")),
79 pfJetEtaCut(iConfig.getParameter<double>(
"pfJetEtaCut")),
80 pfCandidatePtCut(iConfig.getParameter<double>(
"pfCandidatePtCut")),
81 doJetTags(iConfig.getParameter<bool>(
"doJetTags")),
82 doCandidates(iConfig.getParameter<bool>(
"doCandidates")),
83 doMet(iConfig.getParameter<bool>(
"doMet"))
86 produces<ScoutingPFJetCollection>();
87 produces<ScoutingParticleCollection>();
88 produces<ScoutingVertexCollection>();
89 produces<double>(
"rho");
90 produces<double>(
"pfMetPt");
91 produces<double>(
"pfMetPhi");
107 outVertices->emplace_back(
108 vtx.x(), vtx.y(), vtx.z(), vtx.zError()
115 std::unique_ptr<double> outRho(
new double(-999));
117 outRho.reset(
new double(*
rho));
122 std::unique_ptr<double> outMetPt(
new double(-999));
123 std::unique_ptr<double> outMetPhi(
new double(-999));
133 for(
auto &cand : *pfCandidateCollection){
135 int vertex_index = -1;
136 int index_counter = 0;
138 for (
auto &vtx: *outVertices) {
139 double tmp_dr2 =
pow(vtx.x() - cand.vx(), 2) +
pow(vtx.y() - cand.vy(), 2)
140 +
pow(vtx.z() - cand.vz(), 2);
143 vertex_index = index_counter;
149 outPFCandidates->emplace_back(
150 cand.pt(), cand.eta(), cand.phi(), cand.mass(), cand.pdgId(), vertex_index
162 bool haveJetTags =
false;
167 for(
auto &
jet : *pfJetCollection){
170 float tagValue = -20;
173 for(
auto &
tag : *pfJetTagCollection){
177 tagValue =
tag.second;
182 std::vector<int> candIndices;
184 for(
auto &cand :
jet.getPFConstituents()){
187 float minDR2 = 0.0001;
190 for(
auto &outCand : *outPFCandidates){
191 float dR2 =
pow(cand->eta() - outCand.eta(), 2) +
pow(cand->phi() - outCand.phi(), 2);
194 matchIndex = outIndex;
201 candIndices.push_back(matchIndex);
205 outPFJets->emplace_back(
207 jet.chargedHadronEnergy(),
jet.neutralHadronEnergy(),
jet.photonEnergy(),
208 jet.electronEnergy(),
jet.muonEnergy(),
jet.HFHadronEnergy(),
jet.HFEMEnergy(),
209 jet.chargedHadronMultiplicity(),
jet.neutralHadronMultiplicity(),
jet.photonMultiplicity(),
210 jet.electronMultiplicity(),
jet.muonMultiplicity(),
211 jet.HFHadronMultiplicity(),
jet.HFEMMultiplicity(),
212 jet.hoEnergy(), tagValue, 0.0, candIndices
235 desc.
add<
double>(
"pfJetPtCut", 20.0);
236 desc.
add<
double>(
"pfJetEtaCut", 3.0);
237 desc.
add<
double>(
"pfCandidatePtCut", 0.6);
238 desc.
add<
bool>(
"doJetTags",
true);
239 desc.
add<
bool>(
"doCandidates",
true);
240 desc.
add<
bool>(
"doMet",
true);
241 descriptions.
add(
"hltScoutingPFProducer", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::PFMETCollection > metCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< Vertex > VertexCollection
collection of Vertex objects
JetFloatAssociation::Container JetTagCollection
const edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidateCollection_
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
std::vector< ScoutingVertex > ScoutingVertexCollection
std::vector< ScoutingParticle > ScoutingParticleCollection
virtual void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const overridefinal
const edm::EDGetTokenT< reco::PFJetCollection > pfJetCollection_
HLTScoutingPFProducer(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< reco::JetTagCollection > pfJetTagCollection_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
const edm::EDGetTokenT< double > rho_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
std::vector< ScoutingPFJet > ScoutingPFJetCollection
Power< A, B >::type pow(const A &a, const B &b)
const double pfCandidatePtCut