CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Attributes
cms::ElseMETProducer Class Reference

#include <ElseMETProducer.h>

Inheritance diagram for cms::ElseMETProducer:
edm::stream::EDProducer<>

Public Member Functions

 ElseMETProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ElseMETProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

double globalThreshold_
 
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 33 of file ElseMETProducer.h.

Constructor & Destructor Documentation

◆ ElseMETProducer()

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

Definition at line 33 of file ElseMETProducer.cc.

References SiStripOfflineCRack_cfg::alias, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

35  globalThreshold_(iConfig.getParameter<double>("globalThreshold")) {
36  std::string alias = iConfig.exists("alias") ? iConfig.getParameter<std::string>("alias") : "";
37 
38  produces<reco::METCollection>().setBranchAlias(alias);
39  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_

◆ ~ElseMETProducer()

cms::ElseMETProducer::~ElseMETProducer ( )
inlineoverride

Definition at line 36 of file ElseMETProducer.h.

36 {}

Member Function Documentation

◆ produce()

void ElseMETProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 42 of file ElseMETProducer.cc.

References globalThreshold_, input, inputToken_, CommonMETData::met, BTaggingMonitor_cfi::met, CommonMETData::mex, CommonMETData::mey, eostools::move(), CommonMETData::sumet, and extraflags_cff::vtx.

42  {
44  event.getByToken(inputToken_, input);
45 
46  METAlgo algo;
47  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
48 
49  math::XYZTLorentzVector p4(commonMETdata.mex, commonMETdata.mey, 0.0, commonMETdata.met);
50  math::XYZPoint vtx(0, 0, 0);
51  reco::MET met(commonMETdata.sumet, p4, vtx);
52  auto metcoll = std::make_unique<reco::METCollection>();
53  metcoll->push_back(met);
54  event.put(std::move(metcoll));
55  }
static std::string const input
Definition: EdmProvDump.cc:50
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Definition: MET.h:41
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ globalThreshold_

double cms::ElseMETProducer::globalThreshold_
private

Definition at line 42 of file ElseMETProducer.h.

Referenced by produce().

◆ inputToken_

edm::EDGetTokenT<edm::View<reco::Candidate> > cms::ElseMETProducer::inputToken_
private

Definition at line 40 of file ElseMETProducer.h.

Referenced by produce().