ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RegSelSiLUT Class Reference

#include <RegSelSiLUT.h>

Inheritance diagram for RegSelSiLUT:
Collaboration diagram for RegSelSiLUT:

Public Types

enum  DET {
  UNDEF, PIXEL, SCT, TRT,
  FTK, MM, sTGC
}
 

Public Member Functions

 RegSelSiLUT ()
 
 RegSelSiLUT (DET id)
 
 RegSelSiLUT (const RegSelSiLUT &r)
 
 RegSelSiLUT (const std::string &s)
 
virtual ~RegSelSiLUT () override
 
virtual void HashIDList (const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
 implementation of the IRegSelUT interface
hash id methods
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...
 
void addModule (RegSelModule &module)
 
void addModules (const std::vector< RegSelModule > &m)
 
const std::vector< RegSelModule > & getModules () const
 
bool getRoIData (const RegSelRoI &r, std::vector< const RegSelModule * > &modules) const
 
bool getRoIData (const RegSelRoI &r, unsigned layer, std::vector< const RegSelModule * > &modules) const
 here if layer is of the format 1XYY where X=0 (barrel), X=2 (endcap) and YY is the layer within the sub-system then the specific layer in the sub-system is used. More...
 
bool getRoIData (const RegSelRoI &r, unsigned subdetector, unsigned layer, std::vector< const RegSelModule * > &modules) const
 
bool getRoIData (const RegSelRoI &r, std::vector< const RegSelModule * > &modules, double x, double y) const
 
bool getRoIData (const RegSelRoI &r, unsigned subdetector, unsigned layer, std::vector< const RegSelModule * > &modules, double x, double y) const
 
DET ID () const
 
void reset ()
 
void initialise ()
 
void initialiseDisabledModules ()
 
void initialiseFullScan ()
 
void write (std::ostream &s=std::cout) const
 
void write (const std::string &filename) const
 
bool read (std::istream &s)
 
bool read (const std::string &s)
 
const std::vector< RegSelSubDetector > & getSubDet () const
 
const RegSelModuleModule (const IdentifierHash &h) const
 
void getModules (unsigned layer, std::vector< const RegSelModule * > &modules) const
 here if layer is of the format 1XYY where X=0 (barrel), X=2 (endcap) and YY is the layer within the sub-system then the specific layer in the sub-system is used. More...
 
virtual void getHashList (const RegSelRoI &roi, std::vector< IdentifierHash > &hashlist) const
 
virtual void getHashList (const RegSelRoI &roi, std::vector< IdentifierHash > &hashlist, double x, double y) const
 
virtual void getHashList (const RegSelRoI &roi, unsigned layer, std::vector< IdentifierHash > &hashlist) const
 
virtual void getHashList (std::vector< IdentifierHash > &hashlist) const
 
virtual void getHashList (unsigned layer, std::vector< IdentifierHash > &hashlist) const
 
virtual void getRobList (const RegSelRoI &roi, unsigned layer, std::vector< uint32_t > &roblist, bool removeduplicates=true) const
 
virtual void getRobList (const RegSelRoI &roi, std::vector< uint32_t > &roblist, bool removeduplicates=true) const
 
virtual void getRobList (const RegSelRoI &roi, std::vector< uint32_t > &roblist, double x, double y) const
 
virtual void getRobList (std::vector< uint32_t > &roblist) const
 
virtual void getRobList (unsigned layer, std::vector< uint32_t > &roblist) const
 
virtual void getRobHashList (std::vector< uint32_t > &roblist, std::vector< IdentifierHash > &hashlist) const
 
virtual void getRobHashList (const RegSelRoI &roi, std::vector< uint32_t > &roblist, std::vector< IdentifierHash > &hashlist) const
 
virtual void getRobHashList (const RegSelRoI &roi, unsigned layer, std::vector< uint32_t > &roblist, std::vector< IdentifierHash > &hashlist) const
 
void getDisabledHashList (const RegSelRoI &roi, unsigned layer, std::vector< IdentifierHash > &hashlist) const
 
void getDisabledLayers (const RegSelRoI &roi, int subdetector, std::vector< int > &layers) const
 
void enableRobs ()
 
void disableRobs ()
 
void enableModules ()
 
void disableModules ()
 
void enableRobList (const std::vector< uint32_t > &roblist)
 
void disableRobList (const std::vector< uint32_t > &roblist)
 
void enableModuleList (const std::vector< IdentifierHash > &hashlist)
 
void disableModuleList (const std::vector< IdentifierHash > &hashlist)
 
void disableSubDetector (int id)
 
void enableSubDetector (int id)
 
void disableLayer (int id, unsigned layer)
 
void enableLayer (int id, unsigned layer)
 
void drawlayers (std::vector< const ZRObject * > &c) const
 
const std::string & getName () const
 

Static Public Member Functions

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

Protected Member Functions

virtual void construct ()
 

Protected Attributes

DET m_ID
 
std::vector< RegSelSubDetectorm_SubDet
 
std::vector< RegSelModulem_modules
 
std::vector< RegSelModule * > m_disabled
 
std::map< const IdentifierHash, const RegSelModule * > m_map
 
std::vector< IdentifierHashm_allHashes
 
std::vector< uint32_t > m_allROBids
 
std::map< int, int > m_idmap
 
std::string m_name
 

Detailed Description

Definition at line 41 of file RegSelSiLUT.h.

Member Enumeration Documentation

◆ DET

Enumerator
UNDEF 
PIXEL 
SCT 
TRT 
FTK 
MM 
sTGC 

Definition at line 45 of file RegSelSiLUT.h.

45 { UNDEF, PIXEL, SCT, TRT, FTK, MM, sTGC } DET;

Constructor & Destructor Documentation

◆ RegSelSiLUT() [1/4]

RegSelSiLUT::RegSelSiLUT ( )
inline

Definition at line 49 of file RegSelSiLUT.h.

49 : m_ID(UNDEF) { }

◆ RegSelSiLUT() [2/4]

RegSelSiLUT::RegSelSiLUT ( DET  id)

Definition at line 71 of file RegSelSiLUT.cxx.

71 : m_ID(id) { construct(); }

◆ RegSelSiLUT() [3/4]

RegSelSiLUT::RegSelSiLUT ( const RegSelSiLUT r)

Definition at line 73 of file RegSelSiLUT.cxx.

73  :
74  RegSelName(r.getName()), m_ID(r.ID()) {
75  construct();
76  addModules(r.getModules());
77  initialise();
78 }

◆ RegSelSiLUT() [4/4]

RegSelSiLUT::RegSelSiLUT ( const std::string &  s)

Definition at line 80 of file RegSelSiLUT.cxx.

80  :
81  m_ID(UNDEF) {
82  read(s);
83 }

◆ ~RegSelSiLUT()

virtual RegSelSiLUT::~RegSelSiLUT ( )
inlineoverridevirtual

Definition at line 54 of file RegSelSiLUT.h.

54 { }

Member Function Documentation

◆ addModule()

void RegSelSiLUT::addModule ( RegSelModule module)
inline

Definition at line 71 of file RegSelSiLUT.h.

71 { m_modules.push_back(module); }

◆ addModules()

void RegSelSiLUT::addModules ( const std::vector< RegSelModule > &  m)
inline

Definition at line 72 of file RegSelSiLUT.h.

72 { m_modules = m; }

◆ construct()

void RegSelSiLUT::construct ( )
protectedvirtual

Definition at line 90 of file RegSelSiLUT.cxx.

91 {
92  const std::string s[7] = { "", "pixel", "sct", "trt", "ftk", "mm", "stgc" };
93  m_name = s[m_ID];
94 }

◆ disableLayer()

void RegSelSiLUT::disableLayer ( int  id,
unsigned  layer 
)

Definition at line 232 of file RegSelSiLUT.cxx.

232  {
233  std::map<int,int>::iterator sitr = m_idmap.find(id);
234  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].disableLayer(layer);
235 }

◆ disableModuleList()

void RegSelSiLUT::disableModuleList ( const std::vector< IdentifierHash > &  hashlist)

Definition at line 770 of file RegSelSiLUT.cxx.

770  {
771 
772  std::set<IdentifierHash> hashset;
773  for ( unsigned i=0 ; i<hashlist.size() ; i++ ) hashset.insert(hashlist[i]);
774 
776  for ( ; itr!=m_modules.end() ; ++itr ) {
777  // this module is on the list, so disable it
778  if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).disable();
779  }
782 }

◆ disableModules()

void RegSelSiLUT::disableModules ( )
inline

Definition at line 195 of file RegSelSiLUT.h.

195 { disableRobs(); }

◆ disableRobList()

void RegSelSiLUT::disableRobList ( const std::vector< uint32_t > &  roblist)

Definition at line 733 of file RegSelSiLUT.cxx.

733  {
734 
735  std::set<uint32_t> robset;
736  for ( unsigned i=0 ; i<roblist.size() ; i++ ) robset.insert(roblist[i]);
737 
739  for ( ; itr!=m_modules.end() ; ++itr ) {
740  // this module's rob is on the list, so disable it
741  if ( robset.find((*itr).robID())!=robset.end() ) (*itr).disable();
742  }
745 }

◆ disableRobs()

void RegSelSiLUT::disableRobs ( )

Definition at line 722 of file RegSelSiLUT.cxx.

722  {
724  while ( itr!=m_modules.end() ) (*itr++).disable();
727 }

◆ disableSubDetector()

void RegSelSiLUT::disableSubDetector ( int  id)

Definition at line 222 of file RegSelSiLUT.cxx.

222  {
223  std::map<int,int>::iterator sitr = m_idmap.find(id);
224  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].disable();
225 }

◆ drawlayers()

void RegSelSiLUT::drawlayers ( std::vector< const ZRObject * > &  c) const
inline

Definition at line 214 of file RegSelSiLUT.h.

214  {
215  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) m_SubDet[i].drawlayers(c);
216  }

◆ enableLayer()

void RegSelSiLUT::enableLayer ( int  id,
unsigned  layer 
)

Definition at line 237 of file RegSelSiLUT.cxx.

237  {
238  std::map<int,int>::iterator sitr = m_idmap.find(id);
239  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].enableLayer(layer);
240 }

◆ enableModuleList()

void RegSelSiLUT::enableModuleList ( const std::vector< IdentifierHash > &  hashlist)

Definition at line 787 of file RegSelSiLUT.cxx.

787  {
788 
789  std::set<IdentifierHash> hashset;
790  for ( unsigned i=0 ; i<hashlist.size() ; i++ ) hashset.insert(hashlist[i]);
791 
793  for ( ; itr!=m_modules.end() ; ++itr ) {
794  // this module is on the list, so enable it
795  if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).enable();
796  }
799 }

◆ enableModules()

void RegSelSiLUT::enableModules ( )
inline

Definition at line 194 of file RegSelSiLUT.h.

194 { enableRobs(); }

◆ enableRobList()

void RegSelSiLUT::enableRobList ( const std::vector< uint32_t > &  roblist)

Definition at line 750 of file RegSelSiLUT.cxx.

750  {
751 
752  std::set<uint32_t> robset;
753  for ( unsigned i=0 ; i<roblist.size() ; i++ ) robset.insert(roblist[i]);
754 
756  for ( ; itr!=m_modules.end() ; ++itr ) {
757  // this module's rob is on the list, so enable it
758  if ( robset.find((*itr).robID())!=robset.end() ) (*itr).enable();
759  }
762 }

◆ enableRobs()

void RegSelSiLUT::enableRobs ( )

Definition at line 712 of file RegSelSiLUT.cxx.

712  {
714  while ( itr!=m_modules.end() ) (*itr++).enable();
717 }

◆ enableSubDetector()

void RegSelSiLUT::enableSubDetector ( int  id)

Definition at line 227 of file RegSelSiLUT.cxx.

227  {
228  std::map<int,int>::iterator sitr = m_idmap.find(id);
229  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].enable();
230 }

◆ getDisabledHashList()

void RegSelSiLUT::getDisabledHashList ( const RegSelRoI roi,
unsigned  layer,
std::vector< IdentifierHash > &  hashlist 
) const

Definition at line 1086 of file RegSelSiLUT.cxx.

1086  {
1087 
1088  std::vector<const RegSelModule*> modules;
1089  if ( modules.size()<256 ) modules.reserve(256);
1090 
1091  // for ( std::vector<RegSelSubDetector>::const_iterator sptr(getSubDet().begin()) ;
1092  for ( std::vector<RegSelSubDetector>::const_iterator sptr(m_SubDet.begin()) ;
1093  sptr!=m_SubDet.end() ; ++sptr ) {
1094 
1095  if ( (*sptr).inRoI(roi) ) {
1096 
1097  const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1098 
1099  if ( layer<lyrs.size() ) {
1100  // const RegSelLayer& lyr = lyrs.at(layer);
1101  const RegSelLayer& lyr = lyrs[layer];
1102 
1103  if ( lyr.inRoI(roi) ) lyr.getDisabledModules(roi,modules);
1104  }
1105  }
1106  }
1107 
1108  hashlist.reserve(m_modules.size());
1109  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
1110  while ( mptr!=modules.end() ) {
1111  hashlist.push_back((*mptr++)->hashID());
1112  }
1113 }

◆ getDisabledLayers()

void RegSelSiLUT::getDisabledLayers ( const RegSelRoI roi,
int  subdetector,
std::vector< int > &  layers 
) const

Definition at line 1117 of file RegSelSiLUT.cxx.

1117  {
1118 
1119  // layers.clear();
1120 
1121  std::set<int> disabled_layers;
1122 
1123  for ( std::vector<RegSelSubDetector>::const_iterator sptr(m_SubDet.begin()) ;
1124  sptr!=m_SubDet.end() ; ++sptr ) {
1125 
1126  // std::cout << "subdet id = " << sptr->ID() << std::endl;
1127 
1128  if ( subdetector!=sptr->ID() ) continue;
1129 
1130  if ( (*sptr).inRoI(roi) ) {
1131 
1132  const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1133 
1134  for ( int layer=lyrs.size() ; layer-- ; ) {
1135 
1136  std::vector<const RegSelModule*> modules;
1137  if ( modules.size()<256 ) modules.reserve(256);
1138 
1139  // const RegSelLayer& lyr = lyrs.at(layer);
1140  const RegSelLayer& lyr = lyrs[layer];
1141 
1142  if ( lyr.inRoI(roi) ) {
1143  lyr.getDisabledModules(roi,modules);
1144  // if ( modules.size() ) disabled_layers.insert(layer);
1145  if ( modules.size() ) layers.push_back(layer);
1146  }
1147  }
1148  }
1149  }
1150 
1151 #if 0
1152  // copy to output
1153  std::set<int>::iterator bitr(disabled_layers.begin());
1154  std::set<int>::iterator eitr(disabled_layers.end());
1155  while ( bitr!=eitr ) { layers.push_back(*bitr++); }
1156 #endif
1157 
1158 }

◆ getHashList() [1/5]

void RegSelSiLUT::getHashList ( const RegSelRoI roi,
std::vector< IdentifierHash > &  hashlist 
) const
virtual

Definition at line 809 of file RegSelSiLUT.cxx.

809  {
810 
811  // bool hashempty = hashlist.empty();
812 
813  std::vector<const RegSelModule*> modules;
814  if ( modules.size()<256 ) modules.reserve(256);
815 
816  // struct timeval datatimer = gtttimer_start();
817  getRoIData(roi,modules);
818  // double datatime = gtttimer_stop(datatimer);
819 
820  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
821 
822  hashlist.reserve(modules.size());
823  for ( ; mptr!=modules.end() ; ++mptr ) {
824  hashlist.push_back((*mptr)->hashID());
825  }
826 
827  // if ( !hashempty ) removeDuplicates( hashlist );
828 
829  // double vectortime = gtttimer_stop(datatimer);
830 
831  // std::cout << "RegSelSiLUT::getHashList() datatime=" << datatime << "\tvectortime=" << vectortime << "\tf="
832  // << 100*(vectortime-datatime)/vectortime << std::endl;
833 
834 }

◆ getHashList() [2/5]

void RegSelSiLUT::getHashList ( const RegSelRoI roi,
std::vector< IdentifierHash > &  hashlist,
double  x,
double  y 
) const
virtual

Definition at line 839 of file RegSelSiLUT.cxx.

839  {
840 
841  std::vector<const RegSelModule*> modules;
842  if ( modules.size()<256 ) modules.reserve(256);
843 
844  // struct timeval datatimer = gtttimer_start();
845  getRoIData( roi, modules, x, y );
846  // double datatime = gtttimer_stop(datatimer);
847 
848  // bool hashempty = hashlist.empty();
849 
850  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
851 
852  hashlist.reserve(modules.size());
853  for ( ; mptr!=modules.end() ; ++mptr ) {
854  hashlist.push_back((*mptr)->hashID());
855  }
856 
857  // if ( !hashempty ) removeDuplicates( hashlist );
858 
859 }

◆ getHashList() [3/5]

void RegSelSiLUT::getHashList ( const RegSelRoI roi,
unsigned  layer,
std::vector< IdentifierHash > &  hashlist 
) const
virtual

Definition at line 969 of file RegSelSiLUT.cxx.

969  {
970 
971  // bool hashempty = hashlist.empty();
972 
973  std::vector<const RegSelModule*> modules;
974  if ( modules.size()<256 ) modules.reserve(256);
975 
976 
977  getRoIData( roi, layer, modules);
978 
979  // struct timeval datatimer = gtttimer_start();
980 
981  // double datatime = gtttimer_stop(datatimer);
982 
983  hashlist.reserve(modules.size());
984  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
985  while ( mptr!=modules.end() ) {
986  hashlist.push_back((*mptr++)->hashID());
987  }
988 
989  // if ( !hashempty ) removeDuplicates( hashlist );
990 
991  // double vectortime = gtttimer_stop(datatimer);
992 
993  // std::cout << "RegSelSiLUT::getHashList() datatime=" << datatime << "\tvectortime=" << vectortime << "\tf="
994  // << 100*(vectortime-datatime)/vectortime << std::endl;
995 
996 }

◆ getHashList() [4/5]

void RegSelSiLUT::getHashList ( std::vector< IdentifierHash > &  hashlist) const
virtual

Definition at line 866 of file RegSelSiLUT.cxx.

866  {
867 
868 #ifndef OLDFULLSCAN
869  hashlist.reserve(m_allHashes.size());
870  hashlist = m_allHashes;
871  return;
872 #else
873 
874  hashlist.clear();
875  hashlist.reserve(m_modules.size());
876 
877  std::vector<RegSelModule>::const_iterator mptr(m_modules.begin());
878  std::vector<RegSelModule>::const_iterator eptr(m_modules.end());
879  for ( ; mptr!=eptr ; ++mptr ) {
880  if ( (*mptr).enabled() ) hashlist.push_back((*mptr).hashID());
881  }
882 #endif
883 }

◆ getHashList() [5/5]

void RegSelSiLUT::getHashList ( unsigned  layer,
std::vector< IdentifierHash > &  hashlist 
) const
virtual

Definition at line 890 of file RegSelSiLUT.cxx.

890  {
891 
892  std::vector<const RegSelModule*> modules;
893 
894  // bool hashempty = hashlist.empty();
895 
896  getModules( layer, modules );
897 
898  hashlist.reserve(modules.size());
899  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
900  while ( mptr!=modules.end() ) {
901  hashlist.push_back((*mptr++)->hashID());
902  }
903 
904  // if ( !hashempty ) removeDuplicates( hashlist );
905 
906 }

◆ getModules() [1/2]

const std::vector<RegSelModule>& RegSelSiLUT::getModules ( ) const
inline

Definition at line 75 of file RegSelSiLUT.h.

75 { return m_modules; }

◆ getModules() [2/2]

void RegSelSiLUT::getModules ( unsigned  layer,
std::vector< const RegSelModule * > &  modules 
) const

here if layer is of the format 1XYY where X=0 (barrel), X=2 (endcap) and YY is the layer within the sub-system then the specific layer in the sub-system is used.

If it is of the form YY, then simple layer number is used NB: ALL the layer IdentifierHash and uint32_t retreival methods use this format

determine whether an layer in a specific subdetector is requested

Definition at line 266 of file RegSelSiLUT.cxx.

266  {
267  modules.reserve(256);
268 
270  bool subdetflag = layer/1000;
271  int subdet = 0;
272  int ilayer = layer%100;
273  if ( subdetflag ) subdet = (layer%1000)/100;
274 
275  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
276  if ( !subdetflag || ( subdetflag && subdet==std::fabs(m_SubDet[i].ID()) ) ) m_SubDet[i].getModules( ilayer, modules);
277  }
278  }

◆ getName()

const std::string& RegSelName::getName ( ) const
inlineinherited

Definition at line 54 of file RegSelName.h.

◆ getRobHashList() [1/3]

void RegSelSiLUT::getRobHashList ( const RegSelRoI roi,
std::vector< uint32_t > &  roblist,
std::vector< IdentifierHash > &  hashlist 
) const
virtual

Definition at line 559 of file RegSelSiLUT.cxx.

560 {
561  std::vector<const RegSelModule*> modules;
562  if ( modules.size()<256 ) modules.reserve(256);
563 
564  // get the modules
565  getRoIData(roi,modules);
566 
567  // fill the rob and hashid lists
568 
569  std::set<uint32_t> uroblist;
570 
571  hashlist.reserve(modules.size());
572  roblist.reserve(modules.size());
573  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
574  while ( mptr!=modules.end() ) {
575  hashlist.push_back((*mptr)->hashID());
576  roblist.push_back((*mptr++)->robID());
577  }
578  // removeDuplicates( hashlist );
579  removeDuplicates( roblist );
580 
581  // roblist.reserve(uroblist.size());
582  // std::set<uint32_t>::iterator plist(uroblist.begin());
583  // while ( plist!=uroblist.end() ) {
584  // roblist.push_back(*plist++);
585  // }
586 
587 }

◆ getRobHashList() [2/3]

void RegSelSiLUT::getRobHashList ( const RegSelRoI roi,
unsigned  layer,
std::vector< uint32_t > &  roblist,
std::vector< IdentifierHash > &  hashlist 
) const
virtual

Definition at line 592 of file RegSelSiLUT.cxx.

593 {
594  std::vector<const RegSelModule*> modules;
595  if ( modules.size()<256 ) modules.reserve(256);
596 
597  // get the modules
598  getRoIData(roi, layer, modules);
599 
600  // fill the rob and hashid lists
601 
602  std::set<uint32_t> uroblist;
603 
604  hashlist.reserve(modules.size());
605  roblist.reserve(modules.size());
606  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
607  while ( mptr!=modules.end() ) {
608  hashlist.push_back((*mptr)->hashID());
609  roblist.push_back((*mptr++)->robID());
610  }
611  // removeDuplicates( hashlist );
612  removeDuplicates( roblist );
613 
614  // roblist.reserve(uroblist.size());
615  // std::set<uint32_t>::iterator plist(uroblist.begin());
616  // while ( plist!=uroblist.end() ) {
617  // roblist.push_back(*plist++);
618  // }
619 
620 }

◆ getRobHashList() [3/3]

void RegSelSiLUT::getRobHashList ( std::vector< uint32_t > &  roblist,
std::vector< IdentifierHash > &  hashlist 
) const
virtual

Definition at line 938 of file RegSelSiLUT.cxx.

938  {
939 
940 #ifndef OLDFULLSCAN
941  hashlist.reserve(m_allHashes.size());
942  roblist.reserve(m_allROBids.size());
943  roblist = m_allROBids;
944  hashlist = m_allHashes;
945  return;
946 #else
947  roblist.reserve(256);
948  hashlist.reserve(m_modules.size());
949 
950  std::set<uint32_t> uroblist;
951  std::vector<RegSelModule>::const_iterator mptr(m_modules.begin());
952  for ( ; mptr!=m_modules.end() ; ++mptr ) {
953  if ( (*mptr).enabled() ) {
954  uroblist.insert((*mptr).robID());
955  hashlist.push_back((*mptr).hashID());
956  }
957  }
958 
959  std::set<uint32_t>::iterator rlist(uroblist.begin());
960  while ( rlist!=uroblist.end() ) {
961  roblist.push_back(*rlist++);
962  }
963 #endif
964 }

◆ getRobList() [1/5]

void RegSelSiLUT::getRobList ( const RegSelRoI roi,
std::vector< uint32_t > &  roblist,
bool  removeduplicates = true 
) const
virtual

NB: using a vector and removing duplicates is faster than using a set

Definition at line 623 of file RegSelSiLUT.cxx.

623  {
624 
625  std::vector<const RegSelModule*> modules;
626  if ( modules.size()<256 ) modules.reserve(256);
627 
628  // struct timeval datatimer = gtttimer_start();
629  getRoIData(roi,modules);
630  // double datatime = gtttimer_stop(datatimer);
631 
632 #if 0
633  // get the list of unique rob identifiers
634  // FIXME: this uses a set, sould be *much* faster
635  // with a seperate list of robids with their modules'
636  // corresponding extents in r, phi and z etc
637  std::set<uint32_t> uroblist;
638 
639  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
640  while ( mptr!=modules.end() ) {
641  uroblist.insert((*mptr++)->robID());
642  }
643 
644  roblist.reserve(uroblist.size());
645  std::set<uint32_t>::iterator plist(uroblist.begin());
646  while ( plist!=uroblist.end() ) {
647  roblist.push_back(*plist++);
648  }
649 
650 #endif
651 
654  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
655 
656  roblist.reserve(modules.size());
657  while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
658  if ( removeduplicates || roblist.size()>2000 ) removeDuplicates( roblist );
659 
660  // double vectortime = gtttimer_stop(datatimer);
661 
662  // std::cout << "RegSelSiLUT::getRobList() datatime=" << datatime
663  // << "\tvectortime=" << vectortime << "\tf="
664  // << 100*(vectortime-datatime)/vectortime << std::endl;
665 
666 }

◆ getRobList() [2/5]

void RegSelSiLUT::getRobList ( const RegSelRoI roi,
std::vector< uint32_t > &  roblist,
double  x,
double  y 
) const
virtual

Definition at line 674 of file RegSelSiLUT.cxx.

674  {
675 
676  std::vector<const RegSelModule*> modules;
677  if ( modules.size()<256 ) modules.reserve(256);
678 
679  // struct timeval datatimer = gtttimer_start();
680  getRoIData( roi, modules, x, y );
681  // double datatime = gtttimer_stop(datatimer);
682 
683 #if 0
684  std::set<uint32_t> uroblist;
685 
686  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
687  while ( mptr!=modules.end() ) {
688  uroblist.insert((*mptr++)->robID());
689  }
690 
691  roblist.reserve(uroblist.size());
692  std::set<uint32_t>::iterator plist(uroblist.begin());
693  while ( plist!=uroblist.end() ) {
694  roblist.push_back(*plist++);
695  }
696 
697 #endif
698 
699  roblist.reserve(modules.size());
700  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
701  while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
702  removeDuplicates( roblist );
703 
704 }

◆ getRobList() [3/5]

void RegSelSiLUT::getRobList ( const RegSelRoI roi,
unsigned  layer,
std::vector< uint32_t > &  roblist,
bool  removeduplicates = true 
) const
virtual

Definition at line 1003 of file RegSelSiLUT.cxx.

1003  {
1004 
1005  std::vector<const RegSelModule*> modules;
1006  if ( modules.size()<256 ) modules.reserve(256);
1007 
1008 
1009  getRoIData( roi, layer, modules);
1010 
1011 #if 0
1012  for ( std::vector<RegSelSubDetector>::const_iterator sptr(m_SubDet.begin()) ;
1013  sptr!=m_SubDet.end() ; sptr++ ) {
1014 
1015  if ( (*sptr).inRoI(roi) ) {
1016 
1017  const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1018 
1019  if ( layer<lyrs.size() ) {
1020  const RegSelLayer& lyr = lyrs[layer];
1021  if ( lyr.inRoI(roi) ) lyr.getModules(roi,modules);
1022  }
1023  }
1024  }
1025 #endif
1026 
1027  // struct timeval datatimer = gtttimer_start();
1028 
1029  // double datatime = gtttimer_stop(datatimer);
1030 
1031  // std::vector<uint32_t> uroblist;
1032  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
1033  while ( mptr!=modules.end() ) {
1034  roblist.push_back((*mptr++)->robID());
1035  }
1036 
1037  // std::set<uint32_t>::iterator rlist(uroblist.begin());
1038  // while ( rlist!=uroblist.end() ) {
1039  // roblist.push_back(*rlist++);
1040  // }
1041 
1042  if ( removeduplicates || roblist.size()>4000 ) removeDuplicates( roblist );
1043 
1044 }

◆ getRobList() [4/5]

void RegSelSiLUT::getRobList ( std::vector< uint32_t > &  roblist) const
virtual

Definition at line 914 of file RegSelSiLUT.cxx.

914  {
915 
916 #ifndef OLDFULLSCAN
917  roblist.reserve(m_allROBids.size());
918  roblist = m_allROBids;
919  return;
920 #else
921  roblist.reserve(256);
922 
923  std::set<uint32_t> uroblist;
924  std::vector<RegSelModule>::const_iterator mptr(m_modules.begin());
925  for ( ; mptr!=m_modules.end() ; ++mptr ) {
926  if ( (*mptr).enabled() ) uroblist.insert((*mptr).robID());
927  }
928 
929  std::set<uint32_t>::iterator rlist(uroblist.begin());
930  while ( rlist!=uroblist.end() ) {
931  roblist.push_back(*rlist++);
932  }
933 #endif
934 }

◆ getRobList() [5/5]

void RegSelSiLUT::getRobList ( unsigned  layer,
std::vector< uint32_t > &  roblist 
) const
virtual

Definition at line 1056 of file RegSelSiLUT.cxx.

1056  {
1057 
1058  std::vector<const RegSelModule*> modules;
1059 
1060  getModules( layer, modules );
1061 
1062  roblist.reserve(256);
1063 
1064  std::set<uint32_t> uroblist;
1065  std::vector<const RegSelModule*>::const_iterator mptr(modules.begin());
1066  for ( ; mptr!=modules.end() ; ++mptr ) {
1067  if ( (*mptr)->enabled() ) roblist.push_back((*mptr)->robID());
1068  }
1069  removeDuplicates( roblist );
1070 
1071  // std::set<uint32_t>::iterator rlist(uroblist.begin());
1072  // while ( rlist!=uroblist.end() ) roblist.push_back(*rlist++);
1073 
1074 }

◆ getRoIData() [1/5]

bool RegSelSiLUT::getRoIData ( const RegSelRoI r,
std::vector< const RegSelModule * > &  modules 
) const

Definition at line 244 of file RegSelSiLUT.cxx.

245 {
246  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << "\t" << roi << std::endl;
247 
248  bool inDet = false;
249 
250  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
251  bool inSubDet = m_SubDet[i].inRoI(roi);
252  inDet |= inSubDet;
253  // std::cout << "\tRegSelSiLUT::getRoIData() SubDet id " << m_SubDet[i].ID() << std::endl;
254  if ( inSubDet ) m_SubDet[i].getModules(roi, modules);
255  }
256 
257  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
258  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
259 
260  return inDet;
261 }

◆ getRoIData() [2/5]

bool RegSelSiLUT::getRoIData ( const RegSelRoI r,
std::vector< const RegSelModule * > &  modules,
double  x,
double  y 
) const

Definition at line 409 of file RegSelSiLUT.cxx.

410 {
411 
412  if ( x==0 && y==0 ) return getRoIData(roi, modules);
413 
414  bool inDet = false;
415 
416  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
417 
418 #if 1
419 
420  const std::vector<RegSelLayer>& layers = m_SubDet[i].getLayers();
421 
422  for ( unsigned j=0 ; j<layers.size() ; j++ ) {
423 
424  double rmin = layers[j].rMin();
425  double rmax = layers[j].rMax();
426 
427  double phimin = roi.getphiMin();
428  double phimax = roi.getphiMax();
429 
430  // std::cout << layers[j] << "\t" << rmin << " " << rmax << std::endl;
431 
432  // std::cout << "lyr[" << j << "] " << "\tphimin=" << phimin << "\tphimax=" << phimax << "\tbefore" << std::endl;
433 
434  if ( philimits(x, y, rmin, rmax, phimin, phimax) ) {
435 
436  // std::cout << layers[j] << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
437 
438  RegSelRoI troi( roi.getzMin(), roi.getzMax(), phimin, phimax, roi.getetaMin(), roi.getetaMax() );
439 
440 
441  bool inLayer = layers[j].inRoI(troi);
442 
443  inDet |= inLayer;
444 
445  if ( inLayer ) layers[j].getModules(troi, modules);
446 
447  }
448 
449  }
450 
451 #else
452 
453 
454  double rmin = m_SubDet[i].rMin();
455  double rmax = m_SubDet[i].rMax();
456 
457  double phimin = roi.getphiMin();
458  double phimax = roi.getphiMax();
459 
460  // std::cout << layers[j] << "\t" << rmin << " " << rmax << std::endl;
461 
462  philimits(x, y, rmin, rmax, phimin, phimax);
463 
464  // std::cout << layers[j] << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
465 
466  RegSelRoI troi( roi.getzMin(), roi.getzMax(), phimin, phimax, roi.getetaMin(), roi.getetaMax() );
467 
468  bool inSubDet = m_SubDet[i].inRoI(troi);
469  inDet |= inSubDet;
470  if ( inSubDet ) m_SubDet[i].getModules(troi, modules);
471 
472 #endif
473 
474  }
475  // std::cout << "getRoIData() time=" << _time << " ms (shifted)" << std::endl;
476 
477  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
478 
479  return inDet;
480 }

◆ getRoIData() [3/5]

bool RegSelSiLUT::getRoIData ( const RegSelRoI roi,
unsigned  layer,
std::vector< const RegSelModule * > &  modules 
) const

here if layer is of the format 1XYY where X=0 (barrel), X=2 (endcap) and YY is the layer within the sub-system then the specific layer in the sub-system is used.

If it is of the form YY, then simple layer number is used

determine whether an layer in a specific subdetector is requested

Definition at line 286 of file RegSelSiLUT.cxx.

287 {
288  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << std::endl;
289 
290  bool inDet = false;
291 
292 
293  int ilayer = layer%100;
295  bool subdetflag = layer/1000;
296  int subdet = 0;
297  if ( subdetflag ) subdet = (layer%1000)/100;
298 
299  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
300 
301  if ( !subdetflag || ( subdetflag && subdet==std::fabs(m_SubDet[i].ID()) ) ) {
302  bool inSubDet = m_SubDet[i].inRoI(roi);
303  inDet |= inSubDet;
304  if ( inSubDet ) m_SubDet[i].getModules(roi, ilayer, modules);
305  }
306  }
307 
308 
309 
310 
311  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
312  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
313 
314  return inDet;
315 }

◆ getRoIData() [4/5]

bool RegSelSiLUT::getRoIData ( const RegSelRoI r,
unsigned  subdetector,
unsigned  layer,
std::vector< const RegSelModule * > &  modules 
) const

Definition at line 321 of file RegSelSiLUT.cxx.

322 {
323  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << std::endl;
324 
325  bool inDet = false;
326 
327  if ( subdetector<m_SubDet.size() ) {
328  inDet = m_SubDet[subdetector].inRoI(roi);
329  if ( inDet ) m_SubDet[subdetector].getModules(roi, layer, modules);
330  }
331  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
332  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
333 
334  return inDet;
335 }

◆ getRoIData() [5/5]

bool RegSelSiLUT::getRoIData ( const RegSelRoI r,
unsigned  subdetector,
unsigned  layer,
std::vector< const RegSelModule * > &  modules,
double  x,
double  y 
) const

Definition at line 485 of file RegSelSiLUT.cxx.

486 {
487 
488  if ( x==0 && y==0 ) return getRoIData(roi, subdetector, layer, modules);
489 
490  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << std::endl;
491 
492  // struct timeval _timer = gtttimer_start();
493 
494  bool inDet = false;
495 
496  if ( subdetector<m_SubDet.size() ) {
497 
498  const std::vector<RegSelLayer>& layers = m_SubDet[subdetector].getLayers();
499 
500  if ( layer<layers.size() ) {
501 
502  double rmin = layers[layer].rMin();
503  double rmax = layers[layer].rMax();
504 
505  double phimin = roi.getphiMin();
506  double phimax = roi.getphiMax();
507 
508  // std::cout << layers[j] << "\t" << rmin << " " << rmax << std::endl;
509  // std::cout << "lyr[" << subdetector << "] " << "\tphimin=" << phimin << "\tphimax=" << phimax << "\tbefore" << std::endl;
510 
511  if ( philimits(x, y, rmin, rmax, phimin, phimax) ) {
512 
513  // std::cout << layers[j] << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
514  // std::cout << "lyr[" << subdetector << "] " << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
515 
516  RegSelRoI troi( roi.getzMin(), roi.getzMax(), phimin, phimax, roi.getetaMin(), roi.getetaMax() );
517 
518  bool inLayer = layers[layer].inRoI(troi);
519 
520  inDet |= inLayer;
521 
522  if ( inLayer ) layers[layer].getModules(troi, modules);
523 
524  }
525  }
526  }
527 
528  // double _time = gtttimer_stop(_timer);
529 
530  // std::cout << "getRoIData() time=" << _time << " ms (shifted)" << std::endl;
531 
532  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
533  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
534 
535  return inDet;
536 }

◆ getSubDet()

const std::vector<RegSelSubDetector>& RegSelSiLUT::getSubDet ( ) const
inline

Definition at line 108 of file RegSelSiLUT.h.

108 { return m_SubDet; }

◆ HashIDList() [1/2]

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

implementation of the IRegSelUT interface
hash id methods

interface implementation for the IRegSelLUT methods

hash id methods

Implements IRegSelLUT.

Definition at line 39 of file RegSelSiLUT.cxx.

39  {
40  if ( roi.isFullscan() ) return getHashList( idlist );
41  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
42  getHashList( roitmp, idlist );
43  if ( m_ID == MM || m_ID == sTGC ) removeDuplicates( idlist );
44 }

◆ HashIDList() [2/2]

void RegSelSiLUT::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 47 of file RegSelSiLUT.cxx.

47  {
48  if ( roi.isFullscan() ) return getHashList( layer, idlist );
49  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
50  getHashList( roitmp, layer, idlist );
51  if ( m_ID == MM || m_ID == sTGC ) removeDuplicates( idlist );
52 }

◆ ID()

DET RegSelSiLUT::ID ( ) const
inline

Definition at line 84 of file RegSelSiLUT.h.

84 { return m_ID; }

◆ initialise()

void RegSelSiLUT::initialise ( )

uncomment this if you want to print out the list of all the module ids assigned to each rob RegSelROBList roblist( m_modules );

Definition at line 110 of file RegSelSiLUT.cxx.

110  {
111 
112  // struct timeval inittimer = gtttimer_start();
113 
114  // find out how many subdetectors there are
115 
116  std::vector<int> subdetid;
117 
118  for ( std::vector<RegSelModule>::iterator mptr = m_modules.begin() ;
119  mptr!=m_modules.end() ; ++mptr ) {
120  int detid = mptr->detector();
121 
122  bool found = false;
123  for ( int j=subdetid.size() ; j-- ; ) if ( subdetid[j]==detid ) found = true;
124 
125  if ( !found ) subdetid.push_back(detid);
126  }
127 
128  // std::cout << "\tRegSelSiLUT::initialise() creating detector with " << subdetid.size() << " subdetectors" << std::endl;
129 
130  // std::cout << "RegSelSiLUT::initialise()" << std::endl;
131 
132  m_SubDet.reserve(subdetid.size());
133 
134  // push each one to the list
135  for ( int i=subdetid.size() ; i-- ; ) {
136  m_SubDet.push_back( RegSelSubDetector(subdetid[i]) );
137  m_idmap.insert( std::map<int, int>::value_type(subdetid[i], i) );
138 
139  //int ii = subdetid.size()-1-i;
140  //std::cout << "\tsubdet " << ii << "\tid " << subdetid[ii] << std::endl;
141  }
142 
143 
144 
145 
146  // initialise the subdetector look up tables
147  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) m_SubDet[i].addModules(m_modules);
148 
149  // std::cout << "\tRegSelSiLUT " << getName() << std::endl;
150  // write(getName()+".map");
151 
152  // std::cout << "RegSelSiLUT::initialise() creating hash map" << std::endl;
153 
154  // and save pointers to all the modules in a map by hashid
155  for ( std::vector<RegSelModule>::iterator mptr = m_modules.begin() ;
156  mptr!=m_modules.end() ; ++mptr ) {
157  m_map[(*mptr).hashID()] = &(*mptr);
158  }
159 
160  // std::cout << "RegSelSiLUT::initialise() exiting" << std::endl;
161 
162  // double inittime = gtttimer_stop(inittimer);
163  // std::cout << "initialise time=" << inittime << std::endl;
164 
167 
171 
172 }

◆ initialiseDisabledModules()

void RegSelSiLUT::initialiseDisabledModules ( )

Definition at line 203 of file RegSelSiLUT.cxx.

203  {
205  sptr!=m_SubDet.end() ; ++sptr ) {
206  (*sptr).setupDisabledModules();
207  }
208 }

◆ initialiseFullScan()

void RegSelSiLUT::initialiseFullScan ( )

Definition at line 175 of file RegSelSiLUT.cxx.

175  {
176 
177  m_allHashes.clear();
178  m_allROBids.clear();
179 
180  std::set<uint32_t> robids;
181 
182  std::vector<RegSelModule>::const_iterator mptr(m_modules.begin());
183  std::vector<RegSelModule>::const_iterator eptr(m_modules.end());
184  for ( ; mptr!=eptr ; ++mptr ) {
185  if ( (*mptr).enabled() ) {
186  m_allHashes.push_back((*mptr).hashID());
187  robids.insert((*mptr).robID());
188  }
189  }
190 
191  std::set<uint32_t>::iterator ritr(robids.begin());
192  while ( ritr!=robids.end() ) {
193  m_allROBids.push_back(*ritr++);
194  }
195 
196 }

◆ Module()

const RegSelModule * RegSelSiLUT::Module ( const IdentifierHash h) const

Definition at line 213 of file RegSelSiLUT.cxx.

213  {
214  std::map<const IdentifierHash, const RegSelModule*>::const_iterator hptr(m_map.find(h));
215  if ( hptr!=m_map.end() ) return hptr->second;
216  else return NULL;
217 }

◆ read() [1/2]

bool RegSelSiLUT::read ( const std::string &  s)

Definition at line 1168 of file RegSelSiLUT.cxx.

1168  {
1169  std::ifstream infile(s.c_str());
1170  // std::cout << "RegSelSiLUT::read() from file " << s << std::endl;
1171  return read(infile);
1172 }

◆ read() [2/2]

bool RegSelSiLUT::read ( std::istream &  s)

Definition at line 1175 of file RegSelSiLUT.cxx.

1175  {
1176 
1177  unsigned Nmodules = 0;
1178 
1179  // old method - read number of modules and try tp read them in
1180  // new method - just read until module list exhausted,
1181  // this code will allow either
1182 
1183  bool newformat = false;
1184 
1185  s >> Nmodules;
1186 
1187  newformat=s.fail();
1188 
1189  // couldn't read number of modules - try new format
1190  if ( newformat ) s.clear();
1191 
1192  unsigned modcount=0;
1193 
1194  for ( ; newformat || modcount<Nmodules ; modcount++ ) {
1195  RegSelModule m;
1196  if ( !getModule(s, m) ) break;
1197  addModule(m);
1198  }
1199 
1200  // std::cout << "read() newformat " << newformat << std::endl;
1201  // std::cout << "read() read " << modcount << " modules" << std::endl;
1202  // std::cout << "read() Nmodules " << Nmodules << "\tsize " << m_modules.size() << std::endl;
1203 
1204  // std::cout << "RegSelSiLUT::read() creating tables" << std::endl;
1205  initialise();
1206 
1207  if ( (!newformat) && (modcount<Nmodules ) ) return false;
1208 
1209  return true;
1210 }

◆ removeDuplicates()

template<typename T >
static void RegSelSiLUT::removeDuplicates ( std::vector< T > &  vec)
inlinestatic

useful for removing duplicates if required ...

Definition at line 222 of file RegSelSiLUT.h.

222  {
223  std::sort(vec.begin(), vec.end());
224  vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
225  }

◆ reset()

void RegSelSiLUT::reset ( )

Definition at line 100 of file RegSelSiLUT.cxx.

100  {
101  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) m_SubDet[i].reset();
102  m_map.clear();
103 }

◆ ROBIDList() [1/2]

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

rob methods

rob methods

Implements IRegSelLUT.

Definition at line 56 of file RegSelSiLUT.cxx.

56  {
57  if ( roi.isFullscan() ) return getRobList( roblist );
58  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
59  getRobList( roitmp, roblist);
60 }

◆ ROBIDList() [2/2]

void RegSelSiLUT::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 63 of file RegSelSiLUT.cxx.

63  {
64  if ( roi.isFullscan() ) return getRobList( layer, roblist );
65  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
66  getRobList( roitmp, layer, roblist);
67 }

◆ write() [1/2]

void RegSelSiLUT::write ( const std::string &  filename) const

Definition at line 550 of file RegSelSiLUT.cxx.

550  {
551  std::ofstream outfile(s.c_str());
552  write(outfile);
553 }

◆ write() [2/2]

void RegSelSiLUT::write ( std::ostream &  s = std::cout) const

Definition at line 543 of file RegSelSiLUT.cxx.

543  {
544  s << m_modules.size() << std::endl;
545  for ( unsigned i=0 ; i<m_modules.size() ; i++ ) {
546  s << m_modules[i] << std::endl;
547  }
548 }

Member Data Documentation

◆ m_allHashes

std::vector<IdentifierHash> RegSelSiLUT::m_allHashes
protected

Definition at line 243 of file RegSelSiLUT.h.

◆ m_allROBids

std::vector<uint32_t> RegSelSiLUT::m_allROBids
protected

Definition at line 244 of file RegSelSiLUT.h.

◆ m_disabled

std::vector<RegSelModule*> RegSelSiLUT::m_disabled
protected

Definition at line 238 of file RegSelSiLUT.h.

◆ m_ID

DET RegSelSiLUT::m_ID
protected

Definition at line 233 of file RegSelSiLUT.h.

◆ m_idmap

std::map<int, int> RegSelSiLUT::m_idmap
protected

Definition at line 246 of file RegSelSiLUT.h.

◆ m_map

std::map<const IdentifierHash, const RegSelModule*> RegSelSiLUT::m_map
protected

Definition at line 240 of file RegSelSiLUT.h.

◆ m_modules

std::vector<RegSelModule> RegSelSiLUT::m_modules
protected

Definition at line 236 of file RegSelSiLUT.h.

◆ m_name

std::string RegSelName::m_name
protectedinherited

Definition at line 60 of file RegSelName.h.

◆ m_SubDet

std::vector<RegSelSubDetector> RegSelSiLUT::m_SubDet
protected

Definition at line 235 of file RegSelSiLUT.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
RegSelSiLUT::m_allROBids
std::vector< uint32_t > m_allROBids
Definition: RegSelSiLUT.h:244
beamspotman.r
def r
Definition: beamspotman.py:676
RegSelModule
Definition: RegSelModule.h:38
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
run.infile
string infile
Definition: run.py:13
RegSelName::m_name
std::string m_name
Definition: RegSelName.h:60
RegSelSiLUT::UNDEF
@ UNDEF
Definition: RegSelSiLUT.h:45
RegSelSiLUT::initialiseDisabledModules
void initialiseDisabledModules()
Definition: RegSelSiLUT.cxx:203
RegSelLayer::getDisabledModules
void getDisabledModules(const RegSelRoI &roi, std::vector< const RegSelModule * > &modules) const
Definition: RegSelLayer.cxx:314
RegSelSiLUT::DET
DET
Definition: RegSelSiLUT.h:45
IRoiDescriptor::etaMinus
virtual double etaMinus() const =0
RegSelSiLUT::FTK
@ FTK
Definition: RegSelSiLUT.h:45
RegSelSiLUT::m_allHashes
std::vector< IdentifierHash > m_allHashes
Definition: RegSelSiLUT.h:243
RegSelSiLUT::getRoIData
bool getRoIData(const RegSelRoI &r, std::vector< const RegSelModule * > &modules) const
Definition: RegSelSiLUT.cxx:244
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
RegSelSiLUT::initialiseFullScan
void initialiseFullScan()
Definition: RegSelSiLUT.cxx:175
RegSelLayer
Definition: RegSelLayer.h:39
RegSelSiLUT::m_modules
std::vector< RegSelModule > m_modules
Definition: RegSelSiLUT.h:236
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
IRoiDescriptor::etaPlus
virtual double etaPlus() const =0
x
#define x
getModule
bool getModule(std::istream &s, RegSelModule &m)
Definition: RegSelModule.cxx:110
RegSelSiLUT::MM
@ MM
Definition: RegSelSiLUT.h:45
python.PyAthena.module
module
Definition: PyAthena.py:134
RegSelSiLUT::write
void write(std::ostream &s=std::cout) const
Definition: RegSelSiLUT.cxx:543
RegSelSiLUT::initialise
void initialise()
Definition: RegSelSiLUT.cxx:110
RegSelSiLUT::TRT
@ TRT
Definition: RegSelSiLUT.h:45
RegSelSiLUT::enableRobs
void enableRobs()
Definition: RegSelSiLUT.cxx:712
lumiFormat.i
int i
Definition: lumiFormat.py:92
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
RegSelSiLUT::getRobList
virtual void getRobList(const RegSelRoI &roi, unsigned layer, std::vector< uint32_t > &roblist, bool removeduplicates=true) const
Definition: RegSelSiLUT.cxx:1003
RegSelSiLUT::m_ID
DET m_ID
Definition: RegSelSiLUT.h:233
IRoiDescriptor::phiMinus
virtual double phiMinus() const =0
RegSelSiLUT::m_idmap
std::map< int, int > m_idmap
Definition: RegSelSiLUT.h:246
RegSelSiLUT::SCT
@ SCT
Definition: RegSelSiLUT.h:45
RegSelRoI
Definition: RegSelRoI.h:32
IRoiDescriptor::phiPlus
virtual double phiPlus() const =0
extreme phi values
RegSelSiLUT::getHashList
virtual void getHashList(const RegSelRoI &roi, std::vector< IdentifierHash > &hashlist) const
Definition: RegSelSiLUT.cxx:809
RegSelSiLUT::addModules
void addModules(const std::vector< RegSelModule > &m)
Definition: RegSelSiLUT.h:72
philimits
bool philimits(double x, double y, double rmin, double rmax, double &phimin, double &phimax)
Definition: RegSelSiLUT.cxx:374
RegSelSiLUT::PIXEL
@ PIXEL
Definition: RegSelSiLUT.h:45
RegSelLayer::getModules
void getModules(const RegSelRoI &roi, std::vector< const RegSelModule * > &modules) const
Fixme: This is the completely correct solution, where each module is allowed to be at a completely di...
Definition: RegSelLayer.cxx:197
RegSelSubDetector
Definition: RegSelSubDetector.h:44
RegSelSiLUT::construct
virtual void construct()
Definition: RegSelSiLUT.cxx:90
RegSelSiLUT::addModule
void addModule(RegSelModule &module)
Definition: RegSelSiLUT.h:71
RegSelSiLUT::reset
void reset()
Definition: RegSelSiLUT.cxx:100
y
#define y
h
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
IRoiDescriptor::zedPlus
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
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
IRoiDescriptor::isFullscan
virtual bool isFullscan() const =0
is this a full detector RoI?
RegSelName::RegSelName
RegSelName(const std::string &s="")
Definition: RegSelName.h:52
RegSelSiLUT::m_map
std::map< const IdentifierHash, const RegSelModule * > m_map
Definition: RegSelSiLUT.h:240
CaloSwCorrections.removeduplicates
def removeduplicates(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:233
IRoiDescriptor::zedMinus
virtual double zedMinus() const =0
RegSelSiLUT::removeDuplicates
static void removeDuplicates(std::vector< T > &vec)
useful for removing duplicates if required ...
Definition: RegSelSiLUT.h:222
RegSelSiLUT::drawlayers
void drawlayers(std::vector< const ZRObject * > &c) const
Definition: RegSelSiLUT.h:214
RegSelSiLUT::getModules
const std::vector< RegSelModule > & getModules() const
Definition: RegSelSiLUT.h:75
RegSelSiLUT::read
bool read(std::istream &s)
Definition: RegSelSiLUT.cxx:1175
RegSelSiLUT::sTGC
@ sTGC
Definition: RegSelSiLUT.h:45
RegSelSiLUT::m_SubDet
std::vector< RegSelSubDetector > m_SubDet
Definition: RegSelSiLUT.h:235
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
python.compressB64.c
def c
Definition: compressB64.py:93
RegSelSiLUT::disableRobs
void disableRobs()
Definition: RegSelSiLUT.cxx:722
ZRObject::inRoI
virtual bool inRoI(const RegSelRoI &roi) const
Definition: ZRObject.h:71
RegSelSiLUT::ID
DET ID() const
Definition: RegSelSiLUT.h:84