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

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
 

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 construct ()
 
virtual void HashIDList_internal (const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const
 horrible internal interface methods 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

static void cleanup (std::vector< IdentifierHash > &idvec)
 annoying cleanup function specifically for the RPC, but we have to add it here since we have abstracted everything to use identical code - perhaps consider creating the RPC instance as a derived class ? More...
 
template<typename T >
static void removeDuplicates (std::vector< T > &vec)
 useful for removing duplicates if required ... More...
 

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 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.

Member Enumeration Documentation

◆ DET

Enumerator
UNDEF 
PIXEL 
SCT 
TRT 
FTK 
MM 
sTGC 
RPC 

Definition at line 45 of file RegSelSiLUT.h.

45 { UNDEF, PIXEL, SCT, TRT, FTK, MM, sTGC, RPC } 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 100 of file RegSelSiLUT.cxx.

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

◆ RegSelSiLUT() [3/4]

RegSelSiLUT::RegSelSiLUT ( const RegSelSiLUT r)

Definition at line 102 of file RegSelSiLUT.cxx.

102  :
103  RegSelName(r.getName()), m_ID(r.ID()) {
104  construct();
105  addModules(r.getModules());
106  initialise();
107 }

◆ RegSelSiLUT() [4/4]

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

Definition at line 109 of file RegSelSiLUT.cxx.

109  :
110  m_ID(UNDEF) {
111  read(s);
112 }

◆ ~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; }

◆ cleanup()

static void RegSelSiLUT::cleanup ( std::vector< IdentifierHash > &  idvec)
inlinestaticprotected

annoying cleanup function specifically for the RPC, but we have to add it here since we have abstracted everything to use identical code - perhaps consider creating the RPC instance as a derived class ?

Definition at line 246 of file RegSelSiLUT.h.

246  {
247  for ( size_t i=idvec.size() ; i-- ; ) idvec[i] = IdentifierHash( ((unsigned)idvec[i]) & 0xfff );
249  }

◆ construct()

void RegSelSiLUT::construct ( )
protectedvirtual

Definition at line 119 of file RegSelSiLUT.cxx.

120 {
121  const std::string s[8] = { "", "pixel", "sct", "trt", "ftk", "mm", "stgc", "rpc" };
122  m_name = s[m_ID];
123 }

◆ disableLayer()

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

Definition at line 261 of file RegSelSiLUT.cxx.

261  {
262  std::map<int,int>::iterator sitr = m_idmap.find(id);
263  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].disableLayer(layer);
264 }

◆ disableModuleList()

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

Definition at line 799 of file RegSelSiLUT.cxx.

799  {
800 
801  std::set<IdentifierHash> hashset;
802  for ( unsigned i=0 ; i<hashlist.size() ; i++ ) hashset.insert(hashlist[i]);
803 
805  for ( ; itr!=m_modules.end() ; ++itr ) {
806  // this module is on the list, so disable it
807  if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).disable();
808  }
811 }

◆ 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 762 of file RegSelSiLUT.cxx.

762  {
763 
764  std::set<uint32_t> robset;
765  for ( unsigned i=0 ; i<roblist.size() ; i++ ) robset.insert(roblist[i]);
766 
768  for ( ; itr!=m_modules.end() ; ++itr ) {
769  // this module's rob is on the list, so disable it
770  if ( robset.find((*itr).robID())!=robset.end() ) (*itr).disable();
771  }
774 }

◆ disableRobs()

void RegSelSiLUT::disableRobs ( )

Definition at line 751 of file RegSelSiLUT.cxx.

751  {
753  while ( itr!=m_modules.end() ) (*itr++).disable();
756 }

◆ disableSubDetector()

void RegSelSiLUT::disableSubDetector ( int  id)

Definition at line 251 of file RegSelSiLUT.cxx.

251  {
252  std::map<int,int>::iterator sitr = m_idmap.find(id);
253  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].disable();
254 }

◆ 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 266 of file RegSelSiLUT.cxx.

266  {
267  std::map<int,int>::iterator sitr = m_idmap.find(id);
268  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].enableLayer(layer);
269 }

◆ enableModuleList()

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

Definition at line 816 of file RegSelSiLUT.cxx.

816  {
817 
818  std::set<IdentifierHash> hashset;
819  for ( unsigned i=0 ; i<hashlist.size() ; i++ ) hashset.insert(hashlist[i]);
820 
822  for ( ; itr!=m_modules.end() ; ++itr ) {
823  // this module is on the list, so enable it
824  if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).enable();
825  }
828 }

◆ 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 779 of file RegSelSiLUT.cxx.

779  {
780 
781  std::set<uint32_t> robset;
782  for ( unsigned i=0 ; i<roblist.size() ; i++ ) robset.insert(roblist[i]);
783 
785  for ( ; itr!=m_modules.end() ; ++itr ) {
786  // this module's rob is on the list, so enable it
787  if ( robset.find((*itr).robID())!=robset.end() ) (*itr).enable();
788  }
791 }

◆ enableRobs()

void RegSelSiLUT::enableRobs ( )

Definition at line 741 of file RegSelSiLUT.cxx.

741  {
743  while ( itr!=m_modules.end() ) (*itr++).enable();
746 }

◆ enableSubDetector()

void RegSelSiLUT::enableSubDetector ( int  id)

Definition at line 256 of file RegSelSiLUT.cxx.

256  {
257  std::map<int,int>::iterator sitr = m_idmap.find(id);
258  if ( sitr!=m_idmap.end() ) m_SubDet[sitr->second].enable();
259 }

◆ getDisabledHashList()

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

Definition at line 1115 of file RegSelSiLUT.cxx.

1115  {
1116 
1117  std::vector<const RegSelModule*> modules;
1118  if ( modules.size()<256 ) modules.reserve(256);
1119 
1120  // for ( std::vector<RegSelSubDetector>::const_iterator sptr(getSubDet().begin()) ;
1121  for ( std::vector<RegSelSubDetector>::const_iterator sptr(m_SubDet.begin()) ;
1122  sptr!=m_SubDet.end() ; ++sptr ) {
1123 
1124  if ( (*sptr).inRoI(roi) ) {
1125 
1126  const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1127 
1128  if ( layer<lyrs.size() ) {
1129  // const RegSelLayer& lyr = lyrs.at(layer);
1130  const RegSelLayer& lyr = lyrs[layer];
1131 
1132  if ( lyr.inRoI(roi) ) lyr.getDisabledModules(roi,modules);
1133  }
1134  }
1135  }
1136 
1137  hashlist.reserve(m_modules.size());
1138  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
1139  while ( mptr!=modules.end() ) {
1140  hashlist.push_back((*mptr++)->hashID());
1141  }
1142 }

◆ getDisabledLayers()

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

Definition at line 1146 of file RegSelSiLUT.cxx.

1146  {
1147 
1148  // layers.clear();
1149 
1150  std::set<int> disabled_layers;
1151 
1152  for ( std::vector<RegSelSubDetector>::const_iterator sptr(m_SubDet.begin()) ;
1153  sptr!=m_SubDet.end() ; ++sptr ) {
1154 
1155  // std::cout << "subdet id = " << sptr->ID() << std::endl;
1156 
1157  if ( subdetector!=sptr->ID() ) continue;
1158 
1159  if ( (*sptr).inRoI(roi) ) {
1160 
1161  const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1162 
1163  for ( int layer=lyrs.size() ; layer-- ; ) {
1164 
1165  std::vector<const RegSelModule*> modules;
1166  if ( modules.size()<256 ) modules.reserve(256);
1167 
1168  // const RegSelLayer& lyr = lyrs.at(layer);
1169  const RegSelLayer& lyr = lyrs[layer];
1170 
1171  if ( lyr.inRoI(roi) ) {
1172  lyr.getDisabledModules(roi,modules);
1173  // if ( modules.size() ) disabled_layers.insert(layer);
1174  if ( modules.size() ) layers.push_back(layer);
1175  }
1176  }
1177  }
1178  }
1179 
1180 #if 0
1181  // copy to output
1182  std::set<int>::iterator bitr(disabled_layers.begin());
1183  std::set<int>::iterator eitr(disabled_layers.end());
1184  while ( bitr!=eitr ) { layers.push_back(*bitr++); }
1185 #endif
1186 
1187 }

◆ getHashList() [1/5]

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

Definition at line 838 of file RegSelSiLUT.cxx.

838  {
839 
840  // bool hashempty = hashlist.empty();
841 
842  std::vector<const RegSelModule*> modules;
843  if ( modules.size()<256 ) modules.reserve(256);
844 
845  // struct timeval datatimer = gtttimer_start();
846  getRoIData(roi,modules);
847  // double datatime = gtttimer_stop(datatimer);
848 
849  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
850 
851  hashlist.reserve(modules.size());
852  for ( ; mptr!=modules.end() ; ++mptr ) {
853  hashlist.push_back((*mptr)->hashID());
854  }
855 
856  // if ( !hashempty ) removeDuplicates( hashlist );
857 
858  // double vectortime = gtttimer_stop(datatimer);
859 
860  // std::cout << "RegSelSiLUT::getHashList() datatime=" << datatime << "\tvectortime=" << vectortime << "\tf="
861  // << 100*(vectortime-datatime)/vectortime << std::endl;
862 
863 }

◆ getHashList() [2/5]

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

Definition at line 868 of file RegSelSiLUT.cxx.

868  {
869 
870  std::vector<const RegSelModule*> modules;
871  if ( modules.size()<256 ) modules.reserve(256);
872 
873  // struct timeval datatimer = gtttimer_start();
874  getRoIData( roi, modules, x, y );
875  // double datatime = gtttimer_stop(datatimer);
876 
877  // bool hashempty = hashlist.empty();
878 
879  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
880 
881  hashlist.reserve(modules.size());
882  for ( ; mptr!=modules.end() ; ++mptr ) {
883  hashlist.push_back((*mptr)->hashID());
884  }
885 
886  // if ( !hashempty ) removeDuplicates( hashlist );
887 
888 }

◆ getHashList() [3/5]

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

Definition at line 998 of file RegSelSiLUT.cxx.

998  {
999 
1000  // bool hashempty = hashlist.empty();
1001 
1002  std::vector<const RegSelModule*> modules;
1003  if ( modules.size()<256 ) modules.reserve(256);
1004 
1005 
1006  getRoIData( roi, layer, modules);
1007 
1008  // struct timeval datatimer = gtttimer_start();
1009 
1010  // double datatime = gtttimer_stop(datatimer);
1011 
1012  hashlist.reserve(modules.size());
1013  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
1014  while ( mptr!=modules.end() ) {
1015  hashlist.push_back((*mptr++)->hashID());
1016  }
1017 
1018  // if ( !hashempty ) removeDuplicates( hashlist );
1019 
1020  // double vectortime = gtttimer_stop(datatimer);
1021 
1022  // std::cout << "RegSelSiLUT::getHashList() datatime=" << datatime << "\tvectortime=" << vectortime << "\tf="
1023  // << 100*(vectortime-datatime)/vectortime << std::endl;
1024 
1025 }

◆ getHashList() [4/5]

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

Definition at line 895 of file RegSelSiLUT.cxx.

895  {
896 
897 #ifndef OLDFULLSCAN
898  hashlist.reserve(m_allHashes.size());
899  hashlist = m_allHashes;
900  return;
901 #else
902 
903  hashlist.clear();
904  hashlist.reserve(m_modules.size());
905 
906  std::vector<RegSelModule>::const_iterator mptr(m_modules.begin());
907  std::vector<RegSelModule>::const_iterator eptr(m_modules.end());
908  for ( ; mptr!=eptr ; ++mptr ) {
909  if ( (*mptr).enabled() ) hashlist.push_back((*mptr).hashID());
910  }
911 #endif
912 }

◆ getHashList() [5/5]

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

Definition at line 919 of file RegSelSiLUT.cxx.

919  {
920 
921  std::vector<const RegSelModule*> modules;
922 
923  // bool hashempty = hashlist.empty();
924 
925  getModules( layer, modules );
926 
927  hashlist.reserve(modules.size());
928  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
929  while ( mptr!=modules.end() ) {
930  hashlist.push_back((*mptr++)->hashID());
931  }
932 
933  // if ( !hashempty ) removeDuplicates( hashlist );
934 
935 }

◆ 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 295 of file RegSelSiLUT.cxx.

295  {
296  modules.reserve(256);
297 
299  bool subdetflag = layer/1000;
300  int subdet = 0;
301  int ilayer = layer%100;
302  if ( subdetflag ) subdet = (layer%1000)/100;
303 
304  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
305  if ( !subdetflag || ( subdetflag && subdet==std::fabs(m_SubDet[i].ID()) ) ) m_SubDet[i].getModules( ilayer, modules);
306  }
307  }

◆ 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 588 of file RegSelSiLUT.cxx.

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

◆ 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 621 of file RegSelSiLUT.cxx.

622 {
623  std::vector<const RegSelModule*> modules;
624  if ( modules.size()<256 ) modules.reserve(256);
625 
626  // get the modules
627  getRoIData(roi, layer, modules);
628 
629  // fill the rob and hashid lists
630 
631  std::set<uint32_t> uroblist;
632 
633  hashlist.reserve(modules.size());
634  roblist.reserve(modules.size());
635  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
636  while ( mptr!=modules.end() ) {
637  hashlist.push_back((*mptr)->hashID());
638  roblist.push_back((*mptr++)->robID());
639  }
640  // removeDuplicates( hashlist );
641  removeDuplicates( roblist );
642 
643  // roblist.reserve(uroblist.size());
644  // std::set<uint32_t>::iterator plist(uroblist.begin());
645  // while ( plist!=uroblist.end() ) {
646  // roblist.push_back(*plist++);
647  // }
648 
649 }

◆ getRobHashList() [3/3]

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

Definition at line 967 of file RegSelSiLUT.cxx.

967  {
968 
969 #ifndef OLDFULLSCAN
970  hashlist.reserve(m_allHashes.size());
971  roblist.reserve(m_allROBids.size());
972  roblist = m_allROBids;
973  hashlist = m_allHashes;
974  return;
975 #else
976  roblist.reserve(256);
977  hashlist.reserve(m_modules.size());
978 
979  std::set<uint32_t> uroblist;
980  std::vector<RegSelModule>::const_iterator mptr(m_modules.begin());
981  for ( ; mptr!=m_modules.end() ; ++mptr ) {
982  if ( (*mptr).enabled() ) {
983  uroblist.insert((*mptr).robID());
984  hashlist.push_back((*mptr).hashID());
985  }
986  }
987 
988  std::set<uint32_t>::iterator rlist(uroblist.begin());
989  while ( rlist!=uroblist.end() ) {
990  roblist.push_back(*rlist++);
991  }
992 #endif
993 }

◆ 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 652 of file RegSelSiLUT.cxx.

652  {
653 
654  std::vector<const RegSelModule*> modules;
655  if ( modules.size()<256 ) modules.reserve(256);
656 
657  // struct timeval datatimer = gtttimer_start();
658  getRoIData(roi,modules);
659  // double datatime = gtttimer_stop(datatimer);
660 
661 #if 0
662  // get the list of unique rob identifiers
663  // FIXME: this uses a set, sould be *much* faster
664  // with a seperate list of robids with their modules'
665  // corresponding extents in r, phi and z etc
666  std::set<uint32_t> uroblist;
667 
668  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
669  while ( mptr!=modules.end() ) {
670  uroblist.insert((*mptr++)->robID());
671  }
672 
673  roblist.reserve(uroblist.size());
674  std::set<uint32_t>::iterator plist(uroblist.begin());
675  while ( plist!=uroblist.end() ) {
676  roblist.push_back(*plist++);
677  }
678 
679 #endif
680 
683  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
684 
685  roblist.reserve(modules.size());
686  while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
687  if ( removeduplicates || roblist.size()>2000 ) removeDuplicates( roblist );
688 
689  // double vectortime = gtttimer_stop(datatimer);
690 
691  // std::cout << "RegSelSiLUT::getRobList() datatime=" << datatime
692  // << "\tvectortime=" << vectortime << "\tf="
693  // << 100*(vectortime-datatime)/vectortime << std::endl;
694 
695 }

◆ getRobList() [2/5]

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

Definition at line 703 of file RegSelSiLUT.cxx.

703  {
704 
705  std::vector<const RegSelModule*> modules;
706  if ( modules.size()<256 ) modules.reserve(256);
707 
708  // struct timeval datatimer = gtttimer_start();
709  getRoIData( roi, modules, x, y );
710  // double datatime = gtttimer_stop(datatimer);
711 
712 #if 0
713  std::set<uint32_t> uroblist;
714 
715  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
716  while ( mptr!=modules.end() ) {
717  uroblist.insert((*mptr++)->robID());
718  }
719 
720  roblist.reserve(uroblist.size());
721  std::set<uint32_t>::iterator plist(uroblist.begin());
722  while ( plist!=uroblist.end() ) {
723  roblist.push_back(*plist++);
724  }
725 
726 #endif
727 
728  roblist.reserve(modules.size());
729  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
730  while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
731  removeDuplicates( roblist );
732 
733 }

◆ getRobList() [3/5]

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

Definition at line 1032 of file RegSelSiLUT.cxx.

1032  {
1033 
1034  std::vector<const RegSelModule*> modules;
1035  if ( modules.size()<256 ) modules.reserve(256);
1036 
1037 
1038  getRoIData( roi, layer, modules);
1039 
1040 #if 0
1041  for ( std::vector<RegSelSubDetector>::const_iterator sptr(m_SubDet.begin()) ;
1042  sptr!=m_SubDet.end() ; sptr++ ) {
1043 
1044  if ( (*sptr).inRoI(roi) ) {
1045 
1046  const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1047 
1048  if ( layer<lyrs.size() ) {
1049  const RegSelLayer& lyr = lyrs[layer];
1050  if ( lyr.inRoI(roi) ) lyr.getModules(roi,modules);
1051  }
1052  }
1053  }
1054 #endif
1055 
1056  // struct timeval datatimer = gtttimer_start();
1057 
1058  // double datatime = gtttimer_stop(datatimer);
1059 
1060  // std::vector<uint32_t> uroblist;
1061  std::vector<const RegSelModule*>::iterator mptr(modules.begin());
1062  while ( mptr!=modules.end() ) {
1063  roblist.push_back((*mptr++)->robID());
1064  }
1065 
1066  // std::set<uint32_t>::iterator rlist(uroblist.begin());
1067  // while ( rlist!=uroblist.end() ) {
1068  // roblist.push_back(*rlist++);
1069  // }
1070 
1071  if ( removeduplicates || roblist.size()>4000 ) removeDuplicates( roblist );
1072 
1073 }

◆ getRobList() [4/5]

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

Definition at line 943 of file RegSelSiLUT.cxx.

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

◆ getRobList() [5/5]

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

Definition at line 1085 of file RegSelSiLUT.cxx.

1085  {
1086 
1087  std::vector<const RegSelModule*> modules;
1088 
1089  getModules( layer, modules );
1090 
1091  roblist.reserve(256);
1092 
1093  std::set<uint32_t> uroblist;
1094  std::vector<const RegSelModule*>::const_iterator mptr(modules.begin());
1095  for ( ; mptr!=modules.end() ; ++mptr ) {
1096  if ( (*mptr)->enabled() ) roblist.push_back((*mptr)->robID());
1097  }
1098  removeDuplicates( roblist );
1099 
1100  // std::set<uint32_t>::iterator rlist(uroblist.begin());
1101  // while ( rlist!=uroblist.end() ) roblist.push_back(*rlist++);
1102 
1103 }

◆ getRoIData() [1/5]

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

Definition at line 273 of file RegSelSiLUT.cxx.

274 {
275  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << "\t" << roi << std::endl;
276 
277  bool inDet = false;
278 
279  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
280  bool inSubDet = m_SubDet[i].inRoI(roi);
281  inDet |= inSubDet;
282  // std::cout << "\tRegSelSiLUT::getRoIData() SubDet id " << m_SubDet[i].ID() << std::endl;
283  if ( inSubDet ) m_SubDet[i].getModules(roi, modules);
284  }
285 
286  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
287  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
288 
289  return inDet;
290 }

◆ getRoIData() [2/5]

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

Definition at line 438 of file RegSelSiLUT.cxx.

439 {
440 
441  if ( x==0 && y==0 ) return getRoIData(roi, modules);
442 
443  bool inDet = false;
444 
445  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
446 
447 #if 1
448 
449  const std::vector<RegSelLayer>& layers = m_SubDet[i].getLayers();
450 
451  for ( unsigned j=0 ; j<layers.size() ; j++ ) {
452 
453  double rmin = layers[j].rMin();
454  double rmax = layers[j].rMax();
455 
456  double phimin = roi.getphiMin();
457  double phimax = roi.getphiMax();
458 
459  // std::cout << layers[j] << "\t" << rmin << " " << rmax << std::endl;
460 
461  // std::cout << "lyr[" << j << "] " << "\tphimin=" << phimin << "\tphimax=" << phimax << "\tbefore" << std::endl;
462 
463  if ( philimits(x, y, rmin, rmax, phimin, phimax) ) {
464 
465  // std::cout << layers[j] << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
466 
467  RegSelRoI troi( roi.getzMin(), roi.getzMax(), phimin, phimax, roi.getetaMin(), roi.getetaMax() );
468 
469 
470  bool inLayer = layers[j].inRoI(troi);
471 
472  inDet |= inLayer;
473 
474  if ( inLayer ) layers[j].getModules(troi, modules);
475 
476  }
477 
478  }
479 
480 #else
481 
482 
483  double rmin = m_SubDet[i].rMin();
484  double rmax = m_SubDet[i].rMax();
485 
486  double phimin = roi.getphiMin();
487  double phimax = roi.getphiMax();
488 
489  // std::cout << layers[j] << "\t" << rmin << " " << rmax << std::endl;
490 
491  philimits(x, y, rmin, rmax, phimin, phimax);
492 
493  // std::cout << layers[j] << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
494 
495  RegSelRoI troi( roi.getzMin(), roi.getzMax(), phimin, phimax, roi.getetaMin(), roi.getetaMax() );
496 
497  bool inSubDet = m_SubDet[i].inRoI(troi);
498  inDet |= inSubDet;
499  if ( inSubDet ) m_SubDet[i].getModules(troi, modules);
500 
501 #endif
502 
503  }
504  // std::cout << "getRoIData() time=" << _time << " ms (shifted)" << std::endl;
505 
506  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
507 
508  return inDet;
509 }

◆ 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 315 of file RegSelSiLUT.cxx.

316 {
317  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << std::endl;
318 
319  bool inDet = false;
320 
321 
322  int ilayer = layer%100;
324  bool subdetflag = layer/1000;
325  int subdet = 0;
326  if ( subdetflag ) subdet = (layer%1000)/100;
327 
328  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) {
329 
330  if ( !subdetflag || ( subdetflag && subdet==std::fabs(m_SubDet[i].ID()) ) ) {
331  bool inSubDet = m_SubDet[i].inRoI(roi);
332  inDet |= inSubDet;
333  if ( inSubDet ) m_SubDet[i].getModules(roi, ilayer, modules);
334  }
335  }
336 
337 
338 
339 
340  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
341  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
342 
343  return inDet;
344 }

◆ getRoIData() [4/5]

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

Definition at line 350 of file RegSelSiLUT.cxx.

351 {
352  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << std::endl;
353 
354  bool inDet = false;
355 
356  if ( subdetector<m_SubDet.size() ) {
357  inDet = m_SubDet[subdetector].inRoI(roi);
358  if ( inDet ) m_SubDet[subdetector].getModules(roi, layer, modules);
359  }
360  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
361  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
362 
363  return inDet;
364 }

◆ 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 514 of file RegSelSiLUT.cxx.

515 {
516 
517  if ( x==0 && y==0 ) return getRoIData(roi, subdetector, layer, modules);
518 
519  // std::cout << "RegSelSiLUT::getRoIData() ID=" << ID() << std::endl;
520 
521  // struct timeval _timer = gtttimer_start();
522 
523  bool inDet = false;
524 
525  if ( subdetector<m_SubDet.size() ) {
526 
527  const std::vector<RegSelLayer>& layers = m_SubDet[subdetector].getLayers();
528 
529  if ( layer<layers.size() ) {
530 
531  double rmin = layers[layer].rMin();
532  double rmax = layers[layer].rMax();
533 
534  double phimin = roi.getphiMin();
535  double phimax = roi.getphiMax();
536 
537  // std::cout << layers[j] << "\t" << rmin << " " << rmax << std::endl;
538  // std::cout << "lyr[" << subdetector << "] " << "\tphimin=" << phimin << "\tphimax=" << phimax << "\tbefore" << std::endl;
539 
540  if ( philimits(x, y, rmin, rmax, phimin, phimax) ) {
541 
542  // std::cout << layers[j] << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
543  // std::cout << "lyr[" << subdetector << "] " << "\tphimin=" << phimin << "\tphimax=" << phimax << std::endl;
544 
545  RegSelRoI troi( roi.getzMin(), roi.getzMax(), phimin, phimax, roi.getetaMin(), roi.getetaMax() );
546 
547  bool inLayer = layers[layer].inRoI(troi);
548 
549  inDet |= inLayer;
550 
551  if ( inLayer ) layers[layer].getModules(troi, modules);
552 
553  }
554  }
555  }
556 
557  // double _time = gtttimer_stop(_timer);
558 
559  // std::cout << "getRoIData() time=" << _time << " ms (shifted)" << std::endl;
560 
561  // std::cout << "RegSelSiLUT::getRoIData() Nmodules=" << modules.size() << std::endl;
562  // for ( int i=0 ; i<modules.size() ; i++ ) modules[i]->paw();
563 
564  return inDet;
565 }

◆ 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  IRegSelLUT::IDList<RegSelSiLUT>( roi, idlist, &RegSelSiLUT::HashIDList_internal );
41  if ( m_ID == RPC ) RegSelSiLUT::cleanup( idlist );
42 }

◆ 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 45 of file RegSelSiLUT.cxx.

45  {
46  IRegSelLUT::IDList_layer<RegSelSiLUT>( layer, roi, idlist, &RegSelSiLUT::HashIDList_internal );
47  if ( m_ID == RPC ) RegSelSiLUT::cleanup( idlist );
48 }

◆ HashIDList_internal() [1/2]

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

horrible internal interface methods

protected single Roi mathods

hashid methods

hash id methods

Definition at line 68 of file RegSelSiLUT.cxx.

68  {
69  if ( roi.isFullscan() ) return getHashList( idlist );
70  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
71  getHashList( roitmp, idlist );
72  if ( m_ID == MM || m_ID == sTGC ) removeDuplicates( idlist );
73 }

◆ HashIDList_internal() [2/2]

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

Definition at line 76 of file RegSelSiLUT.cxx.

76  {
77  if ( roi.isFullscan() ) return getHashList( layer, idlist );
78  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
79  getHashList( roitmp, layer, idlist );
80  if ( m_ID == MM || m_ID == sTGC ) removeDuplicates( idlist );
81 }

◆ ID()

DET RegSelSiLUT::ID ( ) const
inline

Definition at line 84 of file RegSelSiLUT.h.

84 { return m_ID; }

◆ 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  }

◆ 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 139 of file RegSelSiLUT.cxx.

139  {
140 
141  // struct timeval inittimer = gtttimer_start();
142 
143  // find out how many subdetectors there are
144 
145  std::vector<int> subdetid;
146 
147  for ( std::vector<RegSelModule>::iterator mptr = m_modules.begin() ;
148  mptr!=m_modules.end() ; ++mptr ) {
149  int detid = mptr->detector();
150 
151  bool found = false;
152  for ( int j=subdetid.size() ; j-- ; ) if ( subdetid[j]==detid ) found = true;
153 
154  if ( !found ) subdetid.push_back(detid);
155  }
156 
157  // std::cout << "\tRegSelSiLUT::initialise() creating detector with " << subdetid.size() << " subdetectors" << std::endl;
158 
159  // std::cout << "RegSelSiLUT::initialise()" << std::endl;
160 
161  m_SubDet.reserve(subdetid.size());
162 
163  // push each one to the list
164  for ( int i=subdetid.size() ; i-- ; ) {
165  m_SubDet.push_back( RegSelSubDetector(subdetid[i]) );
166  m_idmap.insert( std::map<int, int>::value_type(subdetid[i], i) );
167 
168  //int ii = subdetid.size()-1-i;
169  //std::cout << "\tsubdet " << ii << "\tid " << subdetid[ii] << std::endl;
170  }
171 
172 
173 
174 
175  // initialise the subdetector look up tables
176  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) m_SubDet[i].addModules(m_modules);
177 
178  // std::cout << "\tRegSelSiLUT " << getName() << std::endl;
179  // write(getName()+".map");
180 
181  // std::cout << "RegSelSiLUT::initialise() creating hash map" << std::endl;
182 
183  // and save pointers to all the modules in a map by hashid
184  for ( std::vector<RegSelModule>::iterator mptr = m_modules.begin() ;
185  mptr!=m_modules.end() ; ++mptr ) {
186  m_map[(*mptr).hashID()] = &(*mptr);
187  }
188 
189  // std::cout << "RegSelSiLUT::initialise() exiting" << std::endl;
190 
191  // double inittime = gtttimer_stop(inittimer);
192  // std::cout << "initialise time=" << inittime << std::endl;
193 
196 
200 
201 }

◆ initialiseDisabledModules()

void RegSelSiLUT::initialiseDisabledModules ( )

Definition at line 232 of file RegSelSiLUT.cxx.

232  {
234  sptr!=m_SubDet.end() ; ++sptr ) {
235  (*sptr).setupDisabledModules();
236  }
237 }

◆ initialiseFullScan()

void RegSelSiLUT::initialiseFullScan ( )

Definition at line 204 of file RegSelSiLUT.cxx.

204  {
205 
206  m_allHashes.clear();
207  m_allROBids.clear();
208 
209  std::set<uint32_t> robids;
210 
211  std::vector<RegSelModule>::const_iterator mptr(m_modules.begin());
212  std::vector<RegSelModule>::const_iterator eptr(m_modules.end());
213  for ( ; mptr!=eptr ; ++mptr ) {
214  if ( (*mptr).enabled() ) {
215  m_allHashes.push_back((*mptr).hashID());
216  robids.insert((*mptr).robID());
217  }
218  }
219 
220  std::set<uint32_t>::iterator ritr(robids.begin());
221  while ( ritr!=robids.end() ) {
222  m_allROBids.push_back(*ritr++);
223  }
224 
225 }

◆ Module()

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

Definition at line 242 of file RegSelSiLUT.cxx.

242  {
243  std::map<const IdentifierHash, const RegSelModule*>::const_iterator hptr(m_map.find(h));
244  if ( hptr!=m_map.end() ) return hptr->second;
245  else return NULL;
246 }

◆ read() [1/2]

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

Definition at line 1197 of file RegSelSiLUT.cxx.

1197  {
1198  std::ifstream infile(s.c_str());
1199  // std::cout << "RegSelSiLUT::read() from file " << s << std::endl;
1200  return read(infile);
1201 }

◆ read() [2/2]

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

Definition at line 1204 of file RegSelSiLUT.cxx.

1204  {
1205 
1206  unsigned Nmodules = 0;
1207 
1208  // old method - read number of modules and try tp read them in
1209  // new method - just read until module list exhausted,
1210  // this code will allow either
1211 
1212  bool newformat = false;
1213 
1214  s >> Nmodules;
1215 
1216  newformat=s.fail();
1217 
1218  // couldn't read number of modules - try new format
1219  if ( newformat ) s.clear();
1220 
1221  unsigned modcount=0;
1222 
1223  for ( ; newformat || modcount<Nmodules ; modcount++ ) {
1224  RegSelModule m;
1225  if ( !getModule(s, m) ) break;
1226  addModule(m);
1227  }
1228 
1229  // std::cout << "read() newformat " << newformat << std::endl;
1230  // std::cout << "read() read " << modcount << " modules" << std::endl;
1231  // std::cout << "read() Nmodules " << Nmodules << "\tsize " << m_modules.size() << std::endl;
1232 
1233  // std::cout << "RegSelSiLUT::read() creating tables" << std::endl;
1234  initialise();
1235 
1236  if ( (!newformat) && (modcount<Nmodules ) ) return false;
1237 
1238  return true;
1239 }

◆ 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  }

◆ reset()

void RegSelSiLUT::reset ( )

Definition at line 129 of file RegSelSiLUT.cxx.

129  {
130  for ( unsigned i=0 ; i<m_SubDet.size() ; i++ ) m_SubDet[i].reset();
131  m_map.clear();
132 }

◆ 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 53 of file RegSelSiLUT.cxx.

53  {
54  IRegSelLUT::IDList<RegSelSiLUT>( roi, roblist, &RegSelSiLUT::ROBIDList_internal );
55 }

◆ 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 58 of file RegSelSiLUT.cxx.

58  {
59  IRegSelLUT::IDList_layer<RegSelSiLUT>( layer, roi, roblist, &RegSelSiLUT::ROBIDList_internal );
60 }

◆ ROBIDList_internal() [1/2]

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

rob methods

rob methods

Definition at line 85 of file RegSelSiLUT.cxx.

85  {
86  if ( roi.isFullscan() ) return getRobList( roblist );
87  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
88  getRobList( roitmp, roblist);
89 }

◆ ROBIDList_internal() [2/2]

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

Definition at line 92 of file RegSelSiLUT.cxx.

92  {
93  if ( roi.isFullscan() ) return getRobList( layer, roblist );
94  RegSelRoI roitmp( roi.zedMinus(), roi.zedPlus(), roi.phiMinus(), roi.phiPlus(), roi.etaMinus(), roi.etaPlus() );
95  getRobList( roitmp, layer, roblist);
96 }

◆ write() [1/2]

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

Definition at line 579 of file RegSelSiLUT.cxx.

579  {
580  std::ofstream outfile(s.c_str());
581  write(outfile);
582 }

◆ write() [2/2]

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

Definition at line 572 of file RegSelSiLUT.cxx.

572  {
573  s << m_modules.size() << std::endl;
574  for ( unsigned i=0 ; i<m_modules.size() ; i++ ) {
575  s << m_modules[i] << std::endl;
576  }
577 }

Member Data Documentation

◆ m_allHashes

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

Definition at line 234 of file RegSelSiLUT.h.

◆ m_allROBids

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

Definition at line 235 of file RegSelSiLUT.h.

◆ m_disabled

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

Definition at line 229 of file RegSelSiLUT.h.

◆ m_ID

DET RegSelSiLUT::m_ID
protected

Definition at line 224 of file RegSelSiLUT.h.

◆ m_idmap

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

Definition at line 237 of file RegSelSiLUT.h.

◆ m_map

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

Definition at line 231 of file RegSelSiLUT.h.

◆ m_modules

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

Definition at line 227 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 226 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:235
RegSelSiLUT::ROBIDList_internal
virtual void ROBIDList_internal(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const
rob methods
Definition: RegSelSiLUT.cxx:85
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:232
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:234
DMTest::C
C_v1 C
Definition: C.h:26
RegSelSiLUT::getRoIData
bool getRoIData(const RegSelRoI &r, std::vector< const RegSelModule * > &modules) const
Definition: RegSelSiLUT.cxx:273
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
IRoiDescriptor::size
virtual unsigned size() const =0
number of constituents
RegSelSiLUT::initialiseFullScan
void initialiseFullScan()
Definition: RegSelSiLUT.cxx:204
RegSelLayer
Definition: RegSelLayer.h:39
RegSelSiLUT::m_modules
std::vector< RegSelModule > m_modules
Definition: RegSelSiLUT.h:227
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:131
RegSelSiLUT::write
void write(std::ostream &s=std::cout) const
Definition: RegSelSiLUT.cxx:572
RegSelSiLUT::initialise
void initialise()
Definition: RegSelSiLUT.cxx:139
RegSelSiLUT::TRT
@ TRT
Definition: RegSelSiLUT.h:45
RegSelSiLUT::enableRobs
void enableRobs()
Definition: RegSelSiLUT.cxx:741
lumiFormat.i
int i
Definition: lumiFormat.py:85
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:1032
RegSelSiLUT::m_ID
DET m_ID
Definition: RegSelSiLUT.h:224
IRoiDescriptor::phiMinus
virtual double phiMinus() const =0
RegSelSiLUT::m_idmap
std::map< int, int > m_idmap
Definition: RegSelSiLUT.h:237
RegSelSiLUT::HashIDList_internal
virtual void HashIDList_internal(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const
horrible internal interface methods
Definition: RegSelSiLUT.cxx:68
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:838
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:403
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
DetDescrDictionaryDict::idvec
DataVector< Identifier > idvec
Definition: DetDescrDictionaryDict.h:14
RegSelSiLUT::construct
virtual void construct()
Definition: RegSelSiLUT.cxx:119
RegSelSiLUT::cleanup
static void cleanup(std::vector< IdentifierHash > &idvec)
annoying cleanup function specifically for the RPC, but we have to add it here since we have abstract...
Definition: RegSelSiLUT.h:246
RegSelSiLUT::addModule
void addModule(RegSelModule &module)
Definition: RegSelSiLUT.h:71
RegSelSiLUT::reset
void reset()
Definition: RegSelSiLUT.cxx:129
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:231
CaloSwCorrections.removeduplicates
def removeduplicates(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:233
IRoiDescriptor::zedMinus
virtual double zedMinus() const =0
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
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
RegSelSiLUT::read
bool read(std::istream &s)
Definition: RegSelSiLUT.cxx:1204
RegSelSiLUT::sTGC
@ sTGC
Definition: RegSelSiLUT.h:45
IRoiDescriptor::at
virtual const IRoiDescriptor * at(int i) const =0
find an RoiDescriptor constituent
RegSelSiLUT::m_SubDet
std::vector< RegSelSubDetector > m_SubDet
Definition: RegSelSiLUT.h:226
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
IRegSelLUT::removeDuplicates
static void removeDuplicates(std::vector< T > &vec)
useful for removing duplicates if required ...
Definition: IRegSelLUT.h:78
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
RegSelSiLUT::disableRobs
void disableRobs()
Definition: RegSelSiLUT.cxx:751
RegSelSiLUT::RPC
@ RPC
Definition: RegSelSiLUT.h:45
ZRObject::inRoI
virtual bool inRoI(const RegSelRoI &roi) const
Definition: ZRObject.h:71
RegSelSiLUT::ID
DET ID() const
Definition: RegSelSiLUT.h:84
IRoiDescriptor::composite
virtual bool composite() const =0
Super RoI access methods.