7 #include "Math/GenVector/VectorUtil.h" 11 #include "vdt/vdtMath.h" 14 #include <unordered_map> 29 const std::vector<bool>&,
51 unsigned int to()
const {
return to_; }
66 const std::vector<double>&,
67 const std::vector<double>&);
68 std::vector<ClusterLink>
prune(std::vector<ClusterLink>&, std::vector<bool>& linkedClusters);
72 std::vector<bool>&
mask,
74 const std::vector<ClusterLink>&
links);
84 if (!acConf.empty()) {
95 const std::vector<bool>& seedable,
98 std::vector<double> etaRMS2(
input.size(), 0.0);
99 std::vector<double> phiRMS2(
input.size(), 0.0);
113 std::vector<bool>
mask(
input.size(),
false);
114 std::vector<bool> linked(
input.size(),
false);
124 for (
unsigned int i = 0;
i <
input.size(); ++
i) {
141 output.push_back(cluster);
147 std::vector<double>& etaRMS2,
148 std::vector<double>& phiRMS2) {
151 for (
unsigned int i = 0;
i <
clusters.size(); ++
i) {
157 auto const&
h = *
frac.recHitRef();
158 auto const&
rep =
h.positionREP();
159 etaSum += (
frac.fraction() *
h.energy()) *
std::abs(
rep.eta() - crep.eta());
164 etaRMS2[
i] *= etaRMS2[
i];
166 phiRMS2[
i] *= phiRMS2[
i];
172 std::vector<ClusterLink>
links;
175 for (
unsigned int j = 0;
j <
clusters.size(); ++
j) {
183 auto dz = (
static_cast<int>(cluster2.
depth()) - static_cast<int>(cluster1.
depth()));
192 auto deta = crep1.eta() - crep2.eta();
193 deta = deta * deta / (etaRMS2[
i] + etaRMS2[
j]);
194 auto dphi =
deltaPhi(crep1.phi(), crep2.phi());
195 dphi = dphi * dphi / (phiRMS2[
i] + phiRMS2[
j]);
207 std::vector<bool>& linkedClusters) {
208 std::vector<ClusterLink> goodLinks;
209 std::vector<bool>
mask(
links.size(),
false);
213 for (
unsigned int i = 0;
i <
links.size() - 1; ++
i) {
216 for (
unsigned int j =
i + 1;
j <
links.size(); ++
j) {
223 if (link1.
to() == link2.
to()) {
225 if (link1.
dZ() < link2.
dZ()) {
227 }
else if (link1.
dZ() > link2.
dZ()) {
230 if (link1.
dR() < link2.
dR()) {
232 }
else if (link1.
dR() > link2.
dR()) {
246 for (
unsigned int i = 0;
i <
links.size(); ++
i) {
249 goodLinks.push_back(
links[
i]);
250 linkedClusters[
links[
i].from()] =
true;
251 linkedClusters[
links[
i].to()] =
true;
270 e2 =
fraction.recHitRef()->energy();
279 std::vector<bool>&
mask,
281 const std::vector<ClusterLink>&
links) {
void calculateShowerShapes(const reco::PFClusterCollection &, std::vector< double > &, std::vector< double > &)
T getParameter(std::string const &) const
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
uint32_t cc[maxCellsPerHit]
DetId seed() const
return DetId of seed
ParameterSet const & getParameterSet(std::string const &) const
unsigned int from() const
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
B2DGPF & operator=(const B2DGPF &)=delete
std::vector< ClusterLink > prune(std::vector< ClusterLink > &, std::vector< bool > &linkedClusters)
const REPPoint & positionREP() const
cluster position: rho, eta, phi
void buildClusters(const reco::PFClusterCollection &, const std::vector< bool > &, reco::PFClusterCollection &outclus, const HcalPFCuts *) override
static std::string const input
double depth() const
cluster depth
std::unique_ptr< PFCPositionCalculatorBase > _allCellsPosCalc
void absorbCluster(reco::PFCluster &, const reco::PFCluster &)
double energy() const
cluster energy
Abs< T >::type abs(const T &t)
std::vector< ClusterLink > link(const reco::PFClusterCollection &, const std::vector< double > &, const std::vector< double > &)
void update(const edm::EventSetup &es) override
PFMultiDepthClusterizer(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
~PFMultiDepthClusterizer() override=default
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
#define DEFINE_EDM_PLUGIN(factory, type, name)
ClusterLink(unsigned int i, unsigned int j, double DR, int DZ, double energy)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Power< A, B >::type pow(const A &a, const B &b)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
PFMultiDepthClusterizer B2DGPF
void expandCluster(reco::PFCluster &, unsigned int point, std::vector< bool > &mask, const reco::PFClusterCollection &, const std::vector< ClusterLink > &links)