|
|
Go to the documentation of this file.
7 #include "Math/GenVector/VectorUtil.h"
10 #include "vdt/vdtMath.h"
13 #include <unordered_map>
28 const std::vector<bool>&,
49 unsigned int to()
const {
return to_; }
64 const std::vector<double>&,
65 const std::vector<double>&);
66 std::vector<ClusterLink>
prune(std::vector<ClusterLink>&, std::vector<bool>& linkedClusters);
70 std::vector<bool>& mask,
72 const std::vector<ClusterLink>&
links);
81 if (conf.
exists(
"allCellsPositionCalc")) {
92 const std::vector<bool>& seedable,
94 std::vector<double> etaRMS2(
input.size(), 0.0);
95 std::vector<double> phiRMS2(
input.size(), 0.0);
109 std::vector<bool> mask(
input.size(),
false);
110 std::vector<bool> linked(
input.size(),
false);
120 for (
unsigned int i = 0;
i <
input.size(); ++
i) {
137 output.push_back(cluster);
143 std::vector<double>& etaRMS2,
144 std::vector<double>& phiRMS2) {
147 for (
unsigned int i = 0;
i <
clusters.size(); ++
i) {
153 auto const&
h = *
frac.recHitRef();
154 auto const&
rep =
h.positionREP();
155 etaSum += (
frac.fraction() *
h.energy()) *
std::abs(
rep.eta() - crep.eta());
160 etaRMS2[
i] *= etaRMS2[
i];
162 phiRMS2[
i] *= phiRMS2[
i];
168 std::vector<ClusterLink>
links;
171 for (
unsigned int j = 0;
j <
clusters.size(); ++
j) {
187 auto deta = crep1.eta() - crep2.eta();
188 deta = deta * deta / (etaRMS2[
i] + etaRMS2[
j]);
189 auto dphi =
deltaPhi(crep1.phi(), crep2.phi());
190 dphi = dphi * dphi / (phiRMS2[
i] + phiRMS2[
j]);
202 std::vector<bool>& linkedClusters) {
203 std::vector<ClusterLink> goodLinks;
204 std::vector<bool> mask(
links.size(),
false);
208 for (
unsigned int i = 0;
i <
links.size() - 1; ++
i) {
211 for (
unsigned int j =
i + 1;
j <
links.size(); ++
j) {
218 if (link1.
to() == link2.
to()) {
220 if (link1.
dZ() < link2.
dZ()) {
222 }
else if (link1.
dZ() > link2.
dZ()) {
224 }
else if (fabs(link1.
dZ() - link2.
dZ()) < 0.2) {
225 if (link1.
dR() < link2.
dR()) {
227 }
else if (link1.
dR() > link2.
dR()) {
241 for (
unsigned int i = 0;
i <
links.size(); ++
i) {
244 goodLinks.push_back(
links[
i]);
245 linkedClusters[
links[
i].from()] =
true;
246 linkedClusters[
links[
i].to()] =
true;
265 e2 =
fraction.recHitRef()->energy();
274 std::vector<bool>& mask,
276 const std::vector<ClusterLink>&
links) {
280 if (!mask[
link.from()]) {
282 mask[
link.from()] =
true;
285 if (!mask[
link.to()]) {
287 mask[
link.to()] =
true;
293 if (!mask[
link.to()]) {
295 mask[
link.to()] =
true;
298 if (!mask[
link.from()]) {
300 mask[
link.from()] =
true;
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
static const std::string input
void calculateShowerShapes(const reco::PFClusterCollection &, std::vector< double > &, std::vector< double > &)
void expandCluster(reco::PFCluster &, unsigned int point, std::vector< bool > &mask, const reco::PFClusterCollection &, const std::vector< ClusterLink > &links)
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
B2DGPF & operator=(const B2DGPF &)=delete
std::unique_ptr< PFCPositionCalculatorBase > _allCellsPosCalc
double energy() const
cluster energy
std::vector< ClusterLink > prune(std::vector< ClusterLink > &, std::vector< bool > &linkedClusters)
double depth() const
cluster depth
PFMultiDepthClusterizer(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
const REPPoint & positionREP() const
cluster position: rho, eta, phi
#define DEFINE_EDM_PLUGIN(factory, type, name)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void absorbCluster(reco::PFCluster &, const reco::PFCluster &)
void update(const edm::EventSetup &es) override
std::vector< ClusterLink > link(const reco::PFClusterCollection &, const std::vector< double > &, const std::vector< double > &)
DetId seed() const
return DetId of seed
~PFMultiDepthClusterizer() override=default
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
ClusterLink(unsigned int i, unsigned int j, double DR, double DZ, double energy)
T getParameter(std::string const &) const
void buildClusters(const reco::PFClusterCollection &, const std::vector< bool > &, reco::PFClusterCollection &outclus) override
unsigned int from() const
Power< A, B >::type pow(const A &a, const B &b)
Abs< T >::type abs(const T &t)
*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
ParameterSet const & getParameterSet(std::string const &) const