00001 /* @version $Revision: 1850 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-08-22 09:59:31 +0200 (Wed, 22 Aug 2012) $ */ 00002 00003 #include "event/Run.hh" 00004 #include "event/Event.hh" 00005 #include "geometry/Detector.hh" 00006 #include "tools/Log.hh" 00007 #include <iostream> 00008 00009 #include "mTypes.h" 00010 00011 using namespace std; 00012 std::ostream& operator <<(std::ostream& out, const Run& x) { 00013 return(x.operator <<(out)); 00014 } 00015 00016 //-------------------------------------------------------- 00017 Run::Run(Detector &aDetector) : detector(aDetector) 00018 { 00019 00020 name = ""; 00021 id = 0; 00022 time(&reconstructionDate); 00023 calibrationRun = false; 00024 difSynchro = false; 00025 svnrev = "$Revision: 1850 $"; 00026 00027 // calibration run only 00028 injectedCharge = 0; 00029 widthCtest = 0; 00030 periodCtest = 0; 00031 delayCtest = 0; 00032 dataFormat = 0; 00033 daqSoftware = 0; 00034 cccFirmware = 0; 00035 sdCCFirmware = 0; 00036 difFirmware = 0; 00037 } 00038 00039 00040 //-------------------------------------------------------- 00041 Run::~Run(){ 00042 //FILE_LOG(logDEBUG) << "----Run destructor"<< endl; 00043 } 00044 00045 00046 //-------------------------------------------------------- 00047 ostream& Run::operator <<(ostream &out) const { 00048 string calib = ", is a production run"; 00049 if ( calibrationRun) 00050 { 00051 calib = ", is a calibration run"; 00052 } 00053 out << " Run " << name << ", id:" << id << ", date:" << date << calib << ". ------ " << svnrev; 00054 00055 return(out); 00056 } // operator < 00057 00058 //-------------------------------------------------------- 00059 std::string Run::getSvnrev()const 00060 { 00061 string without = svnrev.substr(11); 00062 size_t len = without.length(); 00063 return without.substr(0,len-2); 00064 } 00065 00066