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");
105 edm::LogError (
"HLTScoutingPFProducer") <<
"invalid collection: pfJetCollection" <<
"\n";
111 edm::LogError (
"HLTScoutingPFProducer") <<
"invalid collection: pfJetTagCollection" <<
"\n";
117 edm::LogError (
"HLTScoutingPFProducer") <<
"invalid collection: pfCandidateCollection" <<
"\n";
123 edm::LogError (
"HLTScoutingPFProducer") <<
"invalid collection: vertexCollection" <<
"\n";
129 edm::LogError (
"HLTScoutingPFProducer") <<
"invalid collection: rho" <<
"\n";
132 std::auto_ptr<double> outRho(
new double(*
rho));
136 edm::LogError (
"HLTScoutingPFProducer") <<
"invalid collection: metCollection" <<
"\n";
143 outVertices->emplace_back(
144 vtx.x(), vtx.y(), vtx.z(), vtx.zError()
151 for(
auto &cand : *pfCandidateCollection){
153 outPFCandidates->emplace_back(
154 cand.pt(), cand.eta(), cand.phi(), cand.mass(), cand.pdgId()
162 for(
auto &
jet : *pfJetCollection){
165 float tagValue = -20;
168 for(
auto &
tag : *pfJetTagCollection){
172 tagValue =
tag.second;
177 std::vector<int> candIndices;
179 for(
auto &cand :
jet.getPFConstituents()){
182 float minDR2 = 0.0001;
185 for(
auto &outCand : *outPFCandidates){
186 float dR2 =
pow(cand->eta() - outCand.eta(), 2) +
pow(cand->phi() - outCand.phi(), 2);
189 matchIndex = outIndex;
196 candIndices.push_back(matchIndex);
200 outPFJets->emplace_back(
202 jet.chargedHadronEnergy(),
jet.neutralHadronEnergy(),
jet.photonEnergy(),
203 jet.electronEnergy(),
jet.muonEnergy(),
jet.HFHadronEnergy(),
jet.HFEMEnergy(),
204 jet.chargedHadronMultiplicity(),
jet.neutralHadronMultiplicity(),
jet.photonMultiplicity(),
205 jet.electronMultiplicity(),
jet.muonMultiplicity(),
206 jet.HFHadronMultiplicity(),
jet.HFEMMultiplicity(),
207 jet.hoEnergy(), tagValue, 0.0, candIndices
212 double metPhi = -999;
217 std::auto_ptr<double> outMetPt(
new double(metPt));
218 std::auto_ptr<double> outMetPhi(
new double(metPhi));
222 iEvent.
put(outVertices);
223 iEvent.
put(outPFCandidates);
224 iEvent.
put(outPFJets);
225 iEvent.
put(outRho,
"rho");
226 iEvent.
put(outMetPt,
"pfMetPt");
227 iEvent.
put(outMetPhi,
"pfMetPhi");
239 desc.
add<
double>(
"pfJetPtCut", 20.0);
240 desc.
add<
double>(
"pfJetEtaCut", 3.0);
241 desc.
add<
double>(
"pfCandidatePtCut", 0.6);
242 desc.
add<
bool>(
"doJetTags",
true);
243 desc.
add<
bool>(
"doCandidates",
true);
244 desc.
add<
bool>(
"doMet",
true);
245 descriptions.
add(
"hltScoutingPFProducer", desc);
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::METCollection > metCollection_
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
std::vector< ScoutingVertex > ScoutingVertexCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< ScoutingParticle > ScoutingParticleCollection
virtual void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const overridefinal
double deltaR2(const T1 &t1, const T2 &t2)
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)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
std::vector< ScoutingPFJet > ScoutingPFJetCollection
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Power< A, B >::type pow(const A &a, const B &b)
const double pfCandidatePtCut