CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

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
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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
Monica Vazquez Acosta (CERN)

$Id:

Definition at line 27 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_
const edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
EgammaHLTRecoEcalCandidateProducers::~EgammaHLTRecoEcalCandidateProducers ( )

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
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 41 of file EgammaHLTRecoEcalCandidateProducers.cc.

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

41  {
42 
43  using namespace edm;
44 
45  //
46  // create empty output collections
47  //
48 
49  reco::RecoEcalCandidateCollection outputRecoEcalCandidateCollection;
50  std::auto_ptr< reco::RecoEcalCandidateCollection > outputRecoEcalCandidateCollection_p(new 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( 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
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 38 of file EgammaHLTRecoEcalCandidateProducers.h.

Referenced by produce().

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

Definition at line 39 of file EgammaHLTRecoEcalCandidateProducers.h.

Referenced by produce().