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

Public Member Functions | |
| RawRecord () | |
| RawRecord (RawHeader *rh) | |
| virtual | ~RawRecord () |
| const RawHeader * | GetRawHeader () const |
| const RawDataBlock * | FindRawBlock (const char *classname=0, const char *objname=0) const |
| const TObjArray & | GetRawBlockList () const |
| TIter | GetRawBlockIter (Bool_t dir=kIterForward) const |
| void | AdoptRawBlock (RawDataBlock *rawblock) |
| virtual void | Print (Option_t *option="") const |
| virtual const char * | GetName () const |
Static Public Member Functions | |
| void | PrintPromotionCount () |
Protected Member Functions | |
| void | PromoteRawDataBlocks () const |
| void | ListBlocks () const |
| not part of actual record | |
| virtual void | AdoptComponent (TObject *component) |
Protected Attributes | |
| bool | promotionChecked |
|
|
Definition at line 39 of file RawRecord.cxx. 00039 : promotionChecked(false) 00040 { 00041 // Default constructor 00042 }
|
|
|
Definition at line 45 of file RawRecord.cxx. 00045 : RecMinos(rh), promotionChecked(false) 00046 { 00047 // normal ctor, adopt the RawHeader for ownership 00048 }
|
|
|
Definition at line 52 of file RawRecord.cxx. 00053 {
00054 // dtor, no explicit deletion of header -- done by RecMinos
00055 }
|
|
|
Reimplemented from RecMinos. Definition at line 136 of file RawRecord.cxx. References RecMinos::AdoptComponent(), and MSG. 00137 {
00138 // Adopt (to own) a random TObject derived object
00139 // RawRecord should only be adopting RawDataBlocks
00140 // so this will assert before actually adopting.
00141
00142 MSG("Raw",Msg::kFatal)
00143 << "RawRecord::AdoptComponent(TObject*) was called"
00144 << endl;
00145 assert(0);
00146
00147 RecMinos::AdoptComponent(component);
00148 }
|
|
|
Definition at line 108 of file RawRecord.cxx. References RecMinos::AdoptComponent(). Referenced by RotoObjectifier::BuildRecord(), RerootToRawDataModule::Get(), DetSim::Get(), and OltNewModule::WriteConfig(). 00109 {
00110 // Adopt (to own) a RawDataBlock derived object
00111
00112 RecMinos::AdoptComponent(rawblock);
00113 }
|
|
||||||||||||
|
|
Definition at line 223 of file RawRecord.cxx. References Registry::Get(), Nav::GetName(), RecMinos::GetTempTags(), and reg. Referenced by FillNearRunQuality::Ana(), FarDetVarcErrorsDump::Ana(), FarDetTpSinglesDump::Ana(), FarDetRawRateDump::Ana(), FarDetRawDigitDump::Ana(), DumpBadElectronics::Ana(), FillSpillServerMon::Get(), FillHvFromSingles::Get(), FillFarRunQuality::Get(), FarDetDataQualityModule::Reco(), and DataQualityReader::Reco(). 00224 {
00225 // Return the "name"
00226 // If the TNamed value has been set use that otherwise see if
00227 // one can determine a useful name from the stream recorded in
00228 // the registry.
00229
00230 string recUserName = TNamed::GetName();
00231 if (recUserName != "") return recUserName.c_str();
00232 else{
00233 //MSG("Raw",Msg::kInfo) << "Record has no name" << endl;
00234 const char* unknownStream = "?stream?";
00235 const char* tmp = 0;
00236 string recStream(unknownStream);
00237
00238 const Registry& reg = GetTempTags();
00239 if (reg.Get("stream",tmp)) recStream = tmp;
00240 if (recStream != unknownStream) {
00241 // this method is logical "const" but it does modify the object
00242 RawRecord* writeableSelf = const_cast<RawRecord*>(this);
00243 writeableSelf->SetName(recStream.c_str());
00244 //MSG("Raw",Msg::kInfo) << "Record has is now named \""
00245 // << TNamed::GetName() << "\"" << endl;
00246 }
00247 }
00248 return TNamed::GetName();
00249 }
|
|
|
|
Definition at line 61 of file RawRecord.h. References RecMinos::GetComponents(), and PromoteRawDataBlocks(). Referenced by FarPlaneCheckout::Ana(). 00062 { PromoteRawDataBlocks(); return RecMinos::GetComponents(); }
|
|
|
|
not part of actual record
Definition at line 252 of file RawRecord.cxx. References RawDataBlock::GetBlockId(), and MSG. Referenced by Print(). 00253 {
00254 // Lump the classname and block id for all the elements in fComponents.
00255 // Avoid anything that would promote generic blocks.
00256
00257 MSG("Raw",Msg::kInfo)
00258 << " index ClassName RawBlockId"
00259 << endl;
00260
00261 Int_t last = fComponents.GetLast();
00262 for (Int_t idx=0; idx <= last; ++idx) {
00263 TObject* tobj = fComponents[idx];
00264 if ( ! tobj ) continue;
00265 RawDataBlock* rdb = dynamic_cast<RawDataBlock*>(tobj);
00266 if (rdb) {
00267 RawBlockId rbid = rdb->GetBlockId();
00268 MSG("Raw",Msg::kInfo)
00269 << " [" << setw(2) << idx << "] "
00270 << left << setw(25) << tobj->ClassName()
00271 << resetiosflags(ios::adjustfield) // reset "left"
00272 << " " << rbid
00273 << endl;
00274 }
00275 else {
00276 MSG("Raw",Msg::kInfo)
00277 << " [" << setw(2) << idx << "] "
00278 << left << setw(25) << tobj->ClassName()
00279 << resetiosflags(ios::adjustfield) // reset "left"
00280 << " is not a RawDataBlock."
00281 << endl;
00282 }
00283 }
00284
00285 MSG("Raw",Msg::kInfo) << endl;
00286 }
|
|
|
Reimplemented from RecMinos. Definition at line 116 of file RawRecord.cxx. References RecMinos::GetJobHistory(), GetRawBlockIter(), ListBlocks(), option, RecJobHistory::Print(), and RecMinosHdr::Print(). 00117 {
00118 // Print header, loop over raw blocks, print those
00119 // unless passed "l" option, then just list the blocks.
00120
00121 if (fHeader) fHeader->Print();
00122 else cout << "RawRecord: has no header";
00123 cout << endl; // header doesn't terminate the line
00124 GetJobHistory().Print();
00125
00126 string opt = option;
00127 if ( opt.find("l") != string::npos ) ListBlocks();
00128 else {
00129 TIter iter = this->GetRawBlockIter();
00130 TObject *tobj = 0;
00131 while ((tobj = iter())) tobj->Print(option);
00132 }
00133 }
|
|
|
Definition at line 289 of file RawRecord.cxx. References fgPromoteCount, and MSG. 00290 {
00291 // Print the number of times each type of RawDataBlock had to
00292 // be promoted to the non-generic class type
00293
00294 if (fgPromoteCount.empty()) {
00295 MSG("Raw",Msg::kInfo)
00296 << "RawRecord promoted no RawDataBlocks to derived types"
00297 << endl;
00298 }
00299 else {
00300 MSG("Raw",Msg::kInfo)
00301 << "RawRecord promoted RawDataBlocks to derived types:"
00302 << endl;
00303
00304 std::map<std::string,unsigned long int>::const_iterator pc_itr =
00305 fgPromoteCount.begin();
00306 while (pc_itr != fgPromoteCount.end()) {
00307 MSG("Raw",Msg::kInfo)
00308 << " " << pc_itr->first << " "
00309 << pc_itr->second << " times "
00310 << endl;
00311 pc_itr++;
00312 }
00313 }
00314 }
|
|
|
Definition at line 151 of file RawRecord.cxx. References RawBlockProxy::CreateRawDataBlock(), fgPromoteCount, RawDataBlock::GetBlockId(), RawDataBlock::GetData(), RawBlockId::GetMajor(), RawBlockRegistry::Instance(), RawBlockId::IsDCS(), RawBlockRegistry::LookUp(), MSG, and promotionChecked. Referenced by FindRawBlock(), GetRawBlockIter(), and GetRawBlockList(). 00152 {
00153 // Look through list of blocks for generic 'RawDataBlock' objects;
00154 // convert these to specialized blocks based on block id.
00155
00156 if (promotionChecked) return;
00157
00158 const TString generic = "RawDataBlock";
00159 RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00160
00161 Int_t last = fComponents.GetLast();
00162 for (Int_t idx=0; idx <= last; ++idx) {
00163
00164 TObject* tobj = fComponents[idx];
00165 if ( ! tobj ) continue;
00166
00167 RawDataBlock* rdb = dynamic_cast<RawDataBlock*>(tobj);
00168 if ( ! rdb ) {
00169 // protect against serious suprises
00170 MSG("Raw",Msg::kWarning)
00171 << "Element " << idx << " in fComponents was not a RawDataBlock!"
00172 << endl;
00173 continue;
00174 }
00175
00176 if (generic != rdb->ClassName()) continue;
00177
00178 // if we're here then the block is unspecialized
00179
00180 RawBlockId rbid = rdb->GetBlockId();
00181 RawBlockProxy* rbp = rbr.LookUp(rbid.IsDCS(),rbid.GetMajor());
00182
00183 if (rbp) {
00184 // create a block of the right type
00185 RawDataBlock *specialBlk = rbp->CreateRawDataBlock(rdb->GetData());
00186
00187 // a bit of nasty code so that this method can be considered
00188 // logical const even though it changes fComponents
00189 // we do it by index so that no ordering is changed in any way
00190
00191 TObjArray& writable = const_cast<TObjArray&>(fComponents);
00192
00193 writable.RemoveAt(idx); // remove generic version
00194 writable.AddAt(specialBlk,idx); // replace with specialized copy
00195 delete rdb; // delete generic version
00196
00197 std::string finalClass = specialBlk->ClassName();
00198 unsigned long int curcount = (++fgPromoteCount[finalClass]);
00199
00200 const unsigned long int maxmsg = 10;
00201 if (curcount <= maxmsg)
00202 MSG("Raw",Msg::kInfo)
00203 << "RawRecord promoted generic 'RawDataBlock'"
00204 << " to '" << finalClass << "'"
00205 << endl;
00206 if (curcount == maxmsg)
00207 MSG("Raw",Msg::kInfo) << "... last message for " << finalClass << endl;
00208 }
00209 else {
00210 // couldn't find an appropriate block id in the registry
00211 MSG("Raw",Msg::kWarning)
00212 << "No proxy for RawBlockId "
00213 << "0x" << hex << rbid.GetMajor() << dec
00214 << ", can not promote to specialized block."
00215 << endl;
00216 }
00217
00218 } // loop over entries
00219
00220 promotionChecked = true;
00221 }
|
|
|
Definition at line 48 of file RawRecord.h. Referenced by PromoteRawDataBlocks(). |
1.3.9.1