CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CorrMETDataExtractor Class Reference
Inheritance diagram for CorrMETDataExtractor:
edm::stream::EDProducer<>

Public Member Functions

 CorrMETDataExtractor (const edm::ParameterSet &cfg)
 
 ~CorrMETDataExtractor () 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 Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es) override
 

Private Attributes

std::vector< edm::EDGetTokenT
< CorrMETData > > 
corrTokens_
 

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 18 of file CorrMETDataExtractor.cc.

Constructor & Destructor Documentation

CorrMETDataExtractor::CorrMETDataExtractor ( const edm::ParameterSet cfg)
inlineexplicit

Definition at line 20 of file CorrMETDataExtractor.cc.

References corrTokens_, edm::ParameterSet::getParameter(), and beam_dqm_sourceclient-live_cfg::inputTag.

20  {
21  std::vector<edm::InputTag> corrInputTags = cfg.getParameter<std::vector<edm::InputTag> >("corrections");
22  std::vector<edm::EDGetTokenT<CorrMETData> > corrTokens;
23  for (std::vector<edm::InputTag>::const_iterator inputTag = corrInputTags.begin(); inputTag != corrInputTags.end();
24  ++inputTag) {
25  corrTokens_.push_back(consumes<CorrMETData>(*inputTag));
26  }
27 
28  produces<float>("corX");
29  produces<float>("corY");
30  produces<float>("corSumEt");
31  }
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CorrMETDataExtractor::~CorrMETDataExtractor ( )
inlineoverride

Definition at line 33 of file CorrMETDataExtractor.cc.

33 {}

Member Function Documentation

void CorrMETDataExtractor::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlineoverrideprivate

Definition at line 38 of file CorrMETDataExtractor.cc.

References alignCSCRings::corr, corrTokens_, edm::Event::getByToken(), CorrMETData::mex, CorrMETData::mey, eostools::move(), edm::Event::put(), CorrMETData::sumet, and trackerHitRTTI::vector.

38  {
39  CorrMETData sumCor;
41  for (std::vector<edm::EDGetTokenT<CorrMETData> >::const_iterator corrToken = corrTokens_.begin();
42  corrToken != corrTokens_.end();
43  ++corrToken) {
44  evt.getByToken(*corrToken, corr);
45  sumCor += (*corr);
46  }
47 
48  float cX = (float)sumCor.mex;
49  float cY = (float)sumCor.mey;
50  float cSEt = (float)sumCor.sumet;
51 
52  std::unique_ptr<float> corX(new float(0));
53  std::unique_ptr<float> corY(new float(0));
54  std::unique_ptr<float> corSumEt(new float(0));
55 
56  *corX = cX;
57  *corY = cY;
58  *corSumEt = cSEt;
59 
60  evt.put(std::move(corX), "corX");
61  evt.put(std::move(corY), "corY");
62  evt.put(std::move(corSumEt), "corSumEt");
63  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
def move
Definition: eostools.py:511
double sumet
Definition: CorrMETData.h:18
a MET correction term
Definition: CorrMETData.h:14
double mey
Definition: CorrMETData.h:16
double mex
Definition: CorrMETData.h:15

Member Data Documentation

std::vector<edm::EDGetTokenT<CorrMETData> > CorrMETDataExtractor::corrTokens_
private

Definition at line 36 of file CorrMETDataExtractor.cc.

Referenced by CorrMETDataExtractor(), and produce().