CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ConversionGSCrysFixer Class Reference

#include <ConversionGSCrysFixer.h>

Inheritance diagram for ConversionGSCrysFixer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ConversionGSCrysFixer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ConversionGSCrysFixer ()
 
- 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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef edm::ValueMap
< reco::SuperClusterRef
SCRefMap
 

Private Member Functions

template<typename T >
edm::Handle< TgetHandle (edm::Event const &_event, edm::EDGetTokenT< T > const &token, std::string const &name)
 
template<typename T >
void getToken (edm::EDGetTokenT< T > &token, edm::ParameterSet const &pset, std::string const &label, std::string const &instance="")
 

Private Attributes

edm::EDGetTokenT< SCRefMapebSCMapToken_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
ebSCsToken_
 
edm::EDGetTokenT< SCRefMapeeSCMapToken_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
eeSCsToken_
 
edm::EDGetTokenT
< reco::ConversionCollection
inputConvsToken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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

Author
Yutaro Iiyama, MIT

Definition at line 20 of file ConversionGSCrysFixer.h.

Member Typedef Documentation

Definition at line 29 of file ConversionGSCrysFixer.h.

Constructor & Destructor Documentation

ConversionGSCrysFixer::ConversionGSCrysFixer ( const edm::ParameterSet config)

Definition at line 18 of file ConversionGSCrysFixer.cc.

References ebSCMapToken_, ebSCsToken_, eeSCMapToken_, eeSCsToken_, getToken(), and inputConvsToken_.

19 {
20  getToken(inputConvsToken_, config, "conversions");
21  getToken(ebSCsToken_, config, "superClusters", "particleFlowSuperClusterECALBarrel");
22  getToken(ebSCMapToken_, config, "scMaps", "parentSCsEB");
23  getToken(eeSCsToken_, config, "superClusters", "particleFlowSuperClusterECALEndcapWithPreshower");
24  getToken(eeSCMapToken_, config, "scMaps", "parentSCsEE");
25 
26  produces<reco::ConversionCollection>();
27 }
edm::EDGetTokenT< SCRefMap > eeSCMapToken_
edm::EDGetTokenT< reco::ConversionCollection > inputConvsToken_
edm::EDGetTokenT< reco::SuperClusterCollection > ebSCsToken_
edm::EDGetTokenT< SCRefMap > ebSCMapToken_
edm::EDGetTokenT< reco::SuperClusterCollection > eeSCsToken_
void getToken(edm::EDGetTokenT< T > &token, edm::ParameterSet const &pset, std::string const &label, std::string const &instance="")
ConversionGSCrysFixer::~ConversionGSCrysFixer ( )

Definition at line 29 of file ConversionGSCrysFixer.cc.

30 {
31 }

Member Function Documentation

template<typename T >
edm::Handle<T> ConversionGSCrysFixer::getHandle ( edm::Event const &  _event,
edm::EDGetTokenT< T > const &  token,
std::string const &  name 
)
inlineprivate

Definition at line 43 of file ConversionGSCrysFixer.h.

References edm::Event::getByToken(), patZpeak::handle, and mergeVDriftHistosByStation::name.

Referenced by produce().

44  {
46  if (!_event.getByToken(token, handle))
47  throw cms::Exception("ProductNotFound") << name;
48 
49  return handle;
50  }
tuple handle
Definition: patZpeak.py:22
template<typename T >
void ConversionGSCrysFixer::getToken ( edm::EDGetTokenT< T > &  token,
edm::ParameterSet const &  pset,
std::string const &  label,
std::string const &  instance = "" 
)
inlineprivate

Definition at line 33 of file ConversionGSCrysFixer.h.

References edm::ParameterSet::getParameter(), instance, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by ConversionGSCrysFixer().

34  {
35  auto tag(pset.getParameter<edm::InputTag>(label));
36  if (!instance.empty())
37  tag = edm::InputTag(tag.label(), instance, tag.process());
38 
39  token = consumes<T>(tag);
40  }
static PFTauRenderPlugin instance
void ConversionGSCrysFixer::produce ( edm::Event _event,
const edm::EventSetup  
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 34 of file ConversionGSCrysFixer.cc.

References HLT_25ns10e33_v2_cff::clusters, ebSCMapToken_, ebSCsToken_, EcalBarrel, eeSCMapToken_, eeSCsToken_, GainSwitchTools::findNewRef(), getHandle(), inputConvsToken_, edm::Ref< C, T, F >::isNonnull(), edm::Event::put(), and edm::refToPtr().

35 {
36  std::auto_ptr<reco::ConversionCollection> pOutput(new reco::ConversionCollection);
37 
38  auto& inputConvs(*getHandle(_event, inputConvsToken_, "conversions"));
39  auto ebSCs(getHandle(_event, ebSCsToken_, "ebSCs"));
40  auto& ebSCMap(*getHandle(_event, ebSCMapToken_, "ebSCMap"));
41  auto eeSCs(getHandle(_event, eeSCsToken_, "eeSCs"));
42  auto& eeSCMap(*getHandle(_event, eeSCMapToken_, "eeSCMap"));
43 
44  for (auto& inConv : inputConvs) {
45  pOutput->emplace_back(inConv);
46  auto& newConv(pOutput->back());
47 
49  for (auto ptr : inConv.caloCluster()) {
50  auto* sc(static_cast<reco::SuperCluster const*>(ptr.get()));
52  if (sc->seed()->seed().subdetId() == EcalBarrel)
53  newSC = GainSwitchTools::findNewRef(ptr, ebSCs, ebSCMap);
54  else
55  newSC = GainSwitchTools::findNewRef(ptr, eeSCs, eeSCMap);
56 
57  if (newSC.isNonnull())
58  clusters.push_back(edm::refToPtr(newSC));
59  }
60 
61  newConv.setMatchingSuperCluster(clusters);
62  }
63 
64  _event.put(pOutput);
65 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
edm::Handle< T > getHandle(edm::Event const &_event, edm::EDGetTokenT< T > const &token, std::string const &name)
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
Definition: RefToPtr.h:18
edm::EDGetTokenT< SCRefMap > eeSCMapToken_
edm::EDGetTokenT< reco::ConversionCollection > inputConvsToken_
edm::EDGetTokenT< reco::SuperClusterCollection > ebSCsToken_
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
edm::EDGetTokenT< SCRefMap > ebSCMapToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< reco::SuperClusterCollection > eeSCsToken_
static edm::Ref< typename H::element_type > findNewRef(R const &, H const &, M const &)

Member Data Documentation

edm::EDGetTokenT<SCRefMap> ConversionGSCrysFixer::ebSCMapToken_
private

Definition at line 57 of file ConversionGSCrysFixer.h.

Referenced by ConversionGSCrysFixer(), and produce().

edm::EDGetTokenT<reco::SuperClusterCollection> ConversionGSCrysFixer::ebSCsToken_
private

Definition at line 56 of file ConversionGSCrysFixer.h.

Referenced by ConversionGSCrysFixer(), and produce().

edm::EDGetTokenT<SCRefMap> ConversionGSCrysFixer::eeSCMapToken_
private

Definition at line 59 of file ConversionGSCrysFixer.h.

Referenced by ConversionGSCrysFixer(), and produce().

edm::EDGetTokenT<reco::SuperClusterCollection> ConversionGSCrysFixer::eeSCsToken_
private

Definition at line 58 of file ConversionGSCrysFixer.h.

Referenced by ConversionGSCrysFixer(), and produce().

edm::EDGetTokenT<reco::ConversionCollection> ConversionGSCrysFixer::inputConvsToken_
private

Definition at line 52 of file ConversionGSCrysFixer.h.

Referenced by ConversionGSCrysFixer(), and produce().