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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 SimL1EmulatorRepack_Full_cff::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  }
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
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 corr, DEFINE_FWK_MODULE, dqmMemoryStats::float, edm::Event::getByToken(), CorrMETData::mex, CorrMETData::mey, eostools::move(), edm::Event::put(), and CorrMETData::sumet.

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:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
double sumet
Definition: CorrMETData.h:18
JetCorrectorParameters corr
Definition: classes.h:5
a MET correction term
Definition: CorrMETData.h:14
double mey
Definition: CorrMETData.h:16
double mex
Definition: CorrMETData.h:15
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 36 of file CorrMETDataExtractor.cc.

Referenced by CorrMETDataExtractor().