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 
46  ev.getByToken(inputTagEBRecHits_, rechitsEB);
47  ev.getByToken(inputTagEERecHits_, rechitsEE);
48  ev.getByToken(inputTagVertices_, vertices);
49 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
BaselinePFSCRegression::setEvent
void setEvent(const edm::Event &)
Definition: BaselinePFSCRegression.cc:45
BaselinePFSCRegression::calotopo
edm::ESHandle< CaloTopology > calotopo
Definition: BaselinePFSCRegression.h:40
BaselinePFSCRegression::inputTagVertices_
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_
Definition: BaselinePFSCRegression.h:44
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::SuperCluster
Definition: SuperCluster.h:18
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
BaselinePFSCRegression::topo_record
const CaloTopologyRecord * topo_record
Definition: BaselinePFSCRegression.h:38
edm::SortedCollection< EcalRecHit >
EcalRegressionData
Definition: EcalRegressionData.h:17
BaselinePFSCRegression.h
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
EcalBarrel
Definition: EcalSubdetector.h:10
BaselinePFSCRegression::calogeom
edm::ESHandle< CaloGeometry > calogeom
Definition: BaselinePFSCRegression.h:41
deltaR.h
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:73
vars
vars
Definition: DeepTauId.cc:158
PFCluster.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
BaselinePFSCRegression::rechitsEE
edm::Handle< EcalRecHitCollection > rechitsEE
Definition: BaselinePFSCRegression.h:46
BaselinePFSCRegression::geom_record
const CaloGeometryRecord * geom_record
Definition: BaselinePFSCRegression.h:39
BaselinePFSCRegression::setTokens
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
Definition: BaselinePFSCRegression.cc:36
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
EcalEndcap
Definition: EcalSubdetector.h:10
BaselinePFSCRegression::vertices
edm::Handle< reco::VertexCollection > vertices
Definition: BaselinePFSCRegression.h:45
edm::ParameterSet
Definition: ParameterSet.h:36
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
BaselinePFSCRegression::inputTagEERecHits_
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
Definition: BaselinePFSCRegression.h:43
EcalClusterTools.h
BaselinePFSCRegression::rechitsEB
edm::Handle< EcalRecHitCollection > rechitsEB
Definition: BaselinePFSCRegression.h:46
EcalRegressionData::fillVec
void fillVec(std::vector< float > &inputVec) const
Definition: EcalRegressionData.cc:158
edm::EventSetup
Definition: EventSetup.h:57
cc
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
BaselinePFSCRegression::inputTagEBRecHits_
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
Definition: BaselinePFSCRegression.h:42
EcalRegressionData.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:246
edm::eventsetup::EventSetupRecord::cacheIdentifier
unsigned long long cacheIdentifier() const
Definition: EventSetupRecord.h:185
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:39