12 int iphi,
bool includeHO,
bool debug) {
15 std::cout <<
"matrixHCALIds::Add " << ieta <<
" rows and " << iphi
16 <<
" columns of cells for " << dets.size() <<
" cells"
18 for (
unsigned int i1=0; i1<dets.size(); i1++) {
20 std::cout <<
"matrixHCALIds::Cell " << i1 <<
" 0x" << std::hex
21 <<
id.rawId() << std::dec <<
" " <<
id << std::endl;
29 for (
unsigned int i1=0; i1<vdetS.size(); i1++) {
30 if (
std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
31 vdetN.push_back(vdetS[i1]);
37 std::cout <<
"matrixHCALIds::Total number of cells found is "
38 << vdetS.size() << std::endl;
39 for (
unsigned int i1=0; i1<vdetS.size(); i1++) {
41 std::cout <<
"matrixHCALIds::Cell " << i1 <<
" " <<
id << std::endl;
49 int ietaW,
int iphiN,
int iphiS,
50 bool includeHO,
bool debug) {
53 std::cout <<
"matrixHCALIds::Add " <<ietaE <<
"|" <<ietaW <<
" rows and "
54 << iphiN <<
"|" << iphiS <<
" columns of cells for "
55 << dets.size() <<
" cells" << std::endl;
56 for (
unsigned int i1=0; i1<dets.size(); i1++) {
58 std::cout <<
"matrixHCALIds::Cell " << i1 <<
" 0x" << std::hex
59 <<
id.rawId() << std::dec <<
" " <<
id << std::endl;
64 ietaW, iphiN, iphiS, debug);
66 ietaW, iphiN, iphiS, debug);
67 for (
unsigned int i1=0; i1<vdetS.size(); i1++) {
68 if (
std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
69 vdetN.push_back(vdetS[i1]);
75 std::cout <<
"matrixHCALIds::Total number of cells found is "
76 << vdetS.size() << std::endl;
77 for (
unsigned int i1=0; i1<vdetS.size(); i1++) {
79 std::cout <<
"matrixHCALIds::Cell " << i1 <<
" " <<
id << std::endl;
87 int ieta,
int iphi,
bool debug) {
90 std::cout <<
"newHCALIdNS::Add " << iphi <<
" columns of cells along "
91 << shiftNorth <<
" for " << (dets.size()-
last) <<
" cells"
93 for (
unsigned int i1=last; i1<dets.size(); i1++) {
95 std::cout <<
"newHCALIdNS::Cell " << i1 <<
" " <<
id << std::endl;
99 std::vector<DetId> vdets;
100 vdets.insert(vdets.end(), dets.begin(), dets.end());
101 std::vector<DetId> vdetE, vdetW;
105 for (
unsigned int i1=0; i1<vdetW.size(); i1++) {
106 if (
std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
107 vdets.push_back(vdetW[i1]);
109 for (
unsigned int i1=0; i1<vdetE.size(); i1++) {
110 if (
std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
111 vdets.push_back(vdetE[i1]);
114 std::cout <<
"newHCALIdNS::With Added cells along E/W results a set of "
115 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
116 for (
unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
118 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
122 unsigned int last0 = vdets.size();
124 std::vector<DetId> vdetnew;
125 for (
unsigned int i1=last; i1<dets.size(); i1++) {
126 std::vector<DetId> vdet;
127 if (shiftNorth) vdet = topology->
north(dets[i1]);
128 else vdet = topology->
south(dets[i1]);
129 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
130 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
131 vdetnew.push_back(vdet[i2]);
137 for (
unsigned int i2=0; i2<vdetW.size(); i2++) {
138 if (
std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
139 std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
140 vdets.push_back(vdetW[i2]);
142 for (
unsigned int i2=0; i2<vdetE.size(); i2++) {
143 if (
std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
144 std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
145 vdets.push_back(vdetE[i2]);
148 vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
150 std::cout <<
"newHCALIdNS::Addition results a set of "
151 << (vdets.size()-last0) <<
" new cells" << std::endl;
152 for (
unsigned int i1=last0; i1<vdets.size(); i1++) {
154 std::cout <<
"newHCALIdNS::Cell " << i1 <<
" " <<
id << std::endl;
165 std::cout <<
"newHCALIdNS::Final list consists of " << vdets.size()
166 <<
" cells" << std::endl;
167 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
169 std::cout <<
"newHCALIdNS::Cell " << i1 <<
" " <<
id << std::endl;
178 int ietaE,
int ietaW,
int iphiN,
int iphiS,
182 std::cout <<
"newHCALIdNS::Add " << iphiN <<
"|" << iphiS
183 <<
" columns of cells along " << shiftNorth <<
" for "
184 << (dets.size()-
last) <<
" cells" << std::endl;
185 for (
unsigned int i1=last; i1<dets.size(); i1++) {
187 std::cout <<
"newHCALIdNS::Cell " << i1 <<
" " <<
id << std::endl;
191 std::vector<DetId> vdets;
192 vdets.insert(vdets.end(), dets.begin(), dets.end());
193 std::vector<DetId> vdetE, vdetW;
197 for (
unsigned int i1=0; i1<vdetW.size(); i1++) {
198 if (
std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
199 vdets.push_back(vdetW[i1]);
201 for (
unsigned int i1=0; i1<vdetE.size(); i1++) {
202 if (
std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
203 vdets.push_back(vdetE[i1]);
206 std::cout <<
"newHCALIdNS::With Added cells along E/W results a set of "
207 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
208 for (
unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
210 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
214 unsigned int last0 = vdets.size();
216 if (shiftNorth) iphi = iphiN;
218 std::vector<DetId> vdetnew;
219 for (
unsigned int i1=last; i1<dets.size(); i1++) {
220 std::vector<DetId> vdet;
221 if (shiftNorth) vdet = topology->
north(dets[i1]);
222 else vdet = topology->
south(dets[i1]);
223 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
224 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
225 vdetnew.push_back(vdet[i2]);
231 for (
unsigned int i2=0; i2<vdetW.size(); i2++) {
232 if (
std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
233 std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
234 vdets.push_back(vdetW[i2]);
236 for (
unsigned int i2=0; i2<vdetE.size(); i2++) {
237 if (
std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
238 std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
239 vdets.push_back(vdetE[i2]);
242 vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
244 std::cout <<
"newHCALIdNS::Addition results a set of "
245 << (vdets.size()-last0) <<
" new cells" << std::endl;
246 for (
unsigned int i1=last0; i1<vdets.size(); i1++) {
248 std::cout <<
"newHCALIdNS::Cell " << i1 <<
" " <<
id << std::endl;
253 if (shiftNorth) iphiN = iphi;
262 std::cout <<
"newHCALIdNS::Final list consists of " << vdets.size()
263 <<
" cells" << std::endl;
264 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
266 std::cout <<
"newHCALIdNS::Cell " << i1 <<
" " <<
id << std::endl;
275 int ieta,
bool debug) {
278 std::cout <<
"newHCALIdEW::Add " << ieta <<
" rows of cells along "
279 << shiftEast <<
" for " << (dets.size()-
last) <<
" cells"
281 for (
unsigned int i1=last; i1<dets.size(); i1++) {
283 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
287 std::vector<DetId> vdets;
288 vdets.insert(vdets.end(), dets.begin(), dets.end());
290 for (
unsigned int i1=last; i1<dets.size(); i1++) {
291 std::vector<DetId> vdet;
292 if (shiftEast) vdet = topology->
east(dets[i1]);
293 else vdet = topology->
west(dets[i1]);
294 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
295 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
296 vdets.push_back(vdet[i2]);
303 std::cout <<
"newHCALIdEW::Addition results a set of "
304 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
305 for (
unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
307 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
316 std::cout <<
"newHCALIdEW::Final list (EW) consists of " <<vdets.size()
317 <<
" cells" << std::endl;
318 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
320 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
329 int ietaE,
int ietaW,
bool debug) {
332 std::cout <<
"newHCALIdEW::Add " << ietaE <<
"|" << ietaW
333 <<
" rows of cells along " << shiftEast <<
" for "
334 << (dets.size()-
last) <<
" cells" << std::endl;
335 for (
unsigned int i1=last; i1<dets.size(); i1++) {
337 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
342 if (shiftEast) ieta = ietaE;
343 std::vector<DetId> vdets;
344 vdets.insert(vdets.end(), dets.begin(), dets.end());
346 for (
unsigned int i1=last; i1<dets.size(); i1++) {
347 std::vector<DetId> vdet;
348 if (shiftEast) vdet = topology->
east(dets[i1]);
349 else vdet = topology->
west(dets[i1]);
350 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
351 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
352 vdets.push_back(vdet[i2]);
357 if (shiftEast) ietaE = ieta;
361 std::cout <<
"newHCALIdEW::Addition results a set of "
362 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
363 for (
unsigned int i1=dets.size(); i1<vdets.size(); i1++) {
365 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
374 std::cout <<
"newHCALIdEW::Final list (EW) consists of " <<vdets.size()
375 <<
" cells" << std::endl;
376 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
378 std::cout <<
"newHCALIdEW::Cell " << i1 <<
" " <<
id << std::endl;
387 bool includeHO,
bool debug) {
390 std::cout <<
"matrixHCALIdsDepth::Add cells with higher depths with HO"
391 <<
"Flag set to " << includeHO <<
" to existing "
392 << dets.size() <<
" cells" << std::endl;
393 for (
unsigned int i1=0; i1<dets.size(); i1++) {
395 std::cout <<
"matrixHCALIdsDepth::Cell " << i1 <<
" " <<
id <<std::endl;
399 std::vector<DetId> vdets(dets);
400 for (
unsigned int i1=0; i1<dets.size(); i1++) {
402 for (
int idepth = 0; idepth < 3; idepth++) {
403 std::vector<DetId> vUpDetId = topology->
up(vdet);
404 if (vUpDetId.size() != 0) {
405 if (includeHO || vUpDetId[0].subdetId() != (int)(
HcalOuter)) {
406 int n =
std::count(vdets.begin(),vdets.end(),vUpDetId[0]);
408 if (debug)
std::cout <<
"matrixHCALIdsDepth:: Depth " << idepth <<
" " << vdet <<
" " << (
HcalDetId)vUpDetId[0] << std::endl;
409 vdets.push_back(vUpDetId[0]);
418 std::cout <<
"matrixHCALIdsDepth::Final list contains " << vdets.size()
419 <<
" cells" << std::endl;
420 for (
unsigned int i1=0; i1<vdets.size(); i1++) {
422 std::cout <<
"matrixHCALIdsDepth::Cell " << i1 <<
" " <<
id <<std::endl;
std::vector< DetId > newHCALIdNS(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftNorth, int ieta, int iphi, bool debug=false)
virtual std::vector< DetId > south(const DetId &id) const
virtual std::vector< DetId > west(const DetId &id) const
virtual std::vector< DetId > north(const DetId &id) const
virtual std::vector< DetId > up(const DetId &id) const
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
virtual std::vector< DetId > east(const DetId &id) const
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)