ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RegSelectorHashMap Class Reference

#include <RegSelectorHashMap.h>

Inheritance diagram for RegSelectorHashMap:
Collaboration diagram for RegSelectorHashMap:

Public Member Functions

virtual void HashIDList (const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
 implementation of the IRegSelUT interface More...
 
virtual void HashIDList (long layer, const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
 HashIDList interface declaration. return list of non-repeated IdentifierHash. More...
 
virtual void ROBIDList (const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
 rob methods More...
 
virtual void ROBIDList (long layer, const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
 ROBIDList interface declaration. This interface can be used by the ID subdetectors. A list of non-repeated ROBIDs (uint_32_t) is returned by a reference. More...
 
virtual ~RegSelectorHashMap () override=default
 
double etaminValue () const
 rest of the class implementation More...
 
double etamaxValue () const
 
double phiminValue () const
 
double phimaxValue () const
 
const std::vector< double > & etaMinOut (void) const
 
const std::vector< double > & etaMaxOut (void) const
 
const std::vector< double > & phiMinOut (void) const
 
const std::vector< double > & phiMaxOut (void) const
 
void mountDataStruct (void)
 
const std::vector< IdentifierHash > & hashIdOut (void) const
 
const std::vector< std::vector< uint32_t > > & robIdOut (void) const
 
const std::vector< int > & sampleOut (void) const
 
const std::vector< int > & layerOut (void) const
 
void regionSelectorRobIdUint (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outRobIDList) const
 
void regionSelectorRobIdUint (int sampling, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outRobIDList) const
 
void regionSelector (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > &outList) const
 
void regionSelector (int sampling, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > &outList) const
 
void initvar (void)
 
StatusCode read (const char *filename)
 
void addLut (const RegionSelectorLUT *detLut)
 
void summaryDataFile (std::list< RegSelectorMapElement > &dataList)
 
void verifyInputs (double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn) const
 
void verifyROBIDOutput (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outputIdlist) const
 
void verifyROBIDOutput (int sampling, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outputIdlist) const
 
void verifyOutput (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > *outputIdlist) const
 
void verifyOutput (int sampling, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< IdentifierHash > *outputIdlist) const
 
void getEtaPhi (IdentifierHash hashId, double *etaMin, double *etaMax, double *phiMin, double *phiMax) const
 
void DisableMissingROBs (const std::vector< uint32_t > &vec)
 

Private Member Functions

void populateMatrix (int iPage, IdentifierHash value)
 
void populateMatrixRobId (int iPage, uint32_t value)
 
void initMatrix (void)
 
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)
 
int MyRound (double pdValue)
 
void regionSelectorIN (const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< IdentifierHash > *outListIH) const
 
void regionSelectorINROB (const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< uint32_t > *outList) const
 
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
 
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
 
void findIdentifier (std::vector< IdentifierHash > &auxsetIH, const int iXBeg, const int iXEnd, const int iYBeg, const int iYEnd, const int iPage) const
 
void findIdentifierROB (std::vector< uint32_t > &auxset, const int iXBeg, const int iXEnd, const int iYBeg, const int iYEnd, const int iPage) const
 

Private Attributes

double m_stepMinPhi {}
 
double m_stepMinEta {}
 
std::list< RegSelectorMapElementm_dataList
 
std::vector< int > m_sample
 
std::vector< int > m_layer
 
std::vector< IdentifierHashm_hashId
 
std::vector< double > m_etamin
 
std::vector< double > m_etamax
 
std::vector< double > m_phimin
 
std::vector< double > m_phimax
 
std::vector< std::vector< uint32_t > > m_robId
 
double m_etaminDet {}
 
double m_etamaxDet {}
 
double m_phiminDet {}
 
double m_phimaxDet {}
 
int m_NumSamples {}
 
int m_iColumns {}
 
int m_iLines {}
 
bool m_readFromFile {}
 
std::vector< std::vector< uint32_t > > m_robIDMap
 
std::vector< IdentifierHashm_hashIDMap
 

Detailed Description

Definition at line 40 of file RegSelectorHashMap.h.

Constructor & Destructor Documentation

◆ ~RegSelectorHashMap()

virtual RegSelectorHashMap::~RegSelectorHashMap ( )
overridevirtualdefault

Member Function Documentation

◆ addLut()

void RegSelectorHashMap::addLut ( const RegionSelectorLUT detLut)

Definition at line 588 of file RegSelectorHashMap.cxx.

588  {
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 }

◆ DisableMissingROBs()

void RegSelectorHashMap::DisableMissingROBs ( const std::vector< uint32_t > &  vec)

Definition at line 1006 of file RegSelectorHashMap.cxx.

1006  {
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 }

◆ etaMaxOut()

const std::vector< double > & RegSelectorHashMap::etaMaxOut ( void  ) const

Definition at line 83 of file RegSelectorHashMap.cxx.

83  {
84  return m_etamax;
85 }

◆ etamaxValue()

double RegSelectorHashMap::etamaxValue ( ) const

Definition at line 51 of file RegSelectorHashMap.cxx.

51  {
52  return m_etamaxDet;
53 }

◆ etaMinOut()

const std::vector< double > & RegSelectorHashMap::etaMinOut ( void  ) const

Definition at line 79 of file RegSelectorHashMap.cxx.

79  {
80  return m_etamin;
81 }

◆ etaminValue()

double RegSelectorHashMap::etaminValue ( ) const

rest of the class implementation

Definition at line 47 of file RegSelectorHashMap.cxx.

47  {
48  return m_etaminDet;
49 }

◆ findIdentifier()

void RegSelectorHashMap::findIdentifier ( std::vector< IdentifierHash > &  auxsetIH,
const int  iXBeg,
const int  iXEnd,
const int  iYBeg,
const int  iYEnd,
const int  iPage 
) const
private

Definition at line 948 of file RegSelectorHashMap.cxx.

951  {
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 }

◆ findIdentifierROB()

void RegSelectorHashMap::findIdentifierROB ( std::vector< uint32_t > &  auxset,
const int  iXBeg,
const int  iXEnd,
const int  iYBeg,
const int  iYEnd,
const int  iPage 
) const
private

Definition at line 970 of file RegSelectorHashMap.cxx.

973  {
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 }

◆ getEtaPhi()

void RegSelectorHashMap::getEtaPhi ( IdentifierHash  hashId,
double *  etaMin,
double *  etaMax,
double *  phiMin,
double *  phiMax 
) const

Definition at line 996 of file RegSelectorHashMap.cxx.

998  {
999 
1000  (*etaMin) = m_etamin[hashId];
1001  (*etaMax) = m_etamax[hashId];
1002  (*phiMin) = m_phimin[hashId];
1003  (*phiMax) = m_phimax[hashId];
1004 }

◆ HashIDList() [1/2]

void RegSelectorHashMap::HashIDList ( const IRoiDescriptor roi,
std::vector< IdentifierHash > &  idlist 
) const
overridevirtual

implementation of the IRegSelUT interface

implementation of the IRegSelUT interface

hash id methods

Implements IRegSelLUT.

Definition at line 21 of file RegSelectorHashMap.cxx.

21  {
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 }

◆ HashIDList() [2/2]

void RegSelectorHashMap::HashIDList ( long  layer,
const IRoiDescriptor roi,
std::vector< IdentifierHash > &  idlist 
) const
overridevirtual

HashIDList interface declaration. return list of non-repeated IdentifierHash.

Parameters
longlayer, long int to decide which layer within the detector.
IRoiDescriptorroi, the IRoiDescriptor for the roi, all enabled elements in the roi are found.
Returns
std::vector<IdentifierHash> which is a list of non-repeated Offline Identifier Hash numbers.

Implements IRegSelLUT.

Definition at line 26 of file RegSelectorHashMap.cxx.

26  {
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 }

◆ hashIdOut()

const std::vector< IdentifierHash > & RegSelectorHashMap::hashIdOut ( void  ) const

Definition at line 63 of file RegSelectorHashMap.cxx.

63  {
64  return m_hashId;
65 }

◆ initMatrix()

void RegSelectorHashMap::initMatrix ( void  )
private

Definition at line 240 of file RegSelectorHashMap.cxx.

240  {
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 }

◆ initvar()

void RegSelectorHashMap::initvar ( void  )

Definition at line 523 of file RegSelectorHashMap.cxx.

523  {
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 }

◆ layerOut()

const std::vector< int > & RegSelectorHashMap::layerOut ( void  ) const

Definition at line 75 of file RegSelectorHashMap.cxx.

75  {
76  return m_layer;
77 }

◆ mountDataStruct()

void RegSelectorHashMap::mountDataStruct ( void  )

Definition at line 95 of file RegSelectorHashMap.cxx.

95  {
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 }

◆ MyRound()

int RegSelectorHashMap::MyRound ( double  pdValue)
private

Definition at line 268 of file RegSelectorHashMap.cxx.

268  {
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 }

◆ phiCondition()

void RegSelectorHashMap::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
private

Definition at line 439 of file RegSelectorHashMap.cxx.

443  {
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 }

◆ phiConditionRobId()

void RegSelectorHashMap::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
private

Definition at line 473 of file RegSelectorHashMap.cxx.

477  {
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 }

◆ phiMaxOut()

const std::vector< double > & RegSelectorHashMap::phiMaxOut ( void  ) const

Definition at line 91 of file RegSelectorHashMap.cxx.

91  {
92  return m_phimax;
93 }

◆ phimaxValue()

double RegSelectorHashMap::phimaxValue ( ) const

Definition at line 59 of file RegSelectorHashMap.cxx.

59  {
60  return m_phimaxDet;
61 }

◆ phiMinOut()

const std::vector< double > & RegSelectorHashMap::phiMinOut ( void  ) const

Definition at line 87 of file RegSelectorHashMap.cxx.

87  {
88  return m_phimin;
89 }

◆ phiminValue()

double RegSelectorHashMap::phiminValue ( ) const

Definition at line 55 of file RegSelectorHashMap.cxx.

55  {
56  return m_phiminDet;
57 }

◆ populateMatrix()

void RegSelectorHashMap::populateMatrix ( int  iPage,
IdentifierHash  value 
)
private

Definition at line 204 of file RegSelectorHashMap.cxx.

204  {
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 }

◆ populateMatrixRobId()

void RegSelectorHashMap::populateMatrixRobId ( int  iPage,
uint32_t  value 
)
private

Definition at line 228 of file RegSelectorHashMap.cxx.

228  {
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 }

◆ read()

StatusCode RegSelectorHashMap::read ( const char *  filename)

Definition at line 531 of file RegSelectorHashMap.cxx.

531  {
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 }

◆ regionSelector() [1/2]

void RegSelectorHashMap::regionSelector ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< IdentifierHash > &  outList 
) const

Definition at line 507 of file RegSelectorHashMap.cxx.

508  {
509  verifyInputs(etaminIn, etamaxIn, phiminIn, phimaxIn);
510  regionSelectorIN((int)-1, (double)etaminIn, (double)etamaxIn,
511  (double)phiminIn, (double)phimaxIn,&outList);
512 
513 }

◆ regionSelector() [2/2]

void RegSelectorHashMap::regionSelector ( int  sampling,
double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< IdentifierHash > &  outList 
) const

Definition at line 515 of file RegSelectorHashMap.cxx.

516  {
517  verifyInputs(etaminIn, etamaxIn, phiminIn, phimaxIn);
518  regionSelectorIN((int)sampling, (double)etaminIn, (double)etamaxIn,
519  (double)phiminIn, (double)phimaxIn,&outList);
520 
521 }

◆ regionSelectorIN()

void RegSelectorHashMap::regionSelectorIN ( const int &  sampling,
const double &  etaminIn,
const double &  etamaxIn,
const double &  phiminIn,
const double &  phimaxIn,
std::vector< IdentifierHash > *  outListIH 
) const
private

why are we making this

need to check whether spans the pi boundary - using iYBeg > iYEnd isn't good enough since it it is very nearly 2pi, then iYBeg and iYEnd will be equal

wrap phi

why reduce the RoI size?

This is WRONG!! this forces all rois to increase as the radius increases - oh dear

Definition at line 282 of file RegSelectorHashMap.cxx.

285  {
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 }

◆ regionSelectorINROB()

void RegSelectorHashMap::regionSelectorINROB ( const int &  sampling,
const double &  etaminIn,
const double &  etamaxIn,
const double &  phiminIn,
const double &  phimaxIn,
std::vector< uint32_t > *  outList 
) const
private

why do we reduce the size of the RoI here? if we must mess with it, shouldn't we make it larger?

need to check whether spans the pi boundary - using (iYBeg > iYEnd) isn't good enough since it it is very nearly 2pi, then iYBeg and iYEnd will be equal.

wrap phi

why reduce the size of the RoI?

This is WRONG!! this forces all rois to increase as the radius increases - oh dear

Definition at line 359 of file RegSelectorHashMap.cxx.

362  {
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 }

◆ regionSelectorRobIdUint() [1/2]

void RegSelectorHashMap::regionSelectorRobIdUint ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< uint32_t > &  outRobIDList 
) const

Definition at line 192 of file RegSelectorHashMap.cxx.

194  {
195  regionSelectorINROB(-1, etaminIn, etamaxIn, phiminIn, phimaxIn,&outList);
196 }

◆ regionSelectorRobIdUint() [2/2]

void RegSelectorHashMap::regionSelectorRobIdUint ( int  sampling,
double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< uint32_t > &  outRobIDList 
) const

Definition at line 198 of file RegSelectorHashMap.cxx.

200  {
201  regionSelectorINROB(sampling, etaminIn, etamaxIn, phiminIn, phimaxIn, &outList);
202 }

◆ ROBIDList() [1/2]

void RegSelectorHashMap::ROBIDList ( const IRoiDescriptor roi,
std::vector< uint32_t > &  roblist 
) const
overridevirtual

rob methods

Implements IRegSelLUT.

Definition at line 33 of file RegSelectorHashMap.cxx.

33  {
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 }

◆ ROBIDList() [2/2]

void RegSelectorHashMap::ROBIDList ( long  layer,
const IRoiDescriptor roi,
std::vector< uint32_t > &  roblist 
) const
overridevirtual

ROBIDList interface declaration. This interface can be used by the ID subdetectors. A list of non-repeated ROBIDs (uint_32_t) is returned by a reference.

Parameters
longlayer, long int to decide which layer within the detector.
IRoiDescriptorthe IRoiDescriptor for the roi, all enabled elements in the roi are found.
Returns
std::vector<uint32_t> which is a list of non-repeated ROBID numbers.

Implements IRegSelLUT.

Definition at line 38 of file RegSelectorHashMap.cxx.

38  {
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 }

◆ robIdOut()

const std::vector< std::vector< uint32_t > > & RegSelectorHashMap::robIdOut ( void  ) const

Definition at line 67 of file RegSelectorHashMap.cxx.

67  {
68  return m_robId;
69 }

◆ sampleOut()

const std::vector< int > & RegSelectorHashMap::sampleOut ( void  ) const

Definition at line 71 of file RegSelectorHashMap.cxx.

71  {
72  return m_sample;
73 }

◆ summaryDataFile()

void RegSelectorHashMap::summaryDataFile ( std::list< RegSelectorMapElement > &  dataList)

Definition at line 652 of file RegSelectorHashMap.cxx.

652  {
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 }

◆ verifyInputs()

void RegSelectorHashMap::verifyInputs ( double &  etaminIn,
double &  etamaxIn,
double &  phiminIn,
double &  phimaxIn 
) const

Definition at line 667 of file RegSelectorHashMap.cxx.

668  {
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 }

◆ verifyOutput() [1/2]

void RegSelectorHashMap::verifyOutput ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< IdentifierHash > *  outputIdlist 
) const

Definition at line 827 of file RegSelectorHashMap.cxx.

829  {
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 }

◆ verifyOutput() [2/2]

void RegSelectorHashMap::verifyOutput ( int  sampling,
double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< IdentifierHash > *  outputIdlist 
) const

Definition at line 886 of file RegSelectorHashMap.cxx.

888  {
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 }

◆ verifyROBIDOutput() [1/2]

void RegSelectorHashMap::verifyROBIDOutput ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< uint32_t > &  outputIdlist 
) const

Definition at line 696 of file RegSelectorHashMap.cxx.

698  {
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 }

◆ verifyROBIDOutput() [2/2]

void RegSelectorHashMap::verifyROBIDOutput ( int  sampling,
double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::vector< uint32_t > &  outputIdlist 
) const

Definition at line 760 of file RegSelectorHashMap.cxx.

763  {
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 }

◆ writeLine()

void RegSelectorHashMap::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 
)
private

Definition at line 252 of file RegSelectorHashMap.cxx.

255  {
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 }

Member Data Documentation

◆ m_dataList

std::list<RegSelectorMapElement> RegSelectorHashMap::m_dataList
private

Definition at line 130 of file RegSelectorHashMap.h.

◆ m_etamax

std::vector<double> RegSelectorHashMap::m_etamax
private

Definition at line 133 of file RegSelectorHashMap.h.

◆ m_etamaxDet

double RegSelectorHashMap::m_etamaxDet {}
private

Definition at line 136 of file RegSelectorHashMap.h.

◆ m_etamin

std::vector<double> RegSelectorHashMap::m_etamin
private

Definition at line 133 of file RegSelectorHashMap.h.

◆ m_etaminDet

double RegSelectorHashMap::m_etaminDet {}
private

Definition at line 136 of file RegSelectorHashMap.h.

◆ m_hashId

std::vector<IdentifierHash> RegSelectorHashMap::m_hashId
private

Definition at line 132 of file RegSelectorHashMap.h.

◆ m_hashIDMap

std::vector<IdentifierHash> RegSelectorHashMap::m_hashIDMap
private

Definition at line 142 of file RegSelectorHashMap.h.

◆ m_iColumns

int RegSelectorHashMap::m_iColumns {}
private

Definition at line 139 of file RegSelectorHashMap.h.

◆ m_iLines

int RegSelectorHashMap::m_iLines {}
private

Definition at line 139 of file RegSelectorHashMap.h.

◆ m_layer

std::vector<int> RegSelectorHashMap::m_layer
private

Definition at line 131 of file RegSelectorHashMap.h.

◆ m_NumSamples

int RegSelectorHashMap::m_NumSamples {}
private

Definition at line 138 of file RegSelectorHashMap.h.

◆ m_phimax

std::vector<double> RegSelectorHashMap::m_phimax
private

Definition at line 134 of file RegSelectorHashMap.h.

◆ m_phimaxDet

double RegSelectorHashMap::m_phimaxDet {}
private

Definition at line 137 of file RegSelectorHashMap.h.

◆ m_phimin

std::vector<double> RegSelectorHashMap::m_phimin
private

Definition at line 134 of file RegSelectorHashMap.h.

◆ m_phiminDet

double RegSelectorHashMap::m_phiminDet {}
private

Definition at line 137 of file RegSelectorHashMap.h.

◆ m_readFromFile

bool RegSelectorHashMap::m_readFromFile {}
private

Definition at line 140 of file RegSelectorHashMap.h.

◆ m_robId

std::vector<std::vector<uint32_t> > RegSelectorHashMap::m_robId
private

Definition at line 135 of file RegSelectorHashMap.h.

◆ m_robIDMap

std::vector<std::vector<uint32_t> > RegSelectorHashMap::m_robIDMap
private

Definition at line 141 of file RegSelectorHashMap.h.

◆ m_sample

std::vector<int> RegSelectorHashMap::m_sample
private

Definition at line 131 of file RegSelectorHashMap.h.

◆ m_stepMinEta

double RegSelectorHashMap::m_stepMinEta {}
private

Definition at line 128 of file RegSelectorHashMap.h.

◆ m_stepMinPhi

double RegSelectorHashMap::m_stepMinPhi {}
private

Definition at line 128 of file RegSelectorHashMap.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
RegSelectorHashMap::m_hashId
std::vector< IdentifierHash > m_hashId
Definition: RegSelectorHashMap.h:132
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
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
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
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::m_robId
std::vector< std::vector< uint32_t > > m_robId
Definition: RegSelectorHashMap.h:135
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
athena.value
value
Definition: athena.py:124
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
RegSelectorHashMap::m_robIDMap
std::vector< std::vector< uint32_t > > m_robIDMap
Definition: RegSelectorHashMap.h:141
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
RegionSelectorLUT::maxHash
unsigned int maxHash(void) const
Definition: RegionSelectorLUT.cxx:68
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::m_etaminDet
double m_etaminDet
Definition: RegSelectorHashMap.h:136
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
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::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
createCoolChannelIdFile.buffer
buffer
Definition: createCoolChannelIdFile.py:12
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
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
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
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
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
RegionSelectorLUT::layerDiskNumber
int layerDiskNumber(int hashId) const
Definition: RegionSelectorLUT.cxx:36
RegionSelectorLUT::etaMax
double etaMax(int hashId) const
Definition: RegionSelectorLUT.cxx:44
std::unique
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.
Definition: DVL_algorithms.h:135
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?
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
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