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
cms::PFMETProducer Class Reference

#include <PFMETProducer.h>

Inheritance diagram for cms::PFMETProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFMETProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~PFMETProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool calculateSignificance_
 
double globalThreshold_
 
edm::EDGetTokenT< edm::View
< reco::Candidate > > 
inputToken_
 
edm::EDGetTokenT< edm::View
< reco::PFJet > > 
jetToken_
 
metsig::SignAlgoResolutionsresolutions_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 42 of file PFMETProducer.h.

Constructor & Destructor Documentation

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

Definition at line 32 of file PFMETProducer.cc.

References calculateSignificance_, edm::ParameterSet::getParameter(), jetToken_, resolutions_, and AlCaHLTBitMon_QueryRunRegistry::string.

34  , calculateSignificance_(iConfig.getParameter<bool>("calculateSignificance"))
35  , resolutions_(0)
36  , globalThreshold_(iConfig.getParameter<double>("globalThreshold"))
37  {
39  {
40  jetToken_ = consumes<edm::View<reco::PFJet> >(iConfig.getParameter<edm::InputTag>("jets"));
42  }
43 
44  std::string alias(iConfig.getParameter<std::string>("alias"));
45  produces<reco::PFMETCollection>().setBranchAlias(alias.c_str());
46  }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::View< reco::PFJet > > jetToken_
Definition: PFMETProducer.h:58
metsig::SignAlgoResolutions * resolutions_
Definition: PFMETProducer.h:54
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
Definition: PFMETProducer.h:51
virtual cms::PFMETProducer::~PFMETProducer ( )
inlinevirtual

Definition at line 46 of file PFMETProducer.h.

46 { }

Member Function Documentation

void PFMETProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 50 of file PFMETProducer.cc.

References metsig::SignPFSpecificAlgo::addPFJets(), calculateSignificance_, globalThreshold_, input, inputToken_, fwrapper::jets, jetToken_, CommonMETData::met, CommonMETData::mex, CommonMETData::mey, metsig::SignPFSpecificAlgo::mkSignifMatrix(), p4, edm::Handle< T >::product(), resolutions_, PFSpecificAlgo::run(), METAlgo::run(), metsig::SignPFSpecificAlgo::setResolutions(), reco::MET::setSignificanceMatrix(), timingPdfMaker::specific, and CommonMETData::sumet.

51  {
53  event.getByToken(inputToken_, input);
54 
55  METAlgo algo;
56  CommonMETData commonMETdata = algo.run(*input.product(), globalThreshold_);
57 
58  const math::XYZTLorentzVector p4(commonMETdata.mex, commonMETdata.mey, 0.0, commonMETdata.met);
59  const math::XYZPoint vtx(0.0, 0.0, 0.0);
60 
61  PFSpecificAlgo pf;
62  SpecificPFMETData specific = pf.run(*input.product());
63 
64  reco::PFMET pfmet(specific, commonMETdata.sumet, p4, vtx);
65 
67  {
68  metsig::SignPFSpecificAlgo pfsignalgo;
69  pfsignalgo.setResolutions(resolutions_);
70 
72  event.getByToken(jetToken_, jets);
73  pfsignalgo.addPFJets(jets.product());
74  pfmet.setSignificanceMatrix(pfsignalgo.mkSignifMatrix(input));
75  }
76 
77  std::auto_ptr<reco::PFMETCollection> pfmetcoll;
78  pfmetcoll.reset(new reco::PFMETCollection);
79 
80  pfmetcoll->push_back(pfmet);
81  event.put(pfmetcoll);
82  }
dictionary specific
static std::string const input
Definition: EdmProvDump.cc:44
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
CommonMETData run(const edm::View< reco::Candidate > &candidates, double globalThreshold=0.0)
Definition: METAlgo.cc:16
void addPFJets(const edm::View< reco::PFJet > *PFJets)
void setResolutions(metsig::SignAlgoResolutions *resolutions)
double p4[4]
Definition: TauolaWrapper.h:92
vector< PseudoJet > jets
edm::EDGetTokenT< edm::View< reco::PFJet > > jetToken_
Definition: PFMETProducer.h:58
Structure containing data common to all types of MET.
Definition: CommonMETData.h:12
MET made from Particle Flow Candidates.
metsig::SignAlgoResolutions * resolutions_
Definition: PFMETProducer.h:54
SpecificPFMETData run(const edm::View< reco::Candidate > &pfCands)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T const * product() const
Definition: Handle.h:81
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
edm::EDGetTokenT< edm::View< reco::Candidate > > inputToken_
Definition: PFMETProducer.h:51
TMatrixD mkSignifMatrix(edm::Handle< edm::View< reco::Candidate > > &PFCandidates)

Member Data Documentation

bool cms::PFMETProducer::calculateSignificance_
private

Definition at line 53 of file PFMETProducer.h.

Referenced by PFMETProducer(), and produce().

double cms::PFMETProducer::globalThreshold_
private

Definition at line 56 of file PFMETProducer.h.

Referenced by produce().

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

Definition at line 51 of file PFMETProducer.h.

Referenced by produce().

edm::EDGetTokenT<edm::View<reco::PFJet> > cms::PFMETProducer::jetToken_
private

Definition at line 58 of file PFMETProducer.h.

Referenced by PFMETProducer(), and produce().

metsig::SignAlgoResolutions* cms::PFMETProducer::resolutions_
private

Definition at line 54 of file PFMETProducer.h.

Referenced by PFMETProducer(), and produce().