CMS 3D CMS Logo

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< EcalRecHitCollectioninputTagEBRecHits_
 
edm::EDGetTokenT< EcalRecHitCollectioninputTagEERecHits_
 
edm::EDGetTokenT< reco::VertexCollectioninputTagVertices_
 
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::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

◆ set()

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< T >::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
T const * product() const
Definition: ESHandle.h:86
edm::ESHandle< CaloTopology > calotopo
void fillVec(std::vector< float > &inputVec) const
edm::ESHandle< CaloGeometry > calogeom
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
EcalRecHitCollection const * rechitsEE
vars
Definition: DeepTauId.cc:30

◆ setEvent()

void BaselinePFSCRegression::setEvent ( const edm::Event ev)

Definition at line 41 of file BaselinePFSCRegression.cc.

References makeMEIFBenchmarkPlots::ev, inputTagEBRecHits_, inputTagEERecHits_, inputTagVertices_, rechitsEB, rechitsEE, and vertices.

41  {
45 }
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
EcalRecHitCollection const * rechitsEB
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
reco::VertexCollection const * vertices
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_
EcalRecHitCollection const * rechitsEE

◆ setTokens()

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_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_

◆ update()

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
edm::ESHandle< CaloTopology > calotopo
T get() const
Definition: EventSetup.h:82
const CaloTopologyRecord * topo_record
edm::ESHandle< CaloGeometry > calogeom
const CaloGeometryRecord * geom_record
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ calogeom

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

Definition at line 39 of file BaselinePFSCRegression.h.

Referenced by set(), and update().

◆ calotopo

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

Definition at line 38 of file BaselinePFSCRegression.h.

Referenced by set(), and update().

◆ geom_record

const CaloGeometryRecord* BaselinePFSCRegression::geom_record
private

Definition at line 37 of file BaselinePFSCRegression.h.

Referenced by update().

◆ inputTagEBRecHits_

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

Definition at line 40 of file BaselinePFSCRegression.h.

Referenced by setEvent(), and setTokens().

◆ inputTagEERecHits_

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

Definition at line 41 of file BaselinePFSCRegression.h.

Referenced by setEvent(), and setTokens().

◆ inputTagVertices_

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

Definition at line 42 of file BaselinePFSCRegression.h.

Referenced by setEvent(), and setTokens().

◆ rechitsEB

EcalRecHitCollection const* BaselinePFSCRegression::rechitsEB = nullptr
private

Definition at line 44 of file BaselinePFSCRegression.h.

Referenced by set(), and setEvent().

◆ rechitsEE

EcalRecHitCollection const* BaselinePFSCRegression::rechitsEE = nullptr
private

Definition at line 45 of file BaselinePFSCRegression.h.

Referenced by set(), and setEvent().

◆ topo_record

const CaloTopologyRecord* BaselinePFSCRegression::topo_record
private

Definition at line 36 of file BaselinePFSCRegression.h.

Referenced by update().

◆ vertices

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

Definition at line 43 of file BaselinePFSCRegression.h.

Referenced by set(), and setEvent().