CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
unsigned long long cacheIdentifier() const
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
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_
reco::VertexCollection const * vertices
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESHandle< CaloTopology > calotopo
void update(const edm::EventSetup &)
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T const * product() const
Definition: ESHandle.h:86
EcalRecHitCollection const * rechitsEE
T get() const
Definition: EventSetup.h:82
const CaloGeometryRecord * geom_record
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
vars
Definition: DeepTauId.cc:164
void set(const reco::SuperCluster &, std::vector< float > &) const