| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RichSmartID.cpp

Go to the documentation of this file.
00001 
00002 //-----------------------------------------------------------------------------
00012 //-----------------------------------------------------------------------------
00013 
00014 // Gaudi
00015 #include "GaudiKernel/GaudiException.h"
00016 
00017 // boost
00018 #include "boost/lexical_cast.hpp"
00019 
00020 // local
00021 #include "Kernel/RichSmartID.h"
00022 
00023 std::ostream& LHCb::RichSmartID::fillStream(std::ostream& s) const
00024 {
00025 
00026   // Is this smart ID valid
00027   if ( isValid() ) 
00028   {
00029     // If so, print out only the explicitly set fields
00030     const std::string PANEL =  ( rich() == Rich::Rich1 ?
00031                                  ( panel() == Rich::top  ? "Top   " : "Bottom" ) :
00032                                  ( panel() == Rich::left ? "Left  " : "Right " ) );
00033     s << "{";
00034     if ( richIsSet()          ) s << " "            << Rich::text( rich() );
00035     if ( panelIsSet()         ) s << " "            << PANEL;
00036     if ( hpdColIsSet()        ) s << " HPDCol"      << format("%3i",hpdCol());
00037     if ( hpdNumInColIsSet()   ) s << " HPDNumInCol" << format("%3i",hpdNumInCol());
00038     if ( pixelColIsSet()      ) s << " pixCol"      << format("%3i",pixelCol());
00039     if ( pixelRowIsSet()      ) s << " pixRow"      << format("%3i",pixelRow());
00040     if ( pixelSubRowIsSet()   ) s << " pixSubRow"   << format("%2i",pixelSubRow());
00041     s << " }";
00042   } 
00043   else 
00044   {
00045     // This SmartID has no valid bits set. This is bad ...
00046     s << "WARNING : Invalid RichSmartID";
00047   }
00048 
00049   return s;
00050 }
00051 
00052 void LHCb::RichSmartID::rangeError(const int value,
00053                                    const int max,
00054                                    const std::string& message) const
00055 {
00056   throw GaudiException ( message+" value "+boost::lexical_cast<std::string>(value)
00057                          +" exceeds field maximum "+boost::lexical_cast<std::string>(max),
00058                          "*RichSmartID*", StatusCode::FAILURE );
00059 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:03:13 2011 for LHCbKernel by doxygen 1.4.7