92 const std::string
s[7] = {
"",
"pixel",
"sct",
"trt",
"ftk",
"mm",
"stgc" };
116 std::vector<int> subdetid;
120 int detid = mptr->detector();
123 for (
int j=subdetid.size() ; j-- ; )
if ( subdetid[j]==detid )
found =
true;
125 if ( !
found ) subdetid.push_back(detid);
135 for (
int i=subdetid.size() ;
i-- ; ) {
137 m_idmap.insert( std::map<int, int>::value_type(subdetid[
i],
i) );
157 m_map[(*mptr).hashID()] = &(*mptr);
180 std::set<uint32_t> robids;
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() ) {
187 robids.insert((*mptr).robID());
192 while ( ritr!=robids.end() ) {
206 (*sptr).setupDisabledModules();
214 std::map<const IdentifierHash, const RegSelModule*>::const_iterator hptr(
m_map.find(
h));
215 if ( hptr!=
m_map.end() )
return hptr->second;
254 if ( inSubDet )
m_SubDet[
i].getModules(roi, modules);
267 modules.reserve(256);
270 bool subdetflag =
layer/1000;
272 int ilayer =
layer%100;
273 if ( subdetflag ) subdet = (
layer%1000)/100;
293 int ilayer =
layer%100;
295 bool subdetflag =
layer/1000;
297 if ( subdetflag ) subdet = (
layer%1000)/100;
301 if ( !subdetflag || ( subdetflag && subdet==std::fabs(
m_SubDet[
i].
ID()) ) ) {
304 if ( inSubDet )
m_SubDet[
i].getModules(roi, ilayer, modules);
327 if ( subdetector<
m_SubDet.size() ) {
328 inDet =
m_SubDet[subdetector].inRoI(roi);
329 if ( inDet )
m_SubDet[subdetector].getModules(roi,
layer, modules);
355 if ( fabs(
a)>1 ) {
status =
false;
return 0; }
359 double phip = asin(
a)+
phi;
364 if ( phip>
M_PI ) phip = phip-2*
M_PI;
365 if ( phip<-
M_PI ) phip = phip+2*
M_PI;
374 bool philimits(
double x,
double y,
double rmin,
double rmax,
double& phimin,
double& phimax ) {
422 for (
unsigned j=0 ; j<
layers.size() ; j++ ) {
424 double rmin =
layers[j].rMin();
425 double rmax =
layers[j].rMax();
434 if (
philimits(
x,
y, rmin, rmax, phimin, phimax) ) {
441 bool inLayer =
layers[j].inRoI(troi);
445 if ( inLayer )
layers[j].getModules(troi, modules);
470 if ( inSubDet )
m_SubDet[
i].getModules(troi, modules);
496 if ( subdetector<
m_SubDet.size() ) {
498 const std::vector<RegSelLayer>&
layers =
m_SubDet[subdetector].getLayers();
511 if (
philimits(
x,
y, rmin, rmax, phimin, phimax) ) {
522 if ( inLayer )
layers[
layer].getModules(troi, modules);
561 std::vector<const RegSelModule*> modules;
562 if ( modules.size()<256 ) modules.reserve(256);
569 std::set<uint32_t> uroblist;
571 hashlist.reserve(modules.size());
572 roblist.reserve(modules.size());
574 while ( mptr!=modules.end() ) {
575 hashlist.push_back((*mptr)->hashID());
576 roblist.push_back((*mptr++)->robID());
594 std::vector<const RegSelModule*> modules;
595 if ( modules.size()<256 ) modules.reserve(256);
602 std::set<uint32_t> uroblist;
604 hashlist.reserve(modules.size());
605 roblist.reserve(modules.size());
607 while ( mptr!=modules.end() ) {
608 hashlist.push_back((*mptr)->hashID());
609 roblist.push_back((*mptr++)->robID());
625 std::vector<const RegSelModule*> modules;
626 if ( modules.size()<256 ) modules.reserve(256);
637 std::set<uint32_t> uroblist;
640 while ( mptr!=modules.end() ) {
641 uroblist.insert((*mptr++)->robID());
644 roblist.reserve(uroblist.size());
646 while ( plist!=uroblist.end() ) {
647 roblist.push_back(*plist++);
656 roblist.reserve(modules.size());
657 while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
676 std::vector<const RegSelModule*> modules;
677 if ( modules.size()<256 ) modules.reserve(256);
684 std::set<uint32_t> uroblist;
687 while ( mptr!=modules.end() ) {
688 uroblist.insert((*mptr++)->robID());
691 roblist.reserve(uroblist.size());
693 while ( plist!=uroblist.end() ) {
694 roblist.push_back(*plist++);
699 roblist.reserve(modules.size());
701 while ( mptr!=modules.end() ) roblist.push_back((*mptr++)->robID());
714 while ( itr!=
m_modules.end() ) (*itr++).enable();
724 while ( itr!=
m_modules.end() ) (*itr++).disable();
735 std::set<uint32_t> robset;
736 for (
unsigned i=0 ;
i<roblist.size() ;
i++ ) robset.insert(roblist[
i]);
741 if ( robset.find((*itr).robID())!=robset.end() ) (*itr).disable();
752 std::set<uint32_t> robset;
753 for (
unsigned i=0 ;
i<roblist.size() ;
i++ ) robset.insert(roblist[
i]);
758 if ( robset.find((*itr).robID())!=robset.end() ) (*itr).enable();
772 std::set<IdentifierHash> hashset;
773 for (
unsigned i=0 ;
i<hashlist.size() ;
i++ ) hashset.insert(hashlist[
i]);
778 if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).disable();
789 std::set<IdentifierHash> hashset;
790 for (
unsigned i=0 ;
i<hashlist.size() ;
i++ ) hashset.insert(hashlist[
i]);
795 if ( hashset.find((*itr).hashID())!=hashset.end() ) (*itr).enable();
813 std::vector<const RegSelModule*> modules;
814 if ( modules.size()<256 ) modules.reserve(256);
822 hashlist.reserve(modules.size());
823 for ( ; mptr!=modules.end() ; ++mptr ) {
824 hashlist.push_back((*mptr)->hashID());
841 std::vector<const RegSelModule*> modules;
842 if ( modules.size()<256 ) modules.reserve(256);
852 hashlist.reserve(modules.size());
853 for ( ; mptr!=modules.end() ; ++mptr ) {
854 hashlist.push_back((*mptr)->hashID());
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());
892 std::vector<const RegSelModule*> modules;
898 hashlist.reserve(modules.size());
900 while ( mptr!=modules.end() ) {
901 hashlist.push_back((*mptr++)->hashID());
921 roblist.reserve(256);
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());
930 while ( rlist!=uroblist.end() ) {
931 roblist.push_back(*rlist++);
947 roblist.reserve(256);
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());
960 while ( rlist!=uroblist.end() ) {
961 roblist.push_back(*rlist++);
973 std::vector<const RegSelModule*> modules;
974 if ( modules.size()<256 ) modules.reserve(256);
983 hashlist.reserve(modules.size());
985 while ( mptr!=modules.end() ) {
986 hashlist.push_back((*mptr++)->hashID());
1005 std::vector<const RegSelModule*> modules;
1006 if ( modules.size()<256 ) modules.reserve(256);
1012 for ( std::vector<RegSelSubDetector>::const_iterator sptr(
m_SubDet.begin()) ;
1015 if ( (*sptr).inRoI(roi) ) {
1017 const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1019 if (
layer<lyrs.size() ) {
1033 while ( mptr!=modules.end() ) {
1034 roblist.push_back((*mptr++)->robID());
1058 std::vector<const RegSelModule*> modules;
1062 roblist.reserve(256);
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());
1088 std::vector<const RegSelModule*> modules;
1089 if ( modules.size()<256 ) modules.reserve(256);
1092 for ( std::vector<RegSelSubDetector>::const_iterator sptr(
m_SubDet.begin()) ;
1095 if ( (*sptr).inRoI(roi) ) {
1097 const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1099 if (
layer<lyrs.size() ) {
1110 while ( mptr!=modules.end() ) {
1111 hashlist.push_back((*mptr++)->hashID());
1121 std::set<int> disabled_layers;
1123 for ( std::vector<RegSelSubDetector>::const_iterator sptr(
m_SubDet.begin()) ;
1128 if ( subdetector!=sptr->ID() )
continue;
1130 if ( (*sptr).inRoI(roi) ) {
1132 const std::vector<RegSelLayer>& lyrs = (*sptr).getLayers();
1136 std::vector<const RegSelModule*> modules;
1137 if ( modules.size()<256 ) modules.reserve(256);
1142 if ( lyr.
inRoI(roi) ) {
1155 while ( bitr!=eitr ) {
layers.push_back(*bitr++); }
1169 std::ifstream
infile(
s.c_str());
1177 unsigned Nmodules = 0;
1183 bool newformat =
false;
1190 if ( newformat )
s.clear();
1192 unsigned modcount=0;
1194 for ( ; newformat || modcount<Nmodules ; modcount++ ) {
1207 if ( (!newformat) && (modcount<Nmodules ) )
return false;