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 Member Functions | Private Attributes
ZgMassFilter Class Reference

#include <ZgMassFilter.h>

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

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 ZgMassFilter (const edm::ParameterSet &)
 
 ~ZgMassFilter ()
 
- 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 Member Functions

int charge (const int &Id)
 

Private Attributes

double minDileptonMass
 
double minZgMass
 
edm::EDGetTokenT
< edm::HepMCProduct
token_
 

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 42 of file ZgMassFilter.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file ZgMassFilter.cc.

9  :
10 token_(consumes<edm::HepMCProduct>(iConfig.getUntrackedParameter("moduleLabel",edm::InputTag("generator","unsmeared")))),
11 minDileptonMass(iConfig.getUntrackedParameter("MinDileptonMass", 0.)),
12 minZgMass(iConfig.getUntrackedParameter("MinZgMass", 0.))
13 {
14 }
T getUntrackedParameter(std::string const &, T const &) const
double minDileptonMass
Definition: ZgMassFilter.h:56
edm::EDGetTokenT< edm::HepMCProduct > token_
Definition: ZgMassFilter.h:55
double minZgMass
Definition: ZgMassFilter.h:57
ZgMassFilter::~ZgMassFilter ( )

Definition at line 16 of file ZgMassFilter.cc.

17 {
18 }

Member Function Documentation

int ZgMassFilter::charge ( const int &  Id)
private
bool ZgMassFilter::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDFilter.

Definition at line 21 of file ZgMassFilter.cc.

References funct::abs(), edm::Event::getByToken(), minDileptonMass, minZgMass, AlCaHLTBitMon_ParallelJobs::p, configurableAnalysis::Photon, and token_.

22 {
23  using namespace edm;
24  bool accepted = false;
26  iEvent.getByToken(token_, evt);
27  const HepMC::GenEvent * myGenEvent = evt->GetEvent();
28 
29  vector<TLorentzVector> Lepton; Lepton.clear();
30  vector<TLorentzVector> Photon; Photon.clear();
31 
32  for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin();
33  p != myGenEvent->particles_end(); ++p ) {
34  if ((*p)->status() == 1 && (abs((*p)->pdg_id()) == 11 || abs((*p)->pdg_id()) == 13 || abs((*p)->pdg_id()) == 15)) {
35  TLorentzVector LeptP((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
36  Lepton.push_back(LeptP);
37  }
38  if ( abs((*p)->pdg_id()) == 22 && (*p)->status() == 1) {
39  TLorentzVector PhotP((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
40  Photon.push_back(PhotP);
41  }
42  }
43 
44  if (Lepton.size() > 1 && (Lepton[0]+Lepton[1]).M() > minDileptonMass ) {
45  if ((Lepton[0]+Lepton[1]+Photon[0]).M() > minZgMass) {
46  accepted = true;
47  }
48  }
49 
50  return accepted;
51 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
double minDileptonMass
Definition: ZgMassFilter.h:56
edm::EDGetTokenT< edm::HepMCProduct > token_
Definition: ZgMassFilter.h:55
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double minZgMass
Definition: ZgMassFilter.h:57

Member Data Documentation

double ZgMassFilter::minDileptonMass
private

Definition at line 56 of file ZgMassFilter.h.

Referenced by filter().

double ZgMassFilter::minZgMass
private

Definition at line 57 of file ZgMassFilter.h.

Referenced by filter().

edm::EDGetTokenT<edm::HepMCProduct> ZgMassFilter::token_
private

Definition at line 55 of file ZgMassFilter.h.

Referenced by filter().