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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 22 of file CorrMETDataExtractor.cc.

References corrTokens_, edm::ParameterSet::getParameter(), and HiClusterCompatibility_cfi::inputTag.

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

Definition at line 35 of file CorrMETDataExtractor.cc.

35 { }

Member Function Documentation

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

Definition at line 42 of file CorrMETDataExtractor.cc.

References corr, DEFINE_FWK_MODULE, objects.autophobj::float, edm::Event::getByToken(), CorrMETData::mex, CorrMETData::mey, eostools::move(), edm::Event::put(), and CorrMETData::sumet.

43  {
44 
45  CorrMETData sumCor;
47  for (std::vector<edm::EDGetTokenT<CorrMETData> >::const_iterator corrToken = corrTokens_.begin(); corrToken != corrTokens_.end(); ++corrToken) {
48 
49  evt.getByToken(*corrToken, corr);
50  sumCor += (*corr);
51  }
52 
53  float cX=(float)sumCor.mex;
54  float cY=(float)sumCor.mey;
55  float cSEt=(float)sumCor.sumet;
56 
57  std::unique_ptr<float> corX(new float(0));
58  std::unique_ptr<float> corY(new float(0));
59  std::unique_ptr<float> corSumEt(new float(0));
60 
61  *corX = cX;
62  *corY = cY;
63  *corSumEt = cSEt;
64 
65  evt.put(std::move(corX),"corX");
66  evt.put(std::move(corY),"corY");
67  evt.put(std::move(corSumEt),"corSumEt");
68  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< edm::EDGetTokenT< CorrMETData > > corrTokens_
double sumet
Definition: CorrMETData.h:20
JetCorrectorParameters corr
Definition: classes.h:5
a MET correction term
Definition: CorrMETData.h:14
double mey
Definition: CorrMETData.h:18
double mex
Definition: CorrMETData.h:17
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 39 of file CorrMETDataExtractor.cc.

Referenced by CorrMETDataExtractor().