CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | 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

Classes

class  h
 

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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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::SuperClusterCollection
scHybridBarrelProducer_
 
const edm::EDGetTokenT
< reco::SuperClusterCollection
scIslandEndcapProducer_
 

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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 33 of file EgammaHLTRecoEcalCandidateProducers.cc.

Constructor & Destructor Documentation

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

Definition at line 47 of file EgammaHLTRecoEcalCandidateProducers.cc.

References recoEcalCandidateCollection_.

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 }
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
tuple config
parse the configuration file
EgammaHLTRecoEcalCandidateProducers::~EgammaHLTRecoEcalCandidateProducers ( )
override

Definition at line 57 of file EgammaHLTRecoEcalCandidateProducers.cc.

57 {}

Member Function Documentation

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

Definition at line 59 of file EgammaHLTRecoEcalCandidateProducers.cc.

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

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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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.

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

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 }
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
def move
Definition: eostools.py:511
math::XYZPoint Point
point in the space
Definition: Particle.h:25
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21

Member Data Documentation

const std::string EgammaHLTRecoEcalCandidateProducers::recoEcalCandidateCollection_
private
const edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTRecoEcalCandidateProducers::scHybridBarrelProducer_
private

Definition at line 42 of file EgammaHLTRecoEcalCandidateProducers.cc.

Referenced by produce().

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

Definition at line 43 of file EgammaHLTRecoEcalCandidateProducers.cc.

Referenced by produce().