Definition at line 30 of file Basic2DGenericPFlowPositionCalc.cc.
31 if (!cluster.
seed()) {
32 throw cms::Exception(
"ClusterWithNoSeed") <<
" Found a cluster with no seed: " << cluster;
36 double cl_timeweight = 0.0;
46 auto const recHitCollection =
57 auto k =
hf.recHitRef().key();
58 auto p = recHitCollection +
k;
64 for (
auto const& rhf :
hits) {
68 const auto rh_fraction = rhf.fraction;
69 const auto rh_rawenergy = rhf.energy;
70 const auto rh_energy = rh_rawenergy * rh_fraction;
73 throw cms::Exception(
"PFClusterAlgo") <<
"rechit " << refhit.
detId() <<
" has a NaN energy... "
74 <<
"The input of the particle flow clustering seems to be corrupted.";
77 cl_energy += rh_energy;
81 int cell_layer = (
int)refhit.
layer();
84 cl_time += rh_fraction * refhit.
time() * res2;
85 cl_timeweight += rh_fraction * res2;
87 const double rh_rawenergy2 = rh_rawenergy * rh_rawenergy;
88 cl_timeweight += rh_rawenergy2 * rh_fraction;
89 cl_time += rh_rawenergy2 * rh_fraction * refhit.
time();
92 if (rh_energy > max_e) {
94 max_e_layer = refhit.
layer();
99 cluster.
setTime(cl_time / cl_timeweight);
107 double position_norm = 0.0;
108 double x(0.0),
y(0.0),
z(0.0);
109 if (
nullptr !=
mySeed.hit) {
110 auto seedNeighbours =
mySeed.hit->neighbours();
113 seedNeighbours =
mySeed.hit->neighbours4();
116 seedNeighbours =
mySeed.hit->neighbours8();
122 auto compute = [&](LHit
const& rhf) {
125 int cell_layer = (
int)refhit.
layer();
138 const auto rh_energy = rhf.energy * rhf.fraction;
141 const auto rhpos_xyz = refhit.
position() * norm;
146 position_norm += norm;
153 for (
auto const& rhf :
hits)
159 for (
auto k : seedNeighbours) {
160 nei.push_back(recHitCollection +
k);
167 std::set_intersection(
168 hits.begin(),
hits.end(), nei.begin(), nei.end(), boost::make_function_output_iterator(
compute), LHitLess());
172 <<
"Cluster seed hit is null, something is wrong with PFlow RecHit!";
176 edm::LogError(
"WeirdClusterNormalization") <<
"PFCluster too far from seeding cell: set position to (0,0,0).";
180 const double norm_inverse = 1.0 / position_norm;
184 depth *= norm_inverse;
References _logWeightDenom, _minAllowedNorm, PFCPositionCalculatorBase::_minFractionInCalc, _posCalcNCrystals, _timeResolutionCalcBarrel, _timeResolutionCalcEndcap, a, b, electrons_cff::bool, reco::PFCluster::calculatePositionREP(), bookConverter::compute(), declareDynArray, LEDCalibrationChannels::depth, reco::PFRecHit::depth(), HLT_FULL_cff::detectorEnum, reco::PFRecHit::detId(), HCALHighEnergyHPDFilter_cfi::energy, Exception, f, myMath::fast_logf(), dqmMemoryStats::float, HLT_FULL_cff::fraction, PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, photonIsolationHIProducer_cfi::hf, hfClusterShapes_cfi::hits, mps_fire::i, createfilelist::int, PixelPluginsPhase0_cfi::isBarrel, edm::isNotFinite(), dqmiolumiharvest::j, dqmdumpme::k, reco::PFRecHit::layer(), SiStripPI::max, ecalTB2006H4_GenSimDigiReco_cfg::mySeed, nhits, PFLayer::NONE, AlCaHLTBitMon_ParallelJobs::p, reco::PFRecHit::position(), reco::PFCluster::recHitFractions(), reco::CaloCluster::seed(), reco::PFCluster::setDepth(), reco::CaloCluster::setEnergy(), reco::PFCluster::setLayer(), reco::CaloCluster::setPosition(), reco::PFCluster::setTime(), reco::PFCluster::setTimeError(), findQualityFiles::size, jetUpdater_cfi::sort, mathSSE::sqrt(), remoteMonitoring_LED_IterMethod_cfg::threshold, reco::PFRecHit::time(), mitigatedMETSequence_cff::U, unInitDynArray, UNLIKELY, x, y, and z.
Referenced by calculateAndSetPosition(), and calculateAndSetPositions().