CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( edm::ParameterSet const &  conf)
explicit

Definition at line 52 of file HFRecoEcalCandidateProducer.cc.

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

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 }

Member Function Documentation

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

Definition at line 85 of file HFRecoEcalCandidateProducer.cc.

References algo_, edm::Event::getByToken(), hfclustersHFEM_, hfclustersSC_, HFDBversion_, GoodVertex_cfg::maxAbsZ, GoodVertex_cfg::maxd0, eostools::move(), HFRecoEcalCandidateAlgo::produce(), edm::Handle< T >::product(), edm::Event::put(), beam_dqm_sourceclient-live_cfg::vertices, and vertices_.

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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
void produce(const edm::Handle< reco::SuperClusterCollection > &SuperClusters, const reco::HFEMClusterShapeAssociationCollection &AssocShapes, reco::RecoEcalCandidateCollection &RecoECand, int nvtx) const
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
def move
Definition: eostools.py:511
T const * product() const
Definition: Handle.h:70

Member Data Documentation

HFRecoEcalCandidateAlgo HFRecoEcalCandidateProducer::algo_
private

Definition at line 46 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

double HFRecoEcalCandidateProducer::Cut2D_
private

Definition at line 43 of file HFRecoEcalCandidateProducer.cc.

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

Definition at line 38 of file HFRecoEcalCandidateProducer.cc.

double HFRecoEcalCandidateProducer::defaultSlope2D_
private

Definition at line 44 of file HFRecoEcalCandidateProducer.cc.

bool HFRecoEcalCandidateProducer::doPU_
private

Definition at line 42 of file HFRecoEcalCandidateProducer.cc.

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersHFEM_
private

Definition at line 39 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

edm::EDGetToken HFRecoEcalCandidateProducer::hfclustersSC_
private

Definition at line 39 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

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

Definition at line 41 of file HFRecoEcalCandidateProducer.cc.

int HFRecoEcalCandidateProducer::HFDBversion_
private

Definition at line 40 of file HFRecoEcalCandidateProducer.cc.

Referenced by produce().

reco::HFValueStruct HFRecoEcalCandidateProducer::hfvars_
private

Definition at line 45 of file HFRecoEcalCandidateProducer.cc.

edm::EDGetToken HFRecoEcalCandidateProducer::vertices_
private

Definition at line 39 of file HFRecoEcalCandidateProducer.cc.

Referenced by HFRecoEcalCandidateProducer(), and produce().