-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 #11149 from perrozzi/from-CMSSW_7_1_19
Changes to PartonShowerBsHepMCFilter and LHEGenericFilter
- Loading branch information
Showing
7 changed files
with
128 additions
and
17 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
30 changes: 30 additions & 0 deletions
30
GeneratorInterface/Core/interface/PartonShowerBsHepMCFilter.h
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,30 @@ | ||
/** | ||
** Description: Filter gen particles based on pdg_id and status code | ||
** | ||
** @author bortigno | ||
** @version 1.0 02.04.2015 | ||
*/ | ||
|
||
|
||
#ifndef __PARTONSHOWERBSHEPMCFILTER__ | ||
#define __PARTONSHOWERBSHEPMCFILTER__ | ||
|
||
|
||
#include "GeneratorInterface/Core/interface/BaseHepMCFilter.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
class PartonShowerBsHepMCFilter : public BaseHepMCFilter{ | ||
|
||
public: | ||
|
||
PartonShowerBsHepMCFilter( const edm::ParameterSet & ); | ||
~PartonShowerBsHepMCFilter(); | ||
|
||
virtual bool filter(const HepMC::GenEvent* evt); | ||
|
||
private: | ||
|
||
}; | ||
|
||
|
||
#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
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,48 @@ | ||
#include "GeneratorInterface/Core/interface/PartonShowerBsHepMCFilter.h" | ||
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" | ||
#include <iostream> | ||
#include "HepPDT/ParticleID.hh" | ||
|
||
|
||
using namespace edm; | ||
using namespace std; | ||
|
||
|
||
//constructor | ||
PartonShowerBsHepMCFilter::PartonShowerBsHepMCFilter(const edm::ParameterSet& iConfig) | ||
{ | ||
|
||
} | ||
|
||
|
||
//destructor | ||
PartonShowerBsHepMCFilter::~PartonShowerBsHepMCFilter() | ||
{ | ||
|
||
} | ||
|
||
// | ||
// member functions | ||
// | ||
|
||
// ------------ method called to produce the data ------------ | ||
bool PartonShowerBsHepMCFilter::filter(const HepMC::GenEvent* evt) | ||
{ | ||
|
||
// loop over gen particles | ||
for ( HepMC::GenEvent::particle_const_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p ){ | ||
|
||
// check only status 2 particles | ||
if( (*p)->status()==2 ){ | ||
// if one of the status 2 particles is a B-hadron, accept the event | ||
HepPDT::ParticleID pid((*p)->pdg_id()); | ||
if( pid.hasBottom() ){ | ||
return true; // accept event | ||
} | ||
} | ||
|
||
} | ||
|
||
return false; // skip event | ||
|
||
} |
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,8 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
lheGenericFilter = cms.EDFilter("LHEGenericFilter", | ||
src = cms.InputTag("source"), | ||
NumRequired = cms.int32(2), | ||
ParticleID = cms.vint32(5), | ||
AcceptLogic = cms.string("LT") # LT meaning < NumRequired, GT >, EQ =, NE != | ||
) |
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