7 const float etaBorder = 1.479;
20 std::cout <<
"Basic Cluster: (eta,phi,energy) = " << cluster_p->position().eta() <<
" "
21 << cluster_p->position().phi() <<
" " << cluster_p->energy() << std::endl;
25 if (fabs(cluster_p->position().eta()) < etaBorder) {
27 islandClustersBarrel_v.
push_back(cluster_p);
30 islandClustersEndCap_v.
push_back(cluster_p);
48 std::vector<double> usedSeedEnergy;
49 usedSeedEnergy.clear();
54 std::cout <<
"Current Cluster: " << (*currentSeed)->energy() <<
" "
55 << (
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentSeed)->energy()) !=
61 if (
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentSeed)->energy()) != usedSeedEnergy.end())
69 double energy_ = (*currentSeed)->energy();
71 (*currentSeed)->position().X(), (*currentSeed)->position().Y(), (*currentSeed)->position().Z());
73 usedSeedEnergy.push_back((*currentSeed)->energy());
77 std::cout <<
"*****************************" << std::endl;
78 std::cout <<
"******NEW SUPERCLUSTER*******" << std::endl;
79 std::cout <<
"Seed R = " << (*currentSeed)->position().Rho() << std::endl;
80 std::cout <<
"Seed Et = " << (*currentSeed)->energy() *
sin((*currentSeed)->position().theta()) << std::endl;
85 constituentClusters.
push_back(*currentSeed);
89 while (currentCluster != clusters_v.
end()) {
92 std::cout <<
"->Cluster: " << (*currentCluster)->energy() <<
" Used = "
93 << (
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentCluster)->energy()) !=
95 <<
" Matched = " <<
match(*currentSeed, *currentCluster, etaRoad, phiRoad) << std::endl;
99 if (
match(*currentSeed, *currentCluster, etaRoad, phiRoad) &&
100 (
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentCluster)->energy()) ==
101 usedSeedEnergy.end())) {
103 constituentClusters.
push_back(*currentCluster);
104 energy_ += (*currentCluster)->energy();
105 position_ += (*currentCluster)->energy() *
math::XYZVector((*currentCluster)->position().X(),
106 (*currentCluster)->position().Y(),
107 (*currentCluster)->position().Z());
109 usedSeedEnergy.push_back((*currentCluster)->energy());
112 std::cout <<
"Cluster R = " << (*currentCluster)->position().Rho() << std::endl;
119 position_ /= energy_;
122 std::cout <<
"Final SuperCluster R = " << position_.Rho() << std::endl;
127 energy_,
math::XYZPoint(position_.X(), position_.Y(), position_.Z()), (*currentSeed), constituentClusters);
132 std::cout <<
"created a new supercluster of: " << std::endl;
133 std::cout <<
"Energy = " << newSuperCluster.energy() << std::endl;
134 std::cout <<
"Position in (R, phi, theta, eta) = (" << newSuperCluster.position().Rho() <<
", "
135 << newSuperCluster.position().phi() <<
", " << newSuperCluster.position().theta() <<
", "
136 << newSuperCluster.position().eta() <<
")" << std::endl;
140 usedSeedEnergy.clear();
150 double dPhi = acos(
cos(seedPosition.phi() - clusterPosition.phi()));
152 double dEta = fabs(seedPosition.eta() - clusterPosition.eta());
154 std::cout <<
"seed phi: " << seedPosition.phi() <<
" cluster phi: " << clusterPosition.phi() <<
" dphi = " << dPhi
155 <<
" dphiMax = " << dPhiMax << std::endl;
156 std::cout <<
"seed eta: " << seedPosition.eta() <<
" cluster eta: " << clusterPosition.eta() <<
" deta = " << dEta
157 <<
" detaMax = " << dEtaMax << std::endl;
double EndcapBremEnergyThreshold
bool match(reco::CaloClusterPtr seed_p, reco::CaloClusterPtr cluster_p, double etaRoad, double phiRoad)
void push_back(Ptr< T > const &iPtr)
Sin< T >::type sin(const T &t)
double seedTransverseEnergyThreshold
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
reco::SuperClusterCollection makeSuperClusters(reco::CaloClusterPtrVector &clusters)
const_iterator begin() const
reco::SuperClusterCollection superclusters_v
double BarrelBremEnergyThreshold
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Cos< T >::type cos(const T &t)
const_iterator end() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
void clear()
Clear the PtrVector.
void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v, double etaRoad, double phiRoad)