6 #include "Math/GenVector/VectorUtil.h" 8 #include "vdt/vdtMath.h" 19 if( conf.
exists(
"allCellsPositionCalc") ) {
34 const std::vector<bool>& seedable,
37 std::vector<double> etaRMS2(input.size(),0.0);
38 std::vector<double> phiRMS2(input.size(),0.0);
50 auto && links =
link(input,etaRMS2,phiRMS2);
56 std::vector<bool>
mask(input.size(),
false);
57 std::vector<bool> linked(input.size(),
false);
60 auto && prunedLinks =
prune(links,linked);
69 for (
unsigned int i=0;
i<input.size();++
i) {
75 output.push_back(input[i]);
87 output.push_back(cluster);
99 for(
unsigned int i=0;
i<clusters.size();++
i ) {
101 double etaSum=0.0;
double phiSum=0.0;
104 auto const &
h = *
frac.recHitRef();
105 auto const &
rep =
h.positionREP();
111 etaRMS2[
i]*= etaRMS2[
i];
113 phiRMS2[
i]*=phiRMS2[
i];
122 std::vector<ClusterLink> links;
124 for (
unsigned int i=0;
i<clusters.size();++
i)
125 for (
unsigned int j=0;j<clusters.size();++j) {
139 auto deta = crep1.eta()-crep2.eta();
140 deta = deta*deta/(etaRMS2[
i]+etaRMS2[j]);
141 auto dphi =
deltaPhi(crep1.phi(),crep2.phi());
142 dphi = dphi*dphi/(phiRMS2[
i]+phiRMS2[j]);
154 prune(std::vector<ClusterLink>& links,std::vector<bool>& linkedClusters) {
155 std::vector<ClusterLink> goodLinks ;
156 std::vector<bool>
mask(links.size(),
false);
157 if (links.empty())
return goodLinks;
159 for (
unsigned int i=0;
i<links.size()-1;++
i) {
162 for (
unsigned int j=i+1;j<links.size();++j) {
169 if (link1.
to() == link2.
to()) {
171 if (link1.
dZ() < link2.
dZ()) {
174 else if (link1.
dZ() > link2.
dZ()) {
177 else if (fabs(link1.
dZ()-link2.
dZ())<0.2) {
178 if (link1.
dR()<link2.
dR()) {
181 else if (link1.
dR()>link2.
dR()) {
197 for (
unsigned int i=0;
i<links.size();++
i) {
200 goodLinks.push_back(links[i]);
201 linkedClusters[links[
i].from()]=
true;
202 linkedClusters[links[
i].to()]=
true;
238 for (
const auto&
link : links) {
241 if (!mask[
link.from()]) {
243 mask[
link.from()] =
true;
246 if (!mask[
link.to()]) {
248 mask[
link.to()]=
true;
254 if (!mask[
link.to()]) {
256 mask[
link.to()] =
true;
259 if (!mask[
link.from()]) {
261 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
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
void buildClusters(const reco::PFClusterCollection &, const std::vector< bool > &, reco::PFClusterCollection &outclus) override
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