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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CorrMETDataExtractor (const edm::ParameterSet &cfg)
 
 ~CorrMETDataExtractor ()
 
- 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 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 ( )
inline

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:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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().