00001 00002 // $Id: PulserDDSCheck.cxx,v 1.2 2007/03/01 17:06:40 rhatcher Exp $ 00003 // 00004 // FILL_IN: [Document your code!!] 00005 // 00006 // pa@hep.ucl.ac.uk 00008 #include "PulserCalibration/PulserDDSCheck.h" 00009 #include "MessageService/MsgService.h" 00010 #include "MinosObjectMap/MomNavigator.h" 00011 #include "JobControl/JobCModuleRegistry.h" // For JOBMODULE macro 00012 #include "RawData/RawRecord.h" 00013 #include "RawData/RawHeader.h" 00014 #include "RawData/RawDataBlock.h" 00015 #include "Validity/VldContext.h" 00016 #include <iostream> 00017 #include <fstream> 00018 00019 JOBMODULE(PulserDDSCheck, "PulserDDSCheck", 00020 "Checks records from DDS"); 00021 CVSID("$Id: PulserDDSCheck.cxx,v 1.2 2007/03/01 17:06:40 rhatcher Exp $"); 00022 //...................................................................... 00023 00024 PulserDDSCheck::PulserDDSCheck() 00025 { 00026 //====================================================================== 00027 // FILL_IN: [Document your code!!] 00028 //====================================================================== 00029 } 00030 00031 //...................................................................... 00032 00033 PulserDDSCheck::~PulserDDSCheck() 00034 { 00035 //====================================================================== 00036 // FILL_IN: [Document your code!!] 00037 //====================================================================== 00038 } 00039 00040 //...................................................................... 00041 00042 JobCResult PulserDDSCheck::Ana(const MomNavigator* mom) 00043 { 00044 std::ofstream out(fData.c_str(),ios::app); 00045 // Find RawRecord fragment in MOM. 00046 TIter iter = mom->FragmentIter(); 00047 while (TObject *obj = iter.Next()) { 00048 RawRecord *rawrec = dynamic_cast<RawRecord *>(obj); 00049 if (rawrec) { 00050 MSG("PulserDDS",Msg::kVerbose) << "DDSCheck: " <<(rawrec->GetRawHeader())->GetVldContext() <<endl; 00051 out<<"------------------------------New Record-----------------------\n"; 00052 // const char *c = rawrec->Class_Name(); 00053 TIter recit = rawrec->GetRawBlockIter(); 00054 while (TObject *obj = recit.Next()) { 00055 RawDataBlock *rawdata = dynamic_cast<RawDataBlock *>(obj); 00056 if (rawdata) { 00057 out<<(rawrec->GetRawHeader())->GetVldContext() 00058 <<" "<<rawdata->GetBlockId()<<endl; 00059 } else { 00060 out<<(rawrec->GetRawHeader())->GetVldContext()<<" Not RawData\n"; 00061 } 00062 } 00063 } 00064 } 00065 return JobCResult::kPassed; // kNoDecision, kFailed, etc. 00066 } 00067 00068 //...................................................................... 00069 00070 const Registry& PulserDDSCheck::DefaultConfig() const 00071 { 00072 //====================================================================== 00073 // Supply the default configuration for the module 00074 //====================================================================== 00075 static Registry r; // Default configuration for module 00076 00077 // Set name of config 00078 std::string name = this->GetName(); 00079 name += ".config.default"; 00080 r.SetName(name.c_str()); 00081 00082 // Set values in configuration 00083 r.UnLockValues(); 00084 r.Set("Logfile","/home/pa/ddslog"); 00085 r.LockValues(); 00086 00087 return r; 00088 } 00089 00090 //...................................................................... 00091 00092 void PulserDDSCheck::Config(const Registry& r) 00093 { 00094 //====================================================================== 00095 // Configure the module given the Registry r 00096 //====================================================================== 00097 const char* tmps; 00098 00099 if (r.Get("Logfile",tmps)) { fData = std::string(tmps); } 00100 } 00101
1.3.9.1