ATLAS Offline Software
RegSelectorHashMap.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include <fstream>
9 #include <cmath>
10 #include <iostream>
11 #include <cstring>
12 
13 
14 
15 
16 
19 
20 void RegSelectorHashMap::HashIDList( const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const {
21  IRegSelLUT::IDList<RegSelectorHashMap>( roi, idlist, &RegSelectorHashMap::HashIDList_internal );
22 }
23 
24 void RegSelectorHashMap::HashIDList( long layer, const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const {;
25  IRegSelLUT::IDList_layer<RegSelectorHashMap>( layer, roi, idlist, &RegSelectorHashMap::HashIDList_internal );
26 }
27 
29 
30 void RegSelectorHashMap::ROBIDList( const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const {
31  IRegSelLUT::IDList<RegSelectorHashMap>( roi, roblist, &RegSelectorHashMap::ROBIDList_internal );
32 }
33 
34 void RegSelectorHashMap::ROBIDList( long layer, const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const {
35  IRegSelLUT::IDList_layer<RegSelectorHashMap>( layer, roi, roblist, &RegSelectorHashMap::ROBIDList_internal );
36 }
37 
38 
39 
41 
43 
44 void RegSelectorHashMap::HashIDList_internal( const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const {
45  if ( roi.isFullscan() ) regionSelector( -4.8, 4.8, -M_PI, M_PI, idlist );
46  regionSelector( roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), idlist);
47 }
48 
49 void RegSelectorHashMap::HashIDList_internal( long layer, const IRoiDescriptor& roi, std::vector<IdentifierHash>& idlist ) const {
50  if ( roi.isFullscan() ) regionSelector( layer, -4.8, 4.8, -M_PI, M_PI, idlist );
51  regionSelector( layer, roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), idlist);
52 }
53 
55 
56 void RegSelectorHashMap::ROBIDList_internal( const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const {
57  if ( roi.isFullscan() ) regionSelectorRobIdUint( -4.8, 4.8, -M_PI, M_PI, roblist );
58  regionSelectorRobIdUint( roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), roblist);
59 }
60 
61 void RegSelectorHashMap::ROBIDList_internal( long layer, const IRoiDescriptor& roi, std::vector<uint32_t>& roblist ) const {
62  if ( roi.isFullscan() ) regionSelectorRobIdUint( layer, -4.8, 4.8, -M_PI, M_PI, roblist );
63  regionSelectorRobIdUint( layer, roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), roblist);
64 }
65 
66 
67 
69 
71  return m_etaminDet;
72 }
73 
75  return m_etamaxDet;
76 }
77 
79  return m_phiminDet;
80 }
81 
83  return m_phimaxDet;
84 }
85 
86 const std::vector<IdentifierHash>& RegSelectorHashMap::hashIdOut(void) const {
87  return m_hashId;
88 }
89 
90 const std::vector<std::vector<uint32_t> >& RegSelectorHashMap::robIdOut(void) const {
91  return m_robId;
92 }
93 
94 const std::vector<int>& RegSelectorHashMap::sampleOut(void) const {
95  return m_sample;
96 }
97 
98 const std::vector<int>& RegSelectorHashMap::layerOut(void) const {
99  return m_layer;
100 }
101 
102 const std::vector<double>& RegSelectorHashMap::etaMinOut(void) const {
103  return m_etamin;
104 }
105 
106 const std::vector<double>& RegSelectorHashMap::etaMaxOut(void) const {
107  return m_etamax;
108 }
109 
110 const std::vector<double>& RegSelectorHashMap::phiMinOut(void) const {
111  return m_phimin;
112 }
113 
114 const std::vector<double>& RegSelectorHashMap::phiMaxOut(void) const {
115  return m_phimax;
116 }
117 
119  int iNumRanges, iRepeatOverX, iRepeatOverY, xEta, yPhi, k;
120  int iPage, iPosition, iXeta, iYphi; // , iNumSamples;
121  double dEtaMin=-999, dEtaMax=-999, dPhiMin= -999, dPhiMax = -999;
122 
125 
126  //Number of elements from the vectors (number of different ranges)
127  iNumRanges = m_sample.size();
128 
129  //Creates the m_NumSamples matrix"es"
130  // m_NumSamples*iColumns*iLines ->defines the matrix M page
131  // Yphi*iColumns+Xeta -> define the element M[X,Y]
132 
133  // initialize matrix
134  initMatrix();
135 
136  //Populates the matrix
137  for(k=0;k<iNumRanges;++k){
138  //Get the range values
139  dEtaMin = std::min(m_etamin[k],m_etamax[k]);
140  dEtaMax = std::max(m_etamin[k],m_etamax[k]);
141  dPhiMin = std::min(m_phimin[k],m_phimax[k]);
142  dPhiMax = std::max(m_phimin[k],m_phimax[k]);
143  //Guess how many times the hashID must be repeated on the X axis
144  iRepeatOverX = MyRound((dEtaMax-dEtaMin)/m_stepMinEta);
145  iRepeatOverX = std::abs(iRepeatOverX);
146  //Guess how many times the hashID must be repeated on the Y axis
147  iRepeatOverY = MyRound((dPhiMax-dPhiMin)/m_stepMinPhi);
148  iRepeatOverY = std::abs(iRepeatOverY);
149 
150  iPage = m_sample[k] * (m_iColumns * m_iLines);
151 
152  // initial position
153  iYphi = std::floor((dPhiMin - m_phiminDet+2e-6)/m_stepMinPhi);
154  for(yPhi=0;yPhi<iRepeatOverY;++yPhi){
155  iXeta = std::floor((dEtaMin - m_etaminDet)/m_stepMinEta);
156  for(xEta=0;xEta<iRepeatOverX;++xEta){
157  iPosition = iPage + (iYphi* m_iColumns +iXeta);
158  m_hashIDMap[iPosition] = m_hashId[k];
159  m_robIDMap[iPosition][0]=m_robId[k][0];
160  for(unsigned int i=1; i< m_robId[k].size();++i )
161  m_robIDMap[iPosition].push_back(m_robId[k][i]);
162  ++iXeta;
163  }
164  ++iYphi;
165  }
166  }
167 #ifdef REGSELDEBUG
168  for(k=0;k<iNumRanges;++k){
169  std::cout << "REGSELECTOR HASH TABLE " <<
170  m_phimin[k] << " " << m_phimax[k] << " " <<
171  m_etamin[k] << " " << m_etamax[k] << " " <<
172  m_sample[k] << " " << m_layer[k] << " " <<
173  m_hashId[k] << " 0x";
174  std::cout << std::hex;
175  for(unsigned int i=0;i<m_robId[k].size();++i)
176  std::cout << m_robId[k][i] << " ";
177  std::cout << std::dec;
178  std::cout << std::endl;
179  }
180  //Populates the matrix
181  for(k=0;k<iNumRanges;++k){
182  //Get the range values
183  dEtaMin = std::min(m_etamin[k],m_etamax[k]);
184  dEtaMax = std::max(m_etamin[k],m_etamax[k]);
185  dPhiMin = std::min(m_phimin[k],m_phimax[k]);
186  dPhiMax = std::max(m_phimin[k],m_phimax[k]);
187  iRepeatOverX = MyRound((dEtaMax-dEtaMin)/m_stepMinEta);
188  iRepeatOverX = std::abs(iRepeatOverX);
189  iRepeatOverY = MyRound((dPhiMax-dPhiMin)/m_stepMinPhi);
190  iRepeatOverY = std::abs(iRepeatOverY);
191  iPage = m_sample[k] * (m_iColumns * m_iLines);
192  // initial position
193  iYphi = std::floor((dPhiMin - m_phiminDet+2e-6)/m_stepMinPhi);
194  for(yPhi=0;yPhi<iRepeatOverY;++yPhi){
195  iXeta = std::floor((dEtaMin - m_etaminDet)/m_stepMinEta);
196  for(xEta=0;xEta<iRepeatOverX;++xEta){
197  iPosition = iPage + (iYphi* m_iColumns +iXeta);
198  std::cout << "REGSELECTOR MAPS " <<
199  iXeta << " " << iYphi << " " << iPosition << " " <<
200  m_hashIDMap[iPosition] << " ";
201  std::cout << std::hex;
202  for(unsigned int i=0; i<m_robIDMap[iPosition].size();++i)
203  std::cout << "0x" << m_robIDMap[iPosition][i] << " ";
204  std::cout << std::dec;
205  std::cout << std::endl;
206  ++iXeta;
207  }
208  ++iYphi;
209  }
210  }
211 #endif
212 
213 }
214 
215 void RegSelectorHashMap::regionSelectorRobIdUint(double etaminIn, double etamaxIn,
216  double phiminIn, double phimaxIn,
217  std::vector<uint32_t>& outList) const {
218  regionSelectorINROB(-1, etaminIn, etamaxIn, phiminIn, phimaxIn,&outList);
219 }
220 
221 void RegSelectorHashMap::regionSelectorRobIdUint(int sampling, double etaminIn, double etamaxIn,
222  double phiminIn, double phimaxIn,
223  std::vector<uint32_t>& outList) const {
224  regionSelectorINROB(sampling, etaminIn, etamaxIn, phiminIn, phimaxIn, &outList);
225 }
226 
228  int xEta,yPhi, iPosition;
229  int max_iPosition(0);
230  std::vector<uint32_t> tocreate(1);
231  IdentifierHash tocreateIH(value);
232 
233  for(xEta= 0; xEta < m_iColumns; ++xEta){
234  for(yPhi= 0; yPhi < m_iLines; ++yPhi){
235  iPosition = iPage + (yPhi* m_iColumns + xEta);
236  if(iPosition>max_iPosition) max_iPosition=iPosition;
237  }
238  }
239  m_hashIDMap.resize(max_iPosition+1,tocreateIH);
240  m_robIDMap.resize(max_iPosition+1,tocreate);
241  for(xEta= 0; xEta < m_iColumns; ++xEta){
242  for(yPhi= 0; yPhi < m_iLines; ++yPhi){
243  iPosition = iPage + (yPhi* m_iColumns + xEta);
244  m_robIDMap[iPosition].clear();
245  m_robIDMap[iPosition].push_back(value);
246  }
247  }
248 
249 }
250 
252  int xEta,yPhi, iPosition;
253 
254  for(xEta= 0; xEta < m_iColumns; ++xEta){
255  for(yPhi= 0; yPhi < m_iLines; ++yPhi){
256  iPosition = iPage + (yPhi* m_iColumns + xEta);
257  m_robIDMap[iPosition].push_back(value);
258  }
259  }
260 
261 }
262 
264  int k, iPage, iNumRanges;
265 
266  iNumRanges = m_NumSamples;
267 
268  for(k=0;k<=iNumRanges;++k){
269  iPage = k * (m_iColumns * m_iLines);
270  populateMatrix(iPage, INITHASH);
271  }
272 
273 }
274 
275 void RegSelectorHashMap::writeLine(const int& layer, const IdentifierHash& hashId,
276  const std::vector<uint32_t>& robId, const double& emin,
277  const double& emax, const double& pmin,
278  const double& pmax, const int& samp){
279 
280  m_hashId.push_back(hashId);
281  m_robId.push_back(robId);
282  m_etamin.push_back(emin);
283  m_etamax.push_back(emax);
284  m_phimin.push_back(pmin);
285  m_phimax.push_back(pmax);
286  m_layer.push_back(layer);
287  m_sample.push_back(samp);
288 
289 }
290 
291 int RegSelectorHashMap::MyRound(double pdValue){
292  double dFloor, dAux;
293  int iReturn;
294 
295  dFloor = std::floor(pdValue);
296  dAux = std::fabs(pdValue-dFloor);
297  if(dAux >= 0.5f)
298  iReturn = (int) (dFloor + 1);
299  else
300  iReturn = (int) dFloor;
301 
302  return iReturn;
303 }
304 
305 void RegSelectorHashMap::regionSelectorIN(const int& sampling,
306  const double& etaminIn, const double& etamaxIn,
307  const double& phiminIn, const double& phimaxIn,
308  std::vector<IdentifierHash>* outListIH) const {
309  int iYBeg, iYEnd, iXBeg, iXEnd, k, iPage;
310  int iXTemp;
311  std::vector<IdentifierHash>& auxsetIH=(*outListIH);
312 
314  iYBeg = std::floor((phiminIn - m_phiminDet+7e-3)/m_stepMinPhi);
315  iYEnd = std::ceil((phimaxIn - m_phiminDet-7e-3)/m_stepMinPhi);
316 
317 
321  bool pi_boundary = false;
322  if ( phiminIn>phimaxIn ) pi_boundary = true;
323 
325  if(iYBeg < 0) iYBeg += m_iLines;
326  if(iYBeg > m_iLines) iYBeg -= m_iLines;
327  if(iYEnd < 0) iYEnd += m_iLines ;
328  if(iYEnd > m_iLines) iYEnd -= m_iLines;
329 
330 
332  iXBeg = std::floor((etaminIn - m_etaminDet+2e-5)/m_stepMinEta);
333  iXEnd = std::ceil((etamaxIn - m_etaminDet-2e-5)/m_stepMinEta);
334 
335  if(iXBeg < 0) iXBeg = 0;
336  if(iXBeg > m_iColumns) iXBeg = m_iColumns;
337  if(iXEnd < 0) iXEnd = 0;
338  if(iXEnd > m_iColumns) iXEnd = m_iColumns;
339 
340 
343  if(iXBeg > iXEnd){
344  iXTemp = iXBeg;
345  iXBeg = iXEnd;
346  iXEnd = iXTemp;
347  }
348  if(sampling == -1){ // Consider all samplings (0...3)
349  if( pi_boundary ){
350  for(k=0; k<=m_NumSamples; ++k){
351  iPage = k * (m_iColumns * m_iLines);
352  findIdentifier(auxsetIH, iXBeg, iXEnd, iYBeg, m_iLines, iPage);
353  }
354  for(k=0; k<=m_NumSamples; ++k){
355  iPage = k * (m_iColumns * m_iLines);
356  findIdentifier(auxsetIH, iXBeg, iXEnd, 0, iYEnd, iPage);
357  }
358  }
359  else{
360  for(k=0; k<=m_NumSamples; ++k){
361  iPage = k * (m_iColumns * m_iLines);
362  findIdentifier(auxsetIH,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
363  }
364  }
365  }
366  else{ // Consider only the input sampling value
367  k= sampling;
368  iPage = k * (m_iColumns * m_iLines);
369  if( pi_boundary ){
370  findIdentifier(auxsetIH,iXBeg, iXEnd, iYBeg, m_iLines, iPage);
371  findIdentifier(auxsetIH,iXBeg, iXEnd, 0, iYEnd, iPage);
372  }
373  else{
374  findIdentifier(auxsetIH,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
375  }
376  }
377 }
378 
379 
380 
381 
383  const double& etaminIn, const double& etamaxIn, const double& phiminIn,
384  const double& phimaxIn,
385  std::vector<uint32_t>* outList) const {
386  int iYBeg{}, iYEnd{}, iXBeg{}, iXEnd{}, k{}, iPage{};
387  int iXTemp{};
388  std::vector<uint32_t>& auxset=(*outList);
389 
392  if (m_stepMinPhi !=0){
393  //
394  iYBeg = std::floor((phiminIn - m_phiminDet+7e-3)/m_stepMinPhi);
395  iYEnd = std::ceil((phimaxIn - m_phiminDet-7e-3)/m_stepMinPhi);
396  }
397 
401  bool pi_boundary = false;
402  if ( phiminIn>phimaxIn ) pi_boundary = true;
403 
405  if(iYBeg < 0) iYBeg += m_iLines;
406  if(iYBeg > m_iLines) iYBeg -= m_iLines;
407  if(iYEnd < 0) iYEnd += m_iLines ;
408  if(iYEnd > m_iLines) iYEnd -= m_iLines;
410  if (m_stepMinEta!=0) {
411  iXBeg = std::floor((etaminIn - m_etaminDet+2e-5)/m_stepMinEta);
412  iXEnd = std::ceil((etamaxIn - m_etaminDet-2e-5)/m_stepMinEta);
413  }
414  if(iXBeg < 0) iXBeg = 0;
415  if(iXBeg > m_iColumns) iXBeg = m_iColumns;
416  if(iXEnd < 0) iXEnd = 0;
417  if(iXEnd > m_iColumns) iXEnd = m_iColumns;
418 
419 
422  if(iXBeg > iXEnd){
423  iXTemp = iXBeg;
424  iXBeg = iXEnd;
425  iXEnd = iXTemp;
426  }
427 
428  if(sampling == -1){ // Consider all samplings (0...3)
429 
430  if( pi_boundary ){
431  for(k=0; k<=m_NumSamples; ++k){
432  iPage = k * (m_iColumns * m_iLines);
433  findIdentifierROB(auxset, iXBeg, iXEnd, iYBeg, m_iLines,
434  iPage);
435  }
436  for(k=0; k<=m_NumSamples; ++k){
437  iPage = k * (m_iColumns * m_iLines);
438  findIdentifierROB(auxset, iXBeg, iXEnd, 0, iYEnd, iPage);
439  }
440  }
441  else{
442  for(k=0; k<=m_NumSamples; ++k){
443  iPage = k * (m_iColumns * m_iLines);
444  findIdentifierROB(auxset,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
445  }
446  }
447  }
448  else{ // Consider only the input sampling value
449 
450  k= sampling;
451  iPage = k * (m_iColumns * m_iLines);
452  if( pi_boundary ){
453  findIdentifierROB(auxset,iXBeg, iXEnd, iYBeg, m_iLines, iPage);
454  findIdentifierROB(auxset,iXBeg, iXEnd, 0, iYEnd, iPage);
455  }
456  else{
457  findIdentifierROB(auxset,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
458  }
459  }
460 }
461 
462 void RegSelectorHashMap::phiCondition(const std::vector<IdentifierHash>& identifier, int i,
463  double etaminIn, double etamaxIn,
464  double phiminIn, double phimaxIn,
465  double etamin, double etamax,
466  std::set<IdentifierHash>* outset) const {
467  double phimin, phimax;
468  if(m_phimin[i] > m_phimax[i]){
469  phimin = m_phimin[i];
470  phimax = m_phimaxDet;
471 
472  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
473  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
474  (*outset).insert(identifier[i]);
475  }
476  }
477  phimin = m_phiminDet;
478  phimax = m_phimax[i];
479  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
480  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
481  (*outset).insert(identifier[i]);
482  }
483  }
484  }
485  else{
486  phimin = m_phimin[i]; phimax = m_phimax[i];
487  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
488  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
489  (*outset).insert(identifier[i]);
490  }
491  }
492  }
493 
494 }
495 
496 void RegSelectorHashMap::phiConditionRobId(const std::vector<std::vector<uint32_t> >& identifier, int i,
497  double etaminIn, double etamaxIn,
498  double phiminIn, double phimaxIn,
499  double etamin, double etamax,
500  std::set<uint32_t>* outset) const {
501  double phimin, phimax;
502  if(m_phimin[i] > m_phimax[i]){
503  phimin = m_phimin[i];
504  phimax = m_phimaxDet;
505 
506  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
507  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
508  (*outset).insert(identifier[i][0]);
509  }
510  }
511  phimin = m_phiminDet;
512  phimax = m_phimax[i];
513  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
514  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
515  (*outset).insert(identifier[i][0]);
516  }
517  }
518  }
519  else{
520  phimin = m_phimin[i]; phimax = m_phimax[i];
521  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
522  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
523  (*outset).insert(identifier[i][0]);
524  }
525  }
526  }
527 
528 }
529 
530 void RegSelectorHashMap::regionSelector(double etaminIn, double etamaxIn,
531  double phiminIn, double phimaxIn,std::vector<IdentifierHash>& outList) const {
532  verifyInputs(etaminIn, etamaxIn, phiminIn, phimaxIn);
533  regionSelectorIN((int)-1, (double)etaminIn, (double)etamaxIn,
534  (double)phiminIn, (double)phimaxIn,&outList);
535 
536 }
537 
538 void RegSelectorHashMap::regionSelector(int sampling, double etaminIn, double etamaxIn,
539  double phiminIn, double phimaxIn, std::vector<IdentifierHash>& outList) const {
540  verifyInputs(etaminIn, etamaxIn, phiminIn, phimaxIn);
541  regionSelectorIN((int)sampling, (double)etaminIn, (double)etamaxIn,
542  (double)phiminIn, (double)phimaxIn,&outList);
543 
544 }
545 
547  m_NumSamples = -1;
548  m_stepMinPhi = 99;
549  m_stepMinEta = 99;
550  m_etaminDet = m_phiminDet = 99;
551  m_etamaxDet = m_phimaxDet = -99;
552 }
553 
555  StatusCode sc = StatusCode::SUCCESS;
556  char buffer_[256]; // only needs to be 128 long, but safety first!
557  char* buffer = buffer_;
558  int samp, layer;
559  unsigned int hashId;
560  double emin, emax, pmin, pmax;
561  double stepPhi, stepEta;
562  char robIdStr[12], robIdStr2[12];
563  char *pch;
564  std::vector<uint32_t> robId;
565  robId.push_back(0);
566 
567 // use path resolver to find full path to file
568  std::string unresolvedFileName(filename);
569  std::string fullFileName = PathResolver::find_file (unresolvedFileName, "DATAPATH");
570  if (fullFileName == "") {
571  std::cerr << "LArTTRegionSelectorIdentifierHash: FATAL: Could not find input file in DATAPATH" << unresolvedFileName<< std::endl;
572  return StatusCode::FAILURE;
573  }
574 
575  std::ifstream fin(fullFileName.c_str());
576  fin.getline(buffer,128,'\n');
577  if(fin.bad()){ //Test if the file failed:
578  sc = StatusCode::FAILURE;
579  return sc;
580  }
581  if (strncmp(buffer," TT-ID",6)==0){
582  fin.getline(buffer, 128, '\n');
583  do{
584  robId.clear();
585  pch = strchr(buffer,' ');
586  int test = sscanf(pch, " %u %d %d %lf %lf %lf %lf %11s %11s", // max 11 chars + null-byte
587  &hashId, &layer, &samp, &emin, &emax, &pmin, &pmax, robIdStr, robIdStr2);
588  robId.push_back(strtol(robIdStr,nullptr,16));
589  if ( test == 9 ) // this means that there are 2 ROBs in 1 TT
590  robId.push_back(strtol(robIdStr2,nullptr,16));
591  pch=strchr(buffer,' ');
592  stepPhi = std::fabs(pmax-pmin);// initial value for phi and eta step
593  stepEta = std::fabs(emin-emax);
601  writeLine(layer, (IdentifierHash) hashId, robId, emin, emax, pmin, pmax, samp);
602  // ++nlines;
603  }while((fin.getline(buffer, 128, '\n')));
604  }
605  // m_readFromFile = !( nlines == 0 );
606  fin.close();
607 
608  return sc;
609 }
610 
612  // unsigned int j;
613 
614  initvar();
615  std::vector<uint32_t> robId_cpy;
616 
617  // If not readFromFile detLut->maxHash() != 0
618  m_readFromFile = (detLut->maxHash() == 0);
619  // Assuming that we can have up to 2 ROBs for a given TT
620  double etamin(-999.0), etamax(-999.0), phimin(-999.0), phimax(-999.0);
621  int samp(999), layer(999);
622  int hash(999);
623  int tablesize = detLut->maxHash();
624  m_hashId.reserve(tablesize);
625  m_robId.reserve(tablesize);
626  m_etamin.reserve(tablesize);
627  m_etamax.reserve(tablesize);
628  m_phimin.reserve(tablesize);
629  m_phimax.reserve(tablesize);
630  m_layer.reserve(tablesize);
631  m_sample.reserve(tablesize);
632 
633  for( int j=0; j<tablesize; ++j){
634  if ( detLut->hashId(j)==hash && detLut->sampling(j)==samp &&
635  detLut->etaMin(j)==etamin && detLut->etaMax(j) == etamax &&
636  detLut->phiMin(j)==phimin && detLut->phiMax(j) == phimax &&
637  detLut->layerDiskNumber(j) == layer ){
638  robId_cpy.push_back(detLut->robId(j));
639  writeLine(detLut->layerDiskNumber(j),
640  detLut->hashId(j),
641  robId_cpy,
642  detLut->etaMin(j),
643  detLut->etaMax(j),
644  detLut->phiMin(j),
645  detLut->phiMax(j),
646  detLut->sampling(j));
647  ++j;
648  } else { // Write previous line
649  if ( j!= 0 )
650  writeLine(layer,hash,robId_cpy,etamin,etamax,phimin,phimax,samp);
651  }
652  robId_cpy.clear();
653  robId_cpy.push_back(detLut->robId(j));
654  hash=detLut->hashId(j); samp=detLut->sampling(j);
655  etamin=detLut->etaMin(j); etamax=detLut->etaMax(j);
656  phimin=detLut->phiMin(j); phimax=detLut->phiMax(j);
657  layer=detLut->layerDiskNumber(j);
658  // After prossessing need to update global vars
659  double stepPhi = std::fabs(phimax-phimin);// initial value for phi and eta step
660  double stepEta = std::fabs(etamin-etamax);
664  m_phiminDet = std::min(std::min(m_phiminDet,phimin),phimax);
666  m_phimaxDet = std::max(std::max(m_phimaxDet,phimax),phimin);
668  }
669  // Shall not forget to save last one
670  // Assuming last line is NOT a 2 ROB/TT case
671  writeLine(layer,hash,robId_cpy,etamin,etamax,phimin,phimax,samp);
672 
673 }
674 
675 void RegSelectorHashMap::summaryDataFile(std::list<RegSelectorMapElement> &dataList){
676  for(std::list<RegSelectorMapElement>::iterator it = dataList.begin();
677  it != dataList.end(); ++it){ // runs through entire list
678  std::cout << "position: " << (*it).layerDiskPosition() << " number: " << (*it).layerDiskNumber() << std::endl;
679  std::cout << "etamin: " << m_etaminDet << " etamax: " << m_etamaxDet << std::endl;
680  std::cout << "phimin: " << m_phiminDet << " phimax: " << m_phimaxDet << std::endl;
681  std::cout << "hashId: ";
682  std::vector<IdentifierHash> aux = (*it).hashId();
683  for(std::vector<IdentifierHash>::iterator i = aux.begin(); i != aux.end(); ++i)
684  std::cout << (*i) << " ";
685  std::cout << std::endl;
686  std::cin.get();
687  }
688 }
689 
690 void RegSelectorHashMap::verifyInputs(double &etaminIn, double &etamaxIn,
691  double &phiminIn, double &phimaxIn) const {
692 
693  if ( m_readFromFile ) { // Files still 0 <-> 2pi
694  while (phiminIn > 2*M_PI ) phiminIn -= 2*M_PI;
695  while (phiminIn < 0 ) phiminIn += 2*M_PI;
696  while (phimaxIn > 2*M_PI ) phimaxIn -= 2*M_PI;
697  while (phimaxIn < 0 ) phimaxIn += 2*M_PI;
698  } else { // SG maps -pi <-> pi
699  while (phiminIn > M_PI ) phiminIn -= 2*M_PI;
700  while (phiminIn < -M_PI ) phiminIn += 2*M_PI;
701  while (phimaxIn > M_PI ) phimaxIn -= 2*M_PI;
702  while (phimaxIn < -M_PI ) phimaxIn += 2*M_PI;
703  }
704 
705  if( ( (etaminIn < m_etaminDet) && (etamaxIn < m_etaminDet) ) ||
706  ( (etaminIn > m_etamaxDet) && (etamaxIn > m_etamaxDet) ) ){
707  //sc = StatusCode::FAILURE;
708  }
709  else{
710  if( (etaminIn < m_etaminDet) && (etamaxIn > m_etaminDet) ){
711  etaminIn = m_etaminDet;
712  }
713  if( (etamaxIn > m_etamaxDet) && (etaminIn < m_etamaxDet) ){
714  etamaxIn = m_etamaxDet;
715  }
716  }
717 }
718 
719 void RegSelectorHashMap::verifyROBIDOutput(double etaminIn, double etamaxIn,
720  double phiminIn, double phimaxIn,
721  std::vector<uint32_t>& outputIdlist) const {
722  int i;
723  std::set<uint32_t> myset;
724  std::vector<uint32_t> outset;
725  std::vector<std::vector<uint32_t> > identifier;
726  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
727  int vecsize = m_sample.size();
728 
730 
731  if(etaminIn > etamaxIn){
732  etatmp = etamaxIn;
733  etamaxIn = etaminIn;
734  etaminIn = etatmp;
735  }
736 
737  phimintmp = phiminIn;
738  phimaxtmp = phimaxIn;
739 
740  for(i= 0; i < vecsize; ++i){
741  if(m_etamin[i] > m_etamax[i]){
742  etamin = m_etamax[i]; etamax = m_etamin[i];
743  }
744  else{
745  etamin = m_etamin[i]; etamax = m_etamax[i];
746  }
747  if(phiminIn > phimaxIn ){
748  phimaxIn = m_phimaxDet;
749  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
750  phiminIn = m_phiminDet;
751  phimaxIn = phimaxtmp;
752  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
753  }
754  else{
755  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
756  }
757  phiminIn = phimintmp; phimaxIn = phimaxtmp;
758  }
759 
761  for(it = myset.begin(); it!= myset.end(); ++it){
762  outset.push_back(*it);
763  }
764 
765  if( (outset == outputIdlist) || (outputIdlist.size() >= outset.size()) ){
766  std::cout << "equal vectors " << std::endl;
767  }
768  else {
769  std::cout << "nonequal vectors " << std::endl;
770  std::cout << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
771  std::cout << "desired output ";
772  for(unsigned int i=0; i < outset.size(); ++i)
773  std::cout << std::dec << outset[i] << " ";
774  std::cout << std::endl;
775  std::cout << "obtained output ";
776  for(unsigned int i=0; i < outputIdlist.size(); ++i)
777  std::cout << std::dec << outputIdlist[i] << " ";
778  std::cout << std::endl;
779  std::cin.get();
780  }
781 }
782 
784  double etaminIn, double etamaxIn,
785  double phiminIn, double phimaxIn,
786  std::vector<uint32_t>& outputIdlist) const {
787 
788  int i;
789  std::set<uint32_t> myset;
790  std::vector<std::vector<uint32_t> > identifier;
791  std::vector<uint32_t> outset;
792  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
793  int vecsize = m_sample.size();
794 
796 
797  if(etaminIn > etamaxIn){
798  etatmp = etamaxIn;
799  etamaxIn = etaminIn;
800  etaminIn = etatmp;
801  }
802 
803  phimintmp = phiminIn;
804  phimaxtmp = phimaxIn;
805 
806  for(i= 0; i < vecsize; ++i){
807  if( sampling == m_sample[i]){
808  if(m_etamin[i] > m_etamax[i]){
809  etamin = m_etamax[i]; etamax = m_etamin[i];
810  }
811  else{
812  etamin = m_etamin[i]; etamax = m_etamax[i];
813  }
814  if(phiminIn > phimaxIn ){
815  phimaxIn = m_phimaxDet;
816  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
817  phiminIn = m_phiminDet;
818  phimaxIn = phimaxtmp;
819  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
820  }
821  else{
822  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
823  }
824  }
825  phiminIn = phimintmp; phimaxIn = phimaxtmp;
826  }
827 
829  for(it = myset.begin(); it!= myset.end(); ++it){
830  outset.push_back(*it);
831  }
832 
833  if(outset == outputIdlist){
834  std::cout << "equal vectors " << std::endl;
835  }
836  else {
837  std::cout << "sampling " << sampling << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
838  std::cout << "desired output ";
839  for(unsigned int i=0; i < outset.size(); ++i)
840  std::cout << std::dec << outset[i] << " ";
841  std::cout << std::endl;
842  std::cout << "obtained output ";
843  for(unsigned int i=0; i < outputIdlist.size(); ++i)
844  std::cout << std::dec << outputIdlist[i] << " ";
845  std::cout << std::endl;
846  std::cin.get();
847  }
848 }
849 
850 void RegSelectorHashMap::verifyOutput(double etaminIn, double etamaxIn,
851  double phiminIn, double phimaxIn,
852  std::vector<IdentifierHash>* outputIdlist) const {
853  int i;
854  std::set<IdentifierHash> myset;
855  std::vector<IdentifierHash> outset;
856  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
857  int vecsize = m_sample.size();
858 
859  if(etaminIn > etamaxIn){
860  etatmp = etamaxIn;
861  etamaxIn = etaminIn;
862  etaminIn = etatmp;
863  }
864 
865  phimintmp = phiminIn;
866  phimaxtmp = phimaxIn;
867 
868  for(i= 0; i < vecsize; ++i){
869  if(m_etamin[i] > m_etamax[i]){
870  etamin = m_etamax[i]; etamax = m_etamin[i];
871  }
872  else{
873  etamin = m_etamin[i]; etamax = m_etamax[i];
874  }
875  if(phiminIn > phimaxIn ){
876  phimaxIn = m_phimaxDet;
877  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
878  phiminIn = m_phiminDet;
879  phimaxIn = phimaxtmp;
880  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
881  }
882  else{
883  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
884  }
885  phiminIn = phimintmp; phimaxIn = phimaxtmp;
886  }
887 
889  for(it = myset.begin(); it!= myset.end(); ++it){
890  outset.push_back(*it);
891  }
892 
893  if(outset == (*outputIdlist) ){
894  std::cout << "equal vectors " << std::endl;
895  }
896  else {
897  std::cout << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
898  std::cout << "desired output ";
899  for(unsigned int i=0; i < outset.size(); ++i)
900  std::cout << std::dec << outset[i] << " ";
901  std::cout << std::endl;
902  std::cout << "obtained output ";
903  for(unsigned int i=0; i < (*outputIdlist).size(); ++i)
904  std::cout << std::dec << (*outputIdlist)[i] << " ";
905  std::cout << std::endl;
906  }
907 }
908 
909 void RegSelectorHashMap::verifyOutput(int sampling,double etaminIn, double etamaxIn,
910  double phiminIn, double phimaxIn,
911  std::vector<IdentifierHash>* outputIdlist) const {
912  int i;
913  std::set<IdentifierHash> myset;
914  std::vector<IdentifierHash> outset;
915  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
916  int vecsize = m_sample.size();
917 
918  if(etaminIn > etamaxIn){
919  etatmp = etamaxIn;
920  etamaxIn = etaminIn;
921  etaminIn = etatmp;
922  }
923 
924  phimintmp = phiminIn;
925  phimaxtmp = phimaxIn;
926 
927  for(i= 0; i < vecsize; ++i){
928  if( sampling == m_sample[i]){
929  if(m_etamin[i] > m_etamax[i]){
930  etamin = m_etamax[i]; etamax = m_etamin[i];
931  }
932  else{
933  etamin = m_etamin[i]; etamax = m_etamax[i];
934  }
935  if(phiminIn > phimaxIn ){
936  phimaxIn = m_phimaxDet;
937  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
938  phiminIn = m_phiminDet;
939  phimaxIn = phimaxtmp;
940  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
941  }
942  else{
943  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
944  }
945  }
946  phiminIn = phimintmp; phimaxIn = phimaxtmp;
947  }
948 
950  for(it = myset.begin(); it!= myset.end(); ++it){
951  outset.push_back(*it);
952  }
953 
954  if(outset == (*outputIdlist) ){
955  std::cout << "equal vectors " << std::endl;
956  }
957  else {
958  std::cout << "sampling " << sampling << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
959  std::cout << "desired output ";
960  for(unsigned int i=0; i < outset.size(); ++i)
961  std::cout << std::dec << outset[i] << " ";
962  std::cout << std::endl;
963  std::cout << "obtained output ";
964  for(unsigned int i=0; i < (*outputIdlist).size(); ++i)
965  std::cout << std::dec << (*outputIdlist)[i] << " ";
966  std::cout << std::endl;
967  std::cin.get();
968  }
969 }
970 
971 void RegSelectorHashMap::findIdentifier(std::vector<IdentifierHash> &auxsetIH,
972  const int iXBeg, const int iXEnd,
973  const int iYBeg, const int iYEnd,
974  const int iPage) const {
975  int xEta, yPhi, iPosition;
976 
977  for(xEta= iXBeg; xEta < iXEnd; ++xEta){
978  for(yPhi=iYBeg; yPhi < iYEnd; ++yPhi){
979  iPosition = iPage + (yPhi* m_iColumns + xEta);
980  if(m_hashIDMap[iPosition] != INITHASH){
981  auxsetIH.push_back(m_hashIDMap[iPosition]);
982  }
983  }
984  }
985 
986  if(auxsetIH.size()!=0){
987  sort(auxsetIH.begin(),auxsetIH.end());
988  auxsetIH.erase(unique(auxsetIH.begin(),auxsetIH.end()),auxsetIH.end());
989  }
990 
991 }
992 
993 void RegSelectorHashMap::findIdentifierROB( std::vector<uint32_t> &auxset,
994  const int iXBeg, const int iXEnd,
995  const int iYBeg, const int iYEnd,
996  const int iPage ) const {
997  int xEta, yPhi, iPosition;
998  unsigned int i,size_rod;
999 
1000  for(xEta= iXBeg; xEta < iXEnd; ++xEta){
1001  for(yPhi=iYBeg; yPhi < iYEnd; ++yPhi){
1002  iPosition = iPage + (yPhi* m_iColumns + xEta);
1003  size_rod=m_robIDMap[iPosition].size();
1004  for(i=0; i < size_rod; ++i)
1005  if ( m_robIDMap[iPosition][i] != INITHASH )
1006  auxset.push_back(m_robIDMap[iPosition][i]);
1007  }
1008  }
1009 
1010  if(auxset.size()!=0){
1011  sort(auxset.begin(),auxset.end());
1012  auxset.erase(unique(auxset.begin(),auxset.end()),auxset.end());
1013  }
1014 
1015 }
1016 
1017 
1018 
1020  double *etaMin, double *etaMax,
1021  double *phiMin, double *phiMax) const {
1022 
1023  (*etaMin) = m_etamin[hashId];
1024  (*etaMax) = m_etamax[hashId];
1025  (*phiMin) = m_phimin[hashId];
1026  (*phiMax) = m_phimax[hashId];
1027 }
1028 
1029 void RegSelectorHashMap::DisableMissingROBs(const std::vector<uint32_t>& vec){
1030  for(size_t i=0;i<vec.size();++i){
1031  for(size_t j=0;j<m_robIDMap.size();++j){
1032  for(size_t k=0;k<m_robIDMap[j].size();++k){
1033  if ( vec[i] == m_robIDMap[j][k] )
1034  m_robIDMap[j][k] = INITHASH;
1035  }
1036  }
1037  }
1038 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
RegSelectorHashMap::sampleOut
const std::vector< int > & sampleOut(void) const
Definition: RegSelectorHashMap.cxx:94
RegSelectorHashMap::m_hashId
std::vector< IdentifierHash > m_hashId
Definition: RegSelectorHashMap.h:133
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
RegSelectorHashMap::verifyROBIDOutput
void verifyROBIDOutput(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outputIdlist) const
Definition: RegSelectorHashMap.cxx:719
RegSelectorHashMap::m_iColumns
int m_iColumns
Definition: RegSelectorHashMap.h:140
RegSelectorHashMap::m_phiminDet
double m_phiminDet
Definition: RegSelectorHashMap.h:138
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
RegSelectorHashMap::populateMatrix
void populateMatrix(int iPage, IdentifierHash value)
Definition: RegSelectorHashMap.cxx:227
RegionSelectorLUT.h
RegSelectorHashMap::findIdentifierROB
void findIdentifierROB(std::vector< uint32_t > &auxset, const int iXBeg, const int iXEnd, const int iYBeg, const int iYEnd, const int iPage) const
Definition: RegSelectorHashMap.cxx:993
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RegSelectorHashMap::ROBIDList_internal
virtual void ROBIDList_internal(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const
rob methods
Definition: RegSelectorHashMap.cxx:56
RegSelectorHashMap::populateMatrixRobId
void populateMatrixRobId(int iPage, uint32_t value)
Definition: RegSelectorHashMap.cxx:251
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
RegSelectorHashMap::layerOut
const std::vector< int > & layerOut(void) const
Definition: RegSelectorHashMap.cxx:98
RegionSelectorLUT::sampling
int sampling(int hashId) const
Definition: RegionSelectorLUT.cxx:56
IRoiDescriptor::etaMinus
virtual double etaMinus() const =0
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
RegSelectorHashMap::m_phimaxDet
double m_phimaxDet
Definition: RegSelectorHashMap.h:138
RegSelectorHashMap::etamaxValue
double etamaxValue() const
Definition: RegSelectorHashMap.cxx:74
RegSelectorHashMap::m_robId
std::vector< std::vector< uint32_t > > m_robId
Definition: RegSelectorHashMap.h:136
RegSelectorHashMap::addLut
void addLut(const RegionSelectorLUT *detLut)
Definition: RegSelectorHashMap.cxx:611
RegSelectorHashMap::regionSelectorIN
void regionSelectorIN(const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< IdentifierHash > *outListIH) const
Definition: RegSelectorHashMap.cxx:305
skel.it
it
Definition: skel.GENtoEVGEN.py:396
M_PI
#define M_PI
Definition: ActiveFraction.h:11
RegSelectorHashMap::etaMaxOut
const std::vector< double > & etaMaxOut(void) const
Definition: RegSelectorHashMap.cxx:106
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
athena.value
value
Definition: athena.py:124
RegSelectorHashMap::ROBIDList
virtual void ROBIDList(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
rob methods
Definition: RegSelectorHashMap.cxx:30
RegSelectorHashMap::findIdentifier
void findIdentifier(std::vector< IdentifierHash > &auxsetIH, const int iXBeg, const int iXEnd, const int iYBeg, const int iYEnd, const int iPage) const
Definition: RegSelectorHashMap.cxx:971
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
RegSelectorHashMap::m_robIDMap
std::vector< std::vector< uint32_t > > m_robIDMap
Definition: RegSelectorHashMap.h:142
RegionSelectorLUT::maxHash
unsigned int maxHash(void) const
Definition: RegionSelectorLUT.cxx:68
RegSelectorHashMap::hashIdOut
const std::vector< IdentifierHash > & hashIdOut(void) const
Definition: RegSelectorHashMap.cxx:86
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
RegSelectorHashMap::m_etamax
std::vector< double > m_etamax
Definition: RegSelectorHashMap.h:134
IRoiDescriptor::etaPlus
virtual double etaPlus() const =0
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
RegionSelectorLUT::etaMin
double etaMin(int hashId) const
Definition: RegionSelectorLUT.cxx:40
RegSelectorHashMap::getEtaPhi
void getEtaPhi(IdentifierHash hashId, double *etaMin, double *etaMax, double *phiMin, double *phiMax) const
Definition: RegSelectorHashMap.cxx:1019
RegSelectorHashMap::m_etaminDet
double m_etaminDet
Definition: RegSelectorHashMap.h:137
RegSelectorHashMap::HashIDList_internal
virtual void HashIDList_internal(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const
internal implementation of the IRegSelUT interface
Definition: RegSelectorHashMap.cxx:44
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
dq_defect_bulk_create_defects.tocreate
list tocreate
Definition: dq_defect_bulk_create_defects.py:20
RegSelectorHashMap::m_iLines
int m_iLines
Definition: RegSelectorHashMap.h:140
RegSelectorHashMap::initvar
void initvar(void)
Definition: RegSelectorHashMap.cxx:546
RegionSelectorLUT::phiMax
double phiMax(int hashId) const
Definition: RegionSelectorLUT.cxx:52
RegSelectorHashMap::m_stepMinPhi
double m_stepMinPhi
Definition: RegSelectorHashMap.h:129
RegSelectorHashMap::m_phimax
std::vector< double > m_phimax
Definition: RegSelectorHashMap.h:135
RegSelectorHashMap::phimaxValue
double phimaxValue() const
Definition: RegSelectorHashMap.cxx:82
RegSelectorHashMap::HashIDList
virtual void HashIDList(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
implementation of the IRegSelUT interface
Definition: RegSelectorHashMap.cxx:20
RegSelectorHashMap::phiMinOut
const std::vector< double > & phiMinOut(void) const
Definition: RegSelectorHashMap.cxx:110
RegSelectorHashMap::regionSelectorINROB
void regionSelectorINROB(const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< uint32_t > *outList) const
Definition: RegSelectorHashMap.cxx:382
RegSelectorHashMap::etaminValue
double etaminValue() const
rest of the class implementation
Definition: RegSelectorHashMap.cxx:70
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
RegSelectorHashMap::etaMinOut
const std::vector< double > & etaMinOut(void) const
Definition: RegSelectorHashMap.cxx:102
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RegSelectorHashMap::m_etamaxDet
double m_etamaxDet
Definition: RegSelectorHashMap.h:137
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
RegSelectorHashMap::m_stepMinEta
double m_stepMinEta
Definition: RegSelectorHashMap.h:129
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
RegSelectorHashMap::m_sample
std::vector< int > m_sample
Definition: RegSelectorHashMap.h:132
RegSelectorHashMap::writeLine
void writeLine(const int &layer, const IdentifierHash &hashId, const std::vector< uint32_t > &robId, const double &emin, const double &emax, const double &pmin, const double &pmax, const int &samp)
Definition: RegSelectorHashMap.cxx:275
RegSelectorHashMap::verifyInputs
void verifyInputs(double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn) const
Definition: RegSelectorHashMap.cxx:690
RegSelectorHashMap::DisableMissingROBs
void DisableMissingROBs(const std::vector< uint32_t > &vec)
Definition: RegSelectorHashMap.cxx:1029
IRoiDescriptor::phiMinus
virtual double phiMinus() const =0
hist_file_dump.f
f
Definition: hist_file_dump.py:135
RegSelectorHashMap::m_etamin
std::vector< double > m_etamin
Definition: RegSelectorHashMap.h:134
RegSelectorHashMap::m_readFromFile
bool m_readFromFile
Definition: RegSelectorHashMap.h:141
RegSelectorHashMap::m_phimin
std::vector< double > m_phimin
Definition: RegSelectorHashMap.h:135
RegSelectorHashMap::m_layer
std::vector< int > m_layer
Definition: RegSelectorHashMap.h:132
RegSelectorHashMap::phiminValue
double phiminValue() const
Definition: RegSelectorHashMap.cxx:78
IRoiDescriptor::phiPlus
virtual double phiPlus() const =0
extreme phi values
RegionSelectorLUT::robId
int robId(int hashId) const
Definition: RegionSelectorLUT.cxx:60
PathResolver.h
RegSelectorHashMap::phiCondition
void phiCondition(const std::vector< IdentifierHash > &identifier, int i, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, double etamin, double etamax, std::set< IdentifierHash > *outset) const
Definition: RegSelectorHashMap.cxx:462
RegSelectorHashMap::regionSelectorRobIdUint
void regionSelectorRobIdUint(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outRobIDList) const
Definition: RegSelectorHashMap.cxx:215
RegSelectorHashMap::verifyOutput
void verifyOutput(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > *outputIdlist) const
Definition: RegSelectorHashMap.cxx:850
RegionSelectorLUT::layerDiskNumber
int layerDiskNumber(int hashId) const
Definition: RegionSelectorLUT.cxx:36
RegSelectorHashMap::robIdOut
const std::vector< std::vector< uint32_t > > & robIdOut(void) const
Definition: RegSelectorHashMap.cxx:90
RegSelectorHashMap::phiMaxOut
const std::vector< double > & phiMaxOut(void) const
Definition: RegSelectorHashMap.cxx:114
RegSelectorHashMap::mountDataStruct
void mountDataStruct(void)
Definition: RegSelectorHashMap.cxx:118
RegionSelectorLUT::etaMax
double etaMax(int hashId) const
Definition: RegionSelectorLUT.cxx:44
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
RegSelectorHashMap::read
StatusCode read(const char *filename)
Definition: RegSelectorHashMap.cxx:554
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
RegSelectorHashMap::initMatrix
void initMatrix(void)
Definition: RegSelectorHashMap.cxx:263
zebraShift.outList
list outList
Definition: zebraShift.py:103
IRoiDescriptor::isFullscan
virtual bool isFullscan() const =0
is this a full detector RoI?
RegSelectorHashMap.h
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
compute_lumi.fin
fin
Definition: compute_lumi.py:19
RegSelectorHashMap::regionSelector
void regionSelector(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > &outList) const
Definition: RegSelectorHashMap.cxx:530
RegSelectorHashMap::phiConditionRobId
void phiConditionRobId(const std::vector< std::vector< uint32_t > > &identifier, int i, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, double etamin, double etamax, std::set< uint32_t > *outset) const
Definition: RegSelectorHashMap.cxx:496
RegSelectorHashMap::m_NumSamples
int m_NumSamples
Definition: RegSelectorHashMap.h:139
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
RegSelectorHashMap::MyRound
int MyRound(double pdValue)
Definition: RegSelectorHashMap.cxx:291
INITHASH
#define INITHASH
Definition: RegSelectorHashMap.h:24
RegionSelectorLUT::hashId
int hashId(int value) const
Definition: RegionSelectorLUT.cxx:64
RegionSelectorLUT
Definition: RegionSelectorLUT.h:14
RegSelectorHashMap::summaryDataFile
void summaryDataFile(std::list< RegSelectorMapElement > &dataList)
Definition: RegSelectorHashMap.cxx:675
fitman.k
k
Definition: fitman.py:528
RegSelectorHashMap::m_hashIDMap
std::vector< IdentifierHash > m_hashIDMap
Definition: RegSelectorHashMap.h:143
RegionSelectorLUT::phiMin
double phiMin(int hashId) const
Definition: RegionSelectorLUT.cxx:48