117 for(
i = 0;
i < nLines; ++
i){
126 (*it).findMaxMinElem();
128 (*it).findMaxMinElem();
130 (*it).findMaxMinElem();
140 double etaminIn,
double etamaxIn,
141 double phiminIn,
double phimaxIn,
142 std::vector<uint32_t>&
outList )
const {
146 std::list<RegSelectorMapElement>::const_iterator
it;
147 std::set<uint32_t> outset;
148 std::set<uint32_t>::const_iterator itset, negbarrelbeg, negbarrelend;
149 bool divideEta =
false;
153 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset );
157 case TILE: divideEta =
true;
break;
162 if(etaminIn < 0 || etamaxIn < 0){
164 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
168 if( etaminIn >= 0 || etamaxIn >= 0 ){
170 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
176 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
179 (*it).selectionRobIdUint(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
184 negbarrelbeg = outset.upper_bound(0x51000f);
185 negbarrelend = outset.lower_bound(0x530000);
186 for(itset = negbarrelbeg; itset != negbarrelend; ++itset){
189 for(itset = outset.begin(); itset != negbarrelbeg; ++itset){
192 for(itset = negbarrelend; itset != outset.end(); ++itset){
196 for(itset = outset.begin(); itset != outset.end(); ++itset){
221 double etaminIn,
double etamaxIn,
222 double phiminIn,
double phimaxIn,
223 std::vector<IdentifierHash>&
outList)
const {
227 std::list<RegSelectorMapElement>::const_iterator
it;
228 std::set<IdentifierHash> outset;
229 std::set<IdentifierHash>::const_iterator itset, negbarrelbeg,negbarrelend;
230 bool divideEta =
false;
234 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
238 case TILE: divideEta =
true;
break;
243 if(etaminIn < 0 || etamaxIn < 0){
245 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
249 if( etaminIn >= 0 || etamaxIn >= 0 ){
251 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
257 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
260 (*it).selection(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
265 negbarrelbeg = outset.upper_bound(0x3f);
266 negbarrelend = outset.lower_bound(0x80);
267 for(itset = negbarrelbeg; itset != negbarrelend; ++itset){
270 for(itset = outset.begin(); itset != negbarrelbeg; ++itset){
273 for(itset = negbarrelend; itset != outset.end(); ++itset){
277 for(itset = outset.begin(); itset != outset.end(); ++itset){
285 double etaminIn,
double etamaxIn,
286 double phiminIn,
double phimaxIn,
287 std::vector<IdentifierHash>&
outList)
const {
291 std::list<RegSelectorMapElement>::const_iterator
it;
292 std::set<IdentifierHash> outset;
293 std::set<IdentifierHash>::const_iterator itset;
297 if( etaminIn > 0 && etamaxIn > 0 ){
300 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
302 else if( etaminIn < 0 && etamaxIn < 0 ){
305 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
310 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
313 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
316 for(itset = outset.begin(); itset != outset.end(); ++itset){
324 double etaminIn,
double etamaxIn,
325 double phiminIn,
double phimaxIn,
326 std::vector<IdentifierHash>&
outList)
const {
330 std::list<RegSelectorMapElement>::const_iterator
it, itEnd;
331 std::set<IdentifierHash> outset;
332 std::set<IdentifierHash>::const_iterator itset;
336 if( etaminIn > 0 && etamaxIn > 0 ){
339 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
341 else if( etaminIn < 0 && etamaxIn < 0 ){
344 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
352 if( (*it).layerDiskNumber() == layNumber )
358 (*it).selection( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
360 for(itset = outset.begin(); itset != outset.end(); ++itset){
371 std::string unresolvedFileName(
filename);
374 if (fullFileName ==
"") {
376 std::cerr <<
"RegSelectorMap: FATAL: Could not find input file in DATAPATH" << unresolvedFileName<< std::endl;
377 return StatusCode::FAILURE;
389 sc = StatusCode::FAILURE;
397 for(
it = dataList.begin();
it != dataList.end(); ++
it){
398 std::cout <<
"position: " << (*it).layerDiskPosition() <<
" number: " << (*it).layerDiskNumber() << std::endl;
401 std::cout <<
"hashId: ";
402 std::vector<IdentifierHash> aux = (*it).hashId();
404 std::cout << (*i) <<
" ";
405 std::cout << std::endl;
413 double &phiminIn,
double &phimaxIn )
const {
415 while (phiminIn > 2*
M_PI) phiminIn -= 2*
M_PI;
416 while (phiminIn < 0 ) phiminIn += 2*
M_PI;
417 while (phimaxIn > 2*
M_PI) phimaxIn -= 2*
M_PI;
418 while (phimaxIn < 0 ) phimaxIn += 2*
M_PI;
436 double &phiminIn,
double &phimaxIn )
const {
438 return StatusCode::SUCCESS;
444 double &phiminIn,
double &phimaxIn)
const {
448 while (phiminIn >
M_PI) phiminIn -= 2*
M_PI;
449 while (phiminIn < -
M_PI) phiminIn += 2*
M_PI;
450 while (phimaxIn >
M_PI) phimaxIn -= 2*
M_PI;
451 while (phimaxIn < -
M_PI) phimaxIn += 2*
M_PI;
470 double phiminIn,
double phimaxIn,
471 const std::vector<IdentifierHash>& outputIdlist)
const {
473 std::vector<IdentifierHash> outset;
476 double etamin, etamax, phimin, phimax;
478 for(
i= 0;
i < vecsize; ++
i){
488 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
489 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
495 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
496 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
503 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
504 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
510 if(outset == outputIdlist)
511 std::cout <<
"equal vectors " << std::endl;
512 std::cout <<
"desired output ";
513 for( j=0; j < outset.size(); ++j)
514 std::cout << std::dec << outset[j] <<
" ";
515 std::cout << std::endl;
516 std::cout <<
"obtained output ";
517 for( j=0; j < outputIdlist.size(); ++j)
518 std::cout << std::dec << outputIdlist[j] <<
" ";
519 std::cout << std::endl;
524 double phiminIn,
double phimaxIn,
525 std::vector<uint32_t>&
outList)
const {
529 std::set<uint32_t> outset;
532 double etamin, etamax, phimin, phimax;
533 std::vector<uint32_t> outvec;
536 for(
i= 0;
i < vecsize; ++
i){
546 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
547 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
553 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
554 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
561 if( (etaminIn <= etamax) && (etamaxIn >=
etamin) ){
562 if( (phiminIn <= phimax) && (phimaxIn >= phimin) ){
570 for(
it = outset.begin();
it != outset.end(); ++
it)
571 outvec.push_back(*
it);
574 std::cout <<
"equal vectors " << std::endl;
575 std::cout <<
"desired output ";
576 for( j=0; j < outvec.size(); ++j)
577 std::cout << std::dec << outvec[j] <<
" ";
578 std::cout << std::endl;
579 std::cout <<
"obtained output ";
580 for( j=0; j <
outList.size(); ++j)
581 std::cout << std::dec <<
outList[j] <<
" ";
582 std::cout << std::endl;
589 double etaminIn,
double etamaxIn,
590 double phiminIn,
double phimaxIn,
591 std::vector<uint32_t>&
outList)
const {
595 std::set<uint32_t> outset;
596 std::list<RegSelectorMapElement>::const_iterator
it, itEnd;
597 std::set<uint32_t>::const_iterator itset;
601 if( etaminIn > 0 && etamaxIn > 0 ){
604 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
606 else if( etaminIn < 0 && etamaxIn < 0 ){
609 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
617 if( (*it).layerDiskNumber() == layNumber )
623 (*it).selectionRobIdUint( etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
625 for(itset = outset.begin(); itset != outset.end(); ++itset){
632 std::list<RegSelectorMapElement>::const_iterator&
it)
const {
634 std::list<RegSelectorMapElement>::const_iterator itPos, itNeg, itEnd;
640 if(posORneg ==
false){
655 if( (*it).layerDiskNumber() == typeinID )
663 std::list<RegSelectorMapElement>::const_iterator&
it)
const {
665 std::list<RegSelectorMapElement>::const_iterator itPos, itNeg, itEnd;
670 if(posORneg ==
false){
680 if( (*it).layerDiskNumber() == layNumber )
691 for(
it = dataList.begin();
it != dataList.end(); ++
it){
705 double& etaminIn,
double& etamaxIn,
706 double& phiminIn,
double& phimaxIn,
713 numberIn, positionIn, robIdIn );
719 int numberIn,
double etaminIn,
double etamaxIn,
720 double phiminIn,
double phimaxIn,
726 for(
it = dataList.begin();
it != dataList.end(); ++
it){
727 if( positionIn == (*it).layerDiskPosition() ){
729 if( numberIn == (*it).layerDiskNumber() ) {
730 (*it).additem( hashIdIn, etaminIn, etamaxIn,
731 phiminIn, phimaxIn, numberIn, positionIn, robIdIn );
741 if(
flag ==
true || dataList.size() == 0){
746 dataList.push_back( newElement );
754 etaminIn, etamaxIn, phiminIn, phimaxIn, hashIdIn, robIdIn);
756 else if(positionIn < 0){
758 etaminIn, etamaxIn, phiminIn, phimaxIn, hashIdIn, robIdIn);
760 else if(positionIn == 0){
762 etaminIn, etamaxIn, phiminIn, phimaxIn, hashIdIn, robIdIn);
767 double emin,
double emax,
768 double pmin,
double pmax){
784 int barORend =0, layORwhe =0;
786 double emin, emax, pmin, pmax;
791 sc = StatusCode::FAILURE;
796 if (strncmp(
buffer,
"#",1)!=0){
797 sscanf(
buffer,
"%x %x %x %lf %lf %lf %lf", &robid, &collid, (
unsigned int*)&hashId, &emin, &emax, &pmin, &pmax);
798 writeLine(barORend, layORwhe, hashId, robid, emin, emax, pmin, pmax);
810 double *phiMin,
double *phiMax)
const {