CMS 3D CMS Logo

List of all members | Classes | Static Public Member Functions | Static Private Member Functions
EcalClusterToolsT< noZS > Class Template Reference

#include <EcalClusterTools.h>

Classes

struct  EcalClusterEnergyDeposition
 

Static Public Member Functions

static Cluster2ndMoments cluster2ndMoments (const reco::BasicCluster &basicCluster, const EcalRecHitCollection &recHits, double phiCorrectionFactor=0.8, double w0=4.7, bool useLogWeights=true)
 
static Cluster2ndMoments cluster2ndMoments (const reco::SuperCluster &superCluster, const EcalRecHitCollection &recHits, double phiCorrectionFactor=0.8, double w0=4.7, bool useLogWeights=true)
 
static Cluster2ndMoments cluster2ndMoments (const std::vector< std::pair< const EcalRecHit *, float >> &RH_ptrs_fracs, double phiCorrectionFactor=0.8, double w0=4.7, bool useLogWeights=true)
 
static std::vector< float > covariances (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
 
static float e1x3 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e1x5 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e2nd (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
 
static float e2x2 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e2x5Bottom (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e2x5Left (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e2x5Max (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e2x5Right (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e2x5Top (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e3x1 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e3x2 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e3x3 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e4x4 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e5x1 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float e5x5 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float eBottom (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float eLeft (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float eMax (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
 
static std::vector< float > energyBasketFractionEta (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
 
static std::vector< float > energyBasketFractionPhi (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
 
static float eRight (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float eTop (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float getFraction (const std::vector< std::pair< DetId, float >> &v_id, DetId id)
 
static std::pair< DetId, float > getMaximum (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
 
static std::pair< DetId, float > getMaximum (const std::vector< std::pair< DetId, float >> &v_id, const EcalRecHitCollection *recHits)
 
static std::vector< float > lat (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, bool logW=true, float w0=4.7)
 
static std::vector< float > localCovariances (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
 
static std::vector< DetIdmatrixDetId (const CaloTopology *topology, DetId id, CaloRectangle rectangle)
 
static std::vector< DetIdmatrixDetId (const CaloTopology *topology, DetId id, int size)
 
static float matrixEnergy (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, DetId id, CaloRectangle rectangle)
 
static int matrixSize (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, DetId id, CaloRectangle rectangle)
 
static int n5x5 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static int nrSaturatedCrysIn5x5 (const DetId &id, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static float recHitEnergy (DetId id, const EcalRecHitCollection *recHits)
 
static std::vector< float > roundnessBarrelSuperClusters (const reco::SuperCluster &superCluster, const EcalRecHitCollection &recHits, int weightedPositionMethod=0, float energyThreshold=0.0)
 
static std::vector< float > roundnessBarrelSuperClustersUserExtended (const reco::SuperCluster &superCluster, const EcalRecHitCollection &recHits, int ieta_delta=0, int iphi_delta=0, float energyRHThresh=0.00000, int weightedPositionMethod=0)
 
static std::vector< float > roundnessSelectedBarrelRecHits (const std::vector< std::pair< const EcalRecHit *, float >> &rhVector, int weightedPositionMethod=0)
 
static std::vector< float > scLocalCovariances (const reco::SuperCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
 
static double zernike20 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, double R0=6.6, bool logW=true, float w0=4.7)
 
static double zernike42 (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, double R0=6.6, bool logW=true, float w0=4.7)
 

Static Private Member Functions

static double absZernikeMoment (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, int n, int m, double R0, bool logW, float w0)
 
static double calc_AbsZernikeMoment (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, int n, int m, double R0, bool logW, float w0)
 
static float computeWeight (float eRH, float energyTotal, int weightedPositionMethod)
 
static int deltaIEta (int seed_ieta, int rh_ieta)
 
static int deltaIPhi (int seed_iphi, int rh_iphi)
 
static double f00 (double r)
 
static double f11 (double r)
 
static double f20 (double r)
 
static double f22 (double r)
 
static double f31 (double r)
 
static double f33 (double r)
 
static double f40 (double r)
 
static double f42 (double r)
 
static double f44 (double r)
 
static double f51 (double r)
 
static double f53 (double r)
 
static double f55 (double r)
 
static double factorial (int n)
 
static double fast_AbsZernikeMoment (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, int n, int m, double R0, bool logW, float w0)
 
static float getDPhiEndcap (const DetId &crysId, float meanX, float meanY)
 
static std::vector< EcalClusterEnergyDepositiongetEnergyDepTopology (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, bool logW, float w0)
 
static float getIEta (const DetId &id)
 
static float getIPhi (const DetId &id)
 
static float getNormedIX (const DetId &id)
 
static float getNormedIY (const DetId &id)
 
static float getNrCrysDiffInEta (const DetId &crysId, const DetId &orginId)
 
static float getNrCrysDiffInPhi (const DetId &crysId, const DetId &orginId)
 
static std::vector< int > getSeedPosition (const std::vector< std::pair< const EcalRecHit *, float >> &RH_ptrs)
 
static float getSumEnergy (const std::vector< std::pair< const EcalRecHit *, float >> &RH_ptrs_fracs)
 
static std::pair< float, float > mean5x5PositionInLocalCrysCoord (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static std::pair< float, float > mean5x5PositionInXY (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
 
static math::XYZVector meanClusterPosition (const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry)
 

Detailed Description

template<bool noZS>
class EcalClusterToolsT< noZS >

Definition at line 73 of file EcalClusterTools.h.

Member Function Documentation

◆ absZernikeMoment()

template<bool noZS>
double EcalClusterToolsT< noZS >::absZernikeMoment ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloGeometry geometry,
int  n,
int  m,
double  R0,
bool  logW,
float  w0 
)
staticprivate

Definition at line 1132 of file EcalClusterTools.h.

1139  {
1140  // 1. Check if n,m are correctly
1141  if ((m > n) || ((n - m) % 2 != 0) || (n < 0) || (m < 0))
1142  return -1;
1143 
1144  // 2. Check if n,R0 are within validity Range :
1145  // n>20 or R0<2.19cm just makes no sense !
1146  if ((n > 20) || (R0 <= 2.19))
1147  return -1;
1148  if (n <= 5)
1149  return fast_AbsZernikeMoment(cluster, recHits, geometry, n, m, R0, logW, w0);
1150  else
1151  return calc_AbsZernikeMoment(cluster, recHits, geometry, n, m, R0, logW, w0);
1152 }

References visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, HLT_2018_cff::R0, and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ calc_AbsZernikeMoment()

template<bool noZS>
double EcalClusterToolsT< noZS >::calc_AbsZernikeMoment ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloGeometry geometry,
int  n,
int  m,
double  R0,
bool  logW,
float  w0 
)
staticprivate

Definition at line 1198 of file EcalClusterTools.h.

1205  {
1206  double r, ph, e, Re = 0, Im = 0, f_nm;
1207  double TotalEnergy = cluster.energy();
1208  std::vector<EcalClusterEnergyDeposition> energyDistribution =
1209  getEnergyDepTopology(cluster, recHits, geometry, logW, w0);
1210  int clusterSize = energyDistribution.size();
1211  if (clusterSize < 3)
1212  return 0.0;
1213 
1214  for (int i = 0; i < clusterSize; ++i) {
1215  r = energyDistribution[i].r / R0;
1216  if (r < 1) {
1217  ph = energyDistribution[i].phi;
1218  e = energyDistribution[i].deposited_energy;
1219  f_nm = 0;
1220  for (int s = 0; s <= (n - m) / 2; s++) {
1221  if (s % 2 == 0) {
1222  f_nm = f_nm + factorial(n - s) * pow(r, (double)(n - 2 * s)) /
1223  (factorial(s) * factorial((n + m) / 2 - s) * factorial((n - m) / 2 - s));
1224  } else {
1225  f_nm = f_nm - factorial(n - s) * pow(r, (double)(n - 2 * s)) /
1226  (factorial(s) * factorial((n + m) / 2 - s) * factorial((n - m) / 2 - s));
1227  }
1228  }
1229  Re = Re + e / TotalEnergy * f_nm * cos((double)m * ph);
1230  Im = Im - e / TotalEnergy * f_nm * sin((double)m * ph);
1231  }
1232  }
1233  return sqrt(Re * Re + Im * Im);
1234 }

References funct::cos(), MillePedeFileConverter_cfg::e, reco::CaloCluster::energy(), factorial(), mps_fire::i, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, funct::pow(), alignCSCRings::r, HLT_2018_cff::R0, FastTrackerRecHitMaskProducer_cfi::recHits, alignCSCRings::s, funct::sin(), and mathSSE::sqrt().

◆ cluster2ndMoments() [1/3]

template<bool noZS>
Cluster2ndMoments EcalClusterToolsT< noZS >::cluster2ndMoments ( const reco::BasicCluster basicCluster,
const EcalRecHitCollection recHits,
double  phiCorrectionFactor = 0.8,
double  w0 = 4.7,
bool  useLogWeights = true 
)
static

Definition at line 1446 of file EcalClusterTools.h.

1450  {
1451  if (recHits.empty())
1452  return Cluster2ndMoments();
1453 
1454  std::vector<std::pair<const EcalRecHit *, float>> RH_ptrs_fracs;
1455 
1456  const std::vector<std::pair<DetId, float>> &myHitsPair = basicCluster.hitsAndFractions();
1457 
1458  for (unsigned int i = 0; i < myHitsPair.size(); i++) {
1459  //get pointer to recHit object
1460  EcalRecHitCollection::const_iterator myRH = recHits.find(myHitsPair[i].first);
1461  if (myRH != recHits.end()) {
1462  RH_ptrs_fracs.push_back(std::make_pair(&(*myRH), myHitsPair[i].second));
1463  }
1464  }
1465 
1466  return EcalClusterToolsT<noZS>::cluster2ndMoments(RH_ptrs_fracs, phiCorrectionFactor, w0, useLogWeights);
1467 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), mps_fire::i, FastTrackerRecHitMaskProducer_cfi::recHits, and edm::second().

Referenced by EcalClusterToolsT< noZS >::cluster2ndMoments(), GEDPhotonProducer::fillPhotonCollection(), and EG9X105XObjectUpdateModifier::modifyObject().

◆ cluster2ndMoments() [2/3]

template<bool noZS>
Cluster2ndMoments EcalClusterToolsT< noZS >::cluster2ndMoments ( const reco::SuperCluster superCluster,
const EcalRecHitCollection recHits,
double  phiCorrectionFactor = 0.8,
double  w0 = 4.7,
bool  useLogWeights = true 
)
static

Definition at line 1470 of file EcalClusterTools.h.

1474  {
1476  *(superCluster.seed()), recHits, phiCorrectionFactor, w0, useLogWeights);
1477 }

References EcalClusterToolsT< noZS >::cluster2ndMoments(), FastTrackerRecHitMaskProducer_cfi::recHits, and reco::SuperCluster::seed().

◆ cluster2ndMoments() [3/3]

template<bool noZS>
Cluster2ndMoments EcalClusterToolsT< noZS >::cluster2ndMoments ( const std::vector< std::pair< const EcalRecHit *, float >> &  RH_ptrs_fracs,
double  phiCorrectionFactor = 0.8,
double  w0 = 4.7,
bool  useLogWeights = true 
)
static

Definition at line 1480 of file EcalClusterTools.h.

1484  {
1485  if (RH_ptrs_fracs.empty())
1486  return Cluster2ndMoments();
1487 
1488  double mid_eta(0), mid_phi(0), mid_x(0), mid_y(0);
1489 
1490  double Etot = EcalClusterToolsT<noZS>::getSumEnergy(RH_ptrs_fracs);
1491 
1492  double max_phi = -10.;
1493  double min_phi = 100.;
1494 
1495  std::vector<double> etaDetId;
1496  std::vector<double> phiDetId;
1497  std::vector<double> xDetId;
1498  std::vector<double> yDetId;
1499  std::vector<double> wiDetId;
1500 
1501  unsigned int nCry = 0;
1502  double denominator = 0.;
1503  bool isBarrel(true);
1504 
1505  // loop over rechits and compute weights:
1506  for (std::vector<std::pair<const EcalRecHit *, float>>::const_iterator rhf_ptr = RH_ptrs_fracs.begin();
1507  rhf_ptr != RH_ptrs_fracs.end();
1508  rhf_ptr++) {
1509  const EcalRecHit *rh_ptr = rhf_ptr->first;
1510 
1511  //get iEta, iPhi
1512  double temp_eta(0), temp_phi(0), temp_x(0), temp_y(0);
1513  isBarrel = rh_ptr->detid().subdetId() == EcalBarrel;
1514 
1515  if (isBarrel) {
1516  temp_eta = (getIEta(rh_ptr->detid()) > 0. ? getIEta(rh_ptr->detid()) + 84.5 : getIEta(rh_ptr->detid()) + 85.5);
1517  temp_phi = getIPhi(rh_ptr->detid()) - 0.5;
1518  } else {
1519  temp_eta = getIEta(rh_ptr->detid());
1520  temp_x = getNormedIX(rh_ptr->detid());
1521  temp_y = getNormedIY(rh_ptr->detid());
1522  }
1523 
1524  double temp_ene = rh_ptr->energy() * (noZS ? 1.0 : rhf_ptr->second);
1525 
1526  double temp_wi = ((useLogWeights) ? std::max(0.0, w0 + std::log(std::abs(temp_ene) / Etot)) : temp_ene);
1527 
1528  if (temp_phi > max_phi)
1529  max_phi = temp_phi;
1530  if (temp_phi < min_phi)
1531  min_phi = temp_phi;
1532  etaDetId.push_back(temp_eta);
1533  phiDetId.push_back(temp_phi);
1534  xDetId.push_back(temp_x);
1535  yDetId.push_back(temp_y);
1536  wiDetId.push_back(temp_wi);
1537  denominator += temp_wi;
1538  nCry++;
1539  }
1540 
1541  if (isBarrel) {
1542  // correct phi wrap-around:
1543  if (max_phi == 359.5 && min_phi == 0.5) {
1544  for (unsigned int i = 0; i < nCry; i++) {
1545  if (phiDetId[i] - 179. > 0.)
1546  phiDetId[i] -= 360.;
1547  mid_phi += phiDetId[i] * wiDetId[i];
1548  mid_eta += etaDetId[i] * wiDetId[i];
1549  }
1550  } else {
1551  for (unsigned int i = 0; i < nCry; i++) {
1552  mid_phi += phiDetId[i] * wiDetId[i];
1553  mid_eta += etaDetId[i] * wiDetId[i];
1554  }
1555  }
1556  } else {
1557  for (unsigned int i = 0; i < nCry; i++) {
1558  mid_eta += etaDetId[i] * wiDetId[i];
1559  mid_x += xDetId[i] * wiDetId[i];
1560  mid_y += yDetId[i] * wiDetId[i];
1561  }
1562  }
1563 
1564  mid_eta /= denominator;
1565  mid_phi /= denominator;
1566  mid_x /= denominator;
1567  mid_y /= denominator;
1568 
1569  // See = sigma eta eta
1570  // Spp = (B field corrected) sigma phi phi
1571  // See = (B field corrected) sigma eta phi
1572  double See = 0.;
1573  double Spp = 0.;
1574  double Sep = 0.;
1575  double deta(0), dphi(0);
1576  // compute (phi-corrected) covariance matrix:
1577  for (unsigned int i = 0; i < nCry; i++) {
1578  if (isBarrel) {
1579  deta = etaDetId[i] - mid_eta;
1580  dphi = phiDetId[i] - mid_phi;
1581  } else {
1582  deta = etaDetId[i] - mid_eta;
1583  float hitLocalR2 = (xDetId[i] - mid_x) * (xDetId[i] - mid_x) + (yDetId[i] - mid_y) * (yDetId[i] - mid_y);
1584  float hitR2 = xDetId[i] * xDetId[i] + yDetId[i] * yDetId[i];
1585  float meanR2 = mid_x * mid_x + mid_y * mid_y;
1586  float hitR = sqrt(hitR2);
1587  float meanR = sqrt(meanR2);
1588  float phi = acos((hitR2 + meanR2 - hitLocalR2) / (2 * hitR * meanR));
1589  dphi = hitR * phi;
1590  }
1591  See += (wiDetId[i] * deta * deta) / denominator;
1592  Spp += phiCorrectionFactor * (wiDetId[i] * dphi * dphi) / denominator;
1593  Sep += sqrt(phiCorrectionFactor) * (wiDetId[i] * deta * dphi) / denominator;
1594  }
1595 
1596  Cluster2ndMoments returnMoments;
1597 
1598  // compute matrix eigenvalues:
1599  returnMoments.sMaj = ((See + Spp) + sqrt((See - Spp) * (See - Spp) + 4. * Sep * Sep)) / 2.;
1600  returnMoments.sMin = ((See + Spp) - sqrt((See - Spp) * (See - Spp) + 4. * Sep * Sep)) / 2.;
1601 
1602  returnMoments.alpha = atan((See - Spp + sqrt((Spp - See) * (Spp - See) + 4. * Sep * Sep)) / (2. * Sep));
1603 
1604  return returnMoments;
1605 }

References funct::abs(), Cluster2ndMoments::alpha, HLTTauDQMOffline_cfi::denominator, EcalRecHit::detid(), EcalBarrel, EcalRecHit::energy(), EcalClusterToolsT< noZS >::getSumEnergy(), mps_fire::i, PixelPluginsPhase0_cfi::isBarrel, dqm-mbProfile::log, SiStripPI::max, PVValHelper::phi, Cluster2ndMoments::sMaj, Cluster2ndMoments::sMin, mathSSE::sqrt(), and DetId::subdetId().

◆ computeWeight()

template<bool noZS>
static float EcalClusterToolsT< noZS >::computeWeight ( float  eRH,
float  energyTotal,
int  weightedPositionMethod 
)
staticprivate

◆ covariances()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::covariances ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology,
const CaloGeometry geometry,
float  w0 = 4.7 
)
static

Definition at line 957 of file EcalClusterTools.h.

961  {
962  float e_5x5 = e5x5(cluster, recHits, topology);
963  float covEtaEta, covEtaPhi, covPhiPhi;
964  if (e_5x5 >= 0.) {
965  //double w0_ = parameterMap_.find("W0")->second;
966  const std::vector<std::pair<DetId, float>> &v_id = cluster.hitsAndFractions();
967  math::XYZVector meanPosition = meanClusterPosition(cluster, recHits, topology, geometry);
968 
969  // now we can calculate the covariances
970  double numeratorEtaEta = 0;
971  double numeratorEtaPhi = 0;
972  double numeratorPhiPhi = 0;
973  double denominator = 0;
974 
975  DetId id = getMaximum(v_id, recHits).first;
976  CaloRectangle rectangle{-2, 2, -2, 2};
977  for (auto const &detId : rectangle(id, *topology)) {
978  float frac = getFraction(v_id, detId);
979  float energy = recHitEnergy(detId, recHits) * frac;
980 
981  if (energy <= 0)
982  continue;
983 
984  const CaloSubdetectorGeometry *geo = geometry->getSubdetectorGeometry(detId);
985  GlobalPoint position = geo->getGeometry(detId)->getPosition();
986 
987  double dPhi = position.phi() - meanPosition.phi();
988  if (dPhi > +Geom::pi()) {
989  dPhi = Geom::twoPi() - dPhi;
990  }
991  if (dPhi < -Geom::pi()) {
992  dPhi = Geom::twoPi() + dPhi;
993  }
994 
995  double dEta = position.eta() - meanPosition.eta();
996  double w = 0.;
997  w = std::max(0.0f, w0 + std::log(energy / e_5x5));
998 
999  denominator += w;
1000  numeratorEtaEta += w * dEta * dEta;
1001  numeratorEtaPhi += w * dEta * dPhi;
1002  numeratorPhiPhi += w * dPhi * dPhi;
1003  }
1004 
1005  if (denominator != 0.0) {
1006  covEtaEta = numeratorEtaEta / denominator;
1007  covEtaPhi = numeratorEtaPhi / denominator;
1008  covPhiPhi = numeratorPhiPhi / denominator;
1009  } else {
1010  covEtaEta = 999.9;
1011  covEtaPhi = 999.9;
1012  covPhiPhi = 999.9;
1013  }
1014 
1015  } else {
1016  // Warn the user if there was no energy in the cells and return zeroes.
1017  // std::cout << "\ClusterShapeAlgo::Calculate_Covariances: no energy in supplied cells.\n";
1018  covEtaEta = 0;
1019  covEtaPhi = 0;
1020  covPhiPhi = 0;
1021  }
1022  std::vector<float> v;
1023  v.push_back(covEtaEta);
1024  v.push_back(covEtaPhi);
1025  v.push_back(covPhiPhi);
1026  return v;
1027 }

References HLTTauDQMOffline_cfi::denominator, HLT_2018_cff::dEta, HLT_2018_cff::dPhi, HCALHighEnergyHPDFilter_cfi::energy, f, cropTnPTrees::frac, CaloSubdetectorGeometry::getGeometry(), reco::CaloCluster::hitsAndFractions(), dqm-mbProfile::log, SiStripPI::max, Geom::pi(), position, FastTrackerRecHitMaskProducer_cfi::recHits, ecaldqm::topology(), Geom::twoPi(), findQualityFiles::v, and w.

Referenced by PhotonProducer::fillPhotonCollection(), and GEDPhotonProducer::fillPhotonCollection().

◆ deltaIEta()

template<bool noZS>
int EcalClusterToolsT< noZS >::deltaIEta ( int  seed_ieta,
int  rh_ieta 
)
staticprivate

Definition at line 1859 of file EcalClusterTools.h.

1859  {
1860  // get rid of the fact that there is no ieta=0
1861  if (seed_ieta < 0)
1862  seed_ieta++;
1863  if (rh_ieta < 0)
1864  rh_ieta++;
1865  int rel_ieta = rh_ieta - seed_ieta;
1866  return rel_ieta;
1867 }

◆ deltaIPhi()

template<bool noZS>
int EcalClusterToolsT< noZS >::deltaIPhi ( int  seed_iphi,
int  rh_iphi 
)
staticprivate

Definition at line 1845 of file EcalClusterTools.h.

1845  {
1846  int rel_iphi = rh_iphi - seed_iphi;
1847  // take care of cyclic variable iphi [1,360]
1848  if (rel_iphi > 180)
1849  rel_iphi = rel_iphi - 360;
1850  if (rel_iphi < -180)
1851  rel_iphi = rel_iphi + 360;
1852  return rel_iphi;
1853 }

◆ e1x3()

template<bool noZS>
float EcalClusterToolsT< noZS >::e1x3 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ e1x5()

template<bool noZS>
float EcalClusterToolsT< noZS >::e1x5 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ e2nd()

template<bool noZS>
float EcalClusterToolsT< noZS >::e2nd ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits 
)
static

Definition at line 555 of file EcalClusterTools.h.

555  {
556  std::vector<float> energies;
557  const std::vector<std::pair<DetId, float>> &v_id = cluster.hitsAndFractions();
558  energies.reserve(v_id.size());
559  if (v_id.size() < 2)
560  return 0;
561  for (size_t i = 0; i < v_id.size(); ++i) {
562  energies.push_back(recHitEnergy(v_id[i].first, recHits) * (noZS ? 1.0 : v_id[i].second));
563  }
564  std::partial_sort(energies.begin(), energies.begin() + 2, energies.end(), std::greater<float>());
565  return energies[1];
566 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), mps_fire::i, FastTrackerRecHitMaskProducer_cfi::recHits, and edm::second().

Referenced by GEDPhotonProducer::fillPhotonCollection().

◆ e2x2()

template<bool noZS>
float EcalClusterToolsT< noZS >::e2x2 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 489 of file EcalClusterTools.h.

491  {
492  DetId id = getMaximum(cluster.hitsAndFractions(), recHits).first;
493  std::list<float> energies;
494  float max_E = matrixEnergy(cluster, recHits, topology, id, {-1, 0, -1, 0});
495  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {-1, 0, 0, 1}));
496  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {0, 1, 0, 1}));
497  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {0, 1, -1, 0}));
498  return max_E;
499 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), SiStripPI::max, FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

Referenced by GEDPhotonProducer::fillPhotonCollection().

◆ e2x5Bottom()

template<bool noZS>
float EcalClusterToolsT< noZS >::e2x5Bottom ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ e2x5Left()

template<bool noZS>
float EcalClusterToolsT< noZS >::e2x5Left ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ e2x5Max()

template<bool noZS>
float EcalClusterToolsT< noZS >::e2x5Max ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 603 of file EcalClusterTools.h.

605  {
606  DetId id = getMaximum(cluster.hitsAndFractions(), recHits).first;
607 
608  // 1x5 strip left of seed
609  float left = matrixEnergy(cluster, recHits, topology, id, {-1, -1, -2, 2});
610  // 1x5 strip right of seed
611  float right = matrixEnergy(cluster, recHits, topology, id, {1, 1, -2, 2});
612  // 1x5 strip containing seed
613  float centre = matrixEnergy(cluster, recHits, topology, id, {0, 0, -2, 2});
614 
615  // Return the maximum of (left+center) or (right+center) strip
616  return left > right ? left + centre : right + centre;
617 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

Referenced by PhotonProducer::fillPhotonCollection(), and GEDPhotonProducer::fillPhotonCollection().

◆ e2x5Right()

template<bool noZS>
float EcalClusterToolsT< noZS >::e2x5Right ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ e2x5Top()

template<bool noZS>
float EcalClusterToolsT< noZS >::e2x5Top ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ e3x1()

template<bool noZS>
float EcalClusterToolsT< noZS >::e3x1 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 644 of file EcalClusterTools.h.

646  {
647  DetId id = getMaximum(cluster.hitsAndFractions(), recHits).first;
648  return matrixEnergy(cluster, recHits, topology, id, {-1, 1, 0, 0});
649 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

◆ e3x2()

template<bool noZS>
float EcalClusterToolsT< noZS >::e3x2 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 502 of file EcalClusterTools.h.

504  {
505  DetId id = getMaximum(cluster.hitsAndFractions(), recHits).first;
506  float max_E = matrixEnergy(cluster, recHits, topology, id, {-1, 1, -1, 0});
507  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {0, 1, -1, 1}));
508  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {-1, 1, 0, 1}));
509  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {-1, 0, -1, 1}));
510  return max_E;
511 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), SiStripPI::max, FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

◆ e3x3()

template<bool noZS>
float EcalClusterToolsT< noZS >::e3x3 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ e4x4()

template<bool noZS>
float EcalClusterToolsT< noZS >::e4x4 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 522 of file EcalClusterTools.h.

524  {
525  DetId id = getMaximum(cluster.hitsAndFractions(), recHits).first;
526  float max_E = matrixEnergy(cluster, recHits, topology, id, {-1, 2, -2, 1});
527  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {-2, 1, -2, 1}));
528  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {-2, 1, -1, 2}));
529  max_E = std::max(max_E, matrixEnergy(cluster, recHits, topology, id, {-1, 2, -1, 2}));
530  return max_E;
531 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), SiStripPI::max, FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

◆ e5x1()

template<bool noZS>
float EcalClusterToolsT< noZS >::e5x1 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 628 of file EcalClusterTools.h.

630  {
631  DetId id = getMaximum(cluster.hitsAndFractions(), recHits).first;
632  return matrixEnergy(cluster, recHits, topology, id, {-2, 2, 0, 0});
633 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

◆ e5x5()

template<bool noZS>
float EcalClusterToolsT< noZS >::e5x5 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ eBottom()

template<bool noZS>
float EcalClusterToolsT< noZS >::eBottom ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ eLeft()

template<bool noZS>
float EcalClusterToolsT< noZS >::eLeft ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ eMax()

template<bool noZS>
float EcalClusterToolsT< noZS >::eMax ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits 
)
static

◆ energyBasketFractionEta()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::energyBasketFractionEta ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits 
)
static

Definition at line 684 of file EcalClusterTools.h.

685  {
686  std::vector<float> basketFraction(2 * EBDetId::kModulesPerSM);
687  float clusterEnergy = cluster.energy();
688  const std::vector<std::pair<DetId, float>> &v_id = cluster.hitsAndFractions();
689  if (v_id[0].first.subdetId() != EcalBarrel) {
690  edm::LogWarning("EcalClusterToolsT<noZS>::energyBasketFractionEta")
691  << "Trying to get basket fraction for endcap basic-clusters. Basket fractions can be obtained ONLY for barrel "
692  "basic-clusters. Returning empty vector.";
693  return basketFraction;
694  }
695  for (size_t i = 0; i < v_id.size(); ++i) {
696  basketFraction[EBDetId(v_id[i].first).im() - 1 + EBDetId(v_id[i].first).positiveZ() * EBDetId::kModulesPerSM] +=
697  recHitEnergy(v_id[i].first, recHits) * v_id[i].second / clusterEnergy;
698  }
699  std::sort(basketFraction.rbegin(), basketFraction.rend());
700  return basketFraction;
701 }

References EcalBarrel, reco::CaloCluster::energy(), dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), mps_fire::i, EBDetId::im(), EBDetId::kModulesPerSM, EBDetId::positiveZ(), and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ energyBasketFractionPhi()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::energyBasketFractionPhi ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits 
)
static

Definition at line 704 of file EcalClusterTools.h.

705  {
706  std::vector<float> basketFraction(2 * (EBDetId::MAX_IPHI / EBDetId::kCrystalsInPhi));
707  float clusterEnergy = cluster.energy();
708  const std::vector<std::pair<DetId, float>> &v_id = cluster.hitsAndFractions();
709  if (v_id[0].first.subdetId() != EcalBarrel) {
710  edm::LogWarning("EcalClusterToolsT<noZS>::energyBasketFractionPhi")
711  << "Trying to get basket fraction for endcap basic-clusters. Basket fractions can be obtained ONLY for barrel "
712  "basic-clusters. Returning empty vector.";
713  return basketFraction;
714  }
715  for (size_t i = 0; i < v_id.size(); ++i) {
716  basketFraction[(EBDetId(v_id[i].first).iphi() - 1) / EBDetId::kCrystalsInPhi +
718  recHitEnergy(v_id[i].first, recHits) * (noZS ? 1.0 : v_id[i].second) / clusterEnergy;
719  }
720  std::sort(basketFraction.rbegin(), basketFraction.rend());
721  return basketFraction;
722 }

References EcalBarrel, reco::CaloCluster::energy(), dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), mps_fire::i, EBDetId::iphi(), EBDetId::kCrystalsInPhi, EBDetId::kTowersInPhi, EBDetId::MAX_IPHI, EBDetId::positiveZ(), and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ eRight()

template<bool noZS>
float EcalClusterToolsT< noZS >::eRight ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ eTop()

template<bool noZS>
float EcalClusterToolsT< noZS >::eTop ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

◆ f00()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f00 ( double  r)
inlinestaticprivate

Definition at line 312 of file EcalClusterTools.h.

312 { return 1; }

◆ f11()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f11 ( double  r)
inlinestaticprivate

Definition at line 313 of file EcalClusterTools.h.

313 { return r; }

References alignCSCRings::r.

◆ f20()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f20 ( double  r)
inlinestaticprivate

Definition at line 314 of file EcalClusterTools.h.

314 { return 2.0 * r * r - 1.0; }

References alignCSCRings::r.

◆ f22()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f22 ( double  r)
inlinestaticprivate

Definition at line 315 of file EcalClusterTools.h.

315 { return r * r; }

References alignCSCRings::r.

◆ f31()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f31 ( double  r)
inlinestaticprivate

Definition at line 316 of file EcalClusterTools.h.

316 { return 3.0 * r * r * r - 2.0 * r; }

References alignCSCRings::r.

◆ f33()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f33 ( double  r)
inlinestaticprivate

Definition at line 317 of file EcalClusterTools.h.

317 { return r * r * r; }

References alignCSCRings::r.

◆ f40()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f40 ( double  r)
inlinestaticprivate

Definition at line 318 of file EcalClusterTools.h.

318 { return 6.0 * r * r * r * r - 6.0 * r * r + 1.0; }

References alignCSCRings::r.

◆ f42()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f42 ( double  r)
inlinestaticprivate

Definition at line 319 of file EcalClusterTools.h.

319 { return 4.0 * r * r * r * r - 3.0 * r * r; }

References alignCSCRings::r.

◆ f44()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f44 ( double  r)
inlinestaticprivate

Definition at line 320 of file EcalClusterTools.h.

320 { return r * r * r * r; }

References alignCSCRings::r.

◆ f51()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f51 ( double  r)
inlinestaticprivate

Definition at line 321 of file EcalClusterTools.h.

321 { return 10.0 * pow(r, 5) - 12.0 * pow(r, 3) + 3.0 * r; }

References funct::pow(), and alignCSCRings::r.

◆ f53()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f53 ( double  r)
inlinestaticprivate

Definition at line 322 of file EcalClusterTools.h.

322 { return 5.0 * pow(r, 5) - 4.0 * pow(r, 3); }

References funct::pow(), and alignCSCRings::r.

◆ f55()

template<bool noZS>
static double EcalClusterToolsT< noZS >::f55 ( double  r)
inlinestaticprivate

Definition at line 323 of file EcalClusterTools.h.

323 { return pow(r, 5); }

References funct::pow(), and alignCSCRings::r.

◆ factorial()

template<bool noZS>
static double EcalClusterToolsT< noZS >::factorial ( int  n)
inlinestaticprivate

Definition at line 350 of file EcalClusterTools.h.

350  {
351  double res = 1.;
352  for (int i = 2; i <= n; ++i)
353  res *= i;
354  return res;
355  }

References mps_fire::i, and dqmiodumpmetadata::n.

◆ fast_AbsZernikeMoment()

template<bool noZS>
double EcalClusterToolsT< noZS >::fast_AbsZernikeMoment ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloGeometry geometry,
int  n,
int  m,
double  R0,
bool  logW,
float  w0 
)
staticprivate

Definition at line 1155 of file EcalClusterTools.h.

1162  {
1163  double r, ph, e, Re = 0, Im = 0;
1164  double TotalEnergy = cluster.energy();
1165  int index = (n / 2) * (n / 2) + (n / 2) + m;
1166  std::vector<EcalClusterEnergyDeposition> energyDistribution =
1167  getEnergyDepTopology(cluster, recHits, geometry, logW, w0);
1168  int clusterSize = energyDistribution.size();
1169  if (clusterSize < 3)
1170  return 0.0;
1171 
1172  for (int i = 0; i < clusterSize; i++) {
1173  r = energyDistribution[i].r / R0;
1174  if (r < 1) {
1175  std::vector<double> pol;
1176  pol.push_back(f00(r));
1177  pol.push_back(f11(r));
1178  pol.push_back(f20(r));
1179  pol.push_back(f22(r));
1180  pol.push_back(f31(r));
1181  pol.push_back(f33(r));
1182  pol.push_back(f40(r));
1183  pol.push_back(f42(r));
1184  pol.push_back(f44(r));
1185  pol.push_back(f51(r));
1186  pol.push_back(f53(r));
1187  pol.push_back(f55(r));
1188  ph = (energyDistribution[i]).phi;
1189  e = energyDistribution[i].deposited_energy;
1190  Re = Re + e / TotalEnergy * pol[index] * cos((double)m * ph);
1191  Im = Im - e / TotalEnergy * pol[index] * sin((double)m * ph);
1192  }
1193  }
1194  return sqrt(Re * Re + Im * Im);
1195 }

References funct::cos(), MillePedeFileConverter_cfg::e, reco::CaloCluster::energy(), mps_fire::i, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, PVValHelper::phi, alignCSCRings::r, HLT_2018_cff::R0, FastTrackerRecHitMaskProducer_cfi::recHits, funct::sin(), and mathSSE::sqrt().

◆ getDPhiEndcap()

template<bool noZS>
float EcalClusterToolsT< noZS >::getDPhiEndcap ( const DetId crysId,
float  meanX,
float  meanY 
)
staticprivate

Definition at line 1341 of file EcalClusterTools.h.

1341  {
1342  float iXNorm = getNormedIX(crysId);
1343  float iYNorm = getNormedIY(crysId);
1344 
1345  float hitLocalR2 = (iXNorm - meanX) * (iXNorm - meanX) + (iYNorm - meanY) * (iYNorm - meanY);
1346  float hitR2 = iXNorm * iXNorm + iYNorm * iYNorm;
1347  float meanR2 = meanX * meanX + meanY * meanY;
1348  float hitR = sqrt(hitR2);
1349  float meanR = sqrt(meanR2);
1350 
1351  float tmp = (hitR2 + meanR2 - hitLocalR2) / (2 * hitR * meanR);
1352  if (tmp < -1)
1353  tmp = -1;
1354  if (tmp > 1)
1355  tmp = 1;
1356  float phi = acos(tmp);
1357  float dPhi = hitR * phi;
1358 
1359  return dPhi;
1360 }

References HLT_2018_cff::dPhi, PVValHelper::phi, mathSSE::sqrt(), and createJobs::tmp.

◆ getEnergyDepTopology()

template<bool noZS>
std::vector< typename EcalClusterToolsT< noZS >::EcalClusterEnergyDeposition > EcalClusterToolsT< noZS >::getEnergyDepTopology ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloGeometry geometry,
bool  logW,
float  w0 
)
staticprivate

Definition at line 726 of file EcalClusterTools.h.

730  {
731  std::vector<typename EcalClusterToolsT<noZS>::EcalClusterEnergyDeposition> energyDistribution;
732  // init a map of the energy deposition centered on the
733  // cluster centroid. This is for momenta calculation only.
734  CLHEP::Hep3Vector clVect(cluster.position().x(), cluster.position().y(), cluster.position().z());
735  CLHEP::Hep3Vector clDir(clVect);
736  clDir *= 1.0 / clDir.mag();
737  // in the transverse plane, axis perpendicular to clusterDir
738  CLHEP::Hep3Vector theta_axis(clDir.y(), -clDir.x(), 0.0);
739  theta_axis *= 1.0 / theta_axis.mag();
740  CLHEP::Hep3Vector phi_axis = theta_axis.cross(clDir);
741 
742  const std::vector<std::pair<DetId, float>> &clusterDetIds = cluster.hitsAndFractions();
743 
745  EcalRecHit testEcalRecHit;
746  std::vector<std::pair<DetId, float>>::const_iterator posCurrent;
747  // loop over crystals
748  for (posCurrent = clusterDetIds.begin(); posCurrent != clusterDetIds.end(); ++posCurrent) {
749  EcalRecHitCollection::const_iterator itt = recHits->find((*posCurrent).first);
750  testEcalRecHit = *itt;
751 
752  if (((*posCurrent).first != DetId(0)) && (recHits->find((*posCurrent).first) != recHits->end())) {
753  clEdep.deposited_energy = testEcalRecHit.energy() * (noZS ? 1.0 : (*posCurrent).second);
754  // if logarithmic weight is requested, apply cut on minimum energy of the recHit
755  if (logW) {
756  //double w0 = parameterMap_.find("W0")->second;
757 
758  double weight = std::max(0.0, w0 + log(std::abs(clEdep.deposited_energy) / cluster.energy()));
759  if (weight == 0) {
760  LogDebug("ClusterShapeAlgo") << "Crystal has insufficient energy: E = " << clEdep.deposited_energy
761  << " GeV; skipping... ";
762  continue;
763  } else
764  LogDebug("ClusterShapeAlgo") << "===> got crystal. Energy = " << clEdep.deposited_energy << " GeV. ";
765  }
766  DetId id_ = (*posCurrent).first;
767  const CaloSubdetectorGeometry *geo = geometry->getSubdetectorGeometry(id_);
768  auto this_cell = geo->getGeometry(id_);
769  const GlobalPoint &cellPos = this_cell->getPosition();
770  CLHEP::Hep3Vector gblPos(cellPos.x(), cellPos.y(), cellPos.z()); //surface position?
771  // Evaluate the distance from the cluster centroid
772  CLHEP::Hep3Vector diff = gblPos - clVect;
773  // Important: for the moment calculation, only the "lateral distance" is important
774  // "lateral distance" r_i = distance of the digi position from the axis Origin-Cluster Center
775  // ---> subtract the projection on clDir
776  CLHEP::Hep3Vector DigiVect = diff - diff.dot(clDir) * clDir;
777  clEdep.r = DigiVect.mag();
778  LogDebug("ClusterShapeAlgo") << "E = " << clEdep.deposited_energy << "\tdiff = " << diff.mag()
779  << "\tr = " << clEdep.r;
780  clEdep.phi = DigiVect.angle(theta_axis);
781  if (DigiVect.dot(phi_axis) < 0)
782  clEdep.phi = 2 * M_PI - clEdep.phi;
783  energyDistribution.push_back(clEdep);
784  }
785  }
786  return energyDistribution;
787 }

References funct::abs(), EcalClusterToolsT< noZS >::EcalClusterEnergyDeposition::deposited_energy, change_name::diff, EcalRecHit::energy(), reco::CaloCluster::energy(), CaloSubdetectorGeometry::getGeometry(), reco::CaloCluster::hitsAndFractions(), dqm-mbProfile::log, LogDebug, M_PI, SiStripPI::max, EcalClusterToolsT< noZS >::EcalClusterEnergyDeposition::phi, reco::CaloCluster::position(), EcalClusterToolsT< noZS >::EcalClusterEnergyDeposition::r, FastTrackerRecHitMaskProducer_cfi::recHits, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ getFraction()

template<bool noZS>
float EcalClusterToolsT< noZS >::getFraction ( const std::vector< std::pair< DetId, float >> &  v_id,
DetId  id 
)
static

Definition at line 376 of file EcalClusterTools.h.

376  {
377  if (noZS)
378  return 1.0;
379  float frac = 0.0;
380  for (size_t i = 0; i < v_id.size(); ++i) {
381  if (v_id[i].first.rawId() == id.rawId()) {
382  frac = v_id[i].second;
383  break;
384  }
385  }
386  return frac;
387 }

References dqmdumpme::first, cropTnPTrees::frac, and mps_fire::i.

◆ getIEta()

template<bool noZS>
float EcalClusterToolsT< noZS >::getIEta ( const DetId id)
staticprivate

Definition at line 1241 of file EcalClusterTools.h.

1241  {
1242  if (id.det() == DetId::Ecal) {
1243  if (id.subdetId() == EcalBarrel) {
1244  EBDetId ebId(id);
1245  return ebId.ieta();
1246  } else if (id.subdetId() == EcalEndcap) {
1247  float iXNorm = getNormedIX(id);
1248  float iYNorm = getNormedIY(id);
1249 
1250  return std::sqrt(iXNorm * iXNorm + iYNorm * iYNorm);
1251  }
1252  }
1253  return 0.;
1254 }

References DetId::Ecal, EcalBarrel, EcalEndcap, EBDetId::ieta(), and mathSSE::sqrt().

◆ getIPhi()

template<bool noZS>
float EcalClusterToolsT< noZS >::getIPhi ( const DetId id)
staticprivate

Definition at line 1261 of file EcalClusterTools.h.

1261  {
1262  if (id.det() == DetId::Ecal) {
1263  if (id.subdetId() == EcalBarrel) {
1264  EBDetId ebId(id);
1265  return ebId.iphi();
1266  }
1267  }
1268  return 0.;
1269 }

References DetId::Ecal, EcalBarrel, and EBDetId::iphi().

◆ getMaximum() [1/2]

template<bool noZS>
std::pair< DetId, float > EcalClusterToolsT< noZS >::getMaximum ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits 
)
static

Definition at line 405 of file EcalClusterTools.h.

406  {
407  return getMaximum(cluster.hitsAndFractions(), recHits);
408 }

References reco::CaloCluster::hitsAndFractions(), and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ getMaximum() [2/2]

template<bool noZS>
std::pair< DetId, float > EcalClusterToolsT< noZS >::getMaximum ( const std::vector< std::pair< DetId, float >> &  v_id,
const EcalRecHitCollection recHits 
)
static

Definition at line 390 of file EcalClusterTools.h.

391  {
392  float max = 0;
393  DetId id(0);
394  for (size_t i = 0; i < v_id.size(); ++i) {
395  float energy = recHitEnergy(v_id[i].first, recHits) * (noZS ? 1.0 : v_id[i].second);
396  if (energy > max) {
397  max = energy;
398  id = v_id[i].first;
399  }
400  }
401  return std::pair<DetId, float>(id, max);
402 }

References HCALHighEnergyHPDFilter_cfi::energy, dqmdumpme::first, mps_fire::i, triggerObjects_cff::id, SiStripPI::max, and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ getNormedIX()

template<bool noZS>
float EcalClusterToolsT< noZS >::getNormedIX ( const DetId id)
staticprivate

Definition at line 1273 of file EcalClusterTools.h.

1273  {
1274  if (id.det() == DetId::Ecal && id.subdetId() == EcalEndcap) {
1275  EEDetId eeId(id);
1276  int iXNorm = eeId.ix() - 50;
1277  if (iXNorm <= 0)
1278  iXNorm--;
1279  return iXNorm;
1280  }
1281  return 0;
1282 }

References DetId::Ecal, EcalEndcap, and EEDetId::ix().

◆ getNormedIY()

template<bool noZS>
float EcalClusterToolsT< noZS >::getNormedIY ( const DetId id)
staticprivate

Definition at line 1286 of file EcalClusterTools.h.

1286  {
1287  if (id.det() == DetId::Ecal && id.subdetId() == EcalEndcap) {
1288  EEDetId eeId(id);
1289  int iYNorm = eeId.iy() - 50;
1290  if (iYNorm <= 0)
1291  iYNorm--;
1292  return iYNorm;
1293  }
1294  return 0;
1295 }

References DetId::Ecal, EcalEndcap, and EEDetId::iy().

◆ getNrCrysDiffInEta()

template<bool noZS>
float EcalClusterToolsT< noZS >::getNrCrysDiffInEta ( const DetId crysId,
const DetId orginId 
)
staticprivate

Definition at line 1299 of file EcalClusterTools.h.

1299  {
1300  float crysIEta = getIEta(crysId);
1301  float orginIEta = getIEta(orginId);
1302  bool isBarrel = orginId.subdetId() == EcalBarrel;
1303 
1304  float nrCrysDiff = crysIEta - orginIEta;
1305 
1306  //no iEta=0 in barrel, so if go from positive to negative
1307  //need to reduce abs(detEta) by 1
1308  if (isBarrel) {
1309  if (crysIEta * orginIEta < 0) { // -1 to 1 transition
1310  if (crysIEta > 0)
1311  nrCrysDiff--;
1312  else
1313  nrCrysDiff++;
1314  }
1315  }
1316  return nrCrysDiff;
1317 }

References EcalBarrel, PixelPluginsPhase0_cfi::isBarrel, and DetId::subdetId().

◆ getNrCrysDiffInPhi()

template<bool noZS>
float EcalClusterToolsT< noZS >::getNrCrysDiffInPhi ( const DetId crysId,
const DetId orginId 
)
staticprivate

Definition at line 1321 of file EcalClusterTools.h.

1321  {
1322  float crysIPhi = getIPhi(crysId);
1323  float orginIPhi = getIPhi(orginId);
1324  bool isBarrel = orginId.subdetId() == EcalBarrel;
1325 
1326  float nrCrysDiff = crysIPhi - orginIPhi;
1327 
1328  if (isBarrel) { //if barrel, need to map into 0-180
1329  if (nrCrysDiff > +180) {
1330  nrCrysDiff = nrCrysDiff - 360;
1331  }
1332  if (nrCrysDiff < -180) {
1333  nrCrysDiff = nrCrysDiff + 360;
1334  }
1335  }
1336  return nrCrysDiff;
1337 }

References EcalBarrel, PixelPluginsPhase0_cfi::isBarrel, and DetId::subdetId().

◆ getSeedPosition()

template<bool noZS>
std::vector< int > EcalClusterToolsT< noZS >::getSeedPosition ( const std::vector< std::pair< const EcalRecHit *, float >> &  RH_ptrs)
staticprivate

Definition at line 1871 of file EcalClusterTools.h.

1872  {
1873  std::vector<int> seedPosition;
1874  float eSeedRH = 0;
1875  int iEtaSeedRH = 0;
1876  int iPhiSeedRH = 0;
1877 
1878  for (auto const &rhf : RH_ptrs_fracs) {
1879  const EcalRecHit *rh_ptr = rhf.first;
1880  //get iEta, iPhi
1881  EBDetId EBdetIdi(rh_ptr->detid());
1882  float rh_energy = rh_ptr->energy() * (noZS ? 1.0 : rhf.second);
1883 
1884  if (eSeedRH < rh_energy) {
1885  eSeedRH = rh_energy;
1886  iEtaSeedRH = EBdetIdi.ieta();
1887  iPhiSeedRH = EBdetIdi.iphi();
1888  }
1889 
1890  } // for loop
1891 
1892  seedPosition.push_back(iEtaSeedRH);
1893  seedPosition.push_back(iPhiSeedRH);
1894  return seedPosition;
1895 }

References EcalRecHit::detid(), and EcalRecHit::energy().

Referenced by EcalClusterToolsT< noZS >::roundnessBarrelSuperClustersUserExtended(), and EcalClusterToolsT< noZS >::roundnessSelectedBarrelRecHits().

◆ getSumEnergy()

template<bool noZS>
float EcalClusterToolsT< noZS >::getSumEnergy ( const std::vector< std::pair< const EcalRecHit *, float >> &  RH_ptrs_fracs)
staticprivate

Definition at line 1899 of file EcalClusterTools.h.

1899  {
1900  float sumE = 0.;
1901  for (const auto &hAndF : RH_ptrs_fracs) {
1902  sumE += hAndF.first->energy() * (noZS ? 1.0 : hAndF.second);
1903  }
1904  return sumE;
1905 }

Referenced by EcalClusterToolsT< noZS >::cluster2ndMoments(), and EcalClusterToolsT< noZS >::roundnessSelectedBarrelRecHits().

◆ lat()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::lat ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloGeometry geometry,
bool  logW = true,
float  w0 = 4.7 
)
static

Definition at line 790 of file EcalClusterTools.h.

794  {
795  std::vector<EcalClusterToolsT::EcalClusterEnergyDeposition> energyDistribution =
796  getEnergyDepTopology(cluster, recHits, geometry, logW, w0);
797 
798  std::vector<float> lat;
799  double r, redmoment = 0;
800  double phiRedmoment = 0;
801  double etaRedmoment = 0;
802  int n, n1, n2, tmp;
803  int clusterSize = energyDistribution.size();
804  float etaLat_, phiLat_, lat_;
805  if (clusterSize < 3) {
806  etaLat_ = 0.0;
807  lat_ = 0.0;
808  lat.push_back(0.);
809  lat.push_back(0.);
810  lat.push_back(0.);
811  return lat;
812  }
813 
814  n1 = 0;
815  n2 = 1;
816  if (energyDistribution[1].deposited_energy > energyDistribution[0].deposited_energy) {
817  tmp = n2;
818  n2 = n1;
819  n1 = tmp;
820  }
821  for (int i = 2; i < clusterSize; i++) {
822  n = i;
823  if (energyDistribution[i].deposited_energy > energyDistribution[n1].deposited_energy) {
824  tmp = n2;
825  n2 = n1;
826  n1 = i;
827  n = tmp;
828  } else {
829  if (energyDistribution[i].deposited_energy > energyDistribution[n2].deposited_energy) {
830  tmp = n2;
831  n2 = i;
832  n = tmp;
833  }
834  }
835 
836  r = energyDistribution[n].r;
837  redmoment += r * r * energyDistribution[n].deposited_energy;
838  double rphi = r * cos(energyDistribution[n].phi);
839  phiRedmoment += rphi * rphi * energyDistribution[n].deposited_energy;
840  double reta = r * sin(energyDistribution[n].phi);
841  etaRedmoment += reta * reta * energyDistribution[n].deposited_energy;
842  }
843  double e1 = energyDistribution[n1].deposited_energy;
844  double e2 = energyDistribution[n2].deposited_energy;
845 
846  lat_ = redmoment / (redmoment + 2.19 * 2.19 * (e1 + e2));
847  phiLat_ = phiRedmoment / (phiRedmoment + 2.19 * 2.19 * (e1 + e2));
848  etaLat_ = etaRedmoment / (etaRedmoment + 2.19 * 2.19 * (e1 + e2));
849 
850  lat.push_back(etaLat_);
851  lat.push_back(phiLat_);
852  lat.push_back(lat_);
853  return lat;
854 }

References funct::cos(), StorageManager_cfg::e1, mps_fire::i, dqmiodumpmetadata::n, PVValHelper::phi, alignCSCRings::r, FastTrackerRecHitMaskProducer_cfi::recHits, funct::sin(), and createJobs::tmp.

◆ localCovariances()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::localCovariances ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology,
float  w0 = 4.7 
)
static

Definition at line 1034 of file EcalClusterTools.h.

1037  {
1038  float e_5x5 = e5x5(cluster, recHits, topology);
1039  float covEtaEta, covEtaPhi, covPhiPhi;
1040 
1041  if (e_5x5 >= 0.) {
1042  //double w0_ = parameterMap_.find("W0")->second;
1043  const std::vector<std::pair<DetId, float>> &v_id = cluster.hitsAndFractions();
1044  std::pair<float, float> mean5x5PosInNrCrysFromSeed = mean5x5PositionInLocalCrysCoord(cluster, recHits, topology);
1045  std::pair<float, float> mean5x5XYPos = mean5x5PositionInXY(cluster, recHits, topology);
1046 
1047  // now we can calculate the covariances
1048  double numeratorEtaEta = 0;
1049  double numeratorEtaPhi = 0;
1050  double numeratorPhiPhi = 0;
1051  double denominator = 0;
1052 
1053  //these allow us to scale the localCov by the crystal size
1054  //so that the localCovs have the same average value as the normal covs
1055  const double barrelCrysSize = 0.01745; //approximate size of crystal in eta,phi in barrel
1056  const double endcapCrysSize = 0.0447; //the approximate crystal size sigmaEtaEta was corrected to in the endcap
1057 
1058  DetId seedId = getMaximum(v_id, recHits).first;
1059 
1060  bool isBarrel = seedId.subdetId() == EcalBarrel;
1061  const double crysSize = isBarrel ? barrelCrysSize : endcapCrysSize;
1062 
1063  CaloRectangle rectangle{-2, 2, -2, 2};
1064  for (auto const &detId : rectangle(seedId, *topology)) {
1065  float frac = getFraction(v_id, detId);
1066  float energy = recHitEnergy(detId, recHits) * frac;
1067  if (energy <= 0)
1068  continue;
1069 
1070  float dEta = getNrCrysDiffInEta(detId, seedId) - mean5x5PosInNrCrysFromSeed.first;
1071  float dPhi = 0;
1072 
1073  if (isBarrel)
1074  dPhi = getNrCrysDiffInPhi(detId, seedId) - mean5x5PosInNrCrysFromSeed.second;
1075  else
1076  dPhi = getDPhiEndcap(detId, mean5x5XYPos.first, mean5x5XYPos.second);
1077 
1078  double w = std::max(0.0f, w0 + std::log(energy / e_5x5));
1079 
1080  denominator += w;
1081  numeratorEtaEta += w * dEta * dEta;
1082  numeratorEtaPhi += w * dEta * dPhi;
1083  numeratorPhiPhi += w * dPhi * dPhi;
1084  }
1085 
1086  //multiplying by crysSize to make the values compariable to normal covariances
1087  if (denominator != 0.0) {
1088  covEtaEta = crysSize * crysSize * numeratorEtaEta / denominator;
1089  covEtaPhi = crysSize * crysSize * numeratorEtaPhi / denominator;
1090  covPhiPhi = crysSize * crysSize * numeratorPhiPhi / denominator;
1091  } else {
1092  covEtaEta = 999.9;
1093  covEtaPhi = 999.9;
1094  covPhiPhi = 999.9;
1095  }
1096 
1097  } else {
1098  // Warn the user if there was no energy in the cells and return zeroes.
1099  // std::cout << "\ClusterShapeAlgo::Calculate_Covariances: no energy in supplied cells.\n";
1100  covEtaEta = 0;
1101  covEtaPhi = 0;
1102  covPhiPhi = 0;
1103  }
1104  std::vector<float> v;
1105  v.push_back(covEtaEta);
1106  v.push_back(covEtaPhi);
1107  v.push_back(covPhiPhi);
1108  return v;
1109 }

References HLTTauDQMOffline_cfi::denominator, HLT_2018_cff::dEta, HLT_2018_cff::dPhi, EcalBarrel, HCALHighEnergyHPDFilter_cfi::energy, f, cropTnPTrees::frac, reco::CaloCluster::hitsAndFractions(), PixelPluginsPhase0_cfi::isBarrel, dqm-mbProfile::log, SiStripPI::max, FastTrackerRecHitMaskProducer_cfi::recHits, DetId::subdetId(), ecaldqm::topology(), findQualityFiles::v, and w.

Referenced by PhotonProducer::fillPhotonCollection(), and GEDPhotonProducer::fillPhotonCollection().

◆ matrixDetId() [1/2]

template<bool noZS>
std::vector< DetId > EcalClusterToolsT< noZS >::matrixDetId ( const CaloTopology topology,
DetId  id,
CaloRectangle  rectangle 
)
static

Definition at line 477 of file EcalClusterTools.h.

479  {
480  std::vector<DetId> v;
481  for (auto const &detId : rectangle(id, *topology)) {
482  if (detId != DetId(0))
483  v.push_back(detId);
484  }
485  return v;
486 }

References ecaldqm::topology(), and findQualityFiles::v.

Referenced by EcalClusterToolsT< noZS >::matrixDetId().

◆ matrixDetId() [2/2]

template<bool noZS>
static std::vector<DetId> EcalClusterToolsT< noZS >::matrixDetId ( const CaloTopology topology,
DetId  id,
int  size 
)
inlinestatic

Definition at line 242 of file EcalClusterTools.h.

242  {
243  return matrixDetId(topology, id, CaloRectangle{-size, size, -size, size});
244  }

References EcalClusterToolsT< noZS >::matrixDetId(), findQualityFiles::size, and ecaldqm::topology().

◆ matrixEnergy()

template<bool noZS>
float EcalClusterToolsT< noZS >::matrixEnergy ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology,
DetId  id,
CaloRectangle  rectangle 
)
static

Definition at line 444 of file EcalClusterTools.h.

448  {
449  float energy = 0;
450  auto const &vId = cluster.hitsAndFractions();
451 
452  for (auto const &detId : rectangle(id, *topology)) {
453  energy += recHitEnergy(detId, recHits) * getFraction(vId, detId);
454  }
455 
456  return energy;
457 }

References HCALHighEnergyHPDFilter_cfi::energy, reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

◆ matrixSize()

template<bool noZS>
int EcalClusterToolsT< noZS >::matrixSize ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology,
DetId  id,
CaloRectangle  rectangle 
)
static

Definition at line 460 of file EcalClusterTools.h.

464  {
465  int result = 0;
466 
467  for (auto const &detId : rectangle(id, *topology)) {
468  const float energy = recHitEnergy(detId, recHits);
469  const float frac = getFraction(cluster.hitsAndFractions(), detId);
470  if (energy * frac > 0)
471  result++;
472  }
473  return result;
474 }

References HCALHighEnergyHPDFilter_cfi::energy, cropTnPTrees::frac, reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, mps_fire::result, and ecaldqm::topology().

◆ mean5x5PositionInLocalCrysCoord()

template<bool noZS>
std::pair< float, float > EcalClusterToolsT< noZS >::mean5x5PositionInLocalCrysCoord ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
staticprivate

Definition at line 888 of file EcalClusterTools.h.

890  {
891  DetId seedId = getMaximum(cluster, recHits).first;
892  float meanDEta = 0.;
893  float meanDPhi = 0.;
894  float energySum = 0.;
895 
896  const std::vector<std::pair<DetId, float>> &hsAndFs = cluster.hitsAndFractions();
897  std::vector<DetId> v_id = matrixDetId(topology, seedId, 2);
898  for (const std::pair<DetId, float> &hAndF : hsAndFs) {
899  for (std::vector<DetId>::const_iterator it = v_id.begin(); it != v_id.end(); ++it) {
900  if (hAndF.first != *it && !noZS)
901  continue;
902  float energy = recHitEnergy(*it, recHits) * hAndF.second;
903  if (energy < 0.)
904  continue; //skipping negative energy crystals
905  meanDEta += energy * getNrCrysDiffInEta(*it, seedId);
906  meanDPhi += energy * getNrCrysDiffInPhi(*it, seedId);
907  energySum += energy;
908  }
909  if (noZS)
910  break;
911  }
912  meanDEta /= energySum;
913  meanDPhi /= energySum;
914  return std::pair<float, float>(meanDEta, meanDPhi);
915 }

References HCALHighEnergyHPDFilter_cfi::energy, CastorDataFrameFilter_impl::energySum(), reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

◆ mean5x5PositionInXY()

template<bool noZS>
std::pair< float, float > EcalClusterToolsT< noZS >::mean5x5PositionInXY ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
staticprivate

Definition at line 924 of file EcalClusterTools.h.

926  {
927  DetId seedId = getMaximum(cluster, recHits).first;
928 
929  std::pair<float, float> meanXY(0., 0.);
930  if (seedId.subdetId() == EcalBarrel)
931  return meanXY;
932 
933  float energySum = 0.;
934 
935  const std::vector<std::pair<DetId, float>> &hsAndFs = cluster.hitsAndFractions();
936  std::vector<DetId> v_id = matrixDetId(topology, seedId, 2);
937  for (const std::pair<DetId, float> &hAndF : hsAndFs) {
938  for (std::vector<DetId>::const_iterator it = v_id.begin(); it != v_id.end(); ++it) {
939  if (hAndF.first != *it && !noZS)
940  continue;
941  float energy = recHitEnergy(*it, recHits) * hAndF.second;
942  if (energy < 0.)
943  continue; //skipping negative energy crystals
944  meanXY.first += energy * getNormedIX(*it);
945  meanXY.second += energy * getNormedIY(*it);
946  energySum += energy;
947  }
948  if (noZS)
949  break;
950  }
951  meanXY.first /= energySum;
952  meanXY.second /= energySum;
953  return meanXY;
954 }

References EcalBarrel, HCALHighEnergyHPDFilter_cfi::energy, CastorDataFrameFilter_impl::energySum(), reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, DetId::subdetId(), and ecaldqm::topology().

◆ meanClusterPosition()

template<bool noZS>
math::XYZVector EcalClusterToolsT< noZS >::meanClusterPosition ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology,
const CaloGeometry geometry 
)
staticprivate

Definition at line 857 of file EcalClusterTools.h.

860  {
861  // find mean energy position of a 5x5 cluster around the maximum
862  math::XYZVector meanPosition(0.0, 0.0, 0.0);
863  const std::vector<std::pair<DetId, float>> &hsAndFs = cluster.hitsAndFractions();
864  std::vector<DetId> v_id = matrixDetId(topology, getMaximum(cluster, recHits).first, 2);
865  for (const std::pair<DetId, float> &hitAndFrac : hsAndFs) {
866  for (std::vector<DetId>::const_iterator it = v_id.begin(); it != v_id.end(); ++it) {
867  if (hitAndFrac.first != *it && !noZS)
868  continue;
869  const CaloSubdetectorGeometry *geo = geometry->getSubdetectorGeometry(*it);
870  GlobalPoint positionGP = geo->getGeometry(*it)->getPosition();
871  math::XYZVector position(positionGP.x(), positionGP.y(), positionGP.z());
872  meanPosition = meanPosition + recHitEnergy(*it, recHits) * position * hitAndFrac.second;
873  }
874  if (noZS)
875  break;
876  }
877  return meanPosition / e5x5(cluster, recHits, topology);
878 }

References dqmdumpme::first, CaloSubdetectorGeometry::getGeometry(), reco::CaloCluster::hitsAndFractions(), position, FastTrackerRecHitMaskProducer_cfi::recHits, ecaldqm::topology(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ n5x5()

template<bool noZS>
int EcalClusterToolsT< noZS >::n5x5 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 542 of file EcalClusterTools.h.

544  {
545  DetId id = getMaximum(cluster.hitsAndFractions(), recHits).first;
546  return matrixSize(cluster, recHits, topology, id, {-2, 2, -2, 2});
547 }

References dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

◆ nrSaturatedCrysIn5x5()

template<bool noZS>
int EcalClusterToolsT< noZS >::nrSaturatedCrysIn5x5 ( const DetId id,
const EcalRecHitCollection recHits,
const CaloTopology topology 
)
static

Definition at line 1826 of file EcalClusterTools.h.

1828  {
1829  int nrSat = 0;
1830  CaloRectangle rectangle{-2, 2, -2, 2};
1831  for (auto const &detId : rectangle(id, *topology)) {
1832  auto recHitIt = recHits->find(detId);
1833  if (recHitIt != recHits->end() && recHitIt->checkFlag(EcalRecHit::kSaturated)) {
1834  nrSat++;
1835  }
1836  }
1837  return nrSat;
1838 }

References EcalRecHit::kSaturated, FastTrackerRecHitMaskProducer_cfi::recHits, and ecaldqm::topology().

Referenced by ElectronHEEPIDValueMapProducer::nrSaturatedCrysIn5x5().

◆ recHitEnergy()

template<bool noZS>
float EcalClusterToolsT< noZS >::recHitEnergy ( DetId  id,
const EcalRecHitCollection recHits 
)
static

Definition at line 411 of file EcalClusterTools.h.

411  {
412  if (id == DetId(0)) {
413  return 0;
414  } else {
416  if (it != recHits->end()) {
417  if (noZS && (it->checkFlag(EcalRecHit::kTowerRecovered) || it->checkFlag(EcalRecHit::kWeird) ||
418  (it->detid().subdetId() == EcalBarrel && it->checkFlag(EcalRecHit::kDiWeird))))
419  return 0.0;
420  else
421  return it->energy();
422  } else {
423  //throw cms::Exception("EcalRecHitNotFound") << "The recHit corresponding to the DetId" << id.rawId() << " not found in the EcalRecHitCollection";
424  // the recHit is not in the collection (hopefully zero suppressed)
425  return 0;
426  }
427  }
428  return 0;
429 }

References EcalBarrel, EcalRecHit::kDiWeird, EcalRecHit::kTowerRecovered, EcalRecHit::kWeird, and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ roundnessBarrelSuperClusters()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::roundnessBarrelSuperClusters ( const reco::SuperCluster superCluster,
const EcalRecHitCollection recHits,
int  weightedPositionMethod = 0,
float  energyThreshold = 0.0 
)
static

Definition at line 1615 of file EcalClusterTools.h.

1619  { //int positionWeightingMethod=0){
1620  std::vector<std::pair<const EcalRecHit *, float>> RH_ptrs_fracs;
1621  const std::vector<std::pair<DetId, float>> &myHitsPair = superCluster.hitsAndFractions();
1622  for (unsigned int i = 0; i < myHitsPair.size(); ++i) {
1623  //get pointer to recHit object
1624  EcalRecHitCollection::const_iterator myRH = recHits.find(myHitsPair[i].first);
1625  if (myRH != recHits.end() && myRH->energy() * (noZS ? 1.0 : myHitsPair[i].second) > energyThreshold) {
1626  //require rec hit to have positive energy
1627  RH_ptrs_fracs.push_back(std::make_pair(&(*myRH), myHitsPair[i].second));
1628  }
1629  }
1630  std::vector<float> temp =
1631  EcalClusterToolsT<noZS>::roundnessSelectedBarrelRecHits(RH_ptrs_fracs, weightedPositionMethod);
1632  return temp;
1633 }

References ClusterTask_cfi::energyThreshold, dqmdumpme::first, reco::CaloCluster::hitsAndFractions(), mps_fire::i, FastTrackerRecHitMaskProducer_cfi::recHits, EcalClusterToolsT< noZS >::roundnessSelectedBarrelRecHits(), edm::second(), and groupFilesInBlocks::temp.

◆ roundnessBarrelSuperClustersUserExtended()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::roundnessBarrelSuperClustersUserExtended ( const reco::SuperCluster superCluster,
const EcalRecHitCollection recHits,
int  ieta_delta = 0,
int  iphi_delta = 0,
float  energyRHThresh = 0.00000,
int  weightedPositionMethod = 0 
)
static

Definition at line 1640 of file EcalClusterTools.h.

1646  {
1647  std::vector<std::pair<const EcalRecHit *, float>> RH_ptrs_fracs;
1648  const std::vector<std::pair<DetId, float>> &myHitsPair = superCluster.hitsAndFractions();
1649  for (unsigned int i = 0; i < myHitsPair.size(); ++i) {
1650  //get pointer to recHit object
1651  EcalRecHitCollection::const_iterator myRH = recHits.find(myHitsPair[i].first);
1652  if (myRH != recHits.end() && myRH->energy() * (noZS ? 1.0 : myHitsPair[i].second) > energyRHThresh)
1653  RH_ptrs_fracs.push_back(std::make_pair(&(*myRH), myHitsPair[i].second));
1654  }
1655 
1656  std::vector<int> seedPosition = EcalClusterToolsT<noZS>::getSeedPosition(RH_ptrs_fracs);
1657 
1658  for (EcalRecHitCollection::const_iterator rh = recHits.begin(); rh != recHits.end(); rh++) {
1659  EBDetId EBdetIdi(rh->detid());
1660  float the_fraction = 0;
1661  //if(rh != recHits.end())
1662  bool inEtaWindow = (abs(deltaIEta(seedPosition[0], EBdetIdi.ieta())) <= ieta_delta);
1663  bool inPhiWindow = (abs(deltaIPhi(seedPosition[1], EBdetIdi.iphi())) <= iphi_delta);
1664  bool passEThresh = (rh->energy() > energyRHThresh);
1665  bool alreadyCounted = false;
1666 
1667  // figure out if the rechit considered now is already inside the SC
1668  bool is_SCrh_inside_recHits = false;
1669  for (unsigned int i = 0; i < myHitsPair.size(); i++) {
1670  EcalRecHitCollection::const_iterator SCrh = recHits.find(myHitsPair[i].first);
1671  if (SCrh != recHits.end()) {
1672  the_fraction = myHitsPair[i].second;
1673  is_SCrh_inside_recHits = true;
1674  if (rh->detid() == SCrh->detid())
1675  alreadyCounted = true;
1676  }
1677  } //for loop over SC's recHits
1678 
1679  if (is_SCrh_inside_recHits && !alreadyCounted && passEThresh && inEtaWindow && inPhiWindow) {
1680  RH_ptrs_fracs.push_back(std::make_pair(&(*rh), the_fraction));
1681  }
1682 
1683  } //for loop over rh
1684  return EcalClusterToolsT<noZS>::roundnessSelectedBarrelRecHits(RH_ptrs_fracs, weightedPositionMethod);
1685 }

References funct::abs(), dqmdumpme::first, EcalClusterToolsT< noZS >::getSeedPosition(), reco::CaloCluster::hitsAndFractions(), mps_fire::i, FastTrackerRecHitMaskProducer_cfi::recHits, EcalClusterToolsT< noZS >::roundnessSelectedBarrelRecHits(), and edm::second().

◆ roundnessSelectedBarrelRecHits()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::roundnessSelectedBarrelRecHits ( const std::vector< std::pair< const EcalRecHit *, float >> &  rhVector,
int  weightedPositionMethod = 0 
)
static

Definition at line 1691 of file EcalClusterTools.h.

1693  { //int weightedPositionMethod = 0){
1694  //positionWeightingMethod = 0 linear weighting, 1 log energy weighting
1695 
1696  std::vector<float> shapes; // this is the returning vector
1697 
1698  //make sure photon has more than one crystal; else roundness and angle suck
1699  if (RH_ptrs_fracs.size() < 2) {
1700  shapes.push_back(-3);
1701  shapes.push_back(-3);
1702  return shapes;
1703  }
1704 
1705  //Find highest E RH (Seed) and save info, compute sum total energy used
1706  std::vector<int> seedPosition = EcalClusterToolsT<noZS>::getSeedPosition(RH_ptrs_fracs); // *recHits);
1707  int tempInt = seedPosition[0];
1708  if (tempInt < 0)
1709  tempInt++;
1710  float energyTotal = EcalClusterToolsT<noZS>::getSumEnergy(RH_ptrs_fracs);
1711 
1712  //1st loop over rechits: compute new weighted center position in coordinates centered on seed
1713  float centerIEta = 0.;
1714  float centerIPhi = 0.;
1715  float denominator = 0.;
1716 
1717  for (std::vector<std::pair<const EcalRecHit *, float>>::const_iterator rhf_ptr = RH_ptrs_fracs.begin();
1718  rhf_ptr != RH_ptrs_fracs.end();
1719  rhf_ptr++) {
1720  const EcalRecHit *rh_ptr = rhf_ptr->first;
1721  //get iEta, iPhi
1722  EBDetId EBdetIdi(rh_ptr->detid());
1723  if (fabs(energyTotal) < 0.0001) {
1724  // don't /0, bad!
1725  shapes.push_back(-2);
1726  shapes.push_back(-2);
1727  return shapes;
1728  }
1729  float rh_energy = rh_ptr->energy() * (noZS ? 1.0 : rhf_ptr->second);
1730  float weight = 0;
1731  if (std::abs(weightedPositionMethod) < 0.0001) { //linear
1732  weight = rh_energy / energyTotal;
1733  } else { //logrithmic
1734  weight = std::max(0.0, 4.2 + log(rh_energy / energyTotal));
1735  }
1736  denominator += weight;
1737  centerIEta += weight * deltaIEta(seedPosition[0], EBdetIdi.ieta());
1738  centerIPhi += weight * deltaIPhi(seedPosition[1], EBdetIdi.iphi());
1739  }
1740  if (fabs(denominator) < 0.0001) {
1741  // don't /0, bad!
1742  shapes.push_back(-2);
1743  shapes.push_back(-2);
1744  return shapes;
1745  }
1746  centerIEta = centerIEta / denominator;
1747  centerIPhi = centerIPhi / denominator;
1748 
1749  //2nd loop over rechits: compute inertia tensor
1750  TMatrixDSym inertia(2); //initialize 2d inertia tensor
1751  double inertia00 = 0.;
1752  double inertia01 = 0.; // = inertia10 b/c matrix should be symmetric
1753  double inertia11 = 0.;
1754  int i = 0;
1755  for (std::vector<std::pair<const EcalRecHit *, float>>::const_iterator rhf_ptr = RH_ptrs_fracs.begin();
1756  rhf_ptr != RH_ptrs_fracs.end();
1757  rhf_ptr++) {
1758  const EcalRecHit *rh_ptr = rhf_ptr->first;
1759  //get iEta, iPhi
1760  EBDetId EBdetIdi(rh_ptr->detid());
1761 
1762  if (fabs(energyTotal) < 0.0001) {
1763  // don't /0, bad!
1764  shapes.push_back(-2);
1765  shapes.push_back(-2);
1766  return shapes;
1767  }
1768  float rh_energy = rh_ptr->energy() * (noZS ? 1.0 : rhf_ptr->second);
1769  float weight = 0;
1770  if (std::abs(weightedPositionMethod) < 0.0001) { //linear
1771  weight = rh_energy / energyTotal;
1772  } else { //logrithmic
1773  weight = std::max(0.0, 4.2 + log(rh_energy / energyTotal));
1774  }
1775 
1776  float ieta_rh_to_center = deltaIEta(seedPosition[0], EBdetIdi.ieta()) - centerIEta;
1777  float iphi_rh_to_center = deltaIPhi(seedPosition[1], EBdetIdi.iphi()) - centerIPhi;
1778 
1779  inertia00 += weight * iphi_rh_to_center * iphi_rh_to_center;
1780  inertia01 -= weight * iphi_rh_to_center * ieta_rh_to_center;
1781  inertia11 += weight * ieta_rh_to_center * ieta_rh_to_center;
1782  i++;
1783  }
1784 
1785  inertia[0][0] = inertia00;
1786  inertia[0][1] = inertia01; // use same number here
1787  inertia[1][0] = inertia01; // and here to insure symmetry
1788  inertia[1][1] = inertia11;
1789 
1790  //step 1 find principal axes of inertia
1791  TMatrixD eVectors(2, 2);
1792  TVectorD eValues(2);
1793  //std::cout<<"EcalClusterToolsT<noZS>::showerRoundness- about to compute eVectors"<<std::endl;
1794  eVectors = inertia.EigenVectors(eValues); //ordered highest eV to lowest eV (I checked!)
1795  //and eVectors are in columns of matrix! I checked!
1796  //and they are normalized to 1
1797 
1798  //step 2 select eta component of smaller eVal's eVector
1799  TVectorD smallerAxis(2); //easiest to spin SC on this axis (smallest eVal)
1800  smallerAxis[0] = eVectors[0][1]; //row,col //eta component
1801  smallerAxis[1] = eVectors[1][1]; //phi component
1802 
1803  //step 3 compute interesting quatities
1804  Double_t temp = fabs(smallerAxis[0]); // closer to 1 ->beamhalo, closer to 0 something else
1805  if (fabs(eValues[0]) < 0.0001) {
1806  // don't /0, bad!
1807  shapes.push_back(-2);
1808  shapes.push_back(-2);
1809  return shapes;
1810  }
1811 
1812  float Roundness = eValues[1] / eValues[0];
1813  float Angle = acos(temp);
1814 
1815  if (-0.00001 < Roundness && Roundness < 0)
1816  Roundness = 0.;
1817  if (-0.00001 < Angle && Angle < 0)
1818  Angle = 0.;
1819 
1820  shapes.push_back(Roundness);
1821  shapes.push_back(Angle);
1822  return shapes;
1823 }

References funct::abs(), HLTTauDQMOffline_cfi::denominator, EcalRecHit::detid(), EcalRecHit::energy(), EcalClusterToolsT< noZS >::getSeedPosition(), EcalClusterToolsT< noZS >::getSumEnergy(), mps_fire::i, dqm-mbProfile::log, SiStripPI::max, groupFilesInBlocks::temp, and mps_merge::weight.

Referenced by EcalClusterToolsT< noZS >::roundnessBarrelSuperClusters(), and EcalClusterToolsT< noZS >::roundnessBarrelSuperClustersUserExtended().

◆ scLocalCovariances()

template<bool noZS>
std::vector< float > EcalClusterToolsT< noZS >::scLocalCovariances ( const reco::SuperCluster cluster,
const EcalRecHitCollection recHits,
const CaloTopology topology,
float  w0 = 4.7 
)
static

Definition at line 1363 of file EcalClusterTools.h.

1366  {
1367  const reco::BasicCluster bcluster = *(cluster.seed());
1368 
1369  float e_5x5 = e5x5(bcluster, recHits, topology);
1370  float covEtaEta, covEtaPhi, covPhiPhi;
1371 
1372  if (e_5x5 >= 0.) {
1373  const std::vector<std::pair<DetId, float>> &v_id = cluster.hitsAndFractions();
1374  std::pair<float, float> mean5x5PosInNrCrysFromSeed = mean5x5PositionInLocalCrysCoord(bcluster, recHits, topology);
1375  std::pair<float, float> mean5x5XYPos = mean5x5PositionInXY(cluster, recHits, topology);
1376  // now we can calculate the covariances
1377  double numeratorEtaEta = 0;
1378  double numeratorEtaPhi = 0;
1379  double numeratorPhiPhi = 0;
1380  double denominator = 0;
1381 
1382  const double barrelCrysSize = 0.01745; //approximate size of crystal in eta,phi in barrel
1383  const double endcapCrysSize = 0.0447; //the approximate crystal size sigmaEtaEta was corrected to in the endcap
1384 
1385  DetId seedId = getMaximum(v_id, recHits).first;
1386  bool isBarrel = seedId.subdetId() == EcalBarrel;
1387 
1388  const double crysSize = isBarrel ? barrelCrysSize : endcapCrysSize;
1389 
1390  for (size_t i = 0; i < v_id.size(); ++i) {
1391  float frac = getFraction(v_id, v_id[i].first);
1392  float energy = recHitEnergy(v_id[i].first, recHits) * frac;
1393 
1394  if (energy <= 0)
1395  continue;
1396 
1397  float dEta = getNrCrysDiffInEta(v_id[i].first, seedId) - mean5x5PosInNrCrysFromSeed.first;
1398  float dPhi = 0;
1399  if (isBarrel)
1400  dPhi = getNrCrysDiffInPhi(v_id[i].first, seedId) - mean5x5PosInNrCrysFromSeed.second;
1401  else
1402  dPhi = getDPhiEndcap(v_id[i].first, mean5x5XYPos.first, mean5x5XYPos.second);
1403 
1404  double w = 0.;
1405  w = std::max(0.0f, w0 + std::log(energy / e_5x5));
1406 
1407  denominator += w;
1408  numeratorEtaEta += w * dEta * dEta;
1409  numeratorEtaPhi += w * dEta * dPhi;
1410  numeratorPhiPhi += w * dPhi * dPhi;
1411  }
1412 
1413  //multiplying by crysSize to make the values compariable to normal covariances
1414  if (denominator != 0.0) {
1415  covEtaEta = crysSize * crysSize * numeratorEtaEta / denominator;
1416  covEtaPhi = crysSize * crysSize * numeratorEtaPhi / denominator;
1417  covPhiPhi = crysSize * crysSize * numeratorPhiPhi / denominator;
1418  } else {
1419  covEtaEta = 999.9;
1420  covEtaPhi = 999.9;
1421  covPhiPhi = 999.9;
1422  }
1423 
1424  } else {
1425  // Warn the user if there was no energy in the cells and return zeroes.
1426  // std::cout << "\ClusterShapeAlgo::Calculate_Covariances: no energy in supplied cells.\n";
1427  covEtaEta = 0;
1428  covEtaPhi = 0;
1429  covPhiPhi = 0;
1430  }
1431 
1432  std::vector<float> v;
1433  v.push_back(covEtaEta);
1434  v.push_back(covEtaPhi);
1435  v.push_back(covPhiPhi);
1436 
1437  return v;
1438 }

References HLTTauDQMOffline_cfi::denominator, HLT_2018_cff::dEta, HLT_2018_cff::dPhi, EcalBarrel, HCALHighEnergyHPDFilter_cfi::energy, f, dqmdumpme::first, cropTnPTrees::frac, reco::CaloCluster::hitsAndFractions(), mps_fire::i, PixelPluginsPhase0_cfi::isBarrel, dqm-mbProfile::log, SiStripPI::max, FastTrackerRecHitMaskProducer_cfi::recHits, reco::SuperCluster::seed(), DetId::subdetId(), ecaldqm::topology(), findQualityFiles::v, and w.

◆ zernike20()

template<bool noZS>
double EcalClusterToolsT< noZS >::zernike20 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloGeometry geometry,
double  R0 = 6.6,
bool  logW = true,
float  w0 = 4.7 
)
static

Definition at line 1112 of file EcalClusterTools.h.

1117  {
1118  return absZernikeMoment(cluster, recHits, geometry, 2, 0, R0, logW, w0);
1119 }

References HLT_2018_cff::R0, and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ zernike42()

template<bool noZS>
double EcalClusterToolsT< noZS >::zernike42 ( const reco::BasicCluster cluster,
const EcalRecHitCollection recHits,
const CaloGeometry geometry,
double  R0 = 6.6,
bool  logW = true,
float  w0 = 4.7 
)
static

Definition at line 1122 of file EcalClusterTools.h.

1127  {
1128  return absZernikeMoment(cluster, recHits, geometry, 4, 2, R0, logW, w0);
1129 }

References HLT_2018_cff::R0, and FastTrackerRecHitMaskProducer_cfi::recHits.

EBDetId::kCrystalsInPhi
static const int kCrystalsInPhi
Definition: EBDetId.h:142
change_name.diff
diff
Definition: change_name.py:13
EBDetId::positiveZ
bool positiveZ() const
Definition: EBDetId.h:76
EcalClusterEnergyDeposition
Definition: ClusterShapeAlgo.h:29
EcalRecHit
Definition: EcalRecHit.h:15
mps_fire.i
i
Definition: mps_fire.py:355
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
EcalRecHit::detid
const DetId & detid() const
Definition: EcalRecHit.h:72
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
EcalClusterToolsT::calc_AbsZernikeMoment
static double calc_AbsZernikeMoment(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, int n, int m, double R0, bool logW, float w0)
Definition: EcalClusterTools.h:1198
EBDetId
Definition: EBDetId.h:17
mps_merge.weight
weight
Definition: mps_merge.py:88
cropTnPTrees.frac
frac
Definition: cropTnPTrees.py:18
geometry
Definition: geometry.py:1
EcalClusterEnergyDeposition::r
double r
Definition: ClusterShapeAlgo.h:31
EcalRecHit::kSaturated
Definition: EcalRecHit.h:27
EBDetId::im
int im() const
get the number of module inside the SM (1-4)
Definition: EBDetId.h:64
EcalClusterToolsT::fast_AbsZernikeMoment
static double fast_AbsZernikeMoment(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, int n, int m, double R0, bool logW, float w0)
Definition: EcalClusterTools.h:1155
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
EcalClusterToolsT::matrixEnergy
static float matrixEnergy(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, DetId id, CaloRectangle rectangle)
Definition: EcalClusterTools.h:444
EcalRecHit::energy
float energy() const
Definition: EcalRecHit.h:68
findQualityFiles.v
v
Definition: findQualityFiles.py:179
EcalClusterToolsT::getEnergyDepTopology
static std::vector< EcalClusterEnergyDeposition > getEnergyDepTopology(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, bool logW, float w0)
Definition: EcalClusterTools.h:726
EcalRecHit::kTowerRecovered
Definition: EcalRecHit.h:30
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
dqmdumpme.first
first
Definition: dqmdumpme.py:55
EcalBarrel
Definition: EcalSubdetector.h:10
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
EBDetId::kModulesPerSM
static const int kModulesPerSM
Definition: EBDetId.h:140
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
CastorDataFrameFilter_impl::energySum
double energySum(const DataFrame &df, int fs, int ls)
Definition: CastorDataFrameFilter.cc:22
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
EcalClusterToolsT::getMaximum
static std::pair< DetId, float > getMaximum(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
Definition: EcalClusterTools.h:405
DetId
Definition: DetId.h:17
EcalClusterToolsT::f33
static double f33(double r)
Definition: EcalClusterTools.h:317
alignCSCRings.s
s
Definition: alignCSCRings.py:92
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
EcalClusterToolsT::f11
static double f11(double r)
Definition: EcalClusterTools.h:313
EcalClusterToolsT::matrixSize
static int matrixSize(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, DetId id, CaloRectangle rectangle)
Definition: EcalClusterTools.h:460
EcalClusterToolsT::getIEta
static float getIEta(const DetId &id)
Definition: EcalClusterTools.h:1241
ecaldqm::topology
const CaloTopology * topology(nullptr)
w
const double w
Definition: UKUtility.cc:23
EcalClusterToolsT::matrixDetId
static std::vector< DetId > matrixDetId(const CaloTopology *topology, DetId id, CaloRectangle rectangle)
Definition: EcalClusterTools.h:477
EcalClusterToolsT::getIPhi
static float getIPhi(const DetId &id)
Definition: EcalClusterTools.h:1261
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
EcalClusterToolsT::deltaIEta
static int deltaIEta(int seed_ieta, int rh_ieta)
Definition: EcalClusterTools.h:1859
reco::CaloCluster
Definition: CaloCluster.h:31
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
Geom::pi
constexpr double pi()
Definition: Pi.h:31
EcalClusterToolsT::getNrCrysDiffInPhi
static float getNrCrysDiffInPhi(const DetId &crysId, const DetId &orginId)
Definition: EcalClusterTools.h:1321
EcalClusterToolsT::deltaIPhi
static int deltaIPhi(int seed_iphi, int rh_iphi)
Definition: EcalClusterTools.h:1845
Geom::twoPi
constexpr double twoPi()
Definition: Pi.h:32
EBDetId::MAX_IPHI
static const int MAX_IPHI
Definition: EBDetId.h:137
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
Cluster2ndMoments::alpha
float alpha
Definition: EcalClusterTools.h:68
CaloRectangle
Definition: CaloRectangle.h:13
EcalClusterToolsT::f40
static double f40(double r)
Definition: EcalClusterTools.h:318
Point3DBase< float, GlobalTag >
EcalClusterToolsT::mean5x5PositionInXY
static std::pair< float, float > mean5x5PositionInXY(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:924
EcalClusterToolsT::cluster2ndMoments
static Cluster2ndMoments cluster2ndMoments(const reco::BasicCluster &basicCluster, const EcalRecHitCollection &recHits, double phiCorrectionFactor=0.8, double w0=4.7, bool useLogWeights=true)
Definition: EcalClusterTools.h:1446
EcalClusterEnergyDeposition::phi
double phi
Definition: ClusterShapeAlgo.h:32
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
EEDetId
Definition: EEDetId.h:14
EcalEndcap
Definition: EcalSubdetector.h:10
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::LogWarning
Definition: MessageLogger.h:141
EcalClusterToolsT::f31
static double f31(double r)
Definition: EcalClusterTools.h:316
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
EcalClusterToolsT::getNormedIY
static float getNormedIY(const DetId &id)
Definition: EcalClusterTools.h:1286
EcalClusterToolsT::getSumEnergy
static float getSumEnergy(const std::vector< std::pair< const EcalRecHit *, float >> &RH_ptrs_fracs)
Definition: EcalClusterTools.h:1899
EcalClusterToolsT::f44
static double f44(double r)
Definition: EcalClusterTools.h:320
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
Cluster2ndMoments::sMaj
float sMaj
Definition: EcalClusterTools.h:65
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
reco::CaloCluster::hitsAndFractions
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:210
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
EcalClusterToolsT::getNrCrysDiffInEta
static float getNrCrysDiffInEta(const DetId &crysId, const DetId &orginId)
Definition: EcalClusterTools.h:1299
EcalClusterToolsT::getDPhiEndcap
static float getDPhiEndcap(const DetId &crysId, float meanX, float meanY)
Definition: EcalClusterTools.h:1341
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
EcalClusterToolsT::f55
static double f55(double r)
Definition: EcalClusterTools.h:323
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
EcalClusterToolsT::getFraction
static float getFraction(const std::vector< std::pair< DetId, float >> &v_id, DetId id)
Definition: EcalClusterTools.h:376
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
EBDetId::kTowersInPhi
static const int kTowersInPhi
Definition: EBDetId.h:139
EcalClusterToolsT::absZernikeMoment
static double absZernikeMoment(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, int n, int m, double R0, bool logW, float w0)
Definition: EcalClusterTools.h:1132
HLT_2018_cff.R0
R0
Definition: HLT_2018_cff.py:7317
EcalClusterToolsT::mean5x5PositionInLocalCrysCoord
static std::pair< float, float > mean5x5PositionInLocalCrysCoord(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:888
CaloSubdetectorGeometry::getGeometry
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: CaloSubdetectorGeometry.cc:36
EcalRecHit::kWeird
Definition: EcalRecHit.h:35
DetId::Ecal
Definition: DetId.h:27
EcalClusterToolsT::getSeedPosition
static std::vector< int > getSeedPosition(const std::vector< std::pair< const EcalRecHit *, float >> &RH_ptrs)
Definition: EcalClusterTools.h:1871
res
Definition: Electron.h:6
EcalClusterToolsT::f00
static double f00(double r)
Definition: EcalClusterTools.h:312
EcalClusterEnergyDeposition::deposited_energy
double deposited_energy
Definition: ClusterShapeAlgo.h:30
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
alignCSCRings.r
r
Definition: alignCSCRings.py:93
EcalClusterToolsT::f20
static double f20(double r)
Definition: EcalClusterTools.h:314
DDAxes::phi
EcalClusterToolsT::f22
static double f22(double r)
Definition: EcalClusterTools.h:315
noZS
Definition: EcalClusterLazyTools.h:267
EcalClusterToolsT::factorial
static double factorial(int n)
Definition: EcalClusterTools.h:350
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:195
Angle
Definition: Angle.h:17
EcalClusterToolsT::getNormedIX
static float getNormedIX(const DetId &id)
Definition: EcalClusterTools.h:1273
EcalClusterToolsT::recHitEnergy
static float recHitEnergy(DetId id, const EcalRecHitCollection *recHits)
Definition: EcalClusterTools.h:411
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
EcalClusterToolsT::f53
static double f53(double r)
Definition: EcalClusterTools.h:322
EcalClusterToolsT::f51
static double f51(double r)
Definition: EcalClusterTools.h:321
EcalClusterToolsT::e5x5
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:534
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
Cluster2ndMoments::sMin
float sMin
Definition: EcalClusterTools.h:66
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
EcalClusterToolsT::lat
static std::vector< float > lat(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloGeometry *geometry, bool logW=true, float w0=4.7)
Definition: EcalClusterTools.h:790
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
mps_fire.result
result
Definition: mps_fire.py:303
EcalRecHit::kDiWeird
Definition: EcalRecHit.h:36
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
EcalClusterToolsT::f42
static double f42(double r)
Definition: EcalClusterTools.h:319
ClusterTask_cfi.energyThreshold
energyThreshold
Definition: ClusterTask_cfi.py:3
Cluster2ndMoments
Definition: EcalClusterTools.h:63
EcalClusterToolsT::meanClusterPosition
static math::XYZVector meanClusterPosition(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry)
Definition: EcalClusterTools.h:857
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
weight
Definition: weight.py:1
EcalClusterToolsT::roundnessSelectedBarrelRecHits
static std::vector< float > roundnessSelectedBarrelRecHits(const std::vector< std::pair< const EcalRecHit *, float >> &rhVector, int weightedPositionMethod=0)
Definition: EcalClusterTools.h:1691
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37