00001
00002
00003
00004 #include "DataFormats/Luminosity/interface/LumiDetails.h"
00005
00006 #include <iomanip>
00007
00008 using namespace std;
00009
00010 bool
00011 LumiDetails::isProductEqual(LumiDetails const& next) {
00012 return (lumietsum_ == next.lumietsum_ &&
00013 lumietsumerr_ == next.lumietsumerr_ &&
00014 lumietsumqual_ == next.lumietsumqual_ &&
00015 lumiocc_ == next.lumiocc_ &&
00016 lumioccerr_ == next.lumioccerr_ &&
00017 lumioccqual_ == next.lumioccqual_);
00018 }
00019
00020 std::ostream& operator<<(std::ostream& s, const LumiDetails& lumiDetails) {
00021
00022 const std::vector<float>& lumietsum = lumiDetails.lumiEtSum();
00023 const std::vector<float>& lumietsumerr = lumiDetails.lumiEtSumErr();
00024 const std::vector<int>& lumietsumqual = lumiDetails.lumiEtSumQual();
00025 const std::vector<float>& lumiocc = lumiDetails.lumiOcc();
00026 const std::vector<float>& lumioccerr = lumiDetails.lumiOccErr();
00027 const std::vector<int>& lumioccqual = lumiDetails.lumiOccQual();
00028
00029 unsigned int maxSize = lumietsum.size();
00030 if (lumietsumerr.size() > maxSize) maxSize = lumietsumerr.size();
00031 if (lumietsumqual.size() > maxSize) maxSize = lumietsumqual.size();
00032 if (lumiocc.size() > maxSize) maxSize = lumiocc.size();
00033 if (lumioccerr.size() > maxSize) maxSize = lumioccerr.size();
00034 if (lumioccqual.size() > maxSize) maxSize = lumioccqual.size();
00035
00036 s << "\nDumping LumiDetails\n";
00037 s << setw(12) << "etsum";
00038 s << setw(12) << "etsumerr";
00039 s << setw(12) << "etsumqual";
00040 s << setw(12) << "occ";
00041 s << setw(12) << "occerr";
00042 s << setw(12) << "occqual";
00043 s << "\n";
00044
00045 for (unsigned int i = 0; i < maxSize; ++i) {
00046
00047 s << setw(12);
00048 i < lumietsum.size() ? s << lumietsum[i] : s << " ";
00049
00050 s << setw(12);
00051 i < lumietsumerr.size() ? s << lumietsumerr[i] : s << " ";
00052
00053 s << setw(12);
00054 i < lumietsumqual.size() ? s << lumietsumqual[i] : s << " ";
00055
00056 s << setw(12);
00057 i < lumiocc.size() ? s << lumiocc[i] : s << " ";
00058
00059 s << setw(12);
00060 i < lumioccerr.size() ? s << lumioccerr[i] : s << " ";
00061
00062 s << setw(12);
00063 i < lumioccqual.size() ? s << lumioccqual[i] : s << " ";
00064
00065 s << "\n";
00066 }
00067 return s << "\n";
00068 }