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
NJetsMCEta Class Reference
Inheritance diagram for NJetsMCEta:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 NJetsMCEta (const edm::ParameterSet &)
 
 ~NJetsMCEta ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual bool filter (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag GenHandle_
 
double maxeta_
 
double mineta_
 
double minpt_
 
Int_t njets_
 
vector< TLorentzVector * > * pjet
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 61 of file NJetsMCEta.cc.

Constructor & Destructor Documentation

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

Definition at line 83 of file NJetsMCEta.cc.

83  :
84  GenHandle_(iConfig.getUntrackedParameter<InputTag>("GenTag")),
85  njets_(iConfig.getParameter<int32_t>("Njets")),
86  minpt_(iConfig.getParameter<double>("MinPt")),
87  maxeta_(iConfig.getParameter<double>("MaxEta")),
88  mineta_(iConfig.getParameter<double>("MinEta"))
89 {
90 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double minpt_
Definition: NJetsMCEta.cc:75
Int_t njets_
Definition: NJetsMCEta.cc:74
edm::InputTag GenHandle_
Definition: NJetsMCEta.cc:73
double mineta_
Definition: NJetsMCEta.cc:77
double maxeta_
Definition: NJetsMCEta.cc:76
NJetsMCEta::~NJetsMCEta ( )

Definition at line 93 of file NJetsMCEta.cc.

94 {
95 }

Member Function Documentation

void NJetsMCEta::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 133 of file NJetsMCEta.cc.

134 {
135 }
void NJetsMCEta::endJob ( void  )
privatevirtual

Reimplemented from edm::EDFilter.

Definition at line 137 of file NJetsMCEta.cc.

138 {
139 }
bool NJetsMCEta::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDFilter.

Definition at line 97 of file NJetsMCEta.cc.

References abs, prof2calltree::count, reco::Candidate::energy(), reco::Candidate::eta(), GenHandle_, jetmet_cfg::GenJets, edm::Event::getByLabel(), metsig::jet, maxeta_, mineta_, minpt_, mysortPt, njets_, reco::Candidate::phi(), pjet, reco::Candidate::pt(), query::result, and python.multivaluedict::sort().

98 {
99  using namespace edm;
100 
102  iEvent.getByLabel(GenHandle_, GenJets);
103 
104  vector<TLorentzVector*> jet;
105 
106  Int_t count = 0;
107  bool result = false;
108 
109 
110 
111  for(GenJetCollection::const_iterator iJet = GenJets->begin(); iJet != GenJets->end(); ++iJet)
112  {
113  const reco::Candidate* myJet = &(*iJet);
114  TLorentzVector *dummy = new TLorentzVector(0,0,0,0);
115  dummy->SetPtEtaPhiE(myJet->pt(),myJet->eta(),myJet->energy(),myJet->phi());
116  jet.push_back(dummy);
117  }
118 
119  pjet = &jet ;
120 
121  sort (pjet->begin(), pjet->end(), mysortPt);
122 
123  if(pjet->size()>0 && pjet->at(0)->Pt() > minpt_ && abs(pjet->at(0)->Eta()) < maxeta_ && abs(pjet->at(0)->Eta()) > mineta_) ++count;
124  if(pjet->size()>1 && pjet->at(1)->Pt() > minpt_ && abs(pjet->at(1)->Eta()) < maxeta_ && abs(pjet->at(1)->Eta()) > mineta_) ++count;
125 
126 
127  if( count >= njets_ )
128  result = true;
129 
130  return result;
131 }
double minpt_
Definition: NJetsMCEta.cc:75
virtual double energy() const =0
energy
virtual float eta() const =0
momentum pseudorapidity
Int_t njets_
Definition: NJetsMCEta.cc:74
#define abs(x)
Definition: mlp_lapack.h:159
virtual float phi() const =0
momentum azimuthal angle
edm::InputTag GenHandle_
Definition: NJetsMCEta.cc:73
virtual float pt() const =0
transverse momentum
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple GenJets
Definition: jetmet_cfg.py:40
struct sortPt mysortPt
double mineta_
Definition: NJetsMCEta.cc:77
double maxeta_
Definition: NJetsMCEta.cc:76
vector< TLorentzVector * > * pjet
Definition: NJetsMCEta.cc:79

Member Data Documentation

edm::InputTag NJetsMCEta::GenHandle_
private

Definition at line 73 of file NJetsMCEta.cc.

Referenced by filter().

double NJetsMCEta::maxeta_
private

Definition at line 76 of file NJetsMCEta.cc.

Referenced by filter().

double NJetsMCEta::mineta_
private

Definition at line 77 of file NJetsMCEta.cc.

Referenced by filter().

double NJetsMCEta::minpt_
private

Definition at line 75 of file NJetsMCEta.cc.

Referenced by filter().

Int_t NJetsMCEta::njets_
private

Definition at line 74 of file NJetsMCEta.cc.

Referenced by filter().

vector<TLorentzVector*>* NJetsMCEta::pjet
private

Definition at line 79 of file NJetsMCEta.cc.

Referenced by filter().