11 if(
col.empty() )
return false;
12 std::vector<const RpcPrepData*>::const_iterator cit_begin =
col.begin();
13 std::vector<const RpcPrepData*>::const_iterator cit_end =
col.end();
14 if( cit_begin == cit_end )
return false;
15 std::vector<const RpcPrepData*>::const_iterator cit = cit_begin;
17 if( !prd_first )
return false;
21 std::set<Identifier> subModuleIds;
22 for( ; cit!=cit_end;++cit ) {
29 subModuleIds.insert(detElId);
32 std::cout <<
" RPC performing clustering " <<
col.size() <<
" sub modules " << subModuleIds.size() << std::endl;
35 for( ;
it!=it_end;++
it ){
41 for( ;
it!=it_end;++
it ){
70 if(
col.empty() )
return false;
71 std::vector<const RpcPrepData*>::const_iterator cit_begin =
col.begin();
72 std::vector<const RpcPrepData*>::const_iterator cit_end =
col.end();
73 if( cit_begin == cit_end )
return false;
79 std::vector<const RpcPrepData*>::const_iterator cit = cit_begin;
81 for( ; cit!=cit_end;++cit ) {
91 if( !prd_first )
return false;
102 std::vector<Doublet>* channelsPtr =
nullptr;
104 for( ; cit!=cit_end;++cit ) {
119 if(
channel >= (
int)channelsPtr->size() ){
120 std::cout <<
"index channels out of range: " <<
channel <<
" max " << channelsPtr->size() << std::endl;
130 int channelClusterNumber = gasgap==1 ? doublet.
first : doublet.
second;
131 if( channelClusterNumber != -1 ){
133 std::cout <<
" secondary hit " <<
channel <<
" " << gasgap;
134 if( measuresPhi ) std::cout <<
" phi " << channelClusterNumber << std::endl;
135 else std::cout <<
" eta " << channelClusterNumber << std::endl;
138 if( !
cluster.addSecond(prd,gasgap) ){
142 std::vector<Id> neighbours;
145 neighbours.emplace_back(2,
channel );
147 if(
channel < (
int)channelsPtr->size()-1 ) neighbours.emplace_back(2,
channel+1 );
148 }
else if( gasgap == 2 ){
149 neighbours.emplace_back(1,
channel );
151 if(
channel < (
int)channelsPtr->size()-1 ) neighbours.emplace_back(1,
channel+1 );
155 if(
channel < (
int)channelsPtr->size()-1 ) neighbours.emplace_back(gasgap,
channel+1 );
158 std::cout <<
" adding new channel " <<
channel <<
" " << gasgap;
159 if( measuresPhi ) std::cout <<
" phi " <<
" neighbours " << neighbours.size() << std::endl;
160 else std::cout <<
" eta " <<
" neighbours " << neighbours.size() << std::endl;
165 int currentClusterId = -1;
166 for( ;nit!=nit_end;++nit ){
168 Doublet& doub = (*channelsPtr)[nit->ch];
170 int clusterNumber = nit->gp==1 ? doub.
first : doub.
second;
171 if( clusterNumber == -1 )
continue;
172 if(
debug ) std::cout <<
" new neighbour " << nit->gp <<
" " << nit->ch <<
" clusterid " << clusterNumber;
177 if( currentCluster ==
nullptr ){
180 if( gasgap==1 ) doublet.
first = clusterNumber;
181 else doublet.
second = clusterNumber;
182 currentClusterId = clusterNumber;
183 if(
debug ) std::cout <<
" adding hit to neighbour cluster with ID " << clusterNumber << std::endl;
184 }
else if( clusterNumber != currentClusterId ){
189 for( ;
h!=h_end;++
h ) {
194 if( gp==1 ) doub.
first = currentClusterId;
195 else doub.
second = currentClusterId;
197 if(
debug ) std::cout <<
" found cluster overlap, merging clusters " << std::endl;
200 if(
debug ) std::cout <<
" cluster overlap, same cluster " << std::endl;
204 if( currentCluster ==
nullptr ){
205 if(
debug ) std::cout <<
" no neighbouring hits, creating new cluster " <<
clusters.size() << std::endl;
219 std::cout <<
" cluster " <<
cl.ngasgap1 <<
" " <<
cl.ngasgap2 <<
" hits " <<
cl.hitList.size() << std::endl;
220 for(
const auto *hit :
cl.hitList ){
239 std::vector<RpcClusterObj>::const_iterator cit =
clustersEta.begin();
240 std::vector<RpcClusterObj>::const_iterator cit_end =
clustersEta.end();
241 for( ;cit!=cit_end;++cit ){
243 if( !cit->active() )
continue;
244 std::cout <<
" new cluster " << clid <<
" size " << cit->hitList.size() << std::endl;
247 for( ;hit!=hit_end;++hit ){
252 if(measuresPhi) std::cout <<
" phi" << std::endl;
253 else std::cout <<
" eta" << std::endl;