CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTRecoEcalCandidateProducers Class Reference
Inheritance diagram for EgammaHLTRecoEcalCandidateProducers:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EgammaHLTRecoEcalCandidateProducers (const edm::ParameterSet &ps)
 
void produce (edm::StreamID sid, edm::Event &evt, const edm::EventSetup &es) const override
 
 ~EgammaHLTRecoEcalCandidateProducers () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const std::string recoEcalCandidateCollection_
 
const edm::EDGetTokenT< reco::SuperClusterCollectionscHybridBarrelProducer_
 
const edm::EDGetTokenT< reco::SuperClusterCollectionscIslandEndcapProducer_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 33 of file EgammaHLTRecoEcalCandidateProducers.cc.

Constructor & Destructor Documentation

◆ EgammaHLTRecoEcalCandidateProducers()

EgammaHLTRecoEcalCandidateProducers::EgammaHLTRecoEcalCandidateProducers ( const edm::ParameterSet ps)

Definition at line 47 of file EgammaHLTRecoEcalCandidateProducers.cc.

49  consumes<reco::SuperClusterCollection>(config.getParameter<edm::InputTag>("scHybridBarrelProducer"))),
51  consumes<reco::SuperClusterCollection>(config.getParameter<edm::InputTag>("scIslandEndcapProducer"))),
52  recoEcalCandidateCollection_(config.getParameter<std::string>("recoEcalCandidateCollection")) {
53  // Register the product
54  produces<reco::RecoEcalCandidateCollection>(recoEcalCandidateCollection_);
55 }

References recoEcalCandidateCollection_.

◆ ~EgammaHLTRecoEcalCandidateProducers()

EgammaHLTRecoEcalCandidateProducers::~EgammaHLTRecoEcalCandidateProducers ( )
override

Definition at line 57 of file EgammaHLTRecoEcalCandidateProducers.cc.

57 {}

Member Function Documentation

◆ fillDescriptions()

void EgammaHLTRecoEcalCandidateProducers::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 59 of file EgammaHLTRecoEcalCandidateProducers.cc.

59  {
61  desc.add<edm::InputTag>(("scHybridBarrelProducer"), edm::InputTag("correctedHybridSuperClusters"));
62  desc.add<edm::InputTag>(("scIslandEndcapProducer"), edm::InputTag("correctedEndcapSuperClustersWithPreshower"));
63  desc.add<std::string>(("recoEcalCandidateCollection"), "");
64  descriptions.add(("hltEgammaHLTRecoEcalCandidateProducers"), desc);
65 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

void EgammaHLTRecoEcalCandidateProducers::produce ( edm::StreamID  sid,
edm::Event evt,
const edm::EventSetup es 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 67 of file EgammaHLTRecoEcalCandidateProducers.cc.

69  {
70  using namespace edm;
71 
72  //
73  // create empty output collections
74  //
75 
76  reco::RecoEcalCandidateCollection outputRecoEcalCandidateCollection;
77  auto outputRecoEcalCandidateCollection_p = std::make_unique<reco::RecoEcalCandidateCollection>();
78 
79  // Get the Barrel Super Cluster collection
81  theEvent.getByToken(scHybridBarrelProducer_, scBarrelHandle);
82  // Get the Endcap Super Cluster collection
84  theEvent.getByToken(scIslandEndcapProducer_, scEndcapHandle);
85 
86  // Loop over barrel SC and fill the recoecal collection
87  int iSC = 0; // index in recoecal collection
88  int lSC = 0; // local index on barrel
89 
90  for (reco::SuperClusterCollection::const_iterator aClus = scBarrelHandle->begin(); aClus != scBarrelHandle->end();
91  aClus++) {
92  const reco::Particle::Point vtx(0, 0, 0);
93 
94  // compute correctly the momentum vector of the recoecal from primary vertex and cluster position
95  math::XYZVector direction = aClus->position() - vtx;
96  math::XYZVector momentum = direction.unit() * aClus->energy();
97  const reco::Particle::LorentzVector p4(momentum.x(), momentum.y(), momentum.z(), aClus->energy());
98 
99  reco::RecoEcalCandidate newCandidate(0, p4, vtx);
100 
101  outputRecoEcalCandidateCollection.push_back(newCandidate);
102  reco::SuperClusterRef scRef(reco::SuperClusterRef(scBarrelHandle, lSC));
103  outputRecoEcalCandidateCollection[iSC].setSuperCluster(scRef);
104 
105  lSC++;
106  iSC++;
107  }
108 
109  // Loop over Endcap SC and fill the recoecal collection
110  lSC = 0; // reset local index for endcap
111 
112  for (reco::SuperClusterCollection::const_iterator aClus = scEndcapHandle->begin(); aClus != scEndcapHandle->end();
113  aClus++) {
114  const reco::Particle::Point vtx(0, 0, 0);
115 
116  math::XYZVector direction = aClus->position() - vtx;
117  math::XYZVector momentum = direction.unit() * aClus->energy();
118  const reco::Particle::LorentzVector p4(momentum.x(), momentum.y(), momentum.z(), aClus->energy());
119 
120  reco::RecoEcalCandidate newCandidate(0, p4, vtx);
121 
122  outputRecoEcalCandidateCollection.push_back(newCandidate);
123  reco::SuperClusterRef scRef(reco::SuperClusterRef(scEndcapHandle, lSC));
124  outputRecoEcalCandidateCollection[iSC].setSuperCluster(scRef);
125 
126  iSC++;
127  lSC++;
128  }
129 
130  // put the product in the event
131  outputRecoEcalCandidateCollection_p->assign(outputRecoEcalCandidateCollection.begin(),
132  outputRecoEcalCandidateCollection.end());
133  theEvent.put(std::move(outputRecoEcalCandidateCollection_p), recoEcalCandidateCollection_);
134 }

References edm::Event::getByToken(), eostools::move(), p4, edm::Event::put(), recoEcalCandidateCollection_, scHybridBarrelProducer_, scIslandEndcapProducer_, and extraflags_cff::vtx.

Member Data Documentation

◆ recoEcalCandidateCollection_

const std::string EgammaHLTRecoEcalCandidateProducers::recoEcalCandidateCollection_
private

◆ scHybridBarrelProducer_

const edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTRecoEcalCandidateProducers::scHybridBarrelProducer_
private

Definition at line 42 of file EgammaHLTRecoEcalCandidateProducers.cc.

Referenced by produce().

◆ scIslandEndcapProducer_

const edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTRecoEcalCandidateProducers::scIslandEndcapProducer_
private

Definition at line 43 of file EgammaHLTRecoEcalCandidateProducers.cc.

Referenced by produce().

reco::RecoEcalCandidateCollection
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
Definition: RecoEcalCandidateFwd.h:9
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
reco::Particle::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
edm::Ref< SuperClusterCollection >
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaHLTRecoEcalCandidateProducers::scHybridBarrelProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
Definition: EgammaHLTRecoEcalCandidateProducers.cc:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
p4
double p4[4]
Definition: TauolaWrapper.h:92
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
reco::Particle::Point
math::XYZPoint Point
point in the space
Definition: Particle.h:25
reco::RecoEcalCandidate
Definition: RecoEcalCandidate.h:15
EgammaHLTRecoEcalCandidateProducers::recoEcalCandidateCollection_
const std::string recoEcalCandidateCollection_
Definition: EgammaHLTRecoEcalCandidateProducers.cc:44
edm::InputTag
Definition: InputTag.h:15
EgammaHLTRecoEcalCandidateProducers::scIslandEndcapProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
Definition: EgammaHLTRecoEcalCandidateProducers.cc:43