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);
83 if (conf.
exists(
"allCellsPositionCalc")) {
94 const std::vector<bool>& seedable,
97 std::vector<double> etaRMS2(
input.size(), 0.0);
98 std::vector<double> phiRMS2(
input.size(), 0.0);
112 std::vector<bool>
mask(
input.size(),
false);
113 std::vector<bool> linked(
input.size(),
false);
123 for (
unsigned int i = 0;
i <
input.size(); ++
i) {
140 output.push_back(cluster);
146 std::vector<double>& etaRMS2,
147 std::vector<double>& phiRMS2) {
150 for (
unsigned int i = 0;
i <
clusters.size(); ++
i) {
156 auto const&
h = *
frac.recHitRef();
157 auto const&
rep =
h.positionREP();
158 etaSum += (
frac.fraction() *
h.energy()) *
std::abs(
rep.eta() - crep.eta());
163 etaRMS2[
i] *= etaRMS2[
i];
165 phiRMS2[
i] *= phiRMS2[
i];
171 std::vector<ClusterLink>
links;
174 for (
unsigned int j = 0;
j <
clusters.size(); ++
j) {
182 auto dz = (
static_cast<int>(cluster2.
depth()) - static_cast<int>(cluster1.
depth()));
191 auto deta = crep1.eta() - crep2.eta();
192 deta = deta * deta / (etaRMS2[
i] + etaRMS2[
j]);
193 auto dphi =
deltaPhi(crep1.phi(), crep2.phi());
194 dphi = dphi * dphi / (phiRMS2[
i] + phiRMS2[
j]);
206 std::vector<bool>& linkedClusters) {
207 std::vector<ClusterLink> goodLinks;
208 std::vector<bool>
mask(
links.size(),
false);
212 for (
unsigned int i = 0;
i <
links.size() - 1; ++
i) {
215 for (
unsigned int j =
i + 1;
j <
links.size(); ++
j) {
222 if (link1.
to() == link2.
to()) {
224 if (link1.
dZ() < link2.
dZ()) {
226 }
else if (link1.
dZ() > link2.
dZ()) {
229 if (link1.
dR() < link2.
dR()) {
231 }
else if (link1.
dR() > link2.
dR()) {
245 for (
unsigned int i = 0;
i <
links.size(); ++
i) {
248 goodLinks.push_back(
links[
i]);
249 linkedClusters[
links[
i].from()] =
true;
250 linkedClusters[
links[
i].to()] =
true;
269 e2 =
fraction.recHitRef()->energy();
278 std::vector<bool>&
mask,
280 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
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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)