Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize LHEGenericMassFilter with the latest updates merged in 10_6 #36838

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 3 additions & 12 deletions GeneratorInterface/GenFilters/plugins/LHEGenericMassFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ using namespace std;
class LHEGenericMassFilter : public edm::global::EDFilter<> {
public:
explicit LHEGenericMassFilter(const edm::ParameterSet&);
~LHEGenericMassFilter() override;
~LHEGenericMassFilter() override = default;

private:
bool filter(edm::StreamID, edm::Event&, edm::EventSetup const&) const override;
void endJob() override;

// ----------member data ---------------------------

Expand All @@ -45,11 +44,6 @@ LHEGenericMassFilter::LHEGenericMassFilter(const edm::ParameterSet& iConfig)
minMass_(iConfig.getParameter<double>("MinMass")),
maxMass_(iConfig.getParameter<double>("MaxMass")) {}

LHEGenericMassFilter::~LHEGenericMassFilter() {
// do anything here that needs to be done at destruction time
// (e.g. close files, deallocate resources etc.)
}

// ------------ method called to skim the data ------------
bool LHEGenericMassFilter::filter(edm::StreamID iID, edm::Event& iEvent, edm::EventSetup const& iSetup) const {
edm::Handle<LHEEventProduct> EvtHandle;
Expand Down Expand Up @@ -82,16 +76,13 @@ bool LHEGenericMassFilter::filter(edm::StreamID iID, edm::Event& iEvent, edm::Ev

// event accept/reject logic
if (nFound == numRequired_) {
double Mass = std::sqrt(E * E - (Px * Px + Py * Py + Pz * Pz));
if (Mass > minMass_ && Mass < maxMass_) {
double sqrdMass = E * E - (Px * Px + Py * Py + Pz * Pz);
if (sqrdMass > minMass_ * minMass_ && sqrdMass < maxMass_ * maxMass_) {
return true;
}
}
return false;
}

// ------------ method called once each job just after ending the event loop ------------
void LHEGenericMassFilter::endJob() {}

//define this as a plug-in
DEFINE_FWK_MODULE(LHEGenericMassFilter);