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;
24  regData.fill(
25  sc, rechitsEB.product(), rechitsEE.product(), calogeom.product(), calotopo.product(), vertices.product());
26  regData.fillVec(vars);
27 
28  //solely to reproduce old exception behaviour, unnessessary although it likely is
29  if (sc.seed()->hitsAndFractions().at(0).first.subdetId() != EcalBarrel &&
30  sc.seed()->hitsAndFractions().at(0).first.subdetId() != EcalEndcap) {
31  throw cms::Exception("PFECALSuperClusterProducer::calculateRegressedEnergy")
32  << "Supercluster seed is either EB nor EE!" << std::endl;
33  }
34 }
35 
37  const edm::InputTag rceb = ps.getParameter<edm::InputTag>("ecalRecHitsEB");
38  const edm::InputTag rcee = ps.getParameter<edm::InputTag>("ecalRecHitsEE");
39  const edm::InputTag vtx = ps.getParameter<edm::InputTag>("vertexCollection");
40  inputTagEBRecHits_ = cc.consumes<EcalRecHitCollection>(rceb);
41  inputTagEERecHits_ = cc.consumes<EcalRecHitCollection>(rcee);
43 }
44 
49 }
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
edm::Handle< reco::VertexCollection > vertices
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::Handle< EcalRecHitCollection > rechitsEB
bool ev
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESHandle< CaloTopology > calotopo
void update(const edm::EventSetup &)
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 const * product() const
Definition: Handle.h:69
T get() const
Definition: EventSetup.h:73
const CaloGeometryRecord * geom_record
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
vars
Definition: DeepTauId.cc:158
T const * product() const
Definition: ESHandle.h:86
edm::Handle< EcalRecHitCollection > rechitsEE
void set(const reco::SuperCluster &, std::vector< float > &) const