CMS 3D CMS Logo

BaselinePFSCRegression.cc
Go to the documentation of this file.
5 
6 #include "TVector2.h"
8 
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 }
21 
22 void BaselinePFSCRegression::set(const reco::SuperCluster& sc, std::vector<float>& vars) const {
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 }
34 
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 }
40 
45 }
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
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)
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
unsigned long long cacheIdentifier() const
reco::VertexCollection const * vertices
T const * product() const
Definition: ESHandle.h:86
edm::ESHandle< CaloTopology > calotopo
void update(const edm::EventSetup &)
T get() const
Definition: EventSetup.h:82
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_
void fillVec(std::vector< float > &inputVec) const
void setEvent(const edm::Event &)
const CaloTopologyRecord * topo_record
edm::ESHandle< CaloGeometry > calogeom
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
EcalRecHitCollection const * rechitsEE
const CaloGeometryRecord * geom_record
vars
Definition: DeepTauId.cc:30
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
void set(const reco::SuperCluster &, std::vector< float > &) const