49 std::vector< std::vector<const CSCRecHit2D*> >
54 std::vector<ChamberHitContainer> rechits_clusters;
58 float dXclus_box = 0.0;
59 float dYclus_box = 0.0;
61 std::vector<const CSCRecHit2D*>
temp;
63 std::vector< ChamberHitContainer > seeds;
65 std::vector<float> running_meanX;
66 std::vector<float> running_meanY;
68 std::vector<float> seed_minX;
69 std::vector<float> seed_maxX;
70 std::vector<float> seed_minY;
71 std::vector<float> seed_maxY;
76 for(
unsigned int i = 0;
i < rechits.size(); ++
i) {
80 temp.push_back(rechits[
i]);
82 seeds.push_back(temp);
87 running_meanX.push_back( rechits[i]->localPosition().
x() );
88 running_meanY.push_back( rechits[i]->localPosition().
y() );
91 seed_minX.push_back( rechits[i]->localPosition().
x() );
92 seed_maxX.push_back( rechits[i]->localPosition().
x() );
93 seed_minY.push_back( rechits[i]->localPosition().
y() );
94 seed_maxY.push_back( rechits[i]->localPosition().
y() );
99 for(
size_t NNN = 0; NNN < seeds.size(); ++NNN) {
101 for(
size_t MMM = NNN+1; MMM < seeds.size(); ++MMM) {
102 if(running_meanX[MMM] == 999999. || running_meanX[NNN] == 999999. ) {
103 std::cout<<
"We should never see this line now!!!"<<std::endl;
112 if ( running_meanX[NNN] > running_meanX[MMM] ) dXclus_box = seed_minX[NNN] - seed_maxX[MMM];
113 else dXclus_box = seed_minX[MMM] - seed_maxX[NNN];
114 if ( running_meanY[NNN] > running_meanY[MMM] ) dYclus_box = seed_minY[NNN] - seed_maxY[MMM];
115 else dYclus_box = seed_minY[MMM] - seed_maxY[NNN];
123 running_meanX[MMM] = (running_meanX[NNN]*seeds[NNN].size() + running_meanX[MMM]*seeds[MMM].size()) / (seeds[NNN].
size()+seeds[MMM].size());
124 running_meanY[MMM] = (running_meanY[NNN]*seeds[NNN].size() + running_meanY[MMM]*seeds[MMM].size()) / (seeds[NNN].
size()+seeds[MMM].size());
127 if ( seed_minX[NNN] <= seed_minX[MMM] ) seed_minX[MMM] = seed_minX[NNN];
128 if ( seed_maxX[NNN] > seed_maxX[MMM] ) seed_maxX[MMM] = seed_maxX[NNN];
129 if ( seed_minY[NNN] <= seed_minY[MMM] ) seed_minY[MMM] = seed_minY[NNN];
130 if ( seed_maxY[NNN] > seed_maxY[MMM] ) seed_maxY[MMM] = seed_maxY[NNN];
133 seeds[MMM].insert(seeds[MMM].
end(),seeds[NNN].
begin(),seeds[NNN].
end());
136 running_meanX[NNN] = 999999.;
137 running_meanY[NNN] = 999999.;
149 for(
size_t NNN = 0; NNN < seeds.size(); ++NNN) {
150 if (running_meanX[NNN] == 999999.)
continue;
151 rechits_clusters.push_back(seeds[NNN]);
152 mean_x = running_meanX[NNN];
153 mean_y = running_meanY[NNN];
154 err_x = (seed_maxX[NNN]-seed_minX[NNN])/3.464101615;
155 err_y = (seed_maxY[NNN]-seed_minY[NNN])/3.464101615;
159 return rechits_clusters;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const CSCChamber * theChamber
std::vector< const CSCRecHit2D * > ChamberHitContainer
CSCSegAlgoPreClustering(const edm::ParameterSet &ps)
constructor
~CSCSegAlgoPreClustering()
destructor
std::vector< std::vector< const CSCRecHit2D * > > clusterHits(const CSCChamber *aChamber, const ChamberHitContainer &rechits)
clusterize