CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HFRecoEcalCandidateProducer Class Reference

#include <HFRecoEcalCandidateProducer.h>

Inheritance diagram for HFRecoEcalCandidateProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HFRecoEcalCandidateProducer (edm::ParameterSet const &conf)
 
virtual void produce (edm::Event &e, edm::EventSetup const &iSetup)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

HFRecoEcalCandidateAlgo algo_
 
double Cut2D_
 
std::vector< double > defaultDB_
 
double defaultSlope2D_
 
bool doPU_
 
edm::InputTag hfclusters_
 
std::vector< double > HFDBvector_
 
int HFDBversion_
 
reco::HFValueStruct hfvars_
 
edm::InputTag vertices_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- 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

Definition at line 24 of file HFRecoEcalCandidateProducer.h.

Constructor & Destructor Documentation

HFRecoEcalCandidateProducer::HFRecoEcalCandidateProducer ( edm::ParameterSet const &  conf)
explicit

Definition at line 31 of file HFRecoEcalCandidateProducer.cc.

31  :
32  defaultDB_(std::vector<double>()),
33  hfclusters_(conf.getParameter<edm::InputTag>("hfclusters")),
34  vertices_(conf.existsAs<edm::InputTag>("VertexCollection") ? conf.getParameter<edm::InputTag>("VertexCollection"):(edm::InputTag)"offlinePrimaryVertices"),
35  HFDBversion_(conf.existsAs<int>("HFDBversion") ? conf.getParameter<int>("HFDBversion"):99),//do nothing
36  HFDBvector_(conf.existsAs<std::vector<double> >("HFDBvector") ? conf.getParameter<std::vector<double> >("HFDBvector"):defaultDB_),
37  doPU_(false),
38  Cut2D_(conf.getParameter<double>("intercept2DCut")),
39  defaultSlope2D_((Cut2D_<=0.83)?(0.475):((Cut2D_>0.83 && Cut2D_<=0.9)?(0.275):(0.2))),//fix for hlt unable to add slope variable now
41  algo_(conf.existsAs<bool>("Correct") ? conf.getParameter<bool>("Correct") : true,
42  conf.getParameter<double>("e9e25Cut"),
43  conf.getParameter<double>("intercept2DCut"),
44  conf.existsAs<double>("intercept2DSlope") ? conf.getParameter<double>("intercept2DSlope") : defaultSlope2D_,
45  conf.getParameter<std::vector<double> >("e1e9Cut"),
46  conf.getParameter<std::vector<double> >("eCOREe9Cut"),
47  conf.getParameter<std::vector<double> >("eSeLCut"),
48  hfvars_)
49 {
50 
51  produces<reco::RecoEcalCandidateCollection>();
52 
53 }
tuple conf
Definition: dbtoconf.py:185

Member Function Documentation

void HFRecoEcalCandidateProducer::produce ( edm::Event e,
edm::EventSetup const &  iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 55 of file HFRecoEcalCandidateProducer.cc.

References algo_, edm::Event::getByLabel(), hfclusters_, HFDBversion_, GoodVertex_cfg::maxAbsZ, GoodVertex_cfg::maxd0, HFRecoEcalCandidateAlgo::produce(), edm::Handle< T >::product(), edm::Event::put(), and vertices_.

55  {
56 
57 
60 
61  e.getByLabel(hfclusters_,super_clus);
62  e.getByLabel(hfclusters_,hf_assoc);
63 
64  int nvertex = 0;
65  if(HFDBversion_!=99){
67  e.getByLabel(vertices_, pvHandle);
68  const reco::VertexCollection & vertices = *pvHandle.product();
69  static const int minNDOF = 4;
70  static const double maxAbsZ = 15.0;
71  static const double maxd0 = 2.0;
72 
73  //count verticies
74 
75  for(reco::VertexCollection::const_iterator vit = vertices.begin(); vit != vertices.end(); ++vit){
76  if(vit->ndof() > minNDOF && ((maxAbsZ <= 0) || fabs(vit->z()) <= maxAbsZ) && ((maxd0 <= 0) || fabs(vit->position().rho()) <= maxd0))
77  nvertex++;
78  }
79  }else{
80  nvertex = 1;
81  }
82 
83 
84 
85  // create return data
86  std::auto_ptr<reco::RecoEcalCandidateCollection> retdata1(new reco::RecoEcalCandidateCollection());
87 
88 
89  algo_.produce(super_clus,*hf_assoc,*retdata1,nvertex);
90 
91  e.put(retdata1);
92 
93 }
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void produce(const edm::Handle< reco::SuperClusterCollection > &SuperClusters, const reco::HFEMClusterShapeAssociationCollection &AssocShapes, reco::RecoEcalCandidateCollection &RecoECand, int nvtx)
T const * product() const
Definition: Handle.h:74
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects

Member Data Documentation

HFRecoEcalCandidateAlgo HFRecoEcalCandidateProducer::algo_
private

Definition at line 37 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

double HFRecoEcalCandidateProducer::Cut2D_
private

Definition at line 34 of file HFRecoEcalCandidateProducer.h.

std::vector<double> HFRecoEcalCandidateProducer::defaultDB_
private

Definition at line 29 of file HFRecoEcalCandidateProducer.h.

double HFRecoEcalCandidateProducer::defaultSlope2D_
private

Definition at line 35 of file HFRecoEcalCandidateProducer.h.

bool HFRecoEcalCandidateProducer::doPU_
private

Definition at line 33 of file HFRecoEcalCandidateProducer.h.

edm::InputTag HFRecoEcalCandidateProducer::hfclusters_
private

Definition at line 30 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

std::vector<double> HFRecoEcalCandidateProducer::HFDBvector_
private

Definition at line 32 of file HFRecoEcalCandidateProducer.h.

int HFRecoEcalCandidateProducer::HFDBversion_
private

Definition at line 31 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

reco::HFValueStruct HFRecoEcalCandidateProducer::hfvars_
private

Definition at line 36 of file HFRecoEcalCandidateProducer.h.

edm::InputTag HFRecoEcalCandidateProducer::vertices_
private

Definition at line 30 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().