CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
EgammaHLTRecoEcalCandidateProducers Class Reference

#include <EgammaHLTRecoEcalCandidateProducers.h>

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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
 
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::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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 28 of file EgammaHLTRecoEcalCandidateProducers.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file EgammaHLTRecoEcalCandidateProducers.cc.

References recoEcalCandidateCollection_.

21  :
22  scHybridBarrelProducer_(consumes<reco::SuperClusterCollection>(config.getParameter<edm::InputTag>("scHybridBarrelProducer"))),
23  scIslandEndcapProducer_(consumes<reco::SuperClusterCollection>(config.getParameter<edm::InputTag>("scIslandEndcapProducer"))),
24  recoEcalCandidateCollection_(config.getParameter<std::string>("recoEcalCandidateCollection")) {
25 
26  // Register the product
27  produces< reco::RecoEcalCandidateCollection >(recoEcalCandidateCollection_);
28 }
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
Definition: config.py:1
const edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
EgammaHLTRecoEcalCandidateProducers::~EgammaHLTRecoEcalCandidateProducers ( )
override

Definition at line 30 of file EgammaHLTRecoEcalCandidateProducers.cc.

31 {}

Member Function Documentation

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

Definition at line 33 of file EgammaHLTRecoEcalCandidateProducers.cc.

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

33  {
35  desc.add<edm::InputTag>(("scHybridBarrelProducer"), edm::InputTag("correctedHybridSuperClusters"));
36  desc.add<edm::InputTag>(("scIslandEndcapProducer"), edm::InputTag("correctedEndcapSuperClustersWithPreshower"));
37  desc.add<std::string>(("recoEcalCandidateCollection"), "");
38  descriptions.add(("hltEgammaHLTRecoEcalCandidateProducers"), desc);
39 }
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
override

Definition at line 41 of file EgammaHLTRecoEcalCandidateProducers.cc.

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

41  {
42 
43  using namespace edm;
44 
45  //
46  // create empty output collections
47  //
48 
49  reco::RecoEcalCandidateCollection outputRecoEcalCandidateCollection;
50  auto outputRecoEcalCandidateCollection_p = std::make_unique<reco::RecoEcalCandidateCollection>();
51 
52  // Get the Barrel Super Cluster collection
54  theEvent.getByToken(scHybridBarrelProducer_,scBarrelHandle);
55  // Get the Endcap Super Cluster collection
57  theEvent.getByToken(scIslandEndcapProducer_,scEndcapHandle);
58 
59  // Loop over barrel SC and fill the recoecal collection
60  int iSC=0; // index in recoecal collection
61  int lSC=0; // local index on barrel
62 
63 
64 for(reco::SuperClusterCollection::const_iterator aClus = scBarrelHandle->begin(); aClus != scBarrelHandle->end(); aClus++) {
65 
66  const reco::Particle::Point vtx( 0, 0, 0 );
67 
68  // compute correctly the momentum vector of the recoecal from primary vertex and cluster position
69  math::XYZVector direction =aClus->position() - vtx;
70  math::XYZVector momentum = direction.unit() * aClus->energy();
71  const reco::Particle::LorentzVector p4(momentum.x(), momentum.y(), momentum.z(), aClus->energy() );
72 
73  reco::RecoEcalCandidate newCandidate(0, p4, vtx);
74 
75  outputRecoEcalCandidateCollection.push_back(newCandidate);
76  reco::SuperClusterRef scRef(reco::SuperClusterRef(scBarrelHandle, lSC));
77  outputRecoEcalCandidateCollection[iSC].setSuperCluster(scRef);
78 
79  lSC++;
80  iSC++;
81 
82  }
83 
84  // Loop over Endcap SC and fill the recoecal collection
85  lSC=0; // reset local index for endcap
86 
87 for(reco::SuperClusterCollection::const_iterator aClus = scEndcapHandle->begin(); aClus != scEndcapHandle->end(); aClus++) {
88 
89  const reco::Particle::Point vtx( 0, 0, 0 );
90 
91  math::XYZVector direction =aClus->position() - vtx;
92  math::XYZVector momentum = direction.unit() * aClus->energy();
93  const reco::Particle::LorentzVector p4(momentum.x(), momentum.y(), momentum.z(), aClus->energy() );
94 
95  reco::RecoEcalCandidate newCandidate(0, p4, vtx);
96 
97  outputRecoEcalCandidateCollection.push_back(newCandidate);
98  reco::SuperClusterRef scRef(reco::SuperClusterRef(scEndcapHandle, lSC));
99  outputRecoEcalCandidateCollection[iSC].setSuperCluster(scRef);
100 
101  iSC++;
102  lSC++;
103 
104  }
105 
106  // put the product in the event
107  outputRecoEcalCandidateCollection_p->assign(outputRecoEcalCandidateCollection.begin(),outputRecoEcalCandidateCollection.end());
108  theEvent.put(std::move(outputRecoEcalCandidateCollection_p), recoEcalCandidateCollection_);
109 
110 }
const edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
const edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
double p4[4]
Definition: TauolaWrapper.h:92
math::XYZPoint Point
point in the space
Definition: Particle.h:25
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
HLT enums.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:21
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 39 of file EgammaHLTRecoEcalCandidateProducers.h.

Referenced by produce().

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

Definition at line 40 of file EgammaHLTRecoEcalCandidateProducers.h.

Referenced by produce().