CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HFRecoEcalCandidateProducer Class Reference

#include <HFRecoEcalCandidateProducer.h>

Inheritance diagram for HFRecoEcalCandidateProducer:
edm::stream::EDProducer<>

Public Member Functions

 HFRecoEcalCandidateProducer (edm::ParameterSet const &conf)
 
void produce (edm::Event &e, edm::EventSetup const &iSetup) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 24 of file HFRecoEcalCandidateProducer.h.

Constructor & Destructor Documentation

◆ HFRecoEcalCandidateProducer()

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

Definition at line 31 of file HFRecoEcalCandidateProducer.cc.

32  : defaultDB_(std::vector<double>()),
33  hfclustersSC_(consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("hfclusters"))),
35  consumes<reco::HFEMClusterShapeAssociationCollection>(conf.getParameter<edm::InputTag>("hfclusters"))),
36 
37  HFDBversion_(conf.existsAs<int>("HFDBversion") ? conf.getParameter<int>("HFDBversion") : 99), //do nothing
38  HFDBvector_(conf.existsAs<std::vector<double> >("HFDBvector")
39  ? conf.getParameter<std::vector<double> >("HFDBvector")
40  : defaultDB_),
41  doPU_(false),
42  Cut2D_(conf.getParameter<double>("intercept2DCut")),
44  (Cut2D_ <= 0.83)
45  ? (0.475)
46  : ((Cut2D_ > 0.83 && Cut2D_ <= 0.9) ? (0.275) : (0.2))), //fix for hlt unable to add slope variable now
48  algo_(conf.existsAs<bool>("Correct") ? conf.getParameter<bool>("Correct") : true,
49  conf.getParameter<double>("e9e25Cut"),
50  conf.getParameter<double>("intercept2DCut"),
51  conf.existsAs<double>("intercept2DSlope") ? conf.getParameter<double>("intercept2DSlope") : defaultSlope2D_,
52  conf.getParameter<std::vector<double> >("e1e9Cut"),
53  conf.getParameter<std::vector<double> >("eCOREe9Cut"),
54  conf.getParameter<std::vector<double> >("eSeLCut"),
55  hfvars_) {
56  if (conf.existsAs<edm::InputTag>("VertexCollection")) {
57  vertices_ = consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("VertexCollection"));
58  } else
59  vertices_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
60 
61  produces<reco::RecoEcalCandidateCollection>();
62 }

References edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), and vertices_.

Member Function Documentation

◆ produce()

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

Definition at line 64 of file HFRecoEcalCandidateProducer.cc.

64  {
67 
68  e.getByToken(hfclustersSC_, super_clus);
69  e.getByToken(hfclustersHFEM_, hf_assoc);
70 
71  int nvertex = 0;
72  if (HFDBversion_ != 99) {
74  e.getByToken(vertices_, pvHandle);
75  const reco::VertexCollection& vertices = *pvHandle.product();
76  static const int minNDOF = 4;
77  static const double maxAbsZ = 15.0;
78  static const double maxd0 = 2.0;
79 
80  //count verticies
81 
82  for (reco::VertexCollection::const_iterator vit = vertices.begin(); vit != vertices.end(); ++vit) {
83  if (vit->ndof() > minNDOF && ((maxAbsZ <= 0) || fabs(vit->z()) <= maxAbsZ) &&
84  ((maxd0 <= 0) || fabs(vit->position().rho()) <= maxd0))
85  nvertex++;
86  }
87  } else {
88  nvertex = 1;
89  }
90 
91  // create return data
92  auto retdata1 = std::make_unique<reco::RecoEcalCandidateCollection>();
93 
94  algo_.produce(super_clus, *hf_assoc, *retdata1, nvertex);
95 
96  e.put(std::move(retdata1));
97 }

References algo_, MillePedeFileConverter_cfg::e, hfclustersHFEM_, hfclustersSC_, HFDBversion_, commonCuts_cff::maxAbsZ, commonCuts_cff::maxd0, eostools::move(), HFRecoEcalCandidateAlgo::produce(), edm::Handle< T >::product(), pwdgSkimBPark_cfi::vertices, and vertices_.

Member Data Documentation

◆ algo_

HFRecoEcalCandidateAlgo HFRecoEcalCandidateProducer::algo_
private

Definition at line 38 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

◆ Cut2D_

double HFRecoEcalCandidateProducer::Cut2D_
private

Definition at line 35 of file HFRecoEcalCandidateProducer.h.

◆ defaultDB_

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

Definition at line 30 of file HFRecoEcalCandidateProducer.h.

◆ defaultSlope2D_

double HFRecoEcalCandidateProducer::defaultSlope2D_
private

Definition at line 36 of file HFRecoEcalCandidateProducer.h.

◆ doPU_

bool HFRecoEcalCandidateProducer::doPU_
private

Definition at line 34 of file HFRecoEcalCandidateProducer.h.

◆ hfclustersHFEM_

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersHFEM_
private

Definition at line 31 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

◆ hfclustersSC_

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersSC_
private

Definition at line 31 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

◆ HFDBvector_

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

Definition at line 33 of file HFRecoEcalCandidateProducer.h.

◆ HFDBversion_

int HFRecoEcalCandidateProducer::HFDBversion_
private

Definition at line 32 of file HFRecoEcalCandidateProducer.h.

Referenced by produce().

◆ hfvars_

reco::HFValueStruct HFRecoEcalCandidateProducer::hfvars_
private

Definition at line 37 of file HFRecoEcalCandidateProducer.h.

◆ vertices_

edm::EDGetToken HFRecoEcalCandidateProducer::vertices_
private

Definition at line 31 of file HFRecoEcalCandidateProducer.h.

Referenced by HFRecoEcalCandidateProducer(), and produce().

edm::Handle::product
T const * product() const
Definition: Handle.h:70
HFRecoEcalCandidateAlgo::produce
void produce(const edm::Handle< reco::SuperClusterCollection > &SuperClusters, const reco::HFEMClusterShapeAssociationCollection &AssocShapes, reco::RecoEcalCandidateCollection &RecoECand, int nvtx) const
Definition: HFRecoEcalCandidateAlgo.cc:105
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::Handle
Definition: AssociativeIterator.h:50
HFRecoEcalCandidateProducer::hfclustersHFEM_
edm::EDGetToken hfclustersHFEM_
Definition: HFRecoEcalCandidateProducer.h:31
HFRecoEcalCandidateProducer::Cut2D_
double Cut2D_
Definition: HFRecoEcalCandidateProducer.h:35
HFRecoEcalCandidateProducer::algo_
HFRecoEcalCandidateAlgo algo_
Definition: HFRecoEcalCandidateProducer.h:38
HFRecoEcalCandidateProducer::vertices_
edm::EDGetToken vertices_
Definition: HFRecoEcalCandidateProducer.h:31
HFRecoEcalCandidateProducer::HFDBversion_
int HFDBversion_
Definition: HFRecoEcalCandidateProducer.h:32
HFRecoEcalCandidateProducer::hfclustersSC_
edm::EDGetToken hfclustersSC_
Definition: HFRecoEcalCandidateProducer.h:31
HFRecoEcalCandidateProducer::doPU_
bool doPU_
Definition: HFRecoEcalCandidateProducer.h:34
commonCuts_cff.maxAbsZ
maxAbsZ
Definition: commonCuts_cff.py:8
HFRecoEcalCandidateProducer::hfvars_
reco::HFValueStruct hfvars_
Definition: HFRecoEcalCandidateProducer.h:37
HFRecoEcalCandidateProducer::defaultDB_
std::vector< double > defaultDB_
Definition: HFRecoEcalCandidateProducer.h:30
eostools.move
def move(src, dest)
Definition: eostools.py:511
HFRecoEcalCandidateProducer::HFDBvector_
std::vector< double > HFDBvector_
Definition: HFRecoEcalCandidateProducer.h:33
commonCuts_cff.maxd0
maxd0
Definition: commonCuts_cff.py:9
edm::InputTag
Definition: InputTag.h:15
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HFRecoEcalCandidateProducer::defaultSlope2D_
double defaultSlope2D_
Definition: HFRecoEcalCandidateProducer.h:36