00001 #include "SummaryManager.h"
00002 #include "NoiseOccupancySummaryWriter.h"
00003 #include "OpeSummaryTool.h"
00004 #include "SctData/OpeResult.h"
00005 #include "SctData/NoiseOccupancyTestResult.h"
00006 #include <TF1.h>
00007
00008 #include <iomanip>
00009
00010 namespace SctData {
00011 namespace TestSummary{
00012 using namespace std;
00013
00014 void NoiseOccupancySummaryWriter::write(const TestResult& t, ostream& out) const throw(Sct::IoError, Sct::LogicError)
00015 {
00016 t.getNScans();
00017 const NoiseOccupancyTestResult& result = dynamic_cast<const NoiseOccupancyTestResult&>(t);
00018
00019 out << "#\n%NO\n#"<<endl;
00020 out << "#MAX ICC IDD" << endl;
00021 out << std::setw(8) << 0 << std::setw(8) << 0 << endl;
00022 out << "#TYP ICC IDD" << endl;
00023 out << std::setw(8) << 0 << std::setw(8) << 0 << endl;
00024 out << "#\n# Offset MeanOcc RMSOcc EstENC"<<endl;
00025 for (unsigned ichip=0; ichip<nChipModule; ++ichip){
00026 const SctData::ChipNOResult& c = result.getChipResult(ichip);
00027 out << "#"<< getChipName(ichip) << endl;
00028 out << " "
00029 << std::setw(8) << c.offset << " "
00030 << std::setw(8) << c.mean << " "
00031 << std::setw(8) << c.rms << " "
00032 << std::setw(8) << c.getNoise() << endl;
00033 }
00034
00035 shared_ptr<const SctData::OpeResult> ope = result.getOpeResult();
00036
00037 if (ope.get()) {
00038 OpeSummaryTool tool;
00039 tool.write(*ope, out);
00040 }
00041
00042 out << "#\n";
00043 SummaryWriter::write(t.getDefects(), out);
00044 }
00045
00046
00047
00048 bool NoiseOccupancySummaryWriter::inMap = SummaryManager::instance().addWriter("SctData::NoiseOccupancyTestResult", shared_ptr<SummaryWriter>(new NoiseOccupancySummaryWriter()));
00049 }
00050 }