78 pfJetPtCut(iConfig.getParameter<double>(
"pfJetPtCut")),
79 pfJetEtaCut(iConfig.getParameter<double>(
"pfJetEtaCut")),
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<double>(
"rho");
89 produces<double>(
"pfMetPt");
90 produces<double>(
"pfMetPhi");
104 for(
auto &
vtx : *vertexCollection){
105 outVertices->emplace_back(
113 std::unique_ptr<double> outRho(
new double(-999));
115 outRho.reset(
new double(*rho));
120 std::unique_ptr<double> outMetPt(
new double(-999));
121 std::unique_ptr<double> outMetPhi(
new double(-999));
123 outMetPt.reset(
new double(metCollection->front().pt()));
124 outMetPhi.reset(
new double(metCollection->front().phi()));
131 for(
auto &
cand : *pfCandidateCollection){
133 int vertex_index = -1;
134 int index_counter = 0;
136 for (
auto &
vtx: *outVertices) {
141 vertex_index = index_counter;
147 outPFCandidates->emplace_back(
160 bool haveJetTags =
false;
165 for(
auto &
jet : *pfJetCollection){
168 float tagValue = -20;
171 for(
auto &
tag : *pfJetTagCollection){
175 tagValue =
tag.second;
180 std::vector<int> candIndices;
182 for(
auto &
cand :
jet.getPFConstituents()){
185 float minDR2 = 0.0001;
188 for(
auto &outCand : *outPFCandidates){
189 float dR2 =
pow(
cand->eta() - outCand.eta(), 2) +
pow(
cand->phi() - outCand.phi(), 2);
192 matchIndex = outIndex;
199 candIndices.push_back(matchIndex);
203 outPFJets->emplace_back(
205 jet.chargedHadronEnergy(),
jet.neutralHadronEnergy(),
jet.photonEnergy(),
206 jet.electronEnergy(),
jet.muonEnergy(),
jet.HFHadronEnergy(),
jet.HFEMEnergy(),
207 jet.chargedHadronMultiplicity(),
jet.neutralHadronMultiplicity(),
jet.photonMultiplicity(),
208 jet.electronMultiplicity(),
jet.muonMultiplicity(),
209 jet.HFHadronMultiplicity(),
jet.HFEMMultiplicity(),
210 jet.hoEnergy(), tagValue, 0.0, candIndices
232 desc.
add<
double>(
"pfJetPtCut", 20.0);
233 desc.
add<
double>(
"pfJetEtaCut", 3.0);
234 desc.
add<
double>(
"pfCandidatePtCut", 0.6);
235 desc.
add<
bool>(
"doJetTags",
true);
236 desc.
add<
bool>(
"doCandidates",
true);
237 desc.
add<
bool>(
"doMet",
true);
238 descriptions.
add(
"hltScoutingPFProducer", desc);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::PFMETCollection > metCollection_
~HLTScoutingPFProducer() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
def setup(process, global_tag, zero_tesla=False)
std::vector< Vertex > VertexCollection
collection of Vertex objects
JetFloatAssociation::Container JetTagCollection
const edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidateCollection_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
std::vector< ScoutingVertex > ScoutingVertexCollection
std::vector< ScoutingParticle > ScoutingParticleCollection
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