CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PythiaFilterZJet Class Reference

#include <PythiaFilterZJet.h>

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

Public Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 
 PythiaFilterZJet (const edm::ParameterSet &)
 
 ~PythiaFilterZJet () 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 Attributes

double etaMuMax
 
int maxnumberofeventsinrun
 
double ptZMax
 
double ptZMin
 
int theNumberOfSelected
 
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

PythiaFilterZJet filter implements generator-level preselections for photon+jet like events to be used in jet energy calibration. Ported from fortran code written by V.Konoplianikov.

Author
A.Ulyanov, ITEP

Definition at line 30 of file PythiaFilterZJet.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file PythiaFilterZJet.cc.

References theNumberOfSelected.

9  :
10 token_(consumes<edm::HepMCProduct>(edm::InputTag(iConfig.getUntrackedParameter("moduleLabel",std::string("generator")),"unsmeared"))),
11 etaMuMax(iConfig.getUntrackedParameter<double>("MaxMuonEta", 2.5)),
12 ptZMin(iConfig.getUntrackedParameter<double>("MinZPt")),
13 ptZMax(iConfig.getUntrackedParameter<double>("MaxZPt")),
14 maxnumberofeventsinrun(iConfig.getUntrackedParameter<int>("MaxEvents",10000)){
15 
17 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::HepMCProduct > token_
PythiaFilterZJet::~PythiaFilterZJet ( )
override

Definition at line 20 of file PythiaFilterZJet.cc.

20 {}

Member Function Documentation

bool PythiaFilterZJet::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 24 of file PythiaFilterZJet.cc.

References funct::abs(), cms::dd::accepted(), PVValHelper::eta, etaMuMax, edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), RPCpg::mu, AlCaHLTBitMon_ParallelJobs::p, ptZMax, ptZMin, theNumberOfSelected, and token_.

24  {
25 
26 // if(theNumberOfSelected>=maxnumberofeventsinrun) {
27 // throw cms::Exception("endJob")<<"we have reached the maximum number of events ";
28 // }
29 
30  bool accepted = false;
32  iEvent.getByToken(token_, evt);
33 
34  const HepMC::GenEvent * myGenEvent = evt->GetEvent();
35 
36 
37  if(myGenEvent->signal_process_id() == 15 || myGenEvent->signal_process_id() == 30) {
38 
39 
40  std::vector<const HepMC::GenParticle *> mu;
41 
42  for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); ++p ) {
43 
44  if ( std::abs((*p)->pdg_id())==13 && (*p)->status()==1 )
45  mu.push_back(*p);
46  if(mu.size()>1) break;
47  }
48 
49  //***
50 
51  if(mu.size()>1){
52  math::XYZTLorentzVector tot_mom(mu[0]->momentum());
53  math::XYZTLorentzVector mom2(mu[1]->momentum());
54  tot_mom += mom2;
55  // double ptZ= (mu[0]->momentum() + mu[1]->momentum()).perp();
56  double ptZ = tot_mom.pt();
57  if (ptZ > ptZMin && ptZ < ptZMax &&
58  std::abs(mu[0]->momentum().eta()) < etaMuMax &&
59  std::abs(mu[1]->momentum().eta()) < etaMuMax)
60  accepted=true;
61  }
62 
63  } else {
64  // end of if(gammajetevent)
65  return true;
66  // accept all non-gammajet events
67  }
68 
69  if (accepted) {
71  return true;
72  }
73  else return false;
74 
75 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int mu
Definition: Constants.h:22
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
bool accepted(std::vector< std::string_view > const &, std::string_view)
edm::EDGetTokenT< edm::HepMCProduct > token_

Member Data Documentation

double PythiaFilterZJet::etaMuMax
private

Definition at line 40 of file PythiaFilterZJet.h.

Referenced by filter().

int PythiaFilterZJet::maxnumberofeventsinrun
private

Definition at line 45 of file PythiaFilterZJet.h.

double PythiaFilterZJet::ptZMax
private

Definition at line 42 of file PythiaFilterZJet.h.

Referenced by filter().

double PythiaFilterZJet::ptZMin
private

Definition at line 41 of file PythiaFilterZJet.h.

Referenced by filter().

int PythiaFilterZJet::theNumberOfSelected
private

Definition at line 44 of file PythiaFilterZJet.h.

Referenced by filter(), and PythiaFilterZJet().

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

Definition at line 39 of file PythiaFilterZJet.h.

Referenced by filter().