-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from SUEPPhysics/addRho
Add rho
- Loading branch information
Showing
10 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__init__.py | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "PhysicsTools/SUEPScouting/plugins/FixedGridRhoProducerFastjetScouting.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "DataFormats/Common/interface/View.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "DataFormats/Math/interface/LorentzVector.h" | ||
|
||
using namespace std; | ||
|
||
FixedGridRhoProducerFastjetScouting::FixedGridRhoProducerFastjetScouting(const edm::ParameterSet& iConfig) | ||
: bge_(iConfig.getParameter<double>("maxRapidity"), iConfig.getParameter<double>("gridSpacing")) { | ||
pfCandidatesTag_ = iConfig.getParameter<edm::InputTag>("pfCandidatesTag"); | ||
electronsTag_ = iConfig.getParameter<edm::InputTag>("electronsTag"); | ||
produces<double>(); | ||
|
||
input_pfcoll_token_ = consumes<std::vector<ScoutingParticle>>(pfCandidatesTag_); | ||
input_elecoll_token_ = consumes<std::vector<ScoutingElectron>>(electronsTag_); | ||
} | ||
|
||
FixedGridRhoProducerFastjetScouting::~FixedGridRhoProducerFastjetScouting() {} | ||
|
||
void FixedGridRhoProducerFastjetScouting::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { | ||
std::vector<fastjet::PseudoJet> inputs; | ||
|
||
edm::Handle<std::vector<ScoutingParticle>> pfColl; | ||
iEvent.getByToken(input_pfcoll_token_, pfColl); | ||
for (std::vector<ScoutingParticle>::const_iterator ibegin = pfColl->begin(), iend = pfColl->end(), i = ibegin; i != iend; | ||
++i) { | ||
math::PtEtaPhiMLorentzVector v{i->pt(), i->eta(), i->phi(), i->m()}; | ||
inputs.push_back(fastjet::PseudoJet(v.px(), v.py(), v.pz(), v.energy())); | ||
} | ||
|
||
//electrons are not in PF candidate collection | ||
edm::Handle<std::vector<ScoutingElectron>> eleColl; | ||
iEvent.getByToken(input_elecoll_token_, eleColl); | ||
for (std::vector<ScoutingElectron>::const_iterator ibegin = eleColl->begin(), iend = eleColl->end(), i = ibegin; i != iend; | ||
++i) { | ||
math::PtEtaPhiMLorentzVector v{i->pt(), i->eta(), i->phi(), i->m()}; | ||
inputs.push_back(fastjet::PseudoJet(v.px(), v.py(), v.pz(), v.energy())); | ||
} | ||
bge_.set_particles(inputs); | ||
iEvent.put(std::make_unique<double>(bge_.rho())); | ||
} | ||
|
||
DEFINE_FWK_MODULE(FixedGridRhoProducerFastjetScouting); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef PhysicsTools_SUEPScouting_plugins_FixedGridRhoProducerFastjetScouting_h | ||
#define PhysicsTools_SUEPScouting_plugins_FixedGridRhoProducerFastjetScouting_h | ||
|
||
#include "FWCore/Framework/interface/stream/EDProducer.h" | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DataFormats/Scouting/interface/ScoutingElectron.h" | ||
#include "DataFormats/Scouting/interface/ScoutingParticle.h" | ||
#include "fastjet/tools/GridMedianBackgroundEstimator.hh" | ||
|
||
class FixedGridRhoProducerFastjetScouting : public edm::stream::EDProducer<> { | ||
public: | ||
explicit FixedGridRhoProducerFastjetScouting(const edm::ParameterSet& iConfig); | ||
~FixedGridRhoProducerFastjetScouting() override; | ||
|
||
private: | ||
void produce(edm::Event&, const edm::EventSetup&) override; | ||
|
||
edm::InputTag pfCandidatesTag_; | ||
edm::InputTag electronsTag_; | ||
fastjet::GridMedianBackgroundEstimator bge_; | ||
|
||
edm::EDGetTokenT<std::vector<ScoutingParticle>> input_pfcoll_token_; | ||
edm::EDGetTokenT<std::vector<ScoutingElectron>> input_elecoll_token_; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters