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::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
BaselinePFSCRegression::setEvent
void setEvent(const edm::Event &)
Definition: BaselinePFSCRegression.cc:41
BaselinePFSCRegression::calotopo
edm::ESHandle< CaloTopology > calotopo
Definition: BaselinePFSCRegression.h:38
BaselinePFSCRegression::inputTagVertices_
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_
Definition: BaselinePFSCRegression.h:42
reco::SuperCluster
Definition: SuperCluster.h:18
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
BaselinePFSCRegression::topo_record
const CaloTopologyRecord * topo_record
Definition: BaselinePFSCRegression.h:36
EcalRegressionData
Definition: EcalRegressionData.h:17
BaselinePFSCRegression.h
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
BaselinePFSCRegression::rechitsEE
EcalRecHitCollection const * rechitsEE
Definition: BaselinePFSCRegression.h:45
EcalBarrel
Definition: EcalSubdetector.h:10
BaselinePFSCRegression::calogeom
edm::ESHandle< CaloGeometry > calogeom
Definition: BaselinePFSCRegression.h:39
BaselinePFSCRegression::set
void set(const reco::SuperCluster &, std::vector< float > &) const
Definition: BaselinePFSCRegression.cc:22
EcalRegressionData::fill
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
Definition: EcalRegressionData.h:82
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
vars
vars
Definition: DeepTauId.cc:164
PFCluster.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
BaselinePFSCRegression::geom_record
const CaloGeometryRecord * geom_record
Definition: BaselinePFSCRegression.h:37
BaselinePFSCRegression::setTokens
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
Definition: BaselinePFSCRegression.cc:35
EcalEndcap
Definition: EcalSubdetector.h:10
edm::ParameterSet
Definition: ParameterSet.h:47
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
deltaR.h
BaselinePFSCRegression::inputTagEERecHits_
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
Definition: BaselinePFSCRegression.h:41
EcalClusterTools.h
BaselinePFSCRegression::rechitsEB
EcalRecHitCollection const * rechitsEB
Definition: BaselinePFSCRegression.h:44
EcalRegressionData::fillVec
void fillVec(std::vector< float > &inputVec) const
Definition: EcalRegressionData.cc:158
edm::EventSetup
Definition: EventSetup.h:58
cc
BaselinePFSCRegression::inputTagEBRecHits_
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
Definition: BaselinePFSCRegression.h:40
EcalRegressionData.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
Exception
Definition: hltDiff.cc:245
BaselinePFSCRegression::vertices
reco::VertexCollection const * vertices
Definition: BaselinePFSCRegression.h:43
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::eventsetup::EventSetupRecord::cacheIdentifier
unsigned long long cacheIdentifier() const
Definition: EventSetupRecord.h:187
BaselinePFSCRegression::update
void update(const edm::EventSetup &)
Definition: BaselinePFSCRegression.cc:9
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45