ATLAS Offline Software
Public Member Functions | Protected Types | Protected Member Functions | Static Protected 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)
 

Protected Types

template<typename C , typename T >
using handler = void(C::*)(const IRoiDescriptor &, std::vector< T > &) const
 
template<typename C , typename T >
using handler_layer = void(C::*)(long layer, const IRoiDescriptor &, std::vector< T > &) const
 

Protected Member Functions

virtual void HashIDList_internal (const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const
 internal implementation of the IRegSelUT interface More...
 
virtual void HashIDList_internal (long layer, const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const
 
virtual void ROBIDList_internal (const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const
 rob methods More...
 
virtual void ROBIDList_internal (long layer, const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const
 
template<typename C , typename T >
void IDList (const IRoiDescriptor &roi, std::vector< T > &idlist, handler< C, T > lister) const
 
template<typename C , typename T >
void IDList_layer (long layer, const IRoiDescriptor &roi, std::vector< T > &idlist, handler_layer< C, T > lister) const
 

Static Protected Member Functions

template<typename T >
static void removeDuplicates (std::vector< T > &vec)
 useful for removing duplicates if required ... More...
 

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.

Member Typedef Documentation

◆ handler

template<typename C , typename T >
using IRegSelLUT::handler = void (C::*)(const IRoiDescriptor& , std::vector<T>& ) const
protectedinherited

Definition at line 85 of file IRegSelLUT.h.

◆ handler_layer

template<typename C , typename T >
using IRegSelLUT::handler_layer = void (C::*)(long layer, const IRoiDescriptor& , std::vector<T>& ) const
protectedinherited

Definition at line 103 of file IRegSelLUT.h.

Constructor & Destructor Documentation

◆ ~RegSelectorHashMap()

virtual RegSelectorHashMap::~RegSelectorHashMap ( )
overridevirtualdefault

Member Function Documentation

◆ addLut()

void RegSelectorHashMap::addLut ( const RegionSelectorLUT detLut)

Definition at line 611 of file RegSelectorHashMap.cxx.

611  {
612  // unsigned int j;
613 
614  initvar();
615  std::vector<uint32_t> robId_cpy;
616 
617  // If not readFromFile detLut->maxHash() != 0
618  m_readFromFile = (detLut->maxHash() == 0);
619  // Assuming that we can have up to 2 ROBs for a given TT
620  double etamin(-999.0), etamax(-999.0), phimin(-999.0), phimax(-999.0);
621  int samp(999), layer(999);
622  int hash(999);
623  int tablesize = detLut->maxHash();
624  m_hashId.reserve(tablesize);
625  m_robId.reserve(tablesize);
626  m_etamin.reserve(tablesize);
627  m_etamax.reserve(tablesize);
628  m_phimin.reserve(tablesize);
629  m_phimax.reserve(tablesize);
630  m_layer.reserve(tablesize);
631  m_sample.reserve(tablesize);
632 
633  for( int j=0; j<tablesize; ++j){
634  if ( detLut->hashId(j)==hash && detLut->sampling(j)==samp &&
635  detLut->etaMin(j)==etamin && detLut->etaMax(j) == etamax &&
636  detLut->phiMin(j)==phimin && detLut->phiMax(j) == phimax &&
637  detLut->layerDiskNumber(j) == layer ){
638  robId_cpy.push_back(detLut->robId(j));
639  writeLine(detLut->layerDiskNumber(j),
640  detLut->hashId(j),
641  robId_cpy,
642  detLut->etaMin(j),
643  detLut->etaMax(j),
644  detLut->phiMin(j),
645  detLut->phiMax(j),
646  detLut->sampling(j));
647  ++j;
648  } else { // Write previous line
649  if ( j!= 0 )
650  writeLine(layer,hash,robId_cpy,etamin,etamax,phimin,phimax,samp);
651  }
652  robId_cpy.clear();
653  robId_cpy.push_back(detLut->robId(j));
654  hash=detLut->hashId(j); samp=detLut->sampling(j);
655  etamin=detLut->etaMin(j); etamax=detLut->etaMax(j);
656  phimin=detLut->phiMin(j); phimax=detLut->phiMax(j);
657  layer=detLut->layerDiskNumber(j);
658  // After prossessing need to update global vars
659  double stepPhi = std::fabs(phimax-phimin);// initial value for phi and eta step
660  double stepEta = std::fabs(etamin-etamax);
664  m_phiminDet = std::min(std::min(m_phiminDet,phimin),phimax);
666  m_phimaxDet = std::max(std::max(m_phimaxDet,phimax),phimin);
668  }
669  // Shall not forget to save last one
670  // Assuming last line is NOT a 2 ROB/TT case
671  writeLine(layer,hash,robId_cpy,etamin,etamax,phimin,phimax,samp);
672 
673 }

◆ DisableMissingROBs()

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

Definition at line 1029 of file RegSelectorHashMap.cxx.

1029  {
1030  for(size_t i=0;i<vec.size();++i){
1031  for(size_t j=0;j<m_robIDMap.size();++j){
1032  for(size_t k=0;k<m_robIDMap[j].size();++k){
1033  if ( vec[i] == m_robIDMap[j][k] )
1034  m_robIDMap[j][k] = INITHASH;
1035  }
1036  }
1037  }
1038 }

◆ etaMaxOut()

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

Definition at line 106 of file RegSelectorHashMap.cxx.

106  {
107  return m_etamax;
108 }

◆ etamaxValue()

double RegSelectorHashMap::etamaxValue ( ) const

Definition at line 74 of file RegSelectorHashMap.cxx.

74  {
75  return m_etamaxDet;
76 }

◆ etaMinOut()

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

Definition at line 102 of file RegSelectorHashMap.cxx.

102  {
103  return m_etamin;
104 }

◆ etaminValue()

double RegSelectorHashMap::etaminValue ( ) const

rest of the class implementation

Definition at line 70 of file RegSelectorHashMap.cxx.

70  {
71  return m_etaminDet;
72 }

◆ 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 971 of file RegSelectorHashMap.cxx.

974  {
975  int xEta, yPhi, iPosition;
976 
977  for(xEta= iXBeg; xEta < iXEnd; ++xEta){
978  for(yPhi=iYBeg; yPhi < iYEnd; ++yPhi){
979  iPosition = iPage + (yPhi* m_iColumns + xEta);
980  if(m_hashIDMap[iPosition] != INITHASH){
981  auxsetIH.push_back(m_hashIDMap[iPosition]);
982  }
983  }
984  }
985 
986  if(auxsetIH.size()!=0){
987  sort(auxsetIH.begin(),auxsetIH.end());
988  auxsetIH.erase(unique(auxsetIH.begin(),auxsetIH.end()),auxsetIH.end());
989  }
990 
991 }

◆ 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 993 of file RegSelectorHashMap.cxx.

996  {
997  int xEta, yPhi, iPosition;
998  unsigned int i,size_rod;
999 
1000  for(xEta= iXBeg; xEta < iXEnd; ++xEta){
1001  for(yPhi=iYBeg; yPhi < iYEnd; ++yPhi){
1002  iPosition = iPage + (yPhi* m_iColumns + xEta);
1003  size_rod=m_robIDMap[iPosition].size();
1004  for(i=0; i < size_rod; ++i)
1005  if ( m_robIDMap[iPosition][i] != INITHASH )
1006  auxset.push_back(m_robIDMap[iPosition][i]);
1007  }
1008  }
1009 
1010  if(auxset.size()!=0){
1011  sort(auxset.begin(),auxset.end());
1012  auxset.erase(unique(auxset.begin(),auxset.end()),auxset.end());
1013  }
1014 
1015 }

◆ getEtaPhi()

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

Definition at line 1019 of file RegSelectorHashMap.cxx.

1021  {
1022 
1023  (*etaMin) = m_etamin[hashId];
1024  (*etaMax) = m_etamax[hashId];
1025  (*phiMin) = m_phimin[hashId];
1026  (*phiMax) = m_phimax[hashId];
1027 }

◆ 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

hash id methods

Implements IRegSelLUT.

Definition at line 20 of file RegSelectorHashMap.cxx.

20  {
21  IRegSelLUT::IDList<RegSelectorHashMap>( roi, idlist, &RegSelectorHashMap::HashIDList_internal );
22 }

◆ 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 24 of file RegSelectorHashMap.cxx.

24  {;
25  IRegSelLUT::IDList_layer<RegSelectorHashMap>( layer, roi, idlist, &RegSelectorHashMap::HashIDList_internal );
26 }

◆ HashIDList_internal() [1/2]

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

internal implementation of the IRegSelUT interface

implementation of the IRegSelUT interface

hash id methods

Definition at line 44 of file RegSelectorHashMap.cxx.

44  {
45  if ( roi.isFullscan() ) regionSelector( -4.8, 4.8, -M_PI, M_PI, idlist );
46  regionSelector( roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), idlist);
47 }

◆ HashIDList_internal() [2/2]

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

Definition at line 49 of file RegSelectorHashMap.cxx.

49  {
50  if ( roi.isFullscan() ) regionSelector( layer, -4.8, 4.8, -M_PI, M_PI, idlist );
51  regionSelector( layer, roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), idlist);
52 }

◆ hashIdOut()

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

Definition at line 86 of file RegSelectorHashMap.cxx.

86  {
87  return m_hashId;
88 }

◆ IDList()

template<typename C , typename T >
void IRegSelLUT::IDList ( const IRoiDescriptor roi,
std::vector< T > &  idlist,
handler< C, T >  lister 
) const
inlineprotectedinherited

Definition at line 88 of file IRegSelLUT.h.

88  {
89 
90  if ( roi.composite() ) {
91  idlist.clear();
92  for ( unsigned iroi=roi.size() ; iroi-- ; ) IDList<C>( *(roi.at(iroi)), idlist, lister );
93  if ( roi.size()>1 ) IRegSelLUT::removeDuplicates( idlist );
94  return;
95  }
96 
97  (dynamic_cast<const C*>(this)->*lister)( roi, idlist );
98 
99  }

◆ IDList_layer()

template<typename C , typename T >
void IRegSelLUT::IDList_layer ( long  layer,
const IRoiDescriptor roi,
std::vector< T > &  idlist,
handler_layer< C, T >  lister 
) const
inlineprotectedinherited

Definition at line 106 of file IRegSelLUT.h.

106  {
107 
108  if ( roi.composite() ) {
109  idlist.clear();
110  for ( unsigned iroi=roi.size() ; iroi-- ; ) IDList_layer<C>( layer, *(roi.at(iroi)), idlist, lister );
111  if ( roi.size()>1 ) IRegSelLUT::removeDuplicates( idlist );
112  return;
113  }
114 
115  (dynamic_cast<const C*>(this)->*lister)( layer, roi, idlist );
116 
117  }

◆ initMatrix()

void RegSelectorHashMap::initMatrix ( void  )
private

Definition at line 263 of file RegSelectorHashMap.cxx.

263  {
264  int k, iPage, iNumRanges;
265 
266  iNumRanges = m_NumSamples;
267 
268  for(k=0;k<=iNumRanges;++k){
269  iPage = k * (m_iColumns * m_iLines);
270  populateMatrix(iPage, INITHASH);
271  }
272 
273 }

◆ initvar()

void RegSelectorHashMap::initvar ( void  )

Definition at line 546 of file RegSelectorHashMap.cxx.

546  {
547  m_NumSamples = -1;
548  m_stepMinPhi = 99;
549  m_stepMinEta = 99;
550  m_etaminDet = m_phiminDet = 99;
551  m_etamaxDet = m_phimaxDet = -99;
552 }

◆ layerOut()

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

Definition at line 98 of file RegSelectorHashMap.cxx.

98  {
99  return m_layer;
100 }

◆ mountDataStruct()

void RegSelectorHashMap::mountDataStruct ( void  )

Definition at line 118 of file RegSelectorHashMap.cxx.

118  {
119  int iNumRanges, iRepeatOverX, iRepeatOverY, xEta, yPhi, k;
120  int iPage, iPosition, iXeta, iYphi; // , iNumSamples;
121  double dEtaMin=-999, dEtaMax=-999, dPhiMin= -999, dPhiMax = -999;
122 
125 
126  //Number of elements from the vectors (number of different ranges)
127  iNumRanges = m_sample.size();
128 
129  //Creates the m_NumSamples matrix"es"
130  // m_NumSamples*iColumns*iLines ->defines the matrix M page
131  // Yphi*iColumns+Xeta -> define the element M[X,Y]
132 
133  // initialize matrix
134  initMatrix();
135 
136  //Populates the matrix
137  for(k=0;k<iNumRanges;++k){
138  //Get the range values
139  dEtaMin = std::min(m_etamin[k],m_etamax[k]);
140  dEtaMax = std::max(m_etamin[k],m_etamax[k]);
141  dPhiMin = std::min(m_phimin[k],m_phimax[k]);
142  dPhiMax = std::max(m_phimin[k],m_phimax[k]);
143  //Guess how many times the hashID must be repeated on the X axis
144  iRepeatOverX = MyRound((dEtaMax-dEtaMin)/m_stepMinEta);
145  iRepeatOverX = std::abs(iRepeatOverX);
146  //Guess how many times the hashID must be repeated on the Y axis
147  iRepeatOverY = MyRound((dPhiMax-dPhiMin)/m_stepMinPhi);
148  iRepeatOverY = std::abs(iRepeatOverY);
149 
150  iPage = m_sample[k] * (m_iColumns * m_iLines);
151 
152  // initial position
153  iYphi = std::floor((dPhiMin - m_phiminDet+2e-6)/m_stepMinPhi);
154  for(yPhi=0;yPhi<iRepeatOverY;++yPhi){
155  iXeta = std::floor((dEtaMin - m_etaminDet)/m_stepMinEta);
156  for(xEta=0;xEta<iRepeatOverX;++xEta){
157  iPosition = iPage + (iYphi* m_iColumns +iXeta);
158  m_hashIDMap[iPosition] = m_hashId[k];
159  m_robIDMap[iPosition][0]=m_robId[k][0];
160  for(unsigned int i=1; i< m_robId[k].size();++i )
161  m_robIDMap[iPosition].push_back(m_robId[k][i]);
162  ++iXeta;
163  }
164  ++iYphi;
165  }
166  }
167 #ifdef REGSELDEBUG
168  for(k=0;k<iNumRanges;++k){
169  std::cout << "REGSELECTOR HASH TABLE " <<
170  m_phimin[k] << " " << m_phimax[k] << " " <<
171  m_etamin[k] << " " << m_etamax[k] << " " <<
172  m_sample[k] << " " << m_layer[k] << " " <<
173  m_hashId[k] << " 0x";
174  std::cout << std::hex;
175  for(unsigned int i=0;i<m_robId[k].size();++i)
176  std::cout << m_robId[k][i] << " ";
177  std::cout << std::dec;
178  std::cout << std::endl;
179  }
180  //Populates the matrix
181  for(k=0;k<iNumRanges;++k){
182  //Get the range values
183  dEtaMin = std::min(m_etamin[k],m_etamax[k]);
184  dEtaMax = std::max(m_etamin[k],m_etamax[k]);
185  dPhiMin = std::min(m_phimin[k],m_phimax[k]);
186  dPhiMax = std::max(m_phimin[k],m_phimax[k]);
187  iRepeatOverX = MyRound((dEtaMax-dEtaMin)/m_stepMinEta);
188  iRepeatOverX = std::abs(iRepeatOverX);
189  iRepeatOverY = MyRound((dPhiMax-dPhiMin)/m_stepMinPhi);
190  iRepeatOverY = std::abs(iRepeatOverY);
191  iPage = m_sample[k] * (m_iColumns * m_iLines);
192  // initial position
193  iYphi = std::floor((dPhiMin - m_phiminDet+2e-6)/m_stepMinPhi);
194  for(yPhi=0;yPhi<iRepeatOverY;++yPhi){
195  iXeta = std::floor((dEtaMin - m_etaminDet)/m_stepMinEta);
196  for(xEta=0;xEta<iRepeatOverX;++xEta){
197  iPosition = iPage + (iYphi* m_iColumns +iXeta);
198  std::cout << "REGSELECTOR MAPS " <<
199  iXeta << " " << iYphi << " " << iPosition << " " <<
200  m_hashIDMap[iPosition] << " ";
201  std::cout << std::hex;
202  for(unsigned int i=0; i<m_robIDMap[iPosition].size();++i)
203  std::cout << "0x" << m_robIDMap[iPosition][i] << " ";
204  std::cout << std::dec;
205  std::cout << std::endl;
206  ++iXeta;
207  }
208  ++iYphi;
209  }
210  }
211 #endif
212 
213 }

◆ MyRound()

int RegSelectorHashMap::MyRound ( double  pdValue)
private

Definition at line 291 of file RegSelectorHashMap.cxx.

291  {
292  double dFloor, dAux;
293  int iReturn;
294 
295  dFloor = std::floor(pdValue);
296  dAux = std::fabs(pdValue-dFloor);
297  if(dAux >= 0.5f)
298  iReturn = (int) (dFloor + 1);
299  else
300  iReturn = (int) dFloor;
301 
302  return iReturn;
303 }

◆ 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 462 of file RegSelectorHashMap.cxx.

466  {
467  double phimin, phimax;
468  if(m_phimin[i] > m_phimax[i]){
469  phimin = m_phimin[i];
470  phimax = m_phimaxDet;
471 
472  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
473  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
474  (*outset).insert(identifier[i]);
475  }
476  }
477  phimin = m_phiminDet;
478  phimax = m_phimax[i];
479  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
480  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
481  (*outset).insert(identifier[i]);
482  }
483  }
484  }
485  else{
486  phimin = m_phimin[i]; phimax = m_phimax[i];
487  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
488  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
489  (*outset).insert(identifier[i]);
490  }
491  }
492  }
493 
494 }

◆ 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 496 of file RegSelectorHashMap.cxx.

500  {
501  double phimin, phimax;
502  if(m_phimin[i] > m_phimax[i]){
503  phimin = m_phimin[i];
504  phimax = m_phimaxDet;
505 
506  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
507  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
508  (*outset).insert(identifier[i][0]);
509  }
510  }
511  phimin = m_phiminDet;
512  phimax = m_phimax[i];
513  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
514  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
515  (*outset).insert(identifier[i][0]);
516  }
517  }
518  }
519  else{
520  phimin = m_phimin[i]; phimax = m_phimax[i];
521  if( (etaminIn <= etamax) && (etamaxIn >= etamin) ){
522  if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
523  (*outset).insert(identifier[i][0]);
524  }
525  }
526  }
527 
528 }

◆ phiMaxOut()

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

Definition at line 114 of file RegSelectorHashMap.cxx.

114  {
115  return m_phimax;
116 }

◆ phimaxValue()

double RegSelectorHashMap::phimaxValue ( ) const

Definition at line 82 of file RegSelectorHashMap.cxx.

82  {
83  return m_phimaxDet;
84 }

◆ phiMinOut()

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

Definition at line 110 of file RegSelectorHashMap.cxx.

110  {
111  return m_phimin;
112 }

◆ phiminValue()

double RegSelectorHashMap::phiminValue ( ) const

Definition at line 78 of file RegSelectorHashMap.cxx.

78  {
79  return m_phiminDet;
80 }

◆ populateMatrix()

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

Definition at line 227 of file RegSelectorHashMap.cxx.

227  {
228  int xEta,yPhi, iPosition;
229  int max_iPosition(0);
230  std::vector<uint32_t> tocreate(1);
231  IdentifierHash tocreateIH(value);
232 
233  for(xEta= 0; xEta < m_iColumns; ++xEta){
234  for(yPhi= 0; yPhi < m_iLines; ++yPhi){
235  iPosition = iPage + (yPhi* m_iColumns + xEta);
236  if(iPosition>max_iPosition) max_iPosition=iPosition;
237  }
238  }
239  m_hashIDMap.resize(max_iPosition+1,tocreateIH);
240  m_robIDMap.resize(max_iPosition+1,tocreate);
241  for(xEta= 0; xEta < m_iColumns; ++xEta){
242  for(yPhi= 0; yPhi < m_iLines; ++yPhi){
243  iPosition = iPage + (yPhi* m_iColumns + xEta);
244  m_robIDMap[iPosition].clear();
245  m_robIDMap[iPosition].push_back(value);
246  }
247  }
248 
249 }

◆ populateMatrixRobId()

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

Definition at line 251 of file RegSelectorHashMap.cxx.

251  {
252  int xEta,yPhi, iPosition;
253 
254  for(xEta= 0; xEta < m_iColumns; ++xEta){
255  for(yPhi= 0; yPhi < m_iLines; ++yPhi){
256  iPosition = iPage + (yPhi* m_iColumns + xEta);
257  m_robIDMap[iPosition].push_back(value);
258  }
259  }
260 
261 }

◆ read()

StatusCode RegSelectorHashMap::read ( const char *  filename)

Definition at line 554 of file RegSelectorHashMap.cxx.

554  {
555  StatusCode sc = StatusCode::SUCCESS;
556  char buffer_[256]; // only needs to be 128 long, but safety first!
557  char* buffer = buffer_;
558  int samp, layer;
559  unsigned int hashId;
560  double emin, emax, pmin, pmax;
561  double stepPhi, stepEta;
562  char robIdStr[12], robIdStr2[12];
563  char *pch;
564  std::vector<uint32_t> robId;
565  robId.push_back(0);
566 
567 // use path resolver to find full path to file
568  std::string unresolvedFileName(filename);
569  std::string fullFileName = PathResolver::find_file (unresolvedFileName, "DATAPATH");
570  if (fullFileName == "") {
571  std::cerr << "LArTTRegionSelectorIdentifierHash: FATAL: Could not find input file in DATAPATH" << unresolvedFileName<< std::endl;
572  return StatusCode::FAILURE;
573  }
574 
575  std::ifstream fin(fullFileName.c_str());
576  fin.getline(buffer,128,'\n');
577  if(fin.bad()){ //Test if the file failed:
578  sc = StatusCode::FAILURE;
579  return sc;
580  }
581  if (strncmp(buffer," TT-ID",6)==0){
582  fin.getline(buffer, 128, '\n');
583  do{
584  robId.clear();
585  pch = strchr(buffer,' ');
586  int test = sscanf(pch, " %u %d %d %lf %lf %lf %lf %11s %11s", // max 11 chars + null-byte
587  &hashId, &layer, &samp, &emin, &emax, &pmin, &pmax, robIdStr, robIdStr2);
588  robId.push_back(strtol(robIdStr,nullptr,16));
589  if ( test == 9 ) // this means that there are 2 ROBs in 1 TT
590  robId.push_back(strtol(robIdStr2,nullptr,16));
591  pch=strchr(buffer,' ');
592  stepPhi = std::fabs(pmax-pmin);// initial value for phi and eta step
593  stepEta = std::fabs(emin-emax);
601  writeLine(layer, (IdentifierHash) hashId, robId, emin, emax, pmin, pmax, samp);
602  // ++nlines;
603  }while((fin.getline(buffer, 128, '\n')));
604  }
605  // m_readFromFile = !( nlines == 0 );
606  fin.close();
607 
608  return sc;
609 }

◆ regionSelector() [1/2]

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

Definition at line 530 of file RegSelectorHashMap.cxx.

531  {
532  verifyInputs(etaminIn, etamaxIn, phiminIn, phimaxIn);
533  regionSelectorIN((int)-1, (double)etaminIn, (double)etamaxIn,
534  (double)phiminIn, (double)phimaxIn,&outList);
535 
536 }

◆ regionSelector() [2/2]

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

Definition at line 538 of file RegSelectorHashMap.cxx.

539  {
540  verifyInputs(etaminIn, etamaxIn, phiminIn, phimaxIn);
541  regionSelectorIN((int)sampling, (double)etaminIn, (double)etamaxIn,
542  (double)phiminIn, (double)phimaxIn,&outList);
543 
544 }

◆ 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 305 of file RegSelectorHashMap.cxx.

308  {
309  int iYBeg, iYEnd, iXBeg, iXEnd, k, iPage;
310  int iXTemp;
311  std::vector<IdentifierHash>& auxsetIH=(*outListIH);
312 
314  iYBeg = std::floor((phiminIn - m_phiminDet+7e-3)/m_stepMinPhi);
315  iYEnd = std::ceil((phimaxIn - m_phiminDet-7e-3)/m_stepMinPhi);
316 
317 
321  bool pi_boundary = false;
322  if ( phiminIn>phimaxIn ) pi_boundary = true;
323 
325  if(iYBeg < 0) iYBeg += m_iLines;
326  if(iYBeg > m_iLines) iYBeg -= m_iLines;
327  if(iYEnd < 0) iYEnd += m_iLines ;
328  if(iYEnd > m_iLines) iYEnd -= m_iLines;
329 
330 
332  iXBeg = std::floor((etaminIn - m_etaminDet+2e-5)/m_stepMinEta);
333  iXEnd = std::ceil((etamaxIn - m_etaminDet-2e-5)/m_stepMinEta);
334 
335  if(iXBeg < 0) iXBeg = 0;
336  if(iXBeg > m_iColumns) iXBeg = m_iColumns;
337  if(iXEnd < 0) iXEnd = 0;
338  if(iXEnd > m_iColumns) iXEnd = m_iColumns;
339 
340 
343  if(iXBeg > iXEnd){
344  iXTemp = iXBeg;
345  iXBeg = iXEnd;
346  iXEnd = iXTemp;
347  }
348  if(sampling == -1){ // Consider all samplings (0...3)
349  if( pi_boundary ){
350  for(k=0; k<=m_NumSamples; ++k){
351  iPage = k * (m_iColumns * m_iLines);
352  findIdentifier(auxsetIH, iXBeg, iXEnd, iYBeg, m_iLines, iPage);
353  }
354  for(k=0; k<=m_NumSamples; ++k){
355  iPage = k * (m_iColumns * m_iLines);
356  findIdentifier(auxsetIH, iXBeg, iXEnd, 0, iYEnd, iPage);
357  }
358  }
359  else{
360  for(k=0; k<=m_NumSamples; ++k){
361  iPage = k * (m_iColumns * m_iLines);
362  findIdentifier(auxsetIH,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
363  }
364  }
365  }
366  else{ // Consider only the input sampling value
367  k= sampling;
368  iPage = k * (m_iColumns * m_iLines);
369  if( pi_boundary ){
370  findIdentifier(auxsetIH,iXBeg, iXEnd, iYBeg, m_iLines, iPage);
371  findIdentifier(auxsetIH,iXBeg, iXEnd, 0, iYEnd, iPage);
372  }
373  else{
374  findIdentifier(auxsetIH,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
375  }
376  }
377 }

◆ 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 382 of file RegSelectorHashMap.cxx.

385  {
386  int iYBeg{}, iYEnd{}, iXBeg{}, iXEnd{}, k{}, iPage{};
387  int iXTemp{};
388  std::vector<uint32_t>& auxset=(*outList);
389 
392  if (m_stepMinPhi !=0){
393  //
394  iYBeg = std::floor((phiminIn - m_phiminDet+7e-3)/m_stepMinPhi);
395  iYEnd = std::ceil((phimaxIn - m_phiminDet-7e-3)/m_stepMinPhi);
396  }
397 
401  bool pi_boundary = false;
402  if ( phiminIn>phimaxIn ) pi_boundary = true;
403 
405  if(iYBeg < 0) iYBeg += m_iLines;
406  if(iYBeg > m_iLines) iYBeg -= m_iLines;
407  if(iYEnd < 0) iYEnd += m_iLines ;
408  if(iYEnd > m_iLines) iYEnd -= m_iLines;
410  if (m_stepMinEta!=0) {
411  iXBeg = std::floor((etaminIn - m_etaminDet+2e-5)/m_stepMinEta);
412  iXEnd = std::ceil((etamaxIn - m_etaminDet-2e-5)/m_stepMinEta);
413  }
414  if(iXBeg < 0) iXBeg = 0;
415  if(iXBeg > m_iColumns) iXBeg = m_iColumns;
416  if(iXEnd < 0) iXEnd = 0;
417  if(iXEnd > m_iColumns) iXEnd = m_iColumns;
418 
419 
422  if(iXBeg > iXEnd){
423  iXTemp = iXBeg;
424  iXBeg = iXEnd;
425  iXEnd = iXTemp;
426  }
427 
428  if(sampling == -1){ // Consider all samplings (0...3)
429 
430  if( pi_boundary ){
431  for(k=0; k<=m_NumSamples; ++k){
432  iPage = k * (m_iColumns * m_iLines);
433  findIdentifierROB(auxset, iXBeg, iXEnd, iYBeg, m_iLines,
434  iPage);
435  }
436  for(k=0; k<=m_NumSamples; ++k){
437  iPage = k * (m_iColumns * m_iLines);
438  findIdentifierROB(auxset, iXBeg, iXEnd, 0, iYEnd, iPage);
439  }
440  }
441  else{
442  for(k=0; k<=m_NumSamples; ++k){
443  iPage = k * (m_iColumns * m_iLines);
444  findIdentifierROB(auxset,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
445  }
446  }
447  }
448  else{ // Consider only the input sampling value
449 
450  k= sampling;
451  iPage = k * (m_iColumns * m_iLines);
452  if( pi_boundary ){
453  findIdentifierROB(auxset,iXBeg, iXEnd, iYBeg, m_iLines, iPage);
454  findIdentifierROB(auxset,iXBeg, iXEnd, 0, iYEnd, iPage);
455  }
456  else{
457  findIdentifierROB(auxset,iXBeg, iXEnd, iYBeg, iYEnd, iPage);
458  }
459  }
460 }

◆ regionSelectorRobIdUint() [1/2]

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

Definition at line 215 of file RegSelectorHashMap.cxx.

217  {
218  regionSelectorINROB(-1, etaminIn, etamaxIn, phiminIn, phimaxIn,&outList);
219 }

◆ 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 221 of file RegSelectorHashMap.cxx.

223  {
224  regionSelectorINROB(sampling, etaminIn, etamaxIn, phiminIn, phimaxIn, &outList);
225 }

◆ removeDuplicates()

template<typename T >
static void IRegSelLUT::removeDuplicates ( std::vector< T > &  vec)
inlinestaticprotectedinherited

useful for removing duplicates if required ...

Definition at line 78 of file IRegSelLUT.h.

78  {
79  std::sort(vec.begin(), vec.end());
80  vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
81  }

◆ ROBIDList() [1/2]

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

rob methods

Rob identifier methods

Implements IRegSelLUT.

Definition at line 30 of file RegSelectorHashMap.cxx.

30  {
31  IRegSelLUT::IDList<RegSelectorHashMap>( roi, roblist, &RegSelectorHashMap::ROBIDList_internal );
32 }

◆ 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 34 of file RegSelectorHashMap.cxx.

34  {
35  IRegSelLUT::IDList_layer<RegSelectorHashMap>( layer, roi, roblist, &RegSelectorHashMap::ROBIDList_internal );
36 }

◆ ROBIDList_internal() [1/2]

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

rob methods

Definition at line 56 of file RegSelectorHashMap.cxx.

56  {
57  if ( roi.isFullscan() ) regionSelectorRobIdUint( -4.8, 4.8, -M_PI, M_PI, roblist );
58  regionSelectorRobIdUint( roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), roblist);
59 }

◆ ROBIDList_internal() [2/2]

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

Definition at line 61 of file RegSelectorHashMap.cxx.

61  {
62  if ( roi.isFullscan() ) regionSelectorRobIdUint( layer, -4.8, 4.8, -M_PI, M_PI, roblist );
63  regionSelectorRobIdUint( layer, roi.etaMinus(), roi.etaPlus(), roi.phiMinus(), roi.phiPlus(), roblist);
64 }

◆ robIdOut()

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

Definition at line 90 of file RegSelectorHashMap.cxx.

90  {
91  return m_robId;
92 }

◆ sampleOut()

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

Definition at line 94 of file RegSelectorHashMap.cxx.

94  {
95  return m_sample;
96 }

◆ summaryDataFile()

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

Definition at line 675 of file RegSelectorHashMap.cxx.

675  {
676  for(std::list<RegSelectorMapElement>::iterator it = dataList.begin();
677  it != dataList.end(); ++it){ // runs through entire list
678  std::cout << "position: " << (*it).layerDiskPosition() << " number: " << (*it).layerDiskNumber() << std::endl;
679  std::cout << "etamin: " << m_etaminDet << " etamax: " << m_etamaxDet << std::endl;
680  std::cout << "phimin: " << m_phiminDet << " phimax: " << m_phimaxDet << std::endl;
681  std::cout << "hashId: ";
682  std::vector<IdentifierHash> aux = (*it).hashId();
683  for(std::vector<IdentifierHash>::iterator i = aux.begin(); i != aux.end(); ++i)
684  std::cout << (*i) << " ";
685  std::cout << std::endl;
686  std::cin.get();
687  }
688 }

◆ verifyInputs()

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

Definition at line 690 of file RegSelectorHashMap.cxx.

691  {
692 
693  if ( m_readFromFile ) { // Files still 0 <-> 2pi
694  while (phiminIn > 2*M_PI ) phiminIn -= 2*M_PI;
695  while (phiminIn < 0 ) phiminIn += 2*M_PI;
696  while (phimaxIn > 2*M_PI ) phimaxIn -= 2*M_PI;
697  while (phimaxIn < 0 ) phimaxIn += 2*M_PI;
698  } else { // SG maps -pi <-> pi
699  while (phiminIn > M_PI ) phiminIn -= 2*M_PI;
700  while (phiminIn < -M_PI ) phiminIn += 2*M_PI;
701  while (phimaxIn > M_PI ) phimaxIn -= 2*M_PI;
702  while (phimaxIn < -M_PI ) phimaxIn += 2*M_PI;
703  }
704 
705  if( ( (etaminIn < m_etaminDet) && (etamaxIn < m_etaminDet) ) ||
706  ( (etaminIn > m_etamaxDet) && (etamaxIn > m_etamaxDet) ) ){
707  //sc = StatusCode::FAILURE;
708  }
709  else{
710  if( (etaminIn < m_etaminDet) && (etamaxIn > m_etaminDet) ){
711  etaminIn = m_etaminDet;
712  }
713  if( (etamaxIn > m_etamaxDet) && (etaminIn < m_etamaxDet) ){
714  etamaxIn = m_etamaxDet;
715  }
716  }
717 }

◆ verifyOutput() [1/2]

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

Definition at line 850 of file RegSelectorHashMap.cxx.

852  {
853  int i;
854  std::set<IdentifierHash> myset;
855  std::vector<IdentifierHash> outset;
856  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
857  int vecsize = m_sample.size();
858 
859  if(etaminIn > etamaxIn){
860  etatmp = etamaxIn;
861  etamaxIn = etaminIn;
862  etaminIn = etatmp;
863  }
864 
865  phimintmp = phiminIn;
866  phimaxtmp = phimaxIn;
867 
868  for(i= 0; i < vecsize; ++i){
869  if(m_etamin[i] > m_etamax[i]){
870  etamin = m_etamax[i]; etamax = m_etamin[i];
871  }
872  else{
873  etamin = m_etamin[i]; etamax = m_etamax[i];
874  }
875  if(phiminIn > phimaxIn ){
876  phimaxIn = m_phimaxDet;
877  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
878  phiminIn = m_phiminDet;
879  phimaxIn = phimaxtmp;
880  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
881  }
882  else{
883  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
884  }
885  phiminIn = phimintmp; phimaxIn = phimaxtmp;
886  }
887 
889  for(it = myset.begin(); it!= myset.end(); ++it){
890  outset.push_back(*it);
891  }
892 
893  if(outset == (*outputIdlist) ){
894  std::cout << "equal vectors " << std::endl;
895  }
896  else {
897  std::cout << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
898  std::cout << "desired output ";
899  for(unsigned int i=0; i < outset.size(); ++i)
900  std::cout << std::dec << outset[i] << " ";
901  std::cout << std::endl;
902  std::cout << "obtained output ";
903  for(unsigned int i=0; i < (*outputIdlist).size(); ++i)
904  std::cout << std::dec << (*outputIdlist)[i] << " ";
905  std::cout << std::endl;
906  }
907 }

◆ verifyOutput() [2/2]

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

Definition at line 909 of file RegSelectorHashMap.cxx.

911  {
912  int i;
913  std::set<IdentifierHash> myset;
914  std::vector<IdentifierHash> outset;
915  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
916  int vecsize = m_sample.size();
917 
918  if(etaminIn > etamaxIn){
919  etatmp = etamaxIn;
920  etamaxIn = etaminIn;
921  etaminIn = etatmp;
922  }
923 
924  phimintmp = phiminIn;
925  phimaxtmp = phimaxIn;
926 
927  for(i= 0; i < vecsize; ++i){
928  if( sampling == m_sample[i]){
929  if(m_etamin[i] > m_etamax[i]){
930  etamin = m_etamax[i]; etamax = m_etamin[i];
931  }
932  else{
933  etamin = m_etamin[i]; etamax = m_etamax[i];
934  }
935  if(phiminIn > phimaxIn ){
936  phimaxIn = m_phimaxDet;
937  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
938  phiminIn = m_phiminDet;
939  phimaxIn = phimaxtmp;
940  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
941  }
942  else{
943  phiCondition(m_hashId, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
944  }
945  }
946  phiminIn = phimintmp; phimaxIn = phimaxtmp;
947  }
948 
950  for(it = myset.begin(); it!= myset.end(); ++it){
951  outset.push_back(*it);
952  }
953 
954  if(outset == (*outputIdlist) ){
955  std::cout << "equal vectors " << std::endl;
956  }
957  else {
958  std::cout << "sampling " << sampling << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
959  std::cout << "desired output ";
960  for(unsigned int i=0; i < outset.size(); ++i)
961  std::cout << std::dec << outset[i] << " ";
962  std::cout << std::endl;
963  std::cout << "obtained output ";
964  for(unsigned int i=0; i < (*outputIdlist).size(); ++i)
965  std::cout << std::dec << (*outputIdlist)[i] << " ";
966  std::cout << std::endl;
967  std::cin.get();
968  }
969 }

◆ verifyROBIDOutput() [1/2]

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

Definition at line 719 of file RegSelectorHashMap.cxx.

721  {
722  int i;
723  std::set<uint32_t> myset;
724  std::vector<uint32_t> outset;
725  std::vector<std::vector<uint32_t> > identifier;
726  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
727  int vecsize = m_sample.size();
728 
730 
731  if(etaminIn > etamaxIn){
732  etatmp = etamaxIn;
733  etamaxIn = etaminIn;
734  etaminIn = etatmp;
735  }
736 
737  phimintmp = phiminIn;
738  phimaxtmp = phimaxIn;
739 
740  for(i= 0; i < vecsize; ++i){
741  if(m_etamin[i] > m_etamax[i]){
742  etamin = m_etamax[i]; etamax = m_etamin[i];
743  }
744  else{
745  etamin = m_etamin[i]; etamax = m_etamax[i];
746  }
747  if(phiminIn > phimaxIn ){
748  phimaxIn = m_phimaxDet;
749  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
750  phiminIn = m_phiminDet;
751  phimaxIn = phimaxtmp;
752  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
753  }
754  else{
755  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
756  }
757  phiminIn = phimintmp; phimaxIn = phimaxtmp;
758  }
759 
761  for(it = myset.begin(); it!= myset.end(); ++it){
762  outset.push_back(*it);
763  }
764 
765  if( (outset == outputIdlist) || (outputIdlist.size() >= outset.size()) ){
766  std::cout << "equal vectors " << std::endl;
767  }
768  else {
769  std::cout << "nonequal vectors " << std::endl;
770  std::cout << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
771  std::cout << "desired output ";
772  for(unsigned int i=0; i < outset.size(); ++i)
773  std::cout << std::dec << outset[i] << " ";
774  std::cout << std::endl;
775  std::cout << "obtained output ";
776  for(unsigned int i=0; i < outputIdlist.size(); ++i)
777  std::cout << std::dec << outputIdlist[i] << " ";
778  std::cout << std::endl;
779  std::cin.get();
780  }
781 }

◆ 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 783 of file RegSelectorHashMap.cxx.

786  {
787 
788  int i;
789  std::set<uint32_t> myset;
790  std::vector<std::vector<uint32_t> > identifier;
791  std::vector<uint32_t> outset;
792  double etamin, etamax, etatmp, phimintmp, phimaxtmp;
793  int vecsize = m_sample.size();
794 
796 
797  if(etaminIn > etamaxIn){
798  etatmp = etamaxIn;
799  etamaxIn = etaminIn;
800  etaminIn = etatmp;
801  }
802 
803  phimintmp = phiminIn;
804  phimaxtmp = phimaxIn;
805 
806  for(i= 0; i < vecsize; ++i){
807  if( sampling == m_sample[i]){
808  if(m_etamin[i] > m_etamax[i]){
809  etamin = m_etamax[i]; etamax = m_etamin[i];
810  }
811  else{
812  etamin = m_etamin[i]; etamax = m_etamax[i];
813  }
814  if(phiminIn > phimaxIn ){
815  phimaxIn = m_phimaxDet;
816  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
817  phiminIn = m_phiminDet;
818  phimaxIn = phimaxtmp;
819  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax, &myset);
820  }
821  else{
822  phiConditionRobId(identifier, i, etaminIn, etamaxIn, phiminIn, phimaxIn, etamin, etamax,&myset);
823  }
824  }
825  phiminIn = phimintmp; phimaxIn = phimaxtmp;
826  }
827 
829  for(it = myset.begin(); it!= myset.end(); ++it){
830  outset.push_back(*it);
831  }
832 
833  if(outset == outputIdlist){
834  std::cout << "equal vectors " << std::endl;
835  }
836  else {
837  std::cout << "sampling " << sampling << "eta(" << etaminIn << "," << etamaxIn << ") phi(" << phiminIn << "," << phimaxIn << ")" << std::endl;
838  std::cout << "desired output ";
839  for(unsigned int i=0; i < outset.size(); ++i)
840  std::cout << std::dec << outset[i] << " ";
841  std::cout << std::endl;
842  std::cout << "obtained output ";
843  for(unsigned int i=0; i < outputIdlist.size(); ++i)
844  std::cout << std::dec << outputIdlist[i] << " ";
845  std::cout << std::endl;
846  std::cin.get();
847  }
848 }

◆ 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 275 of file RegSelectorHashMap.cxx.

278  {
279 
280  m_hashId.push_back(hashId);
281  m_robId.push_back(robId);
282  m_etamin.push_back(emin);
283  m_etamax.push_back(emax);
284  m_phimin.push_back(pmin);
285  m_phimax.push_back(pmax);
286  m_layer.push_back(layer);
287  m_sample.push_back(samp);
288 
289 }

Member Data Documentation

◆ m_dataList

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

Definition at line 131 of file RegSelectorHashMap.h.

◆ m_etamax

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

Definition at line 134 of file RegSelectorHashMap.h.

◆ m_etamaxDet

double RegSelectorHashMap::m_etamaxDet {}
private

Definition at line 137 of file RegSelectorHashMap.h.

◆ m_etamin

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

Definition at line 134 of file RegSelectorHashMap.h.

◆ m_etaminDet

double RegSelectorHashMap::m_etaminDet {}
private

Definition at line 137 of file RegSelectorHashMap.h.

◆ m_hashId

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

Definition at line 133 of file RegSelectorHashMap.h.

◆ m_hashIDMap

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

Definition at line 143 of file RegSelectorHashMap.h.

◆ m_iColumns

int RegSelectorHashMap::m_iColumns {}
private

Definition at line 140 of file RegSelectorHashMap.h.

◆ m_iLines

int RegSelectorHashMap::m_iLines {}
private

Definition at line 140 of file RegSelectorHashMap.h.

◆ m_layer

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

Definition at line 132 of file RegSelectorHashMap.h.

◆ m_NumSamples

int RegSelectorHashMap::m_NumSamples {}
private

Definition at line 139 of file RegSelectorHashMap.h.

◆ m_phimax

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

Definition at line 135 of file RegSelectorHashMap.h.

◆ m_phimaxDet

double RegSelectorHashMap::m_phimaxDet {}
private

Definition at line 138 of file RegSelectorHashMap.h.

◆ m_phimin

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

Definition at line 135 of file RegSelectorHashMap.h.

◆ m_phiminDet

double RegSelectorHashMap::m_phiminDet {}
private

Definition at line 138 of file RegSelectorHashMap.h.

◆ m_readFromFile

bool RegSelectorHashMap::m_readFromFile {}
private

Definition at line 141 of file RegSelectorHashMap.h.

◆ m_robId

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

Definition at line 136 of file RegSelectorHashMap.h.

◆ m_robIDMap

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

Definition at line 142 of file RegSelectorHashMap.h.

◆ m_sample

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

Definition at line 132 of file RegSelectorHashMap.h.

◆ m_stepMinEta

double RegSelectorHashMap::m_stepMinEta {}
private

Definition at line 129 of file RegSelectorHashMap.h.

◆ m_stepMinPhi

double RegSelectorHashMap::m_stepMinPhi {}
private

Definition at line 129 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:133
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
RegSelectorHashMap::m_iColumns
int m_iColumns
Definition: RegSelectorHashMap.h:140
RegSelectorHashMap::m_phiminDet
double m_phiminDet
Definition: RegSelectorHashMap.h:138
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
RegSelectorHashMap::populateMatrix
void populateMatrix(int iPage, IdentifierHash value)
Definition: RegSelectorHashMap.cxx:227
RegSelectorHashMap::findIdentifierROB
void findIdentifierROB(std::vector< uint32_t > &auxset, const int iXBeg, const int iXEnd, const int iYBeg, const int iYEnd, const int iPage) const
Definition: RegSelectorHashMap.cxx:993
RegSelectorHashMap::ROBIDList_internal
virtual void ROBIDList_internal(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const
rob methods
Definition: RegSelectorHashMap.cxx:56
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
RegionSelectorLUT::sampling
int sampling(int hashId) const
Definition: RegionSelectorLUT.cxx:56
IRoiDescriptor::etaMinus
virtual double etaMinus() const =0
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
RegSelectorHashMap::m_phimaxDet
double m_phimaxDet
Definition: RegSelectorHashMap.h:138
RegSelectorHashMap::m_robId
std::vector< std::vector< uint32_t > > m_robId
Definition: RegSelectorHashMap.h:136
DMTest::C
C_v1 C
Definition: C.h:26
RegSelectorHashMap::regionSelectorIN
void regionSelectorIN(const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< IdentifierHash > *outListIH) const
Definition: RegSelectorHashMap.cxx:305
skel.it
it
Definition: skel.GENtoEVGEN.py:396
IRoiDescriptor::size
virtual unsigned size() const =0
number of constituents
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:971
RegSelectorHashMap::m_robIDMap
std::vector< std::vector< uint32_t > > m_robIDMap
Definition: RegSelectorHashMap.h:142
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:134
IRoiDescriptor::etaPlus
virtual double etaPlus() const =0
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
RegionSelectorLUT::etaMin
double etaMin(int hashId) const
Definition: RegionSelectorLUT.cxx:40
RegSelectorHashMap::m_etaminDet
double m_etaminDet
Definition: RegSelectorHashMap.h:137
RegSelectorHashMap::HashIDList_internal
virtual void HashIDList_internal(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const
internal implementation of the IRegSelUT interface
Definition: RegSelectorHashMap.cxx:44
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:140
RegSelectorHashMap::initvar
void initvar(void)
Definition: RegSelectorHashMap.cxx:546
RegionSelectorLUT::phiMax
double phiMax(int hashId) const
Definition: RegionSelectorLUT.cxx:52
RegSelectorHashMap::m_stepMinPhi
double m_stepMinPhi
Definition: RegSelectorHashMap.h:129
RegSelectorHashMap::m_phimax
std::vector< double > m_phimax
Definition: RegSelectorHashMap.h:135
RegSelectorHashMap::regionSelectorINROB
void regionSelectorINROB(const int &sampling, const double &etaminIn, const double &etamaxIn, const double &phiminIn, const double &phimaxIn, std::vector< uint32_t > *outList) const
Definition: RegSelectorHashMap.cxx:382
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:137
RegSelectorHashMap::m_stepMinEta
double m_stepMinEta
Definition: RegSelectorHashMap.h:129
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
RegSelectorHashMap::m_sample
std::vector< int > m_sample
Definition: RegSelectorHashMap.h:132
RegSelectorHashMap::writeLine
void writeLine(const int &layer, const IdentifierHash &hashId, const std::vector< uint32_t > &robId, const double &emin, const double &emax, const double &pmin, const double &pmax, const int &samp)
Definition: RegSelectorHashMap.cxx:275
RegSelectorHashMap::verifyInputs
void verifyInputs(double &etaminIn, double &etamaxIn, double &phiminIn, double &phimaxIn) const
Definition: RegSelectorHashMap.cxx:690
IRoiDescriptor::phiMinus
virtual double phiMinus() const =0
hist_file_dump.f
f
Definition: hist_file_dump.py:135
RegSelectorHashMap::m_etamin
std::vector< double > m_etamin
Definition: RegSelectorHashMap.h:134
RegSelectorHashMap::m_readFromFile
bool m_readFromFile
Definition: RegSelectorHashMap.h:141
RegSelectorHashMap::m_phimin
std::vector< double > m_phimin
Definition: RegSelectorHashMap.h:135
RegSelectorHashMap::m_layer
std::vector< int > m_layer
Definition: RegSelectorHashMap.h:132
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:462
RegSelectorHashMap::regionSelectorRobIdUint
void regionSelectorRobIdUint(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::vector< uint32_t > &outRobIDList) const
Definition: RegSelectorHashMap.cxx:215
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:263
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
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:530
RegSelectorHashMap::phiConditionRobId
void phiConditionRobId(const std::vector< std::vector< uint32_t > > &identifier, int i, double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, double etamin, double etamax, std::set< uint32_t > *outset) const
Definition: RegSelectorHashMap.cxx:496
RegSelectorHashMap::m_NumSamples
int m_NumSamples
Definition: RegSelectorHashMap.h:139
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
IRoiDescriptor::at
virtual const IRoiDescriptor * at(int i) const =0
find an RoiDescriptor constituent
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
RegSelectorHashMap::MyRound
int MyRound(double pdValue)
Definition: RegSelectorHashMap.cxx:291
IRegSelLUT::removeDuplicates
static void removeDuplicates(std::vector< T > &vec)
useful for removing duplicates if required ...
Definition: IRegSelLUT.h:78
INITHASH
#define INITHASH
Definition: RegSelectorHashMap.h:24
RegionSelectorLUT::hashId
int hashId(int value) const
Definition: RegionSelectorLUT.cxx:64
IRoiDescriptor::composite
virtual bool composite() const =0
Super RoI access methods.
fitman.k
k
Definition: fitman.py:528
RegSelectorHashMap::m_hashIDMap
std::vector< IdentifierHash > m_hashIDMap
Definition: RegSelectorHashMap.h:143
RegionSelectorLUT::phiMin
double phiMin(int hashId) const
Definition: RegionSelectorLUT.cxx:48