17 int iphi,
bool includeHO,
bool debug) {
21 std::cout <<
"matrixHCALIds::Add " << ieta <<
" rows and " << iphi
22 <<
" columns of cells for " << dets.size() <<
" cells" 31 for (
unsigned int i1=0; i1<vdetS.size(); i1++) {
32 if (
std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
33 vdetN.push_back(vdetS[i1]);
40 std::cout <<
"matrixHCALIds::Total number of cells found is " 41 << vdetS.size() << std::endl;
55 std::vector<DetId> dets, vdetx;
57 int ietaphi = (
int)(dR/15.0)+1;
59 ietaphi, includeHO, debug);
60 for (
unsigned int i=0;
i<vdets.size(); ++
i) {
64 vdetx.push_back(vdets[i]);
70 std::cout <<
"matrixHCALIds::Final List of cells for dR " << dR
71 <<
" is with " << vdetx.size() <<
" from original list of " 72 << vdets.size() <<
" cells" << std::endl;
81 int ietaW,
int iphiN,
int iphiS,
82 bool includeHO,
bool debug) {
86 std::cout <<
"matrixHCALIds::Add " <<ietaE <<
"|" <<ietaW <<
" rows and " 87 << iphiN <<
"|" << iphiS <<
" columns of cells for " 88 << dets.size() <<
" cells" << std::endl;
93 ietaW, iphiN, iphiS, debug);
95 ietaW, iphiN, iphiS, debug);
96 for (
unsigned int i1=0; i1<vdetS.size(); i1++) {
97 if (
std::count(vdetN.begin(),vdetN.end(),vdetS[i1]) == 0)
98 vdetN.push_back(vdetS[i1]);
105 std::cout <<
"matrixHCALIds::Total number of cells found is " 106 << vdetS.size() << std::endl;
115 int ieta,
int iphi,
bool debug) {
119 std::cout <<
"newHCALIdNS::Add " << iphi <<
" columns of cells along " 120 << shiftNorth <<
" for " << (dets.size()-
last) <<
" cells" 125 std::vector<DetId> vdets;
126 vdets.insert(vdets.end(), dets.begin(), dets.end());
127 std::vector<DetId> vdetE, vdetW;
131 for (
unsigned int i1=0; i1<vdetW.size(); i1++) {
132 if (
std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
133 vdets.push_back(vdetW[i1]);
135 for (
unsigned int i1=0; i1<vdetE.size(); i1++) {
136 if (
std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
137 vdets.push_back(vdetE[i1]);
141 std::cout <<
"newHCALIdNS::With Added cells along E/W results a set of " 142 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
147 unsigned int last0 = vdets.size();
149 std::vector<DetId> vdetnew;
150 for (
unsigned int i1=last; i1<dets.size(); i1++) {
151 std::vector<DetId> vdet;
152 if (shiftNorth) vdet = topology->
north(dets[i1]);
153 else vdet = topology->
south(dets[i1]);
154 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
155 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
156 vdetnew.push_back(vdet[i2]);
162 for (
unsigned int i2=0; i2<vdetW.size(); i2++) {
163 if (
std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
164 std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
165 vdets.push_back(vdetW[i2]);
167 for (
unsigned int i2=0; i2<vdetE.size(); i2++) {
168 if (
std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
169 std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
170 vdets.push_back(vdetE[i2]);
173 vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
176 std::cout <<
"newHCALIdNS::Addition results a set of " 177 << (vdets.size()-last0) <<
" new cells" << std::endl;
190 std::cout <<
"newHCALIdNS::Final list consists of " << vdets.size()
191 <<
" cells" << std::endl;
201 int ietaE,
int ietaW,
int iphiN,
int iphiS,
206 std::cout <<
"newHCALIdNS::Add " << iphiN <<
"|" << iphiS
207 <<
" columns of cells along " << shiftNorth <<
" for " 208 << (dets.size()-
last) <<
" cells" << std::endl;
212 std::vector<DetId> vdets;
213 vdets.insert(vdets.end(), dets.begin(), dets.end());
214 std::vector<DetId> vdetE, vdetW;
218 for (
unsigned int i1=0; i1<vdetW.size(); i1++) {
219 if (
std::count(vdets.begin(),vdets.end(),vdetW[i1]) == 0)
220 vdets.push_back(vdetW[i1]);
222 for (
unsigned int i1=0; i1<vdetE.size(); i1++) {
223 if (
std::count(vdets.begin(),vdets.end(),vdetE[i1]) == 0)
224 vdets.push_back(vdetE[i1]);
228 std::cout <<
"newHCALIdNS::With Added cells along E/W results a set of " 229 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
234 unsigned int last0 = vdets.size();
236 if (shiftNorth) iphi = iphiN;
238 std::vector<DetId> vdetnew;
239 for (
unsigned int i1=last; i1<dets.size(); i1++) {
240 std::vector<DetId> vdet;
241 if (shiftNorth) vdet = topology->
north(dets[i1]);
242 else vdet = topology->
south(dets[i1]);
243 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
244 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
245 vdetnew.push_back(vdet[i2]);
251 for (
unsigned int i2=0; i2<vdetW.size(); i2++) {
252 if (
std::count(vdets.begin(),vdets.end(),vdetW[i2]) == 0 &&
253 std::count(vdetnew.begin(),vdetnew.end(),vdetW[i2]) == 0)
254 vdets.push_back(vdetW[i2]);
256 for (
unsigned int i2=0; i2<vdetE.size(); i2++) {
257 if (
std::count(vdets.begin(),vdets.end(),vdetE[i2]) == 0 &&
258 std::count(vdetnew.begin(),vdetnew.end(),vdetE[i2]) == 0)
259 vdets.push_back(vdetE[i2]);
262 vdets.insert(vdets.end(), vdetnew.begin(), vdetnew.end());
265 std::cout <<
"newHCALIdNS::Addition results a set of " 266 << (vdets.size()-last0) <<
" new cells" << std::endl;
272 if (shiftNorth) iphiN = iphi;
282 std::cout <<
"newHCALIdNS::Final list consists of " << vdets.size()
283 <<
" cells" << std::endl;
293 int ieta,
bool debug) {
297 std::cout <<
"newHCALIdEW::Add " << ieta <<
" rows of cells along " 298 << shiftEast <<
" for " << (dets.size()-
last) <<
" cells" 303 std::vector<DetId> vdets;
304 vdets.insert(vdets.end(), dets.begin(), dets.end());
306 for (
unsigned int i1=last; i1<dets.size(); i1++) {
307 std::vector<DetId> vdet;
308 if (shiftEast) vdet = topology->
east(dets[i1]);
309 else vdet = topology->
west(dets[i1]);
310 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
311 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
312 vdets.push_back(vdet[i2]);
320 std::cout <<
"newHCALIdEW::Addition results a set of " 321 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
331 std::cout <<
"newHCALIdEW::Final list (EW) consists of " <<vdets.size()
332 <<
" cells" << std::endl;
342 int ietaE,
int ietaW,
bool debug) {
346 std::cout <<
"newHCALIdEW::Add " << ietaE <<
"|" << ietaW
347 <<
" rows of cells along " << shiftEast <<
" for " 348 << (dets.size()-
last) <<
" cells" << std::endl;
353 if (shiftEast) ieta = ietaE;
354 std::vector<DetId> vdets;
355 vdets.insert(vdets.end(), dets.begin(), dets.end());
357 for (
unsigned int i1=last; i1<dets.size(); i1++) {
358 std::vector<DetId> vdet;
359 if (shiftEast) vdet = topology->
east(dets[i1]);
360 else vdet = topology->
west(dets[i1]);
361 for (
unsigned int i2=0; i2<vdet.size(); i2++) {
362 if (
std::count(vdets.begin(),vdets.end(),vdet[i2]) == 0)
363 vdets.push_back(vdet[i2]);
368 if (shiftEast) ietaE = ieta;
373 std::cout <<
"newHCALIdEW::Addition results a set of " 374 << (vdets.size()-dets.size()) <<
" new cells" << std::endl;
384 std::cout <<
"newHCALIdEW::Final list (EW) consists of " <<vdets.size()
385 <<
" cells" << std::endl;
403 std::cout <<
"matrixHCALIdsDepth::Add cells with higher depths with HO" 404 <<
"Flag set to " << includeHO <<
" to existing " 405 << dets.size() <<
" cells" << std::endl;
409 std::vector<DetId> vdets(dets);
410 for (
unsigned int i1=0; i1<dets.size(); i1++) {
412 for (
int idepth = 0; idepth < 3; idepth++) {
413 std::vector<DetId> vUpDetId = topology->
up(vdet);
414 if (!vUpDetId.empty()) {
415 if (includeHO || vUpDetId[0].subdetId() != (
int)(
HcalOuter)) {
416 int n =
std::count(vdets.begin(),vdets.end(),vUpDetId[0]);
420 <<
" " << vdet <<
" " 423 vdets.push_back(vUpDetId[0]);
433 std::cout <<
"matrixHCALIdsDepth::Final list contains " << vdets.size()
434 <<
" cells" << 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)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
double getDistInPlaneTrackDir(const GlobalPoint &caloPoint, const GlobalVector &caloVector, const GlobalPoint &rechitPoint, bool debug=false)
CaloTopology const * topology(0)
std::vector< DetId > up(const DetId &id) const override
void debugHcalDets(unsigned int, std::vector< DetId > &)
std::vector< DetId > south(const DetId &id) const override
std::vector< DetId > matrixHCALIdsDepth(std::vector< DetId > &dets, const HcalTopology *topology, bool includeHO=false, bool debug=false)
std::vector< DetId > west(const DetId &id) const override
std::vector< DetId > north(const DetId &id) const override
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
std::vector< DetId > east(const DetId &id) const override
std::vector< DetId > newHCALIdEW(std::vector< DetId > &dets, unsigned int last, const HcalTopology *topology, bool shiftEast, int ieta, bool debug=false)