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 Attributes
GsfElectronCoreGSCrysFixer Class Reference
Inheritance diagram for GsfElectronCoreGSCrysFixer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

template<typename T >
void getToken (edm::EDGetTokenT< T > &token, const edm::ParameterSet &pset, const std::string &label, const std::string &instance="")
 
 GsfElectronCoreGSCrysFixer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~GsfElectronCoreGSCrysFixer ()
 
- 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 Attributes

edm::EDGetTokenT< SCRefMapebSCMapToken_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
ebSCsToken_
 
edm::EDGetTokenT< SCRefMapeeSCMapToken_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
eeSCsToken_
 
edm::EDGetTokenT
< reco::GsfElectronCoreCollection
orgCoresToken_
 
edm::EDGetTokenT< SCRefMaprefinedSCMapToken_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
refinedSCsToken_
 

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

Definition at line 33 of file GsfElectronCoreGSCrysFixer.cc.

Member Typedef Documentation

Definition at line 49 of file GsfElectronCoreGSCrysFixer.cc.

Constructor & Destructor Documentation

GsfElectronCoreGSCrysFixer::GsfElectronCoreGSCrysFixer ( const edm::ParameterSet pset)
explicit

Definition at line 69 of file GsfElectronCoreGSCrysFixer.cc.

References ebSCMapToken_, ebSCsToken_, eeSCMapToken_, eeSCsToken_, getToken(), orgCoresToken_, refinedSCMapToken_, and refinedSCsToken_.

70 {
71  getToken(orgCoresToken_,pset,"orgCores");
72  getToken(refinedSCsToken_, pset, "refinedSCs");
73  getToken(refinedSCMapToken_, pset, "refinedSCs");
74  getToken(ebSCsToken_, pset, "scs", "particleFlowSuperClusterECALBarrel");
75  getToken(ebSCMapToken_, pset, "refinedSCs", "parentSCsEB");
76  getToken(eeSCsToken_, pset, "scs", "particleFlowSuperClusterECALEndcapWithPreshower");
77  getToken(eeSCMapToken_, pset, "refinedSCs", "parentSCsEE");
78 
79  produces<reco::GsfElectronCoreCollection >();
80  produces<SCRefMap>(); // new core to old SC
81 }
void getToken(edm::EDGetTokenT< T > &token, const edm::ParameterSet &pset, const std::string &label, const std::string &instance="")
edm::EDGetTokenT< SCRefMap > ebSCMapToken_
edm::EDGetTokenT< reco::GsfElectronCoreCollection > orgCoresToken_
edm::EDGetTokenT< SCRefMap > eeSCMapToken_
edm::EDGetTokenT< reco::SuperClusterCollection > ebSCsToken_
edm::EDGetTokenT< reco::SuperClusterCollection > eeSCsToken_
edm::EDGetTokenT< reco::SuperClusterCollection > refinedSCsToken_
edm::EDGetTokenT< SCRefMap > refinedSCMapToken_
virtual GsfElectronCoreGSCrysFixer::~GsfElectronCoreGSCrysFixer ( )
inlinevirtual

Definition at line 36 of file GsfElectronCoreGSCrysFixer.cc.

36 {}

Member Function Documentation

template<typename T >
void GsfElectronCoreGSCrysFixer::getToken ( edm::EDGetTokenT< T > &  token,
const edm::ParameterSet pset,
const std::string &  label,
const std::string &  instance = "" 
)
inline

Definition at line 41 of file GsfElectronCoreGSCrysFixer.cc.

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

Referenced by GsfElectronCoreGSCrysFixer().

41  {
42  auto tag(pset.getParameter<edm::InputTag>(label));
43  if (!instance.empty())
44  tag = edm::InputTag(tag.label(), instance, tag.process());
45 
46  token = consumes<T>(tag);
47  }
T getParameter(std::string const &) const
static PFTauRenderPlugin instance
void GsfElectronCoreGSCrysFixer::produce ( edm::Event iEvent,
const edm::EventSetup  
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 84 of file GsfElectronCoreGSCrysFixer.cc.

References ebSCMapToken_, ebSCsToken_, EcalBarrel, eeSCMapToken_, eeSCsToken_, edm::helper::Filler< Map >::fill(), GainSwitchTools::findNewRef(), edm::helper::Filler< Map >::insert(), eostools::move(), orgCoresToken_, edm::Event::put(), refinedSCMapToken_, and refinedSCsToken_.

85 {
86  auto outCores = std::make_unique<reco::GsfElectronCoreCollection>();
87 
88  auto eleCoresHandle = getHandle(iEvent,orgCoresToken_);
89  auto refinedSCs(getHandle(iEvent, refinedSCsToken_));
90  auto& refinedSCMap(*getHandle(iEvent, refinedSCMapToken_));
91  auto ebSCs(getHandle(iEvent, ebSCsToken_));
92  auto& ebSCMap(*getHandle(iEvent, ebSCMapToken_));
93  auto eeSCs(getHandle(iEvent, eeSCsToken_));
94  auto& eeSCMap(*getHandle(iEvent, eeSCMapToken_));
95 
96  std::vector<reco::SuperClusterRef> oldSCRefs;
97 
98  for (auto& inCore : *eleCoresHandle) {
99  outCores->emplace_back(inCore);
100  auto& outCore(outCores->back());
101 
102  // NOTE: These mappings can result in NULL superclusters!
103  auto& oldRefinedSC(inCore.superCluster());
104  outCore.setSuperCluster(GainSwitchTools::findNewRef(oldRefinedSC, refinedSCs, refinedSCMap));
105 
106  oldSCRefs.push_back(oldRefinedSC);
107 
108  auto& parentSC(inCore.parentSuperCluster());
109  if (parentSC.isNonnull()) {
110  if (parentSC->seed()->seed().subdetId() == EcalBarrel)
111  outCore.setParentSuperCluster(GainSwitchTools::findNewRef(parentSC, ebSCs, ebSCMap));
112  else
113  outCore.setParentSuperCluster(GainSwitchTools::findNewRef(parentSC, eeSCs, eeSCMap));
114  }
115  }
116 
117  auto newCoresHandle(iEvent.put(std::move(outCores)));
118 
119  std::auto_ptr<SCRefMap> pRefMap(new SCRefMap);
120  SCRefMap::Filler refMapFiller(*pRefMap);
121  refMapFiller.insert(newCoresHandle, oldSCRefs.begin(), oldSCRefs.end());
122  refMapFiller.fill();
123  iEvent.put(pRefMap);
124 }
edm::EDGetTokenT< SCRefMap > ebSCMapToken_
edm::EDGetTokenT< reco::GsfElectronCoreCollection > orgCoresToken_
edm::EDGetTokenT< SCRefMap > eeSCMapToken_
edm::ValueMap< reco::SuperClusterRef > SCRefMap
edm::EDGetTokenT< reco::SuperClusterCollection > ebSCsToken_
edm::EDGetTokenT< reco::SuperClusterCollection > eeSCsToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
def move
Definition: eostools.py:510
edm::EDGetTokenT< reco::SuperClusterCollection > refinedSCsToken_
edm::EDGetTokenT< SCRefMap > refinedSCMapToken_
helper::Filler< ValueMap< reco::SuperClusterRef > > Filler
Definition: ValueMap.h:168
static edm::Ref< typename H::element_type > findNewRef(R const &, H const &, M const &)

Member Data Documentation

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

Definition at line 55 of file GsfElectronCoreGSCrysFixer.cc.

Referenced by GsfElectronCoreGSCrysFixer(), and produce().

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

Definition at line 54 of file GsfElectronCoreGSCrysFixer.cc.

Referenced by GsfElectronCoreGSCrysFixer(), and produce().

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

Definition at line 57 of file GsfElectronCoreGSCrysFixer.cc.

Referenced by GsfElectronCoreGSCrysFixer(), and produce().

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

Definition at line 56 of file GsfElectronCoreGSCrysFixer.cc.

Referenced by GsfElectronCoreGSCrysFixer(), and produce().

edm::EDGetTokenT<reco::GsfElectronCoreCollection> GsfElectronCoreGSCrysFixer::orgCoresToken_
private

Definition at line 51 of file GsfElectronCoreGSCrysFixer.cc.

Referenced by GsfElectronCoreGSCrysFixer(), and produce().

edm::EDGetTokenT<SCRefMap> GsfElectronCoreGSCrysFixer::refinedSCMapToken_
private

Definition at line 53 of file GsfElectronCoreGSCrysFixer.cc.

Referenced by GsfElectronCoreGSCrysFixer(), and produce().

edm::EDGetTokenT<reco::SuperClusterCollection> GsfElectronCoreGSCrysFixer::refinedSCsToken_
private

Definition at line 52 of file GsfElectronCoreGSCrysFixer.cc.

Referenced by GsfElectronCoreGSCrysFixer(), and produce().