CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HFRecoEcalCandidateProducer Class Reference
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 32 of file HFRecoEcalCandidateProducer.cc.

Constructor & Destructor Documentation

◆ HFRecoEcalCandidateProducer()

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

Definition at line 52 of file HFRecoEcalCandidateProducer.cc.

53  : defaultDB_(std::vector<double>()),
54  hfclustersSC_(consumes<reco::SuperClusterCollection>(conf.getParameter<edm::InputTag>("hfclusters"))),
56  consumes<reco::HFEMClusterShapeAssociationCollection>(conf.getParameter<edm::InputTag>("hfclusters"))),
57 
58  HFDBversion_(conf.existsAs<int>("HFDBversion") ? conf.getParameter<int>("HFDBversion") : 99), //do nothing
59  HFDBvector_(conf.existsAs<std::vector<double> >("HFDBvector")
60  ? conf.getParameter<std::vector<double> >("HFDBvector")
61  : defaultDB_),
62  doPU_(false),
63  Cut2D_(conf.getParameter<double>("intercept2DCut")),
65  (Cut2D_ <= 0.83)
66  ? (0.475)
67  : ((Cut2D_ > 0.83 && Cut2D_ <= 0.9) ? (0.275) : (0.2))), //fix for hlt unable to add slope variable now
69  algo_(conf.existsAs<bool>("Correct") ? conf.getParameter<bool>("Correct") : true,
70  conf.getParameter<double>("e9e25Cut"),
71  conf.getParameter<double>("intercept2DCut"),
72  conf.existsAs<double>("intercept2DSlope") ? conf.getParameter<double>("intercept2DSlope") : defaultSlope2D_,
73  conf.getParameter<std::vector<double> >("e1e9Cut"),
74  conf.getParameter<std::vector<double> >("eCOREe9Cut"),
75  conf.getParameter<std::vector<double> >("eSeLCut"),
76  hfvars_) {
77  if (conf.existsAs<edm::InputTag>("VertexCollection")) {
78  vertices_ = consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("VertexCollection"));
79  } else
80  vertices_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
81 
82  produces<reco::RecoEcalCandidateCollection>();
83 }

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 85 of file HFRecoEcalCandidateProducer.cc.

85  {
88 
89  e.getByToken(hfclustersSC_, super_clus);
90  e.getByToken(hfclustersHFEM_, hf_assoc);
91 
92  int nvertex = 0;
93  if (HFDBversion_ != 99) {
95  e.getByToken(vertices_, pvHandle);
96  const reco::VertexCollection& vertices = *pvHandle.product();
97  static const int minNDOF = 4;
98  static const double maxAbsZ = 15.0;
99  static const double maxd0 = 2.0;
100 
101  //count verticies
102 
103  for (reco::VertexCollection::const_iterator vit = vertices.begin(); vit != vertices.end(); ++vit) {
104  if (vit->ndof() > minNDOF && ((maxAbsZ <= 0) || fabs(vit->z()) <= maxAbsZ) &&
105  ((maxd0 <= 0) || fabs(vit->position().rho()) <= maxd0))
106  nvertex++;
107  }
108  } else {
109  nvertex = 1;
110  }
111 
112  // create return data
113  auto retdata1 = std::make_unique<reco::RecoEcalCandidateCollection>();
114 
115  algo_.produce(super_clus, *hf_assoc, *retdata1, nvertex);
116 
117  e.put(std::move(retdata1));
118 }

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

Member Data Documentation

◆ algo_

HFRecoEcalCandidateAlgo HFRecoEcalCandidateProducer::algo_
private

Definition at line 46 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

◆ Cut2D_

double HFRecoEcalCandidateProducer::Cut2D_
private

Definition at line 43 of file HFRecoEcalCandidateProducer.cc.

◆ defaultDB_

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

Definition at line 38 of file HFRecoEcalCandidateProducer.cc.

◆ defaultSlope2D_

double HFRecoEcalCandidateProducer::defaultSlope2D_
private

Definition at line 44 of file HFRecoEcalCandidateProducer.cc.

◆ doPU_

bool HFRecoEcalCandidateProducer::doPU_
private

Definition at line 42 of file HFRecoEcalCandidateProducer.cc.

◆ hfclustersHFEM_

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersHFEM_
private

Definition at line 39 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

◆ hfclustersSC_

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersSC_
private

Definition at line 39 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

◆ HFDBvector_

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

Definition at line 41 of file HFRecoEcalCandidateProducer.cc.

◆ HFDBversion_

int HFRecoEcalCandidateProducer::HFDBversion_
private

Definition at line 40 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

◆ hfvars_

reco::HFValueStruct HFRecoEcalCandidateProducer::hfvars_
private

Definition at line 45 of file HFRecoEcalCandidateProducer.cc.

◆ vertices_

edm::EDGetToken HFRecoEcalCandidateProducer::vertices_
private

Definition at line 39 of file HFRecoEcalCandidateProducer.cc.

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.cc:39
HFRecoEcalCandidateProducer::Cut2D_
double Cut2D_
Definition: HFRecoEcalCandidateProducer.cc:43
AlignmentTracksFromVertexSelector_cfi.vertices
vertices
Definition: AlignmentTracksFromVertexSelector_cfi.py:5
HFRecoEcalCandidateProducer::algo_
HFRecoEcalCandidateAlgo algo_
Definition: HFRecoEcalCandidateProducer.cc:46
HFRecoEcalCandidateProducer::vertices_
edm::EDGetToken vertices_
Definition: HFRecoEcalCandidateProducer.cc:39
HFRecoEcalCandidateProducer::HFDBversion_
int HFDBversion_
Definition: HFRecoEcalCandidateProducer.cc:40
HFRecoEcalCandidateProducer::hfclustersSC_
edm::EDGetToken hfclustersSC_
Definition: HFRecoEcalCandidateProducer.cc:39
HFRecoEcalCandidateProducer::doPU_
bool doPU_
Definition: HFRecoEcalCandidateProducer.cc:42
commonCuts_cff.maxAbsZ
maxAbsZ
Definition: commonCuts_cff.py:8
HFRecoEcalCandidateProducer::hfvars_
reco::HFValueStruct hfvars_
Definition: HFRecoEcalCandidateProducer.cc:45
HFRecoEcalCandidateProducer::defaultDB_
std::vector< double > defaultDB_
Definition: HFRecoEcalCandidateProducer.cc:38
eostools.move
def move(src, dest)
Definition: eostools.py:511
HFRecoEcalCandidateProducer::HFDBvector_
std::vector< double > HFDBvector_
Definition: HFRecoEcalCandidateProducer.cc:41
commonCuts_cff.maxd0
maxd0
Definition: commonCuts_cff.py:9
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HFRecoEcalCandidateProducer::defaultSlope2D_
double defaultSlope2D_
Definition: HFRecoEcalCandidateProducer.cc:44