7 const float etaBorder = 1.479;
20 if (fabs(cluster_p->position().eta()) < etaBorder)
22 islandClustersBarrel_v.
push_back(cluster_p);
26 islandClustersEndCap_v.
push_back(cluster_p);
42 double etaRoad,
double phiRoad)
45 std::vector<DetId> usedSeedDetIds;
46 usedSeedDetIds.clear();
52 if (
std::find(usedSeedDetIds.begin(), usedSeedDetIds.end(), (*currentSeed)->seed())
53 != usedSeedDetIds.end())
continue;
60 double energy = (*currentSeed)->energy();
62 (*currentSeed)->position().Y(),
63 (*currentSeed)->position().Z());
65 usedSeedDetIds.push_back((*currentSeed)->seed());
69 std::cout <<
"*****************************" << std::endl;
70 std::cout <<
"******NEW SUPERCLUSTER*******" << std::endl;
71 std::cout <<
"Seed R = " << (*currentSeed)->position().Rho() << std::endl;
76 constituentClusters.
push_back(*currentSeed);
79 while (currentCluster != clusters_v.
end())
88 if (
match(*currentSeed, *currentCluster, etaRoad, phiRoad) &&
89 std::find(usedSeedDetIds.begin(), usedSeedDetIds.end(), (*currentCluster)->seed()) == usedSeedDetIds.end())
93 constituentClusters.
push_back(*currentCluster);
94 energy += (*currentCluster)->energy();
95 position_ += (*currentCluster)->energy() *
math::XYZVector((*currentCluster)->position().X(),
96 (*currentCluster)->position().Y(),
97 (*currentCluster)->position().Z());
100 usedSeedDetIds.push_back((*currentCluster)->seed());
103 std::cout <<
"Cluster R = " << (*currentCluster)->position().Rho() << std::endl;
112 std::cout <<
"Final SuperCluster R = " << position_.Rho() << std::endl;
117 constituentClusters);
123 std::cout <<
"created a new supercluster of: " << std::endl;
124 std::cout <<
"Energy = " << newSuperCluster.energy() << std::endl;
125 std::cout <<
"Position in (R, phi, theta) = ("
126 << newSuperCluster.position().Rho() <<
", "
127 << newSuperCluster.position().phi() <<
", "
128 << newSuperCluster.position().theta() <<
")" << std::endl;
140 double dEtaMax,
double dPhiMax)
145 double dPhi = acos(
cos(seedPosition.phi() - clusterPosition.phi()));
147 double dEta = fabs(seedPosition.eta() - clusterPosition.eta());
149 if (dEta > dEtaMax)
return false;
150 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_