Skip to content

Commit

Permalink
add enum
Browse files Browse the repository at this point in the history
  • Loading branch information
perrozzi committed Sep 13, 2015
1 parent 96d00fa commit a4863f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions GeneratorInterface/GenFilters/interface/LHEGenericFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ class LHEGenericFilter : public edm::EDFilter {
std::vector<int> particleID_; // vector of particle IDs to look for
int totalEvents_; // counters
int passedEvents_;
enum logic_ { LT, GT, EQ, NE};
logic_ whichlogic;
};
#endif
15 changes: 11 additions & 4 deletions GeneratorInterface/GenFilters/src/LHEGenericFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ totalEvents_(0), passedEvents_(0)
{
//here do whatever other initialization is needed
src_ = consumes<LHEEventProduct>(iConfig.getParameter<edm::InputTag>("src"));

if(acceptLogic_.compare("LT")==0) whichlogic = LT;
else if(acceptLogic_.compare("GT")==0) whichlogic = GT;
else if(acceptLogic_.compare("EQ")==0) whichlogic = EQ;
else if(acceptLogic_.compare("NE")==0) whichlogic = NE;

}

LHEGenericFilter::~LHEGenericFilter()
{

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

Expand Down Expand Up @@ -45,10 +52,10 @@ bool LHEGenericFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup)

// event accept/reject logic
if (
(acceptLogic_.compare("LT")==0 && nFound < numRequired_)
|| (acceptLogic_.compare("GT")==0 && nFound > numRequired_)
|| (acceptLogic_.compare("EQ")==0 && nFound == numRequired_)
|| (acceptLogic_.compare("NE")==0 && nFound != numRequired_)
(whichlogic==LT && nFound < numRequired_)
|| (whichlogic==GT && nFound > numRequired_)
|| (whichlogic==EQ && nFound == numRequired_)
|| (whichlogic==NE && nFound != numRequired_)
) {
passedEvents_++;
return true;
Expand Down

0 comments on commit a4863f0

Please sign in to comment.