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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

class  h
 

Public Member Functions

virtual void beginJob (void)
 
 EgammaHLTRecoEcalCandidateProducers (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &evt, const edm::EventSetup &es)
 
 ~EgammaHLTRecoEcalCandidateProducers ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 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
 
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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::ParameterSet conf_
 
std::string recoEcalCandidateCollection_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
scHybridBarrelProducer_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
scIslandEndcapProducer_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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 conf_, edm::ParameterSet::getParameter(), recoEcalCandidateCollection_, scHybridBarrelProducer_, scIslandEndcapProducer_, and AlCaHLTBitMon_QueryRunRegistry::string.

21  :
22  conf_(config) {
23  // use onfiguration file to setup input/output collection names
24  scHybridBarrelProducer_ = consumes<reco::SuperClusterCollection>(conf_.getParameter<edm::InputTag>("scHybridBarrelProducer"));
25  scIslandEndcapProducer_ = consumes<reco::SuperClusterCollection>(conf_.getParameter<edm::InputTag>("scIslandEndcapProducer"));
26 
27  recoEcalCandidateCollection_ = conf_.getParameter<std::string>("recoEcalCandidateCollection");
28 
29  // Register the product
30  produces< reco::RecoEcalCandidateCollection >(recoEcalCandidateCollection_);
31 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
EgammaHLTRecoEcalCandidateProducers::~EgammaHLTRecoEcalCandidateProducers ( )

Definition at line 33 of file EgammaHLTRecoEcalCandidateProducers.cc.

33 {}

Member Function Documentation

void EgammaHLTRecoEcalCandidateProducers::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 43 of file EgammaHLTRecoEcalCandidateProducers.cc.

43 {}
void EgammaHLTRecoEcalCandidateProducers::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 35 of file EgammaHLTRecoEcalCandidateProducers.cc.

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

35  {
37  desc.add<edm::InputTag>(("scHybridBarrelProducer"), edm::InputTag("correctedHybridSuperClusters"));
38  desc.add<edm::InputTag>(("scIslandEndcapProducer"), edm::InputTag("correctedEndcapSuperClustersWithPreshower"));
39  desc.add<std::string>(("recoEcalCandidateCollection"), "");
40  descriptions.add(("hltEgammaHLTRecoEcalCandidateProducers"), desc);
41 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void EgammaHLTRecoEcalCandidateProducers::produce ( edm::Event evt,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 45 of file EgammaHLTRecoEcalCandidateProducers.cc.

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

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

Member Data Documentation

edm::ParameterSet EgammaHLTRecoEcalCandidateProducers::conf_
private
std::string EgammaHLTRecoEcalCandidateProducers::recoEcalCandidateCollection_
private
edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTRecoEcalCandidateProducers::scHybridBarrelProducer_
private
edm::EDGetTokenT<reco::SuperClusterCollection> EgammaHLTRecoEcalCandidateProducers::scIslandEndcapProducer_
private