24 std::vector<float>& vars )
const {
29 const size_t nVtx =
vertices->size();
30 float maxDR=999., maxDRDPhi=999., maxDRDEta=999., maxDRRawEnergy=0.;
31 float subClusRawE[3], subClusDPhi[3], subClusDEta[3];
32 memset(subClusRawE,0,3*
sizeof(
float));
33 memset(subClusDPhi,0,3*
sizeof(
float));
34 memset(subClusDEta,0,3*
sizeof(
float));
37 const float this_deta = (*clus)->eta() - seed->eta();
39 const float this_dr = std::hypot(this_deta,this_dphi);
40 if(this_dr > maxDR || maxDR == 999.0
f) {
42 maxDRDEta = this_deta;
43 maxDRDPhi = this_dphi;
44 maxDRRawEnergy = (*clus)->energy();
47 subClusRawE[iclus] = (*clus)->energy();
48 subClusDEta[iclus] = this_deta;
49 subClusDPhi[iclus] = this_dphi;
53 switch( seed->hitsAndFractions().at(0).first.subdetId() ) {
57 const float e2nd = EcalClusterTools::e2nd( *seed, &*
rechitsEB );
58 const float e3x3 = EcalClusterTools::e3x3( *seed,
61 const float eTop = EcalClusterTools::eTop( *seed,
64 const float eBottom = EcalClusterTools::eBottom( *seed,
67 const float eLeft = EcalClusterTools::eLeft( *seed,
70 const float eRight = EcalClusterTools::eRight( *seed,
73 const float eLpeR = eLeft + eRight;
74 const float eTpeB = eTop + eBottom;
75 const float eLmeR = eLeft - eRight;
76 const float eTmeB = eTop - eBottom;
77 std::vector<float> vCov =
79 const float see = (
isnan(vCov[0]) ? 0. :
sqrt(vCov[0]));
80 const float spp = (
isnan(vCov[2]) ? 0. :
sqrt(vCov[2]));
83 sep = vCov[1] / (see * spp);
88 float cryPhi, cryEta, thetatilt, phitilt;
91 ieta, iphi, thetatilt, phitilt);
97 vars[5] = e3x3/rawEnergy;
98 vars[6] = sc.
seed()->energy()/rawEnergy;
99 vars[7] = eMax/rawEnergy;
100 vars[8] = e2nd/rawEnergy;
101 vars[9] = (eLpeR!=0. ? eLmeR/eLpeR : 0.);
102 vars[10] = (eTpeB!=0.? eTmeB/eTpeB : 0.);
108 vars[16] = maxDRDPhi;
109 vars[17] = maxDRDEta;
110 vars[18] = maxDRRawEnergy/rawEnergy;
111 vars[19] = subClusRawE[0]/rawEnergy;
112 vars[20] = subClusRawE[1]/rawEnergy;
113 vars[21] = subClusRawE[2]/rawEnergy;
114 vars[22] = subClusDPhi[0];
115 vars[23] = subClusDPhi[1];
116 vars[24] = subClusDPhi[2];
117 vars[25] = subClusDEta[0];
118 vars[26] = subClusDEta[1];
119 vars[27] = subClusDEta[2];
124 vars[32] = calibEnergy;
130 const float e2nd = EcalClusterTools::e2nd( *seed, &*
rechitsEE );
131 const float e3x3 = EcalClusterTools::e3x3( *seed,
134 const float eTop = EcalClusterTools::eTop( *seed,
137 const float eBottom = EcalClusterTools::eBottom( *seed,
140 const float eLeft = EcalClusterTools::eLeft( *seed,
143 const float eRight = EcalClusterTools::eRight( *seed,
146 const float eLpeR = eLeft + eRight;
147 const float eTpeB = eTop + eBottom;
148 const float eLmeR = eLeft - eRight;
149 const float eTmeB = eTop - eBottom;
150 std::vector<float> vCov =
152 const float see = (
isnan(vCov[0]) ? 0. :
sqrt(vCov[0]));
153 const float spp = (
isnan(vCov[2]) ? 0. :
sqrt(vCov[2]));
156 sep = vCov[1] / (see * spp);
157 else if (vCov[1] > 0)
166 vars[5] = e3x3/rawEnergy;
167 vars[6] = sc.
seed()->energy()/rawEnergy;
168 vars[7] = eMax/rawEnergy;
169 vars[8] = e2nd/rawEnergy;
170 vars[9] = (eLpeR!=0. ? eLmeR/eLpeR : 0.);
171 vars[10] = (eTpeB!=0.? eTmeB/eTpeB : 0.);
177 vars[16] = maxDRDPhi;
178 vars[17] = maxDRDEta;
179 vars[18] = maxDRRawEnergy/rawEnergy;
180 vars[19] = subClusRawE[0]/rawEnergy;
181 vars[20] = subClusRawE[1]/rawEnergy;
182 vars[21] = subClusRawE[2]/rawEnergy;
183 vars[22] = subClusDPhi[0];
184 vars[23] = subClusDPhi[1];
185 vars[24] = subClusDPhi[2];
186 vars[25] = subClusDEta[0];
187 vars[26] = subClusDEta[1];
188 vars[27] = subClusDEta[2];
189 vars[28] = scPreshowerSum/rawEnergy;
190 vars[29] = calibEnergy;
194 throw cms::Exception(
"PFECALSuperClusterProducer::calculateRegressedEnergy")
195 <<
"Supercluster seed is either EB nor EE!" << std::endl;
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
edm::EDGetTokenT< EcalRecHitCollection > inputTagEERecHits_
double correctedEnergy() const
void setTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
double phiWidth() const
obtain phi and eta width of the Super Cluster
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Handle< reco::VertexCollection > vertices
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::Handle< EcalRecHitCollection > rechitsEB
double Phi_mpi_pi(double x)
edm::EDGetTokenT< EcalRecHitCollection > inputTagEBRecHits_
double eta() const
pseudorapidity of cluster centroid
void get(HolderT &iHolder) const
edm::ESHandle< CaloTopology > calotopo
void update(const edm::EventSetup &)
edm::EDGetTokenT< reco::VertexCollection > inputTagVertices_
void setEvent(const edm::Event &)
const CaloTopologyRecord * topo_record
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
edm::ESHandle< CaloGeometry > calogeom
size_t clustersSize() const
number of BasicCluster constituents
void localCoordsEB(const reco::CaloCluster &bclus, const edm::EventSetup &es, float &etacry, float &phicry, int &ieta, int &iphi, float &thetatilt, float &phitilt) const
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
const CaloGeometryRecord * geom_record
const CaloClusterPtr & seed() const
seed BasicCluster
double preshowerEnergy() const
energy deposited in preshower
double phi() const
azimuthal angle of cluster centroid
edm::Handle< EcalRecHitCollection > rechitsEE
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
void set(const reco::SuperCluster &, std::vector< float > &) const