CMS 3D CMS Logo

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

bool filter (edm::Event &, const edm::EventSetup &) override
 
 ZgMassFilter (const edm::ParameterSet &)
 
 ~ZgMassFilter () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

int charge (const int &Id)
 

Private Attributes

double minDileptonMass
 
double minZgMass
 
edm::EDGetTokenT< edm::HepMCProducttoken_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 ( )
override

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 
)
override

Definition at line 21 of file ZgMassFilter.cc.

References funct::abs(), cms::dd::accepted(), edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), btagElecInJet_cfi::Lepton, minDileptonMass, minZgMass, AlCaHLTBitMon_ParallelJobs::p, nanoDQM_cff::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:517
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
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
bool accepted(std::vector< std::string_view > const &, std::string_view)
double minZgMass
Definition: ZgMassFilter.h:57
HLT enums.

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().