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
PythiaFilterZJet Class Reference

#include <PythiaFilterZJet.h>

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

Public Member Functions

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

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

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

Definition at line 20 of file PythiaFilterZJet.cc.

20 {}

Member Function Documentation

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

Implements edm::EDFilter.

Definition at line 24 of file PythiaFilterZJet.cc.

References funct::abs(), eta, etaMuMax, edm::Event::getByToken(), 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:464
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
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().