CMS 3D CMS Logo

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::CorrMETDataExtractor ( const edm::ParameterSet cfg)
inlineexplicit

Definition at line 20 of file CorrMETDataExtractor.cc.

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  }

References looper::cfg, corrTokens_, and SimL1EmulatorRepack_Full_cff::inputTag.

◆ ~CorrMETDataExtractor()

CorrMETDataExtractor::~CorrMETDataExtractor ( )
inlineoverride

Definition at line 33 of file CorrMETDataExtractor.cc.

33 {}

Member Function Documentation

◆ produce()

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

Definition at line 38 of file CorrMETDataExtractor.cc.

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  }

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

Member Data Documentation

◆ corrTokens_

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

Definition at line 36 of file CorrMETDataExtractor.cc.

Referenced by CorrMETDataExtractor(), and produce().

dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
CorrMETData::mey
double mey
Definition: CorrMETData.h:16
edm::EDGetTokenT< CorrMETData >
CorrMETData::mex
double mex
Definition: CorrMETData.h:15
edm::Handle
Definition: AssociativeIterator.h:50
CorrMETDataExtractor::corrTokens_
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
Definition: CorrMETDataExtractor.cc:36
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
CorrMETData
a MET correction term
Definition: CorrMETData.h:14
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
CorrMETData::sumet
double sumet
Definition: CorrMETData.h:18
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
looper.cfg
cfg
Definition: looper.py:296
eostools.move
def move(src, dest)
Definition: eostools.py:511
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56