6 #include "Math/GenVector/VectorUtil.h"
8 #include "vdt/vdtMath.h"
20 if( conf.
exists(
"allCellsPositionCalc") ) {
37 const std::vector<bool>& seedable,
40 std::vector<double> etaRMS(input.size(),0.0);
41 std::vector<double> phiRMS(input.size(),0.0);
53 std::vector<ClusterLink>
links =
link(input,etaRMS,phiRMS);
59 std::vector<bool> mask(input.size(),
false);
60 std::vector<bool> linked(input.size(),
false);
63 std::vector<ClusterLink> prunedLinks;
65 prunedLinks =
prune(links,linked);
74 for (
unsigned int i=0;
i<input.size();++
i) {
80 output.push_back(input[i]);
92 output.push_back(cluster);
106 for(
unsigned int i=0;
i<clusters.size();++
i ) {
108 etaSum=0.0;phiSum=0.0;
111 auto const &
h = *
frac.recHitRef();
112 auto const &
rep =
h.positionREP();
128 std::vector<ClusterLink>
links;
130 for (
unsigned int i=0;
i<clusters.size();++
i)
131 for (
unsigned int j=0;
j<clusters.size();++
j) {
138 float dz = (cluster2.
depth() - cluster1.
depth());
141 if (dz<0.0 || fabs(dz)<0.2)
146 float deta =(crep1.eta()-crep2.eta())*(crep1.eta()-crep2.eta())/(etaRMS[
i]*etaRMS[
i]+etaRMS[
j]*etaRMS[
j]);
147 float dphi =
deltaPhi(crep1.phi(),crep2.phi())*
deltaPhi(crep1.phi(),crep2.phi())/(phiRMS[
i]*phiRMS[
i]+phiRMS[j]*phiRMS[j]);
159 prune(std::vector<ClusterLink>&
links,std::vector<bool>& linkedClusters) {
160 std::vector<ClusterLink> goodLinks ;
161 std::vector<bool> mask(links.size(),
false);
163 for (
unsigned int i=0;
i<links.size()-1;++
i) {
166 for (
unsigned int j=i+1;
j<links.size();++
j) {
174 if (link1.
to() == link2.
to()) {
176 if (link1.
dZ() < link2.
dZ()) {
179 else if (link1.
dZ() > link2.
dZ()) {
182 else if (fabs(link1.
dZ()-link2.
dZ())<0.2) {
183 if (link1.
dR()<link2.
dR()) {
186 else if (link1.
dR()>link2.
dR()) {
202 for (
unsigned int i=0;
i<links.size();++
i) {
205 goodLinks.push_back(links[i]);
206 linkedClusters[links[
i].from()]=
true;
207 linkedClusters[links[
i].to()]=
true;
243 for (
const auto&
link : links) {
246 if (!mask[
link.from()]) {
248 mask[
link.from()] =
true;
251 if (!mask[
link.to()]) {
253 mask[
link.to()]=
true;
259 if (!mask[
link.to()]) {
261 mask[
link.to()] =
true;
264 if (!mask[
link.from()]) {
266 mask[
link.from()]=
true;
T getParameter(std::string const &) const
void calculateShowerShapes(const reco::PFClusterCollection &, std::vector< double > &, std::vector< double > &)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void buildClusters(const reco::PFClusterCollection &, const std::vector< bool > &, reco::PFClusterCollection &outclus)
std::vector< ClusterLink > prune(std::vector< ClusterLink > &, std::vector< bool > &linkedClusters)
static std::string const input
void setSeed(const DetId &id)
std::unique_ptr< PFCPositionCalculatorBase > _allCellsPosCalc
void absorbCluster(reco::PFCluster &, const reco::PFCluster &)
PFMultiDepthClusterizer(const edm::ParameterSet &conf)
const REPPoint & positionREP() const
cluster position: rho, eta, phi
Abs< T >::type abs(const T &t)
std::vector< ClusterLink > link(const reco::PFClusterCollection &, const std::vector< double > &, const std::vector< double > &)
double energy() const
cluster energy
DetId seed() const
return DetId of seed
ParameterSet const & getParameterSet(std::string const &) const
void addRecHitFraction(const reco::PFRecHitFraction &frac)
add a given fraction of the rechit
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
const std::vector< reco::PFRecHitFraction > & recHitFractions() const
vector of rechit fractions
Power< A, B >::type pow(const A &a, const B &b)
T get(const Candidate &c)
*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
void expandCluster(reco::PFCluster &, unsigned int point, std::vector< bool > &mask, const reco::PFClusterCollection &, const std::vector< ClusterLink > &links)
double depth() const
cluster depth