7 const float etaBorder = 1.479;
24 std::cout <<
"Basic Cluster: (eta,phi,energy) = "<<cluster_p->position().eta()<<
" "<<cluster_p->position().phi()<<
" " 25 <<cluster_p->energy()<<std::endl;
29 if (fabs(cluster_p->position().eta()) < etaBorder)
48 double etaRoad,
double phiRoad)
51 std::vector<double> usedSeedEnergy;
52 usedSeedEnergy.clear();
58 std::cout <<
"Current Cluster: "<<(*currentSeed)->energy()<<
" "<<(
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentSeed)->energy())
59 != usedSeedEnergy.end())<<std::endl;
63 if (
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentSeed)->energy())
64 != usedSeedEnergy.end())
continue;
70 double energy_ = (*currentSeed)->energy();
72 (*currentSeed)->position().Y(),
73 (*currentSeed)->position().Z());
75 usedSeedEnergy.push_back((*currentSeed)->energy());
80 std::cout <<
"*****************************" << std::endl;
81 std::cout <<
"******NEW SUPERCLUSTER*******" << std::endl;
82 std::cout <<
"Seed R = " << (*currentSeed)->position().Rho() << std::endl;
83 std::cout <<
"Seed Et = " << (*currentSeed)->energy()*
sin((*currentSeed)->position().theta()) << std::endl;
88 constituentClusters.
push_back( *currentSeed );
92 while (currentCluster != clusters_v.
end())
96 std::cout <<
"->Cluster: "<<(*currentCluster)->energy()
97 <<
" Used = "<<(
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentCluster)->energy()) != usedSeedEnergy.end())
98 <<
" Matched = "<<
match(*currentSeed, *currentCluster, etaRoad, phiRoad)<<std::endl;
102 if (
match(*currentSeed, *currentCluster, etaRoad, phiRoad)
103 && (
std::find(usedSeedEnergy.begin(), usedSeedEnergy.end(), (*currentCluster)->energy()) == usedSeedEnergy.end()))
106 constituentClusters.push_back(*currentCluster);
107 energy_ += (*currentCluster)->energy();
108 position_ += (*currentCluster)->energy() *
math::XYZVector((*currentCluster)->position().X(),
109 (*currentCluster)->position().Y(),
110 (*currentCluster)->position().Z());
112 usedSeedEnergy.push_back((*currentCluster)->energy());
116 std::cout <<
"Cluster R = " << (*currentCluster)->position().Rho() << std::endl;
124 position_ /= energy_;
128 std::cout <<
"Final SuperCluster R = " << position_.Rho() << std::endl;
135 constituentClusters);
141 std::cout <<
"created a new supercluster of: " << std::endl;
142 std::cout <<
"Energy = " << newSuperCluster.energy() << std::endl;
143 std::cout <<
"Position in (R, phi, theta, eta) = (" 144 << newSuperCluster.position().Rho() <<
", " 145 << newSuperCluster.position().phi() <<
", " 146 << newSuperCluster.position().theta() <<
", " 147 << newSuperCluster.position().eta() <<
")" << std::endl;
151 usedSeedEnergy.clear();
162 double dPhi = acos(
cos(seedPosition.phi() - clusterPosition.phi()));
164 double dEta = fabs(seedPosition.eta() - clusterPosition.eta());
166 std::cout <<
"seed phi: "<<seedPosition.phi()<<
" cluster phi: "<<clusterPosition.phi()<<
" dphi = "<<dPhi<<
" dphiMax = "<<dPhiMax<<std::endl;
167 std::cout <<
"seed eta: "<<seedPosition.eta()<<
" cluster eta: "<<clusterPosition.eta()<<
" deta = "<<dEta<<
" detaMax = "<<dEtaMax<<std::endl;
169 if (dEta > dEtaMax)
return false;
170 if (dPhi > dPhiMax)
return false;
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)