#include <RawRunConfigBlock.h>
Inheritance diagram for RawRunConfigBlock:

Public Member Functions | |
| RawRunConfigBlock () | |
| RawRunConfigBlock (const Int_t *block) | |
| RawRunConfigBlock (const VldContext &vldc, Int_t run, Short_t subrun, Short_t runtype, const Char_t *comment) | |
| virtual | ~RawRunConfigBlock () |
| VldTimeStamp | GetTime () const |
| Int_t | GetRun () const |
| Short_t | GetSubRun () const |
| Short_t | GetRunType () const |
| VldContext | GetVldContext () const |
| const Char_t * | GetRunConfig () const |
| virtual std::ostream & | FormatToOStream (std::ostream &os, Option_t *option="") const |
| RawRunConfigBlock (const RawRunConfigBlock &rhs) | |
| RawRunConfigBlock & | operator= (const RawRunConfigBlock &rhs) |
Static Public Member Functions | |
| void | SetDebugFlags (const UInt_t dbgflgs) |
| UInt_t | GetDebugFlags () |
Protected Attributes | |
| Char_t * | fRunConfig |
Static Private Attributes | |
| UInt_t | fgDebugFlags = 0 |
| not written out | |
|
|
Definition at line 41 of file RawRunConfigBlock.cxx. 00042 : RawDataBlock(), fRunConfig(0) 00043 { 00044 // Default constructor 00045 }
|
|
|
Definition at line 48 of file RawRunConfigBlock.cxx. 00049 : RawDataBlock(block), fRunConfig(0) 00050 { 00051 // stored block format is: 00052 //--------------------- 00053 // 0 # words in block 00054 // 1 checksum 00055 // 2 Block Id 00056 //----- 00057 // 3 run # 00058 // 4 {subrun#| run type} 00059 // 5 time (sec) 00060 // 6 time (nsec) 00061 // 7 comment string (padded to 4 char) 00062 00063 }
|
|
||||||||||||||||||||||||
|
Definition at line 66 of file RawRunConfigBlock.cxx. References VldContext::GetDetector(), RawBlockProxy::GetMajorId(), VldTimeStamp::GetNanoSec(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), RawBlockRegistry::Instance(), RawBlockProxy::IsDCS(), RawBlockRegistry::LookUp(), nwords_in_string(), pack_string_in_lel(), rdxsum_fill(), and zzzz_last. 00069 : RawDataBlock(), fRunConfig(0) 00070 { 00071 // Component ctor 00072 00073 UInt_t nwdc = nwords_in_string(comment); 00074 fSize = zzzz_last + nwdc; 00075 if (fRawBlock) delete [] fRawBlock; 00076 fRawBlock = new Int_t [fSize]; 00077 00078 fRawBlock[0] = fSize; 00079 // fRawBlock[1] = checksum... see below 00080 00081 RawBlockRegistry& rbr = RawBlockRegistry::Instance(); 00082 RawBlockProxy* rbp = rbr.LookUp("RawRunConfigBlock"); 00083 00084 Bool_t isDCS = rbp->IsDCS(); 00085 Int_t majorId = rbp->GetMajorId(); 00086 Int_t minorId = 2; 00087 RawBlockId rbid(majorId,minorId,isDCS, 00088 vldc.GetDetector(),vldc.GetSimFlag()); 00089 fRawBlock[2] = rbid.GetEncoded(); 00090 00091 fRawBlock[indx_run] = run; 00092 fRawBlock[indx_subrun] = (subrun&0xffff)<<16 | (runtype&0xffff); 00093 fRawBlock[indx_startsec] = vldc.GetTimeStamp().GetSec(); 00094 fRawBlock[indx_startnsec] = vldc.GetTimeStamp().GetNanoSec(); 00095 00096 fRawBlock[fSize-1] = 0; // ensure final '\0' 00097 pack_string_in_lel(fRawBlock+zzzz_last,comment); 00098 00099 // fill checksum 00100 rdxsum_fill((long*)fRawBlock,0); 00101 }
|
|
|
Definition at line 104 of file RawRunConfigBlock.cxx. References fRunConfig. 00105 {
00106 // dtor
00107 if (fRunConfig) {
00108 delete [] fRunConfig;
00109 fRunConfig = 0;
00110 }
00111 }
|
|
|
Definition at line 46 of file RawRunConfigBlock.h. References fRunConfig. 00047 : RawDataBlock(rhs), fRunConfig(0) { ; }
|
|
||||||||||||
|
Reimplemented from RawDataBlock. Definition at line 198 of file RawRunConfigBlock.cxx. References VldTimeStamp::AsString(), RawDataBlock::FormatToOStream(), GetRun(), GetRunConfig(), GetRunType(), GetSubRun(), GetTime(), and option. 00200 {
00201 RawDataBlock::FormatToOStream(os,option);
00202 if (option[0] == 'X') return os;
00203
00204 // additional block specific formatted output is done here
00205
00206 os << "Time " << GetTime().AsString("c") << endl;
00207 os << " Run " << GetRun()
00208 << " SubRun " << GetSubRun()
00209 << " RunType " << GetRunType() << endl;
00210 // os << "'" << GetRunConfig() << "'" << endl;
00211 const Char_t* cfg = GetRunConfig();
00212 const Char_t* linestart = " | ";
00213 os << linestart;
00214 while (*cfg != '\0') {
00215 os << *cfg;
00216 if (*cfg == '\n' && *(cfg+1) != '\0') os << linestart;
00217 ++cfg;
00218 }
00219 os << endl;
00220
00221 return os;
00222 }
|
|
|
Definition at line 43 of file RawRunConfigBlock.h. 00043 { return fgDebugFlags; }
|
|
|
Definition at line 136 of file RawRunConfigBlock.cxx. Referenced by RunSummary::Ana(), FilterRunType::Ana(), and FormatToOStream(). 00137 {
00138 // get the run number
00139
00140 if ( fSize >= zzzz_last ) return fRawBlock[indx_run];
00141 return -1;
00142 }
|
|
|
Definition at line 173 of file RawRunConfigBlock.cxx. References fRunConfig, and unpack_lel_to_string(). Referenced by RunSummary::Ana(), FilterRunType::Ana(), cfgtest(), FormatToOStream(), FillNearRunQuality::ProcessBlock(), FillFarRunQuality::ProcessBlock(), DbuDaqFileModule::ProcessRawBlock(), and OltBlockScan::Reco(). 00174 {
00175 // return the run config string
00176
00177 if (!fRunConfig) {
00178
00179 Int_t* insitu = fRawBlock+zzzz_last;
00180
00181 UInt_t nwd = (fRawBlock+fSize) - insitu;
00182 fRunConfig = unpack_lel_to_string(insitu,nwd);
00183
00184 // replace non-printable, non-newline characters with blanks
00185 // leave final null (which should be there ... but make sure it is).
00186 int nchar = nwd*sizeof(Int_t)/sizeof(Char_t) - 1;
00187 fRunConfig[nchar] = '\0';
00188 for (int i=0; i<nchar; ++i) {
00189 Char_t c = fRunConfig[i];
00190 if ( !isprint(c) && '\n'!=c ) fRunConfig[i] = ' ';
00191 }
00192
00193 }
00194 return fRunConfig;
00195 }
|
|
|
Definition at line 155 of file RawRunConfigBlock.cxx. Referenced by FormatToOStream(). 00156 {
00157 // get the run type
00158
00159 if ( fSize >= zzzz_last )
00160 return fRawBlock[indx_runtype]&0xffff;
00161 return -1;
00162 }
|
|
|
Definition at line 145 of file RawRunConfigBlock.cxx. Referenced by RunSummary::Ana(), FilterRunType::Ana(), and FormatToOStream(). 00146 {
00147 // get the subrun number
00148
00149 if ( fSize >= zzzz_last )
00150 return (fRawBlock[indx_subrun]>>16)&0xffff;
00151 return -1;
00152 }
|
|
|
Definition at line 125 of file RawRunConfigBlock.cxx. References indx_startnsec, and indx_startsec. Referenced by FormatToOStream(), GetVldContext(), and DbuDaqFileModule::ProcessRawBlock(). 00126 {
00127 // get the trigger time
00128
00129 if ( fSize >= zzzz_last )
00130 return VldTimeStamp(fRawBlock[indx_startsec],fRawBlock[indx_startnsec]);
00131
00132 return VldTimeStamp((time_t)0,(Int_t)0);
00133 }
|
|
|
Definition at line 165 of file RawRunConfigBlock.cxx. References RawDataBlock::GetBlockId(), RawBlockId::GetDetector(), RawBlockId::GetSimFlag(), and GetTime(). 00166 {
00167 // build validity context
00168 RawBlockId rbid = GetBlockId();
00169 return VldContext(rbid.GetDetector(),rbid.GetSimFlag(),GetTime());
00170 }
|
|
|
Definition at line 114 of file RawRunConfigBlock.cxx. References fRunConfig, and RawDataBlock::operator=(). 00115 {
00116 // deep copy assignment
00117 if (this != &rhs) {
00118 RawDataBlock::operator=(rhs);
00119 if (fRunConfig) { delete [] fRunConfig; fRunConfig = 0; }
00120 }
00121 return *this;
00122 }
|
|
|
Definition at line 42 of file RawRunConfigBlock.h. References fgDebugFlags. 00042 {fgDebugFlags=dbgflgs;}
|
|
|
not written out
Definition at line 14 of file RawRunConfigBlock.cxx. Referenced by SetDebugFlags(). |
|
|
Definition at line 53 of file RawRunConfigBlock.h. Referenced by GetRunConfig(), operator=(), RawRunConfigBlock(), and ~RawRunConfigBlock(). |
1.3.9.1