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;
74 throw cms::Exception(
"PFClusterAlgo") <<
"rechit " << refhit.
detId() <<
" has a NaN energy... "
75 <<
"The input of the particle flow clustering seems to be corrupted.";
78 cl_energy += rh_energy;
82 int cell_layer = (
int)refhit.
layer();
85 cl_time += rh_fraction * refhit.
time() * res2;
86 cl_timeweight += rh_fraction * res2;
88 const double rh_rawenergy2 = rh_rawenergy * rh_rawenergy;
89 cl_timeweight += rh_rawenergy2 * rh_fraction;
90 cl_time += rh_rawenergy2 * rh_fraction * refhit.
time();
93 if (rh_energy > max_e) {
95 max_e_layer = refhit.
layer();
100 cluster.
setTime(cl_time / cl_timeweight);
108 double position_norm = 0.0;
109 double x(0.0),
y(0.0),
z(0.0);
110 if (
nullptr !=
mySeed.hit) {
111 auto seedNeighbours =
mySeed.hit->neighbours();
114 seedNeighbours =
mySeed.hit->neighbours4();
117 seedNeighbours =
mySeed.hit->neighbours8();
123 auto compute = [&](LHit
const& rhf) {
126 int cell_layer = (
int)refhit.
layer();
139 const auto rh_energy = rhf.energy * rhf.fraction;
142 const auto rhpos_xyz = refhit.
position() * norm;
147 position_norm += norm;
151 std::sort(
hits.begin(),
hits.end(), [](LHit
const&
a, LHit
const&
b) {
return a.hit <
b.hit; });
154 for (
auto const& rhf :
hits)
160 for (
auto k : seedNeighbours) {
161 nei.push_back(recHitCollection +
k);
163 std::sort(nei.begin(), nei.end());
168 std::set_intersection(
169 hits.begin(),
hits.end(), nei.begin(), nei.end(), boost::make_function_output_iterator(
compute), LHitLess());
173 <<
"Cluster seed hit is null, something is wrong with PFlow RecHit!";
177 edm::LogError(
"WeirdClusterNormalization") <<
"PFCluster too far from seeding cell: set position to (0,0,0).";
181 const double norm_inverse = 1.0 / position_norm;
185 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, mathSSE::sqrt(), remoteMonitoring_LED_IterMethod_cfg::threshold, reco::PFRecHit::time(), mitigatedMETSequence_cff::U, unInitDynArray, UNLIKELY, x, y, and z.
Referenced by calculateAndSetPosition(), and calculateAndSetPositions().