24 int plane =
strip.plane();
26 LogTrace(
"PreShowerClusterAlgo") <<
"Preshower Seeded Algorithm - looking for clusters";
27 LogTrace(
"PreShowerClusterAlgo") <<
"Preshower is intersected at strip" <<
strip.strip() <<
",at plane" << plane;
30 std::vector<std::pair<DetId, float> >
dummy;
32 LogTrace(
"PreShowerClusterAlgo") <<
" Creating a null-cluster";
49 LogTrace(
"PreShowerClusterAlgo") <<
"Total number of strips in the central road:" <<
road_2d.size();
67 LogTrace(
"PreShowerClusterAlgo") <<
"Total number of strips in all three roads:" <<
road_2d.size();
72 RecHitsMap::iterator max_it;
74 std::vector<ESDetId>::iterator itID;
76 LogTrace(
"PreShowerClusterAlgo") <<
"ID =" << *itID;
78 RecHitsMap::iterator strip_it =
rechits_map->find(*itID);
82 LogTrace(
"PreShowerClusterAlgo") <<
" strip is " <<
ESDetId(strip_it->first) <<
"E =" << strip_it->second.energy();
84 float E = strip_it->second.energy();
97 recHits_pos.insert(std::make_pair(max_it->first, max_it->second));
98 used_s->insert(max_it->first);
99 LogTrace(
"PreShowerClusterAlgo") <<
"Central hottest strip" <<
ESDetId(max_it->first)
100 <<
"is saved with energy E =" << E_max;
105 ESDetId startES = max_it->first;
109 int nadjacents_east = 0;
112 LogTrace(
"PreShowerClusterAlgo") <<
"Adjacent east #" << nadjacents_east <<
":" <<
next;
119 clusterRecHits.
push_back(strip_it->second);
121 if (nadjacents_east == 1)
123 used_s->insert(strip_it->first);
124 LogTrace(
"PreShowerClusterAlgo") <<
"East adjacent strip #" << nadjacents_east
125 <<
"is saved with energy E =" << strip_it->second.energy();
129 int nadjacents_west = 0;
132 LogTrace(
"PreShowerClusterAlgo") <<
"Adjacent west #" << nadjacents_west <<
":" <<
next;
137 clusterRecHits.
push_back(strip_it->second);
138 if (nadjacents_west == 1)
140 used_s->insert(strip_it->first);
141 LogTrace(
"PreShowerClusterAlgo") <<
"West adjacent strip #" << nadjacents_west
142 <<
"is saved with energy E =" << strip_it->second.energy();
144 }
else if (plane == 2) {
146 int nadjacents_north = 0;
149 LogTrace(
"PreShowerClusterAlgo") <<
"Adjacent north #" << nadjacents_north <<
":" <<
next;
154 clusterRecHits.
push_back(strip_it->second);
155 if (nadjacents_north == 1)
157 used_s->insert(strip_it->first);
158 LogTrace(
"PreShowerClusterAlgo") <<
"North adjacent strip #" << nadjacents_north
159 <<
"is saved with energy E =" << strip_it->second.energy();
163 int nadjacents_south = 0;
166 LogTrace(
"PreShowerClusterAlgo") <<
"Adjacent south #" << nadjacents_south <<
":" <<
next;
171 clusterRecHits.
push_back(strip_it->second);
172 if (nadjacents_south == 1)
174 used_s->insert(strip_it->first);
175 LogTrace(
"PreShowerClusterAlgo") <<
"South adjacent strip #" << nadjacents_south
176 <<
"is saved with energy E =" << strip_it->second.energy();
179 LogTrace(
"PreShowerClusterAlgo") <<
" Wrong plane number" << plane <<
", null cluster will be returned! "
184 LogTrace(
"PreShowerClusterAlgo") <<
"Total size of clusterRecHits is" << clusterRecHits.
size();
185 LogTrace(
"PreShowerClusterAlgo") <<
"Two adjacent strips for position calculation are:" << strip_1 <<
"and"
189 RecHitsMap::iterator strip_it1, strip_it2;
192 recHits_pos.insert(std::make_pair(strip_it1->first, strip_it1->second));
196 recHits_pos.insert(std::make_pair(strip_it2->first, strip_it2->second));
199 RecHitsMap::iterator
cp;
200 double energy_pos = 0;
204 for (
cp = recHits_pos.begin();
cp != recHits_pos.end();
cp++) {
205 double E =
cp->second.energy();
213 if (energy_pos > 0.) {
219 LogTrace(
"PreShowerClusterAlgo") <<
"ES Cluster position ="
220 <<
"(" << x_pos <<
"," << y_pos <<
"," << z_pos <<
")";
225 std::vector<std::pair<DetId, float> > usedHits;
226 for (it = clusterRecHits.
begin(); it != clusterRecHits.
end(); it++) {
227 Eclust += it->energy();
228 usedHits.push_back(std::pair<DetId, float>(it->id(), 1.));
233 LogTrace(
"PreShowerClusterAlgo") <<
" ES Cluster is created with:";
234 LogTrace(
"PreShowerClusterAlgo") <<
" energy =" << cluster.
energy();
235 LogTrace(
"PreShowerClusterAlgo") <<
" (eta,phi) ="
236 <<
"(" << cluster.
eta() <<
"," << cluster.
phi() <<
")";
237 LogTrace(
"PreShowerClusterAlgo") <<
" nhits =" << cluster.
nhits();
239 LogTrace(
"PreShowerClusterAlgo") <<
" (x,y,z) ="
240 <<
"(" << cluster.
x() <<
", " << cluster.
y() <<
"," << cluster.
z() <<
")";
252 LogTrace(
"PreShowerClusterAlgo") <<
" This strip is in use";
254 LogTrace(
"PreShowerClusterAlgo") <<
" No such a strip in rechits_map";
256 LogTrace(
"PreShowerClusterAlgo") <<
"Strip energy" << candidate_it->second.energy() <<
"is below threshold";
259 if ((
used_s->find(candidate_it->first) !=
used_s->end()) ||
277 LogTrace(
"PreShowerClusterAlgo") <<
"findRoad starts from strip" <<
strip;
282 LogTrace(
"PreShowerClusterAlgo") <<
" Go to the East ";
285 LogTrace(
"PreShowerClusterAlgo") <<
"East:" << n_east <<
"current strip is" <<
next;
294 LogTrace(
"PreShowerClusterAlgo") <<
"Go to the West";
298 LogTrace(
"PreShowerClusterAlgo") <<
"West: " << n_west <<
"current strip is" <<
next;
305 LogTrace(
"PreShowerClusterAlgo") <<
"Total number of strips found in the road at 1-st plane is" << n_east + n_west;
307 }
else if (plane == 2) {
310 LogTrace(
"PreShowerClusterAlgo") <<
"Go to the North";
313 LogTrace(
"PreShowerClusterAlgo") <<
"North:" << n_north <<
"current strip is" <<
next;
322 LogTrace(
"PreShowerClusterAlgo") <<
"Go to the South";
326 LogTrace(
"PreShowerClusterAlgo") <<
"South:" << n_south <<
"current strip is" <<
next;
334 LogTrace(
"PreShowerClusterAlgo") <<
"Total number of strips found in the road at 2-nd plane is"
335 << n_south + n_north;
338 LogTrace(
"PreShowerClusterAlgo") <<
" Wrong plane number, null cluster will be returned!";