121 const std::string
s[8] = {
"",
"pixel",
"sct",
"trt",
"ftk",
"mm",
"stgc",
"rpc" };
145 std::vector<int> subdetid;
149 int detid = mptr->detector();
152 for (
int j=subdetid.size() ; j-- ; )
if ( subdetid[j]==detid )
found =
true;
154 if ( !
found ) subdetid.push_back(detid);
164 for (
int i=subdetid.size() ;
i-- ; ) {
166 m_idmap.insert( std::map<int, int>::value_type(subdetid[
i],
i) );
186 m_map[(*mptr).hashID()] = &(*mptr);
209 std::set<uint32_t> robids;
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() ) {
216 robids.insert((*mptr).robID());
221 while ( ritr!=robids.end() ) {
235 (*sptr).setupDisabledModules();
243 std::map<const IdentifierHash, const RegSelModule*>::const_iterator hptr(
m_map.find(
h));
244 if ( hptr!=
m_map.end() )
return hptr->second;
283 if ( inSubDet )
m_SubDet[
i].getModules(roi, modules);
296 modules.reserve(256);
299 bool subdetflag =
layer/1000;
301 int ilayer =
layer%100;
302 if ( subdetflag ) subdet = (
layer%1000)/100;
322 int ilayer =
layer%100;
324 bool subdetflag =
layer/1000;
326 if ( subdetflag ) subdet = (
layer%1000)/100;
330 if ( !subdetflag || ( subdetflag && subdet==std::fabs(
m_SubDet[
i].
ID()) ) ) {
333 if ( inSubDet )
m_SubDet[
i].getModules(roi, ilayer, modules);
356 if ( subdetector<
m_SubDet.size() ) {
357 inDet =
m_SubDet[subdetector].inRoI(roi);
358 if ( inDet )
m_SubDet[subdetector].getModules(roi,
layer, modules);
384 if ( fabs(
a)>1 ) {
status =
false;
return 0; }
388 double phip = asin(
a)+
phi;
393 if ( phip>
M_PI ) phip = phip-2*
M_PI;
394 if ( phip<-
M_PI ) phip = phip+2*
M_PI;
403 bool philimits(
double x,
double y,
double rmin,
double rmax,
double& phimin,
double& phimax ) {
451 for (
unsigned j=0 ; j<
layers.size() ; j++ ) {
453 double rmin =
layers[j].rMin();
454 double rmax =
layers[j].rMax();
463 if (
philimits(
x,
y, rmin, rmax, phimin, phimax) ) {
470 bool inLayer =
layers[j].inRoI(troi);
474 if ( inLayer )
layers[j].getModules(troi, modules);
499 if ( inSubDet )
m_SubDet[
i].getModules(troi, modules);
525 if ( subdetector<
m_SubDet.size() ) {
527 const std::vector<RegSelLayer>&
layers =
m_SubDet[subdetector].getLayers();
540 if (
philimits(
x,
y, rmin, rmax, phimin, phimax) ) {
551 if ( inLayer )
layers[
layer].getModules(troi, modules);
590 std::vector<const RegSelModule*> modules;
591 if ( modules.size()<256 ) modules.reserve(256);
598 std::set<uint32_t> uroblist;
600 hashlist.reserve(modules.size());
601 roblist.reserve(modules.size());
603 while ( mptr!=modules.end() ) {
604 hashlist.push_back((*mptr)->hashID());
605 roblist.push_back((*mptr++)->robID());
623 std::vector<const RegSelModule*> modules;
624 if ( modules.size()<256 ) modules.reserve(256);
631 std::set<uint32_t> uroblist;
633 hashlist.reserve(modules.size());
634 roblist.reserve(modules.size());
636 while ( mptr!=modules.end() ) {
637 hashlist.push_back((*mptr)->hashID());
638 roblist.push_back((*mptr++)->robID());
654 std::vector<const RegSelModule*> modules;
655 if ( modules.size()<256 ) modules.reserve(256);
666 std::set<uint32_t> uroblist;
669 while ( mptr!=modules.end() ) {
670 uroblist.insert((*mptr++)->robID());
673 roblist.reserve(uroblist.size());
675 while ( plist!=uroblist.end() ) {
676 roblist.push_back(*plist++);
685 roblist.reserve(modules.size());
686 while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
705 std::vector<const RegSelModule*> modules;
706 if ( modules.size()<256 ) modules.reserve(256);
713 std::set<uint32_t> uroblist;
716 while ( mptr!=modules.end() ) {
717 uroblist.insert((*mptr++)->robID());
720 roblist.reserve(uroblist.size());
722 while ( plist!=uroblist.end() ) {
723 roblist.push_back(*plist++);
728 roblist.reserve(modules.size());
730 while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
743 while ( itr!=
m_modules.end() ) (*itr++).enable();
753 while ( itr!=
m_modules.end() ) (*itr++).disable();
764 std::set<uint32_t> robset;
765 for (
unsigned i=0 ;
i<roblist.size() ;
i++ ) robset.insert(roblist[
i]);
770 if ( robset.find((*itr).robID())!=robset.end() ) (*itr).disable();
781 std::set<uint32_t> robset;
782 for (
unsigned i=0 ;
i<roblist.size() ;
i++ ) robset.insert(roblist[
i]);
787 if ( robset.find((*itr).robID())!=robset.end() ) (*itr).enable();
801 std::set<IdentifierHash> hashset;
802 for (
unsigned i=0 ;
i<hashlist.size() ;
i++ ) hashset.insert(hashlist[
i]);
807 if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).disable();
818 std::set<IdentifierHash> hashset;
819 for (
unsigned i=0 ;
i<hashlist.size() ;
i++ ) hashset.insert(hashlist[
i]);
824 if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).enable();
842 std::vector<const RegSelModule*> modules;
843 if ( modules.size()<256 ) modules.reserve(256);
851 hashlist.reserve(modules.size());
852 for ( ; mptr!=modules.end() ; ++mptr ) {
853 hashlist.push_back((*mptr)->hashID());
870 std::vector<const RegSelModule*> modules;
871 if ( modules.size()<256 ) modules.reserve(256);
881 hashlist.reserve(modules.size());
882 for ( ; mptr!=modules.end() ; ++mptr ) {
883 hashlist.push_back((*mptr)->hashID());
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());
921 std::vector<const RegSelModule*> modules;
927 hashlist.reserve(modules.size());
929 while ( mptr!=modules.end() ) {
930 hashlist.push_back((*mptr++)->hashID());
950 roblist.reserve(256);
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());
959 while ( rlist!=uroblist.end() ) {
960 roblist.push_back(*rlist++);
976 roblist.reserve(256);
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());
989 while ( rlist!=uroblist.end() ) {
990 roblist.push_back(*rlist++);
1002 std::vector<const RegSelModule*> modules;
1003 if ( modules.size()<256 ) modules.reserve(256);
1012 hashlist.reserve(modules.size());
1014 while ( mptr!=modules.end() ) {
1015 hashlist.push_back((*mptr++)->hashID());
1034 std::vector<const RegSelModule*> modules;
1035 if ( modules.size()<256 ) modules.reserve(256);
1041 for ( std::vector<RegSelSubDetector>::const_iterator sptr(
m_SubDet.begin()) ;
1044 if ( (*sptr).inRoI(roi) ) {
1046 const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1048 if (
layer<lyrs.size() ) {
1062 while ( mptr!=modules.end() ) {
1063 roblist.push_back((*mptr++)->robID());
1087 std::vector<const RegSelModule*> modules;
1091 roblist.reserve(256);
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());
1117 std::vector<const RegSelModule*> modules;
1118 if ( modules.size()<256 ) modules.reserve(256);
1121 for ( std::vector<RegSelSubDetector>::const_iterator sptr(
m_SubDet.begin()) ;
1124 if ( (*sptr).inRoI(roi) ) {
1126 const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1128 if (
layer<lyrs.size() ) {
1139 while ( mptr!=modules.end() ) {
1140 hashlist.push_back((*mptr++)->hashID());
1150 std::set<int> disabled_layers;
1152 for ( std::vector<RegSelSubDetector>::const_iterator sptr(
m_SubDet.begin()) ;
1157 if ( subdetector!=sptr->ID() )
continue;
1159 if ( (*sptr).inRoI(roi) ) {
1161 const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1165 std::vector<const RegSelModule*> modules;
1166 if ( modules.size()<256 ) modules.reserve(256);
1171 if ( lyr.
inRoI(roi) ) {
1184 while ( bitr!=eitr ) {
layers.push_back(*bitr++); }
1198 std::ifstream
infile(
s.c_str());
1206 unsigned Nmodules = 0;
1212 bool newformat =
false;
1219 if ( newformat )
s.clear();
1221 unsigned modcount=0;
1223 for ( ; newformat || modcount<Nmodules ; modcount++ ) {
1236 if ( (!newformat) && (modcount<Nmodules ) )
return false;