Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed May 4, 2022
1 parent 2fcdef7 commit 7797b41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions GeneratorInterface/Herwig6Interface/plugins/Herwig6Filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ class Herwig6Filter : public edm::stream::EDFilter<> {
Herwig6Filter::Herwig6Filter(const edm::ParameterSet& ppp) {}

bool Herwig6Filter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) {

std::vector< Handle<HepMCProduct> > AllProds;
std::vector<Handle<HepMCProduct> > AllProds;
iEvent.getManyByType(AllProds);

if (AllProds.size() == 0) {
edm::LogInfo("")<<" Event is skipped and removed.\n";
edm::LogInfo("") << " Event is skipped and removed.\n";
return false;
}
else
} else
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "FWCore/ServiceRegistry/interface/RandomEngineSentry.h"

TauSpinnerFilter::TauSpinnerFilter(const edm::ParameterSet& pset)
: WTToken_(consumes<double>(pset.getParameter<edm::InputTag>("src"))), fRandomEngine(nullptr), ntaus_(0) {
: WTToken_(consumes<double>(pset.getParameter<edm::InputTag>("src"))), fRandomEngine(nullptr), ntaus_(0) {
if (pset.getParameter<int>("ntaus") == 1)
ntaus_ = 1.0;
if (pset.getParameter<int>("ntaus") == 2)
Expand All @@ -16,7 +16,7 @@ TauSpinnerFilter::TauSpinnerFilter(const edm::ParameterSet& pset)

bool TauSpinnerFilter::filter(edm::Event& e, edm::EventSetup const& es) {
edm::RandomEngineSentry<TauSpinnerFilter> randomEngineSentry(this, e.streamID());
const edm::Handle<double> & WT = e.getHandle(WTToken_);
const edm::Handle<double>& WT = e.getHandle(WTToken_);
if (*(WT.product()) >= 0 && *(WT.product()) <= 4.0) {
double weight = (*(WT.product()));
if (fRandomEngine->flat() * ntaus_ * 2.0 < weight) {
Expand Down

0 comments on commit 7797b41

Please sign in to comment.