CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
LHEDYdecayFilter Class Reference

#include <LHEDYdecayFilter.h>

Inheritance diagram for LHEDYdecayFilter:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 LHEDYdecayFilter (const edm::ParameterSet &)
 
 ~LHEDYdecayFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

int leptonID_
 
edm::InputTag src_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 29 of file LHEDYdecayFilter.h.

Constructor & Destructor Documentation

LHEDYdecayFilter::LHEDYdecayFilter ( const edm::ParameterSet iConfig)
explicit

Definition at line 11 of file LHEDYdecayFilter.cc.

11  :
12  src_(iConfig.getParameter<InputTag>( "src" ) ),
13  leptonID_(iConfig.getParameter<int>( "leptonID" ) ),
14  verbose_(iConfig.getUntrackedParameter<bool>( "verbose","False" ) )
15 {
16  //now do what ever initialization is needed
17 
18 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag src_
LHEDYdecayFilter::~LHEDYdecayFilter ( )

Definition at line 21 of file LHEDYdecayFilter.cc.

22 {
23 
24  // do anything here that needs to be done at desctruction time
25  // (e.g. close files, deallocate resources etc.)
26 
27 }

Member Function Documentation

bool LHEDYdecayFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDFilter.

Definition at line 35 of file LHEDYdecayFilter.cc.

References funct::abs(), gather_cfg::cout, plotBeamSpotDB::first, edm::Event::getByLabel(), hepeup_, lhef::HEPEUP::IDUP, leptonID_, lhef::HEPEUP::MOTHUP, lhef::HEPEUP::NUP, lhef::HEPEUP::PUP, src_, and verbose_.

36 {
37  bool accepted = false;
38 
40  iEvent.getByLabel( src_, evt );
41 
42  const lhef::HEPEUP hepeup_ = evt->hepeup();
43 
44  const int nup_ = hepeup_.NUP;
45  const std::vector<int> idup_ = hepeup_.IDUP;
46  const std::vector< std::pair<int,int> > mothup_ = hepeup_.MOTHUP;
47  const std::vector<lhef::HEPEUP::FiveVector> pup_ = hepeup_.PUP;
48 
49  unsigned int cLep = 0;
50  int netCharge = 0;
51 
52  for ( unsigned int icount = 0 ; icount < (unsigned int)nup_; icount++ ) {
53 
54  if ( std::abs(idup_[icount]) == leptonID_ ) {
55  if ( mothup_[icount].first != 0 ) {
56  if ( idup_[mothup_[icount].first-1] == 23 ) { cLep++; netCharge += idup_[icount]; }
57  }
58  }
59  }
60 
61  if ( cLep == 2 && netCharge == 0 ) {
62  accepted = true;
63  if (verbose_) {
64  for ( unsigned int icount = 0 ; icount < (unsigned int)nup_; icount++ ) {
65  std::cout << "# " << icount << " " << idup_[icount] << " " << (pup_[icount])[0] << " " << (pup_[icount])[1] << " " << (pup_[icount])[2] << " " << (pup_[icount])[3] << " " << (pup_[icount])[4] << std::endl;
66  }
67  }
68  }
69 
70  if (accepted){
71  return true; } else {return false;}
72 
73 }
struct HEPEUP_ hepeup_
std::vector< std::pair< int, int > > MOTHUP
Definition: LesHouches.h:236
std::vector< FiveVector > PUP
Definition: LesHouches.h:248
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
std::vector< int > IDUP
Definition: LesHouches.h:225
edm::InputTag src_
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

int LHEDYdecayFilter::leptonID_
private

Definition at line 40 of file LHEDYdecayFilter.h.

Referenced by filter().

edm::InputTag LHEDYdecayFilter::src_
private

Definition at line 39 of file LHEDYdecayFilter.h.

Referenced by filter().

bool LHEDYdecayFilter::verbose_
private

Definition at line 41 of file LHEDYdecayFilter.h.

Referenced by filter().