94 for(
i = 0;
i < nLines; ++
i){
103 (*it).findMaxMinElem();
105 (*it).findMaxMinElem();
107 (*it).findMaxMinElem();
117 double etaminIn,
double etamaxIn,
118 double phiminIn,
double phimaxIn,
119 std::vector<uint32_t>&
outList )
const {
123 std::list<RegSelectorMapElement>::const_iterator
it;
124 std::set<uint32_t> outset;
125 std::set<uint32_t>::const_iterator itset, negbarrelbeg, negbarrelend;
126 bool divideEta =
false;
130 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset );
134 case TILE: divideEta =
true;
break;
139 if(etaminIn < 0 || etamaxIn < 0){
141 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
145 if( etaminIn >= 0 || etamaxIn >= 0 ){
147 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
153 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
156 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
161 negbarrelbeg = outset.upper_bound(0x51000f);
162 negbarrelend = outset.lower_bound(0x530000);
163 for(itset = negbarrelbeg; itset != negbarrelend; ++itset){
166 for(itset = outset.begin(); itset != negbarrelbeg; ++itset){
169 for(itset = negbarrelend; itset != outset.end(); ++itset){
173 for(itset = outset.begin(); itset != outset.end(); ++itset){
198 double etaminIn,
double etamaxIn,
199 double phiminIn,
double phimaxIn,
200 std::vector<IdentifierHash>&
outList)
const {
204 std::list<RegSelectorMapElement>::const_iterator
it;
205 std::set<IdentifierHash> outset;
206 std::set<IdentifierHash>::const_iterator itset, negbarrelbeg,negbarrelend;
207 bool divideEta =
false;
211 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
215 case TILE: divideEta =
true;
break;
220 if(etaminIn < 0 || etamaxIn < 0){
222 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
226 if( etaminIn >= 0 || etamaxIn >= 0 ){
228 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
234 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
237 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
242 negbarrelbeg = outset.upper_bound(0x3f);
243 negbarrelend = outset.lower_bound(0x80);
244 for(itset = negbarrelbeg; itset != negbarrelend; ++itset){
247 for(itset = outset.begin(); itset != negbarrelbeg; ++itset){
250 for(itset = negbarrelend; itset != outset.end(); ++itset){
254 for(itset = outset.begin(); itset != outset.end(); ++itset){
262 double etaminIn,
double etamaxIn,
263 double phiminIn,
double phimaxIn,
264 std::vector<IdentifierHash>&
outList)
const {
268 std::list<RegSelectorMapElement>::const_iterator
it;
269 std::set<IdentifierHash> outset;
270 std::set<IdentifierHash>::const_iterator itset;
274 if( etaminIn > 0 && etamaxIn > 0 ){
277 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
279 else if( etaminIn < 0 && etamaxIn < 0 ){
282 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
287 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
290 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
293 for(itset = outset.begin(); itset != outset.end(); ++itset){
301 double etaminIn,
double etamaxIn,
302 double phiminIn,
double phimaxIn,
303 std::vector<IdentifierHash>&
outList)
const {
307 std::list<RegSelectorMapElement>::const_iterator
it, itEnd;
308 std::set<IdentifierHash> outset;
309 std::set<IdentifierHash>::const_iterator itset;
313 if( etaminIn > 0 && etamaxIn > 0 ){
316 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
318 else if( etaminIn < 0 && etamaxIn < 0 ){
321 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
329 if( (*it).layerDiskNumber() == layNumber )
333 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
335 for(itset = outset.begin(); itset != outset.end(); ++itset){
346 std::string unresolvedFileName(
filename);
349 if (fullFileName ==
"") {
351 std::cerr <<
"RegSelectorMap: FATAL: Could not find input file in DATAPATH" << unresolvedFileName<< std::endl;
352 return StatusCode::FAILURE;
364 sc = StatusCode::FAILURE;
372 for(
it = dataList.begin();
it != dataList.end(); ++
it){
373 std::cout <<
"position: " << (*it).layerDiskPosition() <<
" number: " << (*it).layerDiskNumber() << std::endl;
376 std::cout <<
"hashId: ";
377 std::vector<IdentifierHash> aux = (*it).hashId();
379 std::cout << (*i) <<
" ";
380 std::cout << std::endl;
388 double &phiminIn,
double &phimaxIn )
const {
390 while (phiminIn > 2*
M_PI) phiminIn -= 2*
M_PI;
391 while (phiminIn < 0 ) phiminIn += 2*
M_PI;
392 while (phimaxIn > 2*
M_PI) phimaxIn -= 2*
M_PI;
393 while (phimaxIn < 0 ) phimaxIn += 2*
M_PI;
411 double &phiminIn,
double &phimaxIn )
const {
413 return StatusCode::SUCCESS;
419 double &phiminIn,
double &phimaxIn)
const {
423 while (phiminIn >
M_PI) phiminIn -= 2*
M_PI;
424 while (phiminIn < -
M_PI) phiminIn += 2*
M_PI;
425 while (phimaxIn >
M_PI) phimaxIn -= 2*
M_PI;
426 while (phimaxIn < -
M_PI) phimaxIn += 2*
M_PI;
445 double phiminIn,
double phimaxIn,
446 const std::vector<IdentifierHash>& outputIdlist)
const {
448 std::vector<IdentifierHash> outset;
451 double etamin, etamax, phimin, phimax;
453 for(
i= 0;
i < vecsize; ++
i){
463 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
464 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
470 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
471 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
478 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
479 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
485 if(outset == outputIdlist)
486 std::cout <<
"equal vectors " << std::endl;
487 std::cout <<
"desired output ";
488 for( j=0; j < outset.size(); ++j)
489 std::cout << std::dec << outset[j] <<
" ";
490 std::cout << std::endl;
491 std::cout <<
"obtained output ";
492 for( j=0; j < outputIdlist.size(); ++j)
493 std::cout << std::dec << outputIdlist[j] <<
" ";
494 std::cout << std::endl;
499 double phiminIn,
double phimaxIn,
500 std::vector<uint32_t>&
outList)
const {
504 std::set<uint32_t> outset;
507 double etamin, etamax, phimin, phimax;
508 std::vector<uint32_t> outvec;
511 for(
i= 0;
i < vecsize; ++
i){
521 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
522 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
528 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
529 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
536 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
537 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
545 for(
it = outset.begin();
it != outset.end(); ++
it)
546 outvec.push_back(*
it);
549 std::cout <<
"equal vectors " << std::endl;
550 std::cout <<
"desired output ";
551 for( j=0; j < outvec.size(); ++j)
552 std::cout << std::dec << outvec[j] <<
" ";
553 std::cout << std::endl;
554 std::cout <<
"obtained output ";
555 for( j=0; j <
outList.size(); ++j)
556 std::cout << std::dec <<
outList[j] <<
" ";
557 std::cout << std::endl;
564 double etaminIn,
double etamaxIn,
565 double phiminIn,
double phimaxIn,
566 std::vector<uint32_t>&
outList)
const {
570 std::set<uint32_t> outset;
571 std::list<RegSelectorMapElement>::const_iterator
it, itEnd;
572 std::set<uint32_t>::const_iterator itset;
576 if( etaminIn > 0 && etamaxIn > 0 ){
579 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
581 else if( etaminIn < 0 && etamaxIn < 0 ){
584 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
592 if( (*it).layerDiskNumber() == layNumber )
596 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
598 for(itset = outset.begin(); itset != outset.end(); ++itset){
605 std::list<RegSelectorMapElement>::const_iterator&
it)
const {
607 std::list<RegSelectorMapElement>::const_iterator itPos, itNeg, itEnd;
613 if(posORneg ==
false){
628 if( (*it).layerDiskNumber() == typeinID )
636 std::list<RegSelectorMapElement>::const_iterator&
it)
const {
638 std::list<RegSelectorMapElement>::const_iterator itPos, itNeg, itEnd;
643 if(posORneg ==
false){
653 if( (*it).layerDiskNumber() == layNumber )
664 for(
it = dataList.begin();
it != dataList.end(); ++
it){
678 double& etaminIn,
double& etamaxIn,
679 double& phiminIn,
double& phimaxIn,
686 numberIn, positionIn, robIdIn );
692 int numberIn,
double etaminIn,
double etamaxIn,
693 double phiminIn,
double phimaxIn,
699 for(
it = dataList.begin();
it != dataList.end(); ++
it){
700 if( positionIn == (*it).layerDiskPosition() ){
702 if( numberIn == (*it).layerDiskNumber() ) {
703 (*it).additem( hashIdIn, etaminIn, etamaxIn,
704 phiminIn, phimaxIn, numberIn, positionIn, robIdIn );
714 if(
flag ==
true || dataList.size() == 0){
719 dataList.push_back( newElement );
727 etaminIn, etamaxIn, phiminIn, phimaxIn, hashIdIn, robIdIn);
729 else if(positionIn < 0){
731 etaminIn, etamaxIn, phiminIn, phimaxIn, hashIdIn, robIdIn);
733 else if(positionIn == 0){
735 etaminIn, etamaxIn, phiminIn, phimaxIn, hashIdIn, robIdIn);
740 double emin,
double emax,
741 double pmin,
double pmax){
757 int barORend =0, layORwhe =0;
759 double emin, emax, pmin, pmax;
764 sc = StatusCode::FAILURE;
769 if (strncmp(
buffer,
"#",1)!=0){
770 sscanf(
buffer,
"%x %x %x %lf %lf %lf %lf", &robid, &collid, (
unsigned int*)&hashId, &emin, &emax, &pmin, &pmax);
771 writeLine(barORend, layORwhe, hashId, robid, emin, emax, pmin, pmax);
783 double *phiMin,
double *phiMax)
const {