test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 ||
12  topofrom_es.cacheIdentifier() != topo_record->cacheIdentifier() ) {
13  topo_record = &topofrom_es;
15  }
16  const CaloGeometryRecord& geomfrom_es = es.get<CaloGeometryRecord>();
17  if( !geom_record ||
18  geomfrom_es.cacheIdentifier() != geom_record->cacheIdentifier() ) {
19  geom_record = &geomfrom_es;
21  }
22 }
23 
25  std::vector<float>& vars ) const {
26  EcalRegressionData regData;
27  regData.fill(sc,rechitsEB.product(),rechitsEE.product(),calogeom.product(),calotopo.product(),vertices.product());
28  regData.fillVec(vars);
29 
30  //solely to reproduce old exception behaviour, unnessessary although it likely is
31  if( sc.seed()->hitsAndFractions().at(0).first.subdetId()!=EcalBarrel &&
32  sc.seed()->hitsAndFractions().at(0).first.subdetId()!=EcalEndcap){
33  throw cms::Exception("PFECALSuperClusterProducer::calculateRegressedEnergy")
34  << "Supercluster seed is either EB nor EE!" << std::endl;
35  }
36 
37 
38 }
39 
42  const edm::InputTag rceb = ps.getParameter<edm::InputTag>("ecalRecHitsEB");
43  const edm::InputTag rcee = ps.getParameter<edm::InputTag>("ecalRecHitsEE");
44  const edm::InputTag vtx = ps.getParameter<edm::InputTag>("vertexCollection");
45  inputTagEBRecHits_ = cc.consumes<EcalRecHitCollection>(rceb);
46  inputTagEERecHits_ = cc.consumes<EcalRecHitCollection>(rcee);
47  inputTagVertices_ = cc.consumes<reco::VertexCollection>(vtx);
48 }
49 
54 }
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:462
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_
void get(HolderT &iHolder) 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:81
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
const CaloGeometryRecord * geom_record
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
edm::Handle< EcalRecHitCollection > rechitsEE
void set(const reco::SuperCluster &, std::vector< float > &) const