00001
00002
00003
00004
00005
00006
00008
00009 #include "Rotorooter/RotoObjectifier.h"
00010
00011 #include "OnlineUtil/msgLogLib/msgLog.h"
00012
00013 #include "MessageService/MsgService.h"
00014
00015 #include "TObjArray.h"
00016
00017 #include "TString.h"
00018
00019 #include "MinosObjectMap/MomNavigator.h"
00020 #include "RawData/RawRecord.h"
00021 #include "RawData/RawDaqHeader.h"
00022 #include "RawData/RawDaqSnarlHeader.h"
00023 #include "RawData/RawBeamMonHeader.h"
00024
00025 #include "RawData/RawBlockId.h"
00026 #include "RawData/RawBlockRegistry.h"
00027 #include "RawData/RawDataBlock.h"
00028
00029 #include "RawData/RawDaqHeaderBlock.h"
00030 #include "RawData/RawSnarlHeaderBlock.h"
00031 #include "RawData/RawDcsHeaderBlock.h"
00032 #include "RawData/RawBeamMonHeaderBlock.h"
00033
00034 #include "RawData/RawLIAdcSummaryBlock.h"
00035 #include "RawData/RawLITimingSummaryBlock.h"
00036 #include "RawData/RawRunStartBlock.h"
00037 #include "RawData/RawRunEndBlock.h"
00038
00039 const UInt_t dbg_InflateDumpBufferHeads = 0x0001;
00040 const UInt_t dbg_InflatePrintBlockType = 0x0002;
00041 const UInt_t dbg_InflatePrintWholeBlock = 0x0004;
00042
00043 const UInt_t dbg_SquishDumpBufferHeads = (0x0001 << 16);
00044 const UInt_t dbg_SquishPrintBlockType = (0x0002 << 16);
00045 const UInt_t dbg_SquishPrintWholeBlock = (0x0004 << 16);
00046
00047 const UInt_t headSize = 16;
00048
00049 UInt_t RotoObjectifier::fgDebugFlags = 0;
00050
00051
00052
00053
00054
00055
00056
00057
00058 Detector::Detector_t
00059 RotoObjectifier::fgForceDetector = Detector::kUnknown;
00060 SimFlag::SimFlag_t
00061 RotoObjectifier::fgForceSimFlag = SimFlag::kUnknown;
00062
00063 enum RotoObjectifierFailureFlag {
00064 kSuccess = 0x00000000,
00065 kUnknownId = 0x00000001,
00066 kBadCheckSum = 0x00000002,
00067 kPartialRecord = 0x00000004,
00068 kUknownRecType = 0x00000008
00069 };
00070
00071
00072 ClassImp(RotoObjectifier)
00073 CVSID("$Id: RotoObjectifier.cxx,v 1.21 2007/11/10 16:46:09 schubert Exp $");
00074
00075
00076 MomNavigator* RotoObjectifier::BufferInflate(const Char_t* buffer,
00077 Int_t nbytes,
00078 Int_t& status)
00079 {
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 static int nrec = 0;
00099 nrec++;
00100
00101
00102
00103
00104
00105 TObjArray tmpArray;
00106 RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00107 RawBlockProxy* rbp_generic = rbr.LookUp(0,0);
00108
00109 Int_t *iptr_begin = (Int_t*) buffer;
00110 Int_t *iptr_end = (Int_t*)(buffer+nbytes);
00111
00112 Int_t *iptr = iptr_begin;
00113 status = 0;
00114
00115 Int_t nblk = -1;
00116 Int_t last_id = 0;
00117 Int_t last_nwords = 0;
00118
00119 while ( iptr < iptr_end ) {
00120 nblk++;
00121
00122
00123
00124
00125
00126 if ( iptr_end-iptr < 3 ) {
00127
00128
00129 logError("REC %d BLK %d, size %d, too few words (%d) at BUF end",
00130 nrec,nblk,nbytes,iptr_end-iptr);
00131 status |= kPartialRecord;
00132 break;
00133 }
00134
00135 int nwords = iptr[0];
00136 if (nwords < 3) {
00137
00138 logError("REC %d BLK %d, blocksize %d (0x%8.8x) too short",
00139 nrec,nblk,nwords,nwords);
00140 logError(" at BUF index 0x%x of 0x%x",
00141 iptr-iptr_begin,iptr_end-iptr_begin);
00142
00143 if (nblk > 0)
00144 logError(" previous BLK id 0x%8.8x, size 0x%x",
00145 last_id,last_nwords);
00146
00147 if (iptr_end-iptr > 3 ) {
00148 Int_t encoded_id = ExtractEncodedRawBlockId(iptr);
00149 logError(" current BLK id 0x%8.8x",encoded_id);
00150 }
00151
00152
00153
00154
00155 status |= kPartialRecord;
00156 break;
00157 }
00158
00159 Int_t encoded_id = ExtractEncodedRawBlockId(iptr);
00160 RawBlockId rbid(encoded_id);
00161
00162 RawBlockProxy* rbp = rbr.LookUp(rbid.IsDCS(),rbid.GetMajor());
00163 if (!rbp) {
00164
00165 logNotice("REC %d, BUF index %d, no PROXY for RawBlockId 0x%8.8x",
00166 nrec,iptr-iptr_begin,encoded_id);
00167
00168 rbp = rbp_generic;
00169 status |= kUnknownId;
00170 }
00171
00172 RawDataBlock *rawBlock = rbp->CreateRawDataBlock(iptr);
00173
00174 if (rawBlock->TestChecksum()) {
00175 status |= kBadCheckSum;
00176 static int nmsg = 5;
00177 if (nmsg>0) {
00178 nmsg--;
00179 if (rawBlock->GetChecksum() == 0)
00180 logNotice("REC %d, unset checksum on %s",nrec,rbid.AsString());
00181 else
00182 logNotice("REC %d, checksum err on %s",nrec,rbid.AsString());
00183 if (nmsg==0)
00184 logNotice("...last checksum error message");
00185 }
00186 }
00187
00188
00189 tmpArray.Add(rawBlock);
00190
00191
00192 iptr += rawBlock->GetSize();
00193
00194 last_id = encoded_id;
00195 last_nwords = nwords;
00196
00197
00198
00199
00200 }
00201
00202
00203
00204
00205 return BuildRecord(&tmpArray,status);
00206 }
00207
00208
00209 void RotoObjectifier::SysLogRawBlockRegistry()
00210 {
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221 RawBlockRegistry& rbr = RawBlockRegistry::Instance();
00222
00223 logInfo("RawBlockProxies in the RawBlockRegistry:");
00224 list<RawBlockProxy*> proxyTable = rbr.GetProxyList();
00225 list<RawBlockProxy*>::iterator itrProxyTable;
00226 for (itrProxyTable = proxyTable.begin();
00227 itrProxyTable != proxyTable.end();
00228 ++itrProxyTable) {
00229 const RawBlockProxy& proxy = (*(*itrProxyTable));
00230 const char* dataSrc = ((proxy.IsDCS()) ? "DCS" : "DAQ");
00231 int majorid = proxy.GetMajorId();
00232 const char* proxyName = proxy.GetName();
00233 logInfo(" %s 0x%4.4x %s",dataSrc,majorid,proxyName);
00234
00235 }
00236 }
00237
00238
00239 Int_t RotoObjectifier::ExtractEncodedRawBlockId(Int_t* block)
00240 {
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267 Int_t* encodedId = block + 2;
00268
00269 if (Detector::kUnknown != fgForceDetector) {
00270 *encodedId &= ~maskRawBlkIdDetector;
00271 *encodedId |= ((fgForceDetector & 0x07) << shiftRawBlkIdDetector);
00272 }
00273 if (SimFlag::kUnknown != fgForceSimFlag) {
00274 *encodedId &= ~maskRawBlkIdCSimFlag;
00275 *encodedId |= ((SimFlag::Compact(fgForceSimFlag) & 0x03)
00276 << shiftRawBlkIdCSimFlag);
00277 }
00278
00279 return *encodedId;
00280 }
00281
00282 Int_t RotoObjectifier::BufferSquish(const RawRecord* rawrec,
00283 Char_t* buffer, Int_t maxbytes)
00284 {
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297 MSG("Roto", Msg::kDebug) << "RotoObjectifier::BufferSquish" << endl;
00298
00299 if (rawrec == 0) {
00300 MSG("Root", Msg::kWarning) << "No RawRecord in MOM." << endl;
00301 return 0;
00302 }
00303
00304 Int_t* iptr_begin = (Int_t*) buffer;
00305 Int_t* iptr_end = (Int_t*)(buffer+maxbytes);
00306 Bool_t partial = false;
00307
00308 Int_t* iptr = iptr_begin;
00309
00310 TObject *tobj;
00311
00312
00313 RawSnarlHeaderBlock* snarlHdrBlk = 0;
00314 RawDaqHeaderBlock* daqHdrBlk = 0;
00315 TIter rbi = rawrec->GetRawBlockIter();
00316 while ((tobj = rbi())) {
00317 if ((snarlHdrBlk = dynamic_cast<RawSnarlHeaderBlock*>(tobj))) break;
00318 if ((daqHdrBlk = dynamic_cast<RawDaqHeaderBlock*>(tobj) )) break;
00319 }
00320
00321
00322 if ( ! snarlHdrBlk && ! daqHdrBlk ) {
00323
00324
00325
00326 snarlHdrBlk = BuildSnarlHeaderBlock(rawrec);
00327
00328 if (snarlHdrBlk) {
00329 iptr = snarlHdrBlk->AppendToBuffer(iptr);
00330 if (fgDebugFlags) {
00331 Int_t* iptr_bsize = iptr;
00332 DebugDumpSquishBlock(iptr_bsize,snarlHdrBlk);
00333 }
00334 delete snarlHdrBlk;
00335 }
00336 else {
00337
00338
00339
00340 daqHdrBlk = BuildDaqHeaderBlock(rawrec);
00341
00342 if (daqHdrBlk) {
00343 iptr = daqHdrBlk->AppendToBuffer(iptr);
00344 if (fgDebugFlags) {
00345 Int_t* iptr_bsize = iptr;
00346 DebugDumpSquishBlock(iptr_bsize,daqHdrBlk);
00347 }
00348 delete daqHdrBlk;
00349 }
00350 }
00351 }
00352
00353
00354
00355 TIter rawBlockIter = rawrec->GetRawBlockIter();
00356 RawDataBlock *rawBlock;
00357 while ((tobj = rawBlockIter())) {
00358 if ((rawBlock = dynamic_cast<RawDataBlock*>(tobj))) {
00359
00360 int size = rawBlock->GetSize();
00361
00362 if (iptr+size < iptr_end) {
00363
00364 Int_t* iptr_bsize = iptr;
00365
00366 iptr = rawBlock->AppendToBuffer(iptr);
00367
00368 if (fgDebugFlags) DebugDumpSquishBlock(iptr_bsize,rawBlock);
00369
00370 } else {
00371
00372 if ( ! partial ) {
00373 partial = true;
00374 MSG("Roto", Msg::kWarning)
00375 << "RotoObjectifier::BufferSquish adding " << size
00376 << " words would exceed buffer - "
00377 << " current index " << iptr-iptr_begin << endl;
00378
00379
00380
00381 }
00382 }
00383 }
00384 }
00385
00386
00387 return (iptr-iptr_begin)*sizeof(Int_t)/sizeof(Char_t);
00388
00389 }
00390
00391
00392 void RotoObjectifier::FormattedIntDump(void* buffer, Int_t nwords,
00393 Bool_t extra_endl)
00394 {
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408 #ifdef OLDCODE
00409 Int_t *iptr = (Int_t*)buffer;
00410 int nperline = 4;
00411 int online = 0;
00412 for (int i=0; i<nwords; i++) {
00413 printf(" 0x%8.8x",*iptr++);
00414 online++;
00415 if (online == nperline) { printf("\n"); online=0; }
00416 }
00417 if (online != 0) printf("\n");
00418 #else
00419 Int_t* start = (Int_t*)buffer;
00420
00421
00422
00423
00424 Int_t ncol = 4;
00425 Int_t ncol_last = (nwords+ncol-1)%ncol + 1;
00426 Bool_t lastmatch = false;
00427 Bool_t lastline = false;
00428 Int_t *next_word = start;
00429 Int_t nfull_lines = nwords/ncol;
00430 if (ncol_last == ncol) nfull_lines--;
00431 Int_t *start_last = start + ncol*nfull_lines;
00432 Int_t nbytes = 0;
00433
00434 while (next_word < start+nwords) {
00435
00436 if (next_word == start_last) {
00437 lastline = true;
00438 ncol = ncol_last;
00439 }
00440
00441 Int_t *prev = next_word - ncol;
00442 if (prev >= start && !lastline ) {
00443
00444 Bool_t linematch = true;
00445 Int_t *chek = next_word;
00446 for (int i=0; i<ncol; i++)
00447 linematch = ( *prev++ == *chek++ ) ? linematch : false;
00448 if (linematch) {
00449 next_word += ncol;
00450 nbytes += sizeof(Int_t)*ncol;
00451 if (!lastmatch) {
00452
00453
00454 printf(" *\n");
00455 }
00456 lastmatch = true;
00457 continue;
00458 }
00459 else lastmatch = false;
00460
00461 }
00462
00463
00464 printf(" 0x%6.6x:",nbytes/4);
00465
00466 for (int i=0; i<ncol; i++) {
00467 printf(" %8.8x",*next_word);
00468 next_word++;
00469 nbytes += sizeof(Int_t);
00470 }
00471
00472 printf("\n");
00473 }
00474
00475 #endif
00476
00477 if (extra_endl) printf("\n");
00478 }
00479
00480
00481 void RotoObjectifier::DebugDumpInflateBlock(Int_t* iptr, RawDataBlock* rawBlock)
00482 {
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495 if (fgDebugFlags & dbg_InflatePrintBlockType && rawBlock)
00496 cout << " Built " << rawBlock->GetName()
00497 << " size " << rawBlock->GetSize()
00498 << endl;
00499
00500 if (fgDebugFlags & dbg_InflateDumpBufferHeads)
00501 FormattedIntDump(iptr,headSize,true);
00502
00503 if (fgDebugFlags & dbg_InflatePrintWholeBlock)
00504 rawBlock->Print();
00505
00506 }
00507
00508
00509 void RotoObjectifier::DebugDumpSquishBlock(Int_t* iptr, RawDataBlock* rawBlock)
00510 {
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523 if (fgDebugFlags & dbg_SquishPrintBlockType && rawBlock)
00524 cout << " Squish " << rawBlock->GetName()
00525 << " size " << rawBlock->GetSize() << endl;
00526
00527 if (fgDebugFlags & dbg_SquishDumpBufferHeads && iptr)
00528 FormattedIntDump(iptr,headSize,true);
00529
00530 if (fgDebugFlags & dbg_SquishPrintWholeBlock && rawBlock)
00531 rawBlock->Print();
00532
00533 }
00534
00535
00536 MomNavigator* RotoObjectifier::BuildRecord(TObjArray* tobjarray,
00537 Int_t& )
00538 {
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552 MomNavigator* mom = 0;
00553
00554 TObject *tobj = 0;
00555 RawSnarlHeaderBlock *snarlHdrBlk = 0;
00556 RawDaqHeaderBlock *daqHdrBlk = 0;
00557 RawDcsHeaderBlock *dcsHdrBlk = 0;
00558 RawBeamMonHeaderBlock *beamHdrBlk = 0;
00559 RawLIAdcSummaryBlock *liAdcBlk = 0;
00560 RawLITimingSummaryBlock *liTimingBlk = 0;
00561 RawRunStartBlock *startBlk = 0;
00562 RawRunEndBlock *endBlk = 0;
00563
00564
00565 TIter iter_quick(tobjarray);
00566 while ((tobj = iter_quick())) {
00567 if (!snarlHdrBlk)
00568 snarlHdrBlk = dynamic_cast<RawSnarlHeaderBlock*>(tobj);
00569 if (!daqHdrBlk)
00570 daqHdrBlk = dynamic_cast<RawDaqHeaderBlock*>(tobj);
00571 if (!dcsHdrBlk)
00572 dcsHdrBlk = dynamic_cast<RawDcsHeaderBlock*>(tobj);
00573 if (!beamHdrBlk)
00574 beamHdrBlk = dynamic_cast<RawBeamMonHeaderBlock*>(tobj);
00575
00576
00577
00578 if (!liAdcBlk)
00579 liAdcBlk = dynamic_cast<RawLIAdcSummaryBlock*>(tobj);
00580 if (!liTimingBlk)
00581 liTimingBlk = dynamic_cast<RawLITimingSummaryBlock*>(tobj);
00582 if (!startBlk)
00583 startBlk = dynamic_cast<RawRunStartBlock*>(tobj);
00584 if (!endBlk)
00585 endBlk = dynamic_cast<RawRunEndBlock*>(tobj);
00586 }
00587
00588 RawHeader* rawhead = 0;
00589
00590 if (snarlHdrBlk) {
00591
00592
00593
00594 VldContext vldc = snarlHdrBlk->GetVldContext();
00595 Int_t run = snarlHdrBlk->GetRun();
00596 Short_t subrun = snarlHdrBlk->GetSubRun();
00597 Short_t runtype = snarlHdrBlk->GetRunType();
00598 Int_t tf = snarlHdrBlk->GetTimeFrameNum();
00599 Int_t snarl = snarlHdrBlk->GetSnarl();
00600 Int_t trigsrc = snarlHdrBlk->GetTriggerSource();
00601 Int_t errcode = snarlHdrBlk->GetErrorCode();
00602 Int_t nrdigit = snarlHdrBlk->GetNumRawDigits();
00603 Int_t spilltype = snarlHdrBlk->GetRemoteSpillType();
00604
00605 rawhead = new RawDaqSnarlHeader(vldc,run,subrun,runtype,tf,
00606 snarl,trigsrc,errcode,nrdigit,spilltype);
00607 }
00608 else
00609 if (daqHdrBlk) {
00610
00611
00612
00613 VldContext vldc = daqHdrBlk->GetVldContext();
00614 Int_t run = daqHdrBlk->GetRun();
00615 Short_t subrun = daqHdrBlk->GetSubRun();
00616 Short_t runtype = daqHdrBlk->GetRunType();
00617 Int_t tf = daqHdrBlk->GetTimeFrameNum();
00618
00619 rawhead = new RawDaqHeader(vldc,run,subrun,runtype,tf);
00620 }
00621 else
00622 if (dcsHdrBlk) {
00623
00624
00625
00626 VldContext vldc = dcsHdrBlk->GetVldContext();
00627
00628 rawhead = new RawHeader(vldc);
00629 }
00630 else
00631 if (beamHdrBlk) {
00632
00633
00634
00635 VldContext vldc = beamHdrBlk->GetVldContext();
00636 UInt_t spillcnt = beamHdrBlk->GetSpillCountNum();
00637
00638 rawhead = new RawBeamMonHeader(vldc,spillcnt);
00639 }
00640 else
00641 if (startBlk) {
00642
00643
00644
00645
00646 logWarn("BuildRecord missing HeaderBlock, use RunStart");
00647
00648 VldContext vldc = startBlk->GetVldContext();
00649 Int_t run = startBlk->GetRun();
00650 Short_t subrun = startBlk->GetSubRun();
00651 Short_t runtype = startBlk->GetRunType();
00652 Int_t tf = 0;
00653
00654 rawhead = new RawDaqHeader(vldc,run,subrun,runtype,tf);
00655 }
00656 else
00657 if (endBlk) {
00658
00659
00660
00661
00662 logWarn("BuildRecord missing HeaderBlock, use RunEnd");
00663
00664 VldContext vldc = endBlk->GetVldContext();
00665 Int_t run = endBlk->GetRun();
00666 Short_t subrun = endBlk->GetSubRun();
00667 Short_t runtype = endBlk->GetRunType();
00668 Int_t tf = endBlk->GetTotalTimeFrames();
00669
00670 rawhead = new RawDaqHeader(vldc,run,subrun,runtype,tf);
00671 }
00672 else
00673 if (liAdcBlk || liTimingBlk) {
00674
00675
00676
00677
00678 logWarn("BuildRecord missing HeaderBlock, attempt to use LI");
00679
00680 Int_t run = -1;
00681 Short_t subrun = -1;
00682 Short_t runtype = -1;
00683 Int_t tf = -1;
00684 VldContext vldc;
00685 if (liAdcBlk) {
00686 RawBlockId rbid = liAdcBlk->GetBlockId();
00687 vldc = VldContext(rbid.GetDetector(),rbid.GetSimFlag(),
00688 liAdcBlk->GetTimeStamp());
00689 }
00690 else if (liTimingBlk) {
00691 RawBlockId rbid = liTimingBlk->GetBlockId();
00692 vldc = VldContext(rbid.GetDetector(),rbid.GetSimFlag(),
00693 liTimingBlk->GetTimeStamp());
00694 }
00695 rawhead = new RawDaqHeader(vldc,run,subrun,runtype,tf);
00696
00697 }
00698
00699 if (!rawhead) {
00700
00701
00702
00703
00704 Int_t run = -1;
00705 Short_t subrun = -1;
00706 Short_t runtype = -1;
00707 Int_t tf = -1;
00708 VldTimeStamp ts;
00709 VldContext vldc = VldContext(Detector::kUnknown,
00710 SimFlag::kUnknown,ts);
00711
00712 rawhead = new RawDaqHeader(vldc,run,subrun,runtype,tf);
00713
00714 }
00715
00716
00717
00718 RawRecord *rawRec = new RawRecord(rawhead);
00719 RecJobHistory& jobhist
00720 = const_cast<RecJobHistory&>(rawRec->GetJobHistory());
00721 jobhist.CreateJobRecord(RecJobHistory::kRaw);
00722
00723
00724 TIter iter(tobjarray);
00725 while ((tobj = iter())) {
00726 RawDataBlock* rawBlock =
00727 dynamic_cast<RawDataBlock*>(tobj);
00728 if (rawBlock) {
00729 rawRec->AdoptRawBlock(rawBlock);
00730 tobjarray->Remove(tobj);
00731 } else {
00732 MSG("Roto", Msg::kWarning)
00733 << "Saw something other than RawDataBlock" << endl;
00734 }
00735 }
00736
00737
00738 mom = new MomNavigator;
00739 mom->AdoptFragment(rawRec);
00740
00741
00742
00743
00744 tobjarray->Delete();
00745
00746 return mom;
00747
00748 }
00749
00750 RawDaqHeaderBlock* RotoObjectifier::BuildDaqHeaderBlock(const TObject* tobj)
00751 {
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762 RawDaqHeaderBlock *daqHdrBlk = 0;
00763
00764
00765
00766
00767 const RawRecord *rr = dynamic_cast<const RawRecord *>(tobj);
00768
00769 if (rr) {
00770 const RawDaqHeader* daqHdr =
00771 dynamic_cast<const RawDaqHeader*>(rr->GetRawHeader());
00772
00773 if (daqHdr) {
00774 VldContext vldc = daqHdr->GetVldContext();
00775 Int_t run = daqHdr->GetRun();
00776 Short_t subrun = daqHdr->GetSubRun();
00777 Short_t runtype = daqHdr->GetRunType();
00778 Int_t timeframe = -1;
00779
00780 daqHdrBlk =
00781 new RawDaqHeaderBlock(vldc,run,subrun,runtype,timeframe);
00782
00783 }
00784 }
00785
00786 return daqHdrBlk;
00787 }
00788
00789 RawSnarlHeaderBlock* RotoObjectifier::BuildSnarlHeaderBlock(const TObject* tobj)
00790 {
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801 RawSnarlHeaderBlock *snarlHdrBlk = 0;
00802
00803
00804
00805
00806 const RawRecord *rr = dynamic_cast<const RawRecord *>(tobj);
00807
00808 if (rr) {
00809 const RawDaqSnarlHeader* snarlHdr =
00810 dynamic_cast<const RawDaqSnarlHeader*>(rr->GetRawHeader());
00811
00812 if (snarlHdr) {
00813 VldContext vldc = snarlHdr->GetVldContext();
00814 Int_t run = snarlHdr->GetRun();
00815 Short_t subrun = snarlHdr->GetSubRun();
00816 Short_t runtype = snarlHdr->GetRunType();
00817 Int_t timeframe = snarlHdr->GetTimeFrameNum();
00818 Int_t snarl = snarlHdr->GetSnarl();
00819 Int_t trigsrc = snarlHdr->GetTrigSrc();
00820 Int_t err = snarlHdr->GetErrorCode();
00821 Int_t nrawdigit = snarlHdr->GetNumRawDigits();
00822
00823 snarlHdrBlk =
00824 new RawSnarlHeaderBlock(vldc,run,subrun,runtype,timeframe,
00825 snarl,trigsrc,err,nrawdigit);
00826
00827 }
00828 }
00829
00830 return snarlHdrBlk;
00831 }
00832