589{
592 G4int len = theUnitsTable[a.IndexOfCategory]->GetSymbMxLen();
593
594 G4long ksup(-1), kinf(-1);
597
598
600 std::max(std::max(std::fabs(a.Value[0]), std::fabs(a.Value[1])),
601 std::fabs(a.Value[2]));
602
603
604 if ((a.Category == "Energy") && (value == 0.)) {
605 for (
G4int j = 0; j < a.nbOfVals; ++j) {
606 flux << a.Value[j] << " ";
607 }
608 std::ios::fmtflags oldform = flux.flags();
609 flux.setf(std::ios::left, std::ios::adjustfield);
610 flux << std::setw(len) << "eV";
611 flux.flags(oldform);
612 return flux;
613 }
614
615
616 for(std::size_t k = 0; k < List.size(); ++k)
617 {
618 G4double unit = List[k]->GetValue();
620 {
621 if(unit > umax)
622 {
623 umax = unit;
624 ksup = k;
625 }
626 }
628 {
629 if(unit < umin)
630 {
631 umin = unit;
632 kinf = k;
633 }
634 }
635 else
636 {
638 if((ratio >= 1.) && (ratio < rsup))
639 {
640 rsup = ratio;
641 ksup = k;
642 }
643 if((ratio < 1.) && (ratio > rinf))
644 {
645 rinf = ratio;
646 kinf = k;
647 }
648 }
649 }
650
652 if(index == -1)
653 {
654 index = kinf;
655 }
656 if(index == -1)
657 {
658 index = 0;
659 }
660
661 for(
G4int j = 0; j < a.nbOfVals; ++j)
662 {
663 flux << a.Value[j] / (List[index]->GetValue()) << " ";
664 }
665
666 std::ios::fmtflags oldform = flux.flags();
667
668 flux.setf(std::ios::left, std::ios::adjustfield);
669 flux << std::setw(len) << List[index]->GetSymbol();
670 flux.flags(oldform);
671
672 return flux;
673}
std::vector< G4UnitDefinition * > G4UnitsContainer