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