8 const float etaBorder = 1.479;
21 if (fabs(cluster_p->position().eta()) < etaBorder)
23 islandClustersBarrel_v.
push_back(cluster_p);
27 islandClustersEndCap_v.
push_back(cluster_p);
43 double etaRoad,
double phiRoad)
46 std::vector<DetId> usedSeedDetIds;
47 usedSeedDetIds.clear();
53 if (
std::find(usedSeedDetIds.begin(), usedSeedDetIds.end(), (*currentSeed)->seed())
54 != usedSeedDetIds.end())
continue;
61 double energy = (*currentSeed)->energy();
63 (*currentSeed)->position().Y(),
64 (*currentSeed)->position().Z());
66 usedSeedDetIds.push_back((*currentSeed)->seed());
68 LogTrace(
"EcalClusters") <<
"*****************************";
69 LogTrace(
"EcalClusters") <<
"******NEW SUPERCLUSTER*******";
70 LogTrace(
"EcalClusters") <<
"Seed R = " << (*currentSeed)->position().Rho();
73 constituentClusters.
push_back(*currentSeed);
76 while (currentCluster != clusters_v.
end())
85 if (
match(*currentSeed, *currentCluster, etaRoad, phiRoad) &&
86 std::find(usedSeedDetIds.begin(), usedSeedDetIds.end(), (*currentCluster)->seed()) == usedSeedDetIds.end())
90 constituentClusters.
push_back(*currentCluster);
91 energy += (*currentCluster)->energy();
92 position_ += (*currentCluster)->energy() *
math::XYZVector((*currentCluster)->position().X(),
93 (*currentCluster)->position().Y(),
94 (*currentCluster)->position().Z());
97 usedSeedDetIds.push_back((*currentCluster)->seed());
98 LogTrace(
"EcalClusters") <<
"Cluster R = " << (*currentCluster)->position().Rho();
106 LogTrace(
"EcalClusters") <<
"Final SuperCluster R = " << position_.Rho();
111 constituentClusters);
114 LogTrace(
"EcalClusters") <<
"created a new supercluster of: ";
115 LogTrace(
"EcalClusters") <<
"Energy = " << newSuperCluster.energy();
116 LogTrace(
"EcalClusters") <<
"Position in (R, phi, theta) = ("
117 << newSuperCluster.position().Rho() <<
", "
118 << newSuperCluster.position().phi() <<
", "
119 << newSuperCluster.position().theta() <<
")" ;
131 double dEtaMax,
double dPhiMax)
136 double dPhi = acos(
cos(seedPosition.phi() - clusterPosition.phi()));
138 double dEta = fabs(seedPosition.eta() - clusterPosition.eta());
140 if (dEta > dEtaMax)
return false;
141 if (dPhi > dPhiMax)
return false;
void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v, double etaRoad, double phiRoad)
void push_back(Ptr< T > const &iPtr)
Sin< T >::type sin(const T &t)
reco::SuperClusterCollection makeSuperClusters(reco::CaloClusterPtrVector &clusters)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const_iterator begin() const
double dPhi(double phi1, double phi2)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Cos< T >::type cos(const T &t)
const_iterator end() const
double seedTransverseEnergyThreshold
reco::SuperClusterCollection superclusters_v
double endcapPhiRoad(double energy)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
void clear()
Clear the PtrVector.
bool match(reco::CaloClusterPtr seed_p, reco::CaloClusterPtr cluster_p, double etaRoad, double phiRoad)
BremRecoveryPhiRoadAlgo * phiRoadAlgo_