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
BaselinePFSCRegression Class Reference

#include <BaselinePFSCRegression.h>

Public Member Functions

 BaselinePFSCRegression ()
 
void set (const reco::SuperCluster &, std::vector< float > &) const
 
void setEvent (const edm::Event &)
 
void setTokens (const edm::ParameterSet &, edm::ConsumesCollector &&)
 
void update (const edm::EventSetup &)
 

Private Attributes

edm::ESHandle< CaloGeometrycalogeom
 
edm::ESHandle< CaloTopologycalotopo
 
const CaloGeometryRecordgeom_record
 
edm::EDGetTokenT
< EcalRecHitCollection
inputTagEBRecHits_
 
edm::EDGetTokenT
< EcalRecHitCollection
inputTagEERecHits_
 
edm::EDGetTokenT
< reco::VertexCollection
inputTagVertices_
 
EcalRecHitCollection const * rechitsEB = nullptr
 
EcalRecHitCollection const * rechitsEE = nullptr
 
const CaloTopologyRecordtopo_record
 
reco::VertexCollection const * vertices = nullptr
 

Detailed Description

Definition at line 27 of file BaselinePFSCRegression.h.

Constructor & Destructor Documentation

BaselinePFSCRegression::BaselinePFSCRegression ( )
inline

Definition at line 29 of file BaselinePFSCRegression.h.

29 : topo_record(nullptr), geom_record(nullptr){};
const CaloTopologyRecord * topo_record
const CaloGeometryRecord * geom_record

Member Function Documentation

void BaselinePFSCRegression::set ( const reco::SuperCluster sc,
std::vector< float > &  vars 
) const

Definition at line 22 of file BaselinePFSCRegression.cc.

References calogeom, calotopo, EcalBarrel, EcalEndcap, Exception, EcalRegressionData::fill(), EcalRegressionData::fillVec(), edm::ESHandle< class >::product(), rechitsEB, rechitsEE, reco::SuperCluster::seed(), and vertices.

22  {
23  EcalRegressionData regData;
25  regData.fillVec(vars);
26 
27  //solely to reproduce old exception behaviour, unnessessary although it likely is
28  if (sc.seed()->hitsAndFractions().at(0).first.subdetId() != EcalBarrel &&
29  sc.seed()->hitsAndFractions().at(0).first.subdetId() != EcalEndcap) {
30  throw cms::Exception("PFECALSuperClusterProducer::calculateRegressedEnergy")
31  << "Supercluster seed is either EB nor EE!" << std::endl;
32  }
33 }
EcalRecHitCollection const * rechitsEB
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
reco::VertexCollection const * vertices
edm::ESHandle< CaloTopology > calotopo
void fillVec(std::vector< float > &inputVec) const
edm::ESHandle< CaloGeometry > calogeom
T const * product() const
Definition: ESHandle.h:86
EcalRecHitCollection const * rechitsEE
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
vars
Definition: DeepTauId.cc:164
void BaselinePFSCRegression::setEvent ( const edm::Event ev)

Definition at line 41 of file BaselinePFSCRegression.cc.

References edm::Event::get(), inputTagEBRecHits_, inputTagEERecHits_, inputTagVertices_, rechitsEB, rechitsEE, and vertices.

41  {
45 }
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
EcalRecHitCollection const * rechitsEB
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
reco::VertexCollection const * vertices
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_
EcalRecHitCollection const * rechitsEE
void BaselinePFSCRegression::setTokens ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  cc 
)

Definition at line 35 of file BaselinePFSCRegression.cc.

References edm::ParameterSet::getParameter(), inputTagEBRecHits_, inputTagEERecHits_, and inputTagVertices_.

35  {
36  inputTagEBRecHits_ = cc.consumes(ps.getParameter<edm::InputTag>("ecalRecHitsEB"));
37  inputTagEERecHits_ = cc.consumes(ps.getParameter<edm::InputTag>("ecalRecHitsEE"));
38  inputTagVertices_ = cc.consumes(ps.getParameter<edm::InputTag>("vertexCollection"));
39 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void BaselinePFSCRegression::update ( const edm::EventSetup es)

Definition at line 9 of file BaselinePFSCRegression.cc.

References edm::eventsetup::EventSetupRecord::cacheIdentifier(), calogeom, calotopo, geom_record, edm::EventSetup::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), and topo_record.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

9  {
10  const CaloTopologyRecord& topofrom_es = es.get<CaloTopologyRecord>();
11  if (!topo_record || topofrom_es.cacheIdentifier() != topo_record->cacheIdentifier()) {
12  topo_record = &topofrom_es;
14  }
15  const CaloGeometryRecord& geomfrom_es = es.get<CaloGeometryRecord>();
16  if (!geom_record || geomfrom_es.cacheIdentifier() != geom_record->cacheIdentifier()) {
17  geom_record = &geomfrom_es;
19  }
20 }
unsigned long long cacheIdentifier() const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESHandle< CaloTopology > calotopo
const CaloTopologyRecord * topo_record
edm::ESHandle< CaloGeometry > calogeom
T get() const
Definition: EventSetup.h:82
const CaloGeometryRecord * geom_record

Member Data Documentation

edm::ESHandle<CaloGeometry> BaselinePFSCRegression::calogeom
private

Definition at line 39 of file BaselinePFSCRegression.h.

Referenced by set(), and update().

edm::ESHandle<CaloTopology> BaselinePFSCRegression::calotopo
private

Definition at line 38 of file BaselinePFSCRegression.h.

Referenced by set(), and update().

const CaloGeometryRecord* BaselinePFSCRegression::geom_record
private

Definition at line 37 of file BaselinePFSCRegression.h.

Referenced by update().

edm::EDGetTokenT<EcalRecHitCollection> BaselinePFSCRegression::inputTagEBRecHits_
private

Definition at line 40 of file BaselinePFSCRegression.h.

Referenced by setEvent(), and setTokens().

edm::EDGetTokenT<EcalRecHitCollection> BaselinePFSCRegression::inputTagEERecHits_
private

Definition at line 41 of file BaselinePFSCRegression.h.

Referenced by setEvent(), and setTokens().

edm::EDGetTokenT<reco::VertexCollection> BaselinePFSCRegression::inputTagVertices_
private

Definition at line 42 of file BaselinePFSCRegression.h.

Referenced by setEvent(), and setTokens().

EcalRecHitCollection const* BaselinePFSCRegression::rechitsEB = nullptr
private

Definition at line 44 of file BaselinePFSCRegression.h.

Referenced by set(), and setEvent().

EcalRecHitCollection const* BaselinePFSCRegression::rechitsEE = nullptr
private

Definition at line 45 of file BaselinePFSCRegression.h.

Referenced by set(), and setEvent().

const CaloTopologyRecord* BaselinePFSCRegression::topo_record
private

Definition at line 36 of file BaselinePFSCRegression.h.

Referenced by update().

reco::VertexCollection const* BaselinePFSCRegression::vertices = nullptr
private

Definition at line 43 of file BaselinePFSCRegression.h.

Referenced by set(), and setEvent().