1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 /// This is the base class for reading raw data.
22 /// The derived classes, which operate on concrete raw data formats,
24 /// - ReadHeader to read the next (data/equipment) header
25 /// - ReadNextData to read the next raw data block (=1 DDL)
26 /// - ReadNext to read a given number of bytes
27 /// - several getters like GetType
29 /// Sequential access to the raw data is provided by the methods
30 /// ReadHeader, ReadNextData, ReadNextInt, ReadNextShort, ReadNextChar
32 /// If only data from a specific detector (and a given range of DDL numbers)
33 /// should be read, this can be achieved by the Select method.
34 /// Several getters provide information about the current event and the
35 /// current type of raw data.
37 ///////////////////////////////////////////////////////////////////////////////
40 #include <TPluginManager.h>
42 #include <TInterpreter.h>
45 #include <THashList.h>
47 #include <Riostream.h>
48 #include "AliRawReader.h"
49 #include "AliRawReaderFile.h"
50 #include "AliRawReaderDate.h"
51 #include "AliRawReaderRoot.h"
52 #include "AliRawReaderChain.h"
57 ClassImp(AliRawReader)
60 AliRawReader::AliRawReader() :
61 fEquipmentIdsIn(NULL),
62 fEquipmentIdsOut(NULL),
63 fRequireHeader(kTRUE),
66 fSelectEquipmentType(-1),
67 fSelectMinEquipmentId(-1),
68 fSelectMaxEquipmentId(-1),
71 fSelectTriggerMask(0),
75 fErrorLogs("AliRawDataErrorLog",100),
78 fIsTriggerClassLoaded(kFALSE)
80 // default constructor: initialize data members
81 // Allocate the swapped header in case of Mac
83 fHeaderSwapped=new AliRawDataHeader();
87 Bool_t AliRawReader::LoadEquipmentIdsMap(const char *fileName)
89 // Open the mapping file
90 // and load the mapping data
91 ifstream input(fileName);
92 if (input.is_open()) {
93 Warning("AliRawReader","Equipment ID mapping file is found !");
94 const Int_t kMaxDDL = 256;
95 fEquipmentIdsIn = new TArrayI(kMaxDDL);
96 fEquipmentIdsOut = new TArrayI(kMaxDDL);
97 Int_t equipIn, equipOut;
99 while (input >> equipIn >> equipOut) {
100 if (nIds >= kMaxDDL) {
101 Error("AliRawReader","Too many equipment Id mappings found ! Truncating the list !");
104 fEquipmentIdsIn->AddAt(equipIn,nIds);
105 fEquipmentIdsOut->AddAt(equipOut,nIds);
108 fEquipmentIdsIn->Set(nIds);
109 fEquipmentIdsOut->Set(nIds);
114 Error("AliRawReader","equipment id map file is not found ! Skipping the mapping !");
119 AliRawReader::AliRawReader(const AliRawReader& rawReader) :
121 fEquipmentIdsIn(rawReader.fEquipmentIdsIn),
122 fEquipmentIdsOut(rawReader.fEquipmentIdsOut),
123 fRequireHeader(rawReader.fRequireHeader),
124 fHeader(rawReader.fHeader),
125 fCount(rawReader.fCount),
126 fSelectEquipmentType(rawReader.fSelectEquipmentType),
127 fSelectMinEquipmentId(rawReader.fSelectMinEquipmentId),
128 fSelectMaxEquipmentId(rawReader.fSelectMaxEquipmentId),
129 fSkipInvalid(rawReader.fSkipInvalid),
130 fSelectEventType(rawReader.fSelectEventType),
131 fSelectTriggerMask(rawReader.fSelectTriggerMask),
132 fSelectTriggerExpr(rawReader.fSelectTriggerExpr),
135 fErrorLogs("AliRawDataErrorLog",100),
136 fHeaderSwapped(NULL),
137 fIsValid(rawReader.fIsValid),
138 fIsTriggerClassLoaded(rawReader.fIsTriggerClassLoaded)
141 // Allocate the swapped header in case of Mac
143 fHeaderSwapped=new AliRawDataHeader(*rawReader.fHeaderSwapped);
147 AliRawReader& AliRawReader::operator = (const AliRawReader& rawReader)
149 // assignment operator
150 if(&rawReader == this) return *this;
151 fEquipmentIdsIn = rawReader.fEquipmentIdsIn;
152 fEquipmentIdsOut = rawReader.fEquipmentIdsOut;
154 fHeader = rawReader.fHeader;
155 fCount = rawReader.fCount;
157 fSelectEquipmentType = rawReader.fSelectEquipmentType;
158 fSelectMinEquipmentId = rawReader.fSelectMinEquipmentId;
159 fSelectMaxEquipmentId = rawReader.fSelectMaxEquipmentId;
160 fSkipInvalid = rawReader.fSkipInvalid;
161 fSelectEventType = rawReader.fSelectEventType;
162 fSelectTriggerMask = rawReader.fSelectTriggerMask;
163 fSelectTriggerExpr = rawReader.fSelectTriggerExpr;
165 fErrorCode = rawReader.fErrorCode;
167 fEventNumber = rawReader.fEventNumber;
168 fErrorLogs = *((TClonesArray*)rawReader.fErrorLogs.Clone());
170 fIsValid = rawReader.fIsValid;
171 fIsTriggerClassLoaded = rawReader.fIsTriggerClassLoaded;
176 AliRawReader::~AliRawReader()
179 // delete the mapping arrays if
181 if (fEquipmentIdsIn) delete fEquipmentIdsIn;
182 if (fEquipmentIdsOut) delete fEquipmentIdsOut;
184 if (fHeaderSwapped) delete fHeaderSwapped;
187 AliRawReader* AliRawReader::Create(const char *uri)
189 // RawReader's factory
190 // It instantiate corresponding raw-reader implementation class object
191 // depending on the URI provided
192 // Normal URIs point to files, while the URI starting with
193 // 'mem://:' or 'mem://<filename>' will create
194 // AliRawReaderDateOnline object which is supposed to be used
195 // in the online reconstruction
197 TString strURI = uri;
199 if (strURI.IsNull()) {
200 AliWarningClass("No raw-reader created");
204 TObjArray *fields = strURI.Tokenize("?");
205 TString &fileURI = ((TObjString*)fields->At(0))->String();
207 AliRawReader *rawReader = NULL;
208 if (fileURI.BeginsWith("mem://") || fileURI.BeginsWith("^")) {
209 if (fileURI.BeginsWith("mem://")) fileURI.ReplaceAll("mem://","");
210 AliInfoClass(Form("Creating raw-reader in order to read events in shared memory (option=%s)",fileURI.Data()));
212 TPluginManager* pluginManager = gROOT->GetPluginManager();
213 TString rawReaderName = "AliRawReaderDateOnline";
214 TPluginHandler* pluginHandler = pluginManager->FindHandler("AliRawReader", "online");
215 // if not, add a plugin for it
216 if (!pluginHandler) {
217 pluginManager->AddHandler("AliRawReader", "online",
218 "AliRawReaderDateOnline", "RAWDatarecOnline", "AliRawReaderDateOnline(const char*)");
219 pluginHandler = pluginManager->FindHandler("AliRawReader", "online");
221 if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
222 rawReader = (AliRawReader*)pluginHandler->ExecPlugin(1,fileURI.Data());
229 else if (fileURI.BeginsWith("amore://")) {
230 // A special raw-data URL used in case
231 // the raw-data reading is steered from
232 // ouside, i.e. from AMORE
233 fileURI.ReplaceAll("amore://","");
234 AliInfoClass("Creating raw-reader in order to read events sent by AMORE");
235 rawReader = new AliRawReaderDate((void *)NULL);
237 else if (fileURI.BeginsWith("collection://")) {
238 fileURI.ReplaceAll("collection://","");
239 AliInfoClass(Form("Creating raw-reader in order to read raw-data files collection defined in %s",fileURI.Data()));
240 rawReader = new AliRawReaderChain(fileURI);
242 else if (fileURI.BeginsWith("raw://run")) {
243 fileURI.ReplaceAll("raw://run","");
244 if (fileURI.IsDigit()) {
245 rawReader = new AliRawReaderChain(fileURI.Atoi());
248 AliErrorClass(Form("Invalid syntax: %s",fileURI.Data()));
254 AliInfoClass(Form("Creating raw-reader in order to read raw-data file: %s",fileURI.Data()));
255 TString filename(gSystem->ExpandPathName(fileURI.Data()));
256 if (filename.EndsWith("/")) {
257 rawReader = new AliRawReaderFile(filename);
258 } else if (filename.EndsWith(".root")) {
259 rawReader = new AliRawReaderRoot(filename);
261 rawReader = new AliRawReaderDate(filename);
265 if (!rawReader->IsRawReaderValid()) {
266 AliErrorClass(Form("Raw-reader is invalid - check the input URI (%s)",fileURI.Data()));
273 // Now apply event selection criteria (if specified)
274 if (fields->GetEntries() > 1) {
275 Int_t eventType = -1;
276 ULong64_t triggerMask = 0;
278 for(Int_t i = 1; i < fields->GetEntries(); i++) {
279 if (!fields->At(i)) continue;
280 TString &option = ((TObjString*)fields->At(i))->String();
281 if (option.BeginsWith("EventType=",TString::kIgnoreCase)) {
282 option.ReplaceAll("EventType=","");
283 eventType = option.Atoi();
286 if (option.BeginsWith("Trigger=",TString::kIgnoreCase)) {
287 option.ReplaceAll("Trigger=","");
288 if (option.IsDigit()) {
289 triggerMask = option.Atoll();
292 triggerExpr = option.Data();
296 AliWarningClass(Form("Ignoring invalid event selection option: %s",option.Data()));
298 AliInfoClass(Form("Event selection criteria specified: eventype=%d trigger mask=%llx trigger expression=%s",
299 eventType,triggerMask,triggerExpr.Data()));
300 rawReader->SelectEvents(eventType,triggerMask,triggerExpr.Data());
309 Int_t AliRawReader::GetMappedEquipmentId() const
311 if (!fEquipmentIdsIn || !fEquipmentIdsOut) {
312 Error("AliRawReader","equipment Ids mapping is not initialized !");
313 return GetEquipmentId();
315 Int_t equipmentId = GetEquipmentId();
316 for(Int_t iId = 0; iId < fEquipmentIdsIn->GetSize(); iId++) {
317 if (equipmentId == fEquipmentIdsIn->At(iId)) {
318 equipmentId = fEquipmentIdsOut->At(iId);
325 Int_t AliRawReader::GetDetectorID() const
327 // Get the detector ID
328 // The list of detector IDs
329 // can be found in AliDAQ.h
331 if (fEquipmentIdsIn && fEquipmentIdsIn)
332 equipmentId = GetMappedEquipmentId();
334 equipmentId = GetEquipmentId();
336 if (equipmentId >= 0) {
338 return AliDAQ::DetectorIDFromDdlID(equipmentId,ddlIndex);
344 Int_t AliRawReader::GetDDLID() const
346 // Get the DDL ID (within one sub-detector)
347 // The list of detector IDs
348 // can be found in AliDAQ.h
350 if (fEquipmentIdsIn && fEquipmentIdsIn)
351 equipmentId = GetMappedEquipmentId();
353 equipmentId = GetEquipmentId();
355 if (equipmentId >= 0) {
357 AliDAQ::DetectorIDFromDdlID(equipmentId,ddlIndex);
364 void AliRawReader::Select(const char *detectorName, Int_t minDDLID, Int_t maxDDLID)
366 // read only data of the detector with the given name and in the given
367 // range of DDLs (minDDLID <= DDLID <= maxDDLID).
368 // no selection is applied if a value < 0 is used.
369 Int_t detectorID = AliDAQ::DetectorID(detectorName);
371 Select(detectorID,minDDLID,maxDDLID);
374 void AliRawReader::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID)
376 // read only data of the detector with the given ID and in the given
377 // range of DDLs (minDDLID <= DDLID <= maxDDLID).
378 // no selection is applied if a value < 0 is used.
380 fSelectEquipmentType = -1;
383 fSelectMinEquipmentId = AliDAQ::DdlIDOffset(detectorID);
385 fSelectMinEquipmentId = AliDAQ::DdlID(detectorID,minDDLID);
388 fSelectMaxEquipmentId = AliDAQ::DdlID(detectorID,AliDAQ::NumberOfDdls(detectorID)-1);
390 fSelectMaxEquipmentId = AliDAQ::DdlID(detectorID,maxDDLID);
393 void AliRawReader::SelectEquipment(Int_t equipmentType,
394 Int_t minEquipmentId, Int_t maxEquipmentId)
396 // read only data of the equipment with the given type and in the given
397 // range of IDs (minEquipmentId <= EquipmentId <= maxEquipmentId).
398 // no selection is applied if a value < 0 is used.
400 fSelectEquipmentType = equipmentType;
401 fSelectMinEquipmentId = minEquipmentId;
402 fSelectMaxEquipmentId = maxEquipmentId;
405 void AliRawReader::SelectEvents(Int_t type, ULong64_t triggerMask,
406 const char *triggerExpr)
408 // read only events with the given type and optionally
410 // no selection is applied if value = 0 is used.
411 // Trigger selection can be done via string (triggerExpr)
412 // which defines the trigger logic to be used. It works only
413 // after LoadTriggerClass() method is called for all involved
416 fSelectEventType = type;
417 fSelectTriggerMask = triggerMask;
418 if (triggerExpr) fSelectTriggerExpr = triggerExpr;
421 void AliRawReader::LoadTriggerClass(const char* name, Int_t index)
423 // Loads the list of trigger classes defined.
424 // Used in conjunction with IsEventSelected in the
425 // case when the trigger selection is given by
426 // fSelectedTriggerExpr
428 if (fSelectTriggerExpr.IsNull()) return;
430 fIsTriggerClassLoaded = kTRUE;
433 fSelectTriggerExpr.ReplaceAll(name,Form("[%d]",index));
435 fSelectTriggerExpr.ReplaceAll(name,"0");
438 void AliRawReader::LoadTriggerAlias(const THashList *lst)
440 // Loads the list of trigger aliases defined.
441 // Replaces the alias by the OR of the triggers included in it.
442 // The subsiquent call to LoadTriggerClass is needed
443 // to obtain the final expression in
444 // fSelectedTriggerExpr
446 if (fSelectTriggerExpr.IsNull()) return;
448 // Make a THashList alias -> trigger classes
450 THashList alias2trig;
456 while((nmd = dynamic_cast<TNamed*>(iter.Next()))){
458 TString aliasList(nmd->GetTitle());
459 TObjArray* arrAliases = aliasList.Tokenize(',');
460 Int_t nAliases = arrAliases->GetEntries();
462 // Loop on aliases for the current trigger
463 for(Int_t i=0; i<nAliases; i++){
465 TObjString *alias = (TObjString*) arrAliases->At(i);
467 // Find the current alias in the hash list. If it is not there, add TNamed entry
468 TNamed * inlist = (TNamed*)alias2trig.FindObject((alias->GetString()).Data());
470 inlist = new TNamed((alias->GetString()).Data(),nmd->GetName());
471 alias2trig.Add(inlist);
474 TString tt(inlist->GetTitle());
476 tt += nmd->GetName();
477 inlist->SetTitle(tt.Data());
483 alias2trig.Sort(kSortDescending);
485 // Replace all the aliases by the OR of triggers
486 TIter iter1(&alias2trig);
487 while((nmd = dynamic_cast<TNamed*>(iter1.Next()))){
488 fSelectTriggerExpr.ReplaceAll(nmd->GetName(),nmd->GetTitle());
492 Bool_t AliRawReader::IsSelected() const
494 // apply the selection (if any)
496 if (fSkipInvalid && !IsValid()) return kFALSE;
498 if (fSelectEquipmentType >= 0)
499 if (GetEquipmentType() != fSelectEquipmentType) return kFALSE;
502 if (fEquipmentIdsIn && fEquipmentIdsIn)
503 equipmentId = GetMappedEquipmentId();
505 equipmentId = GetEquipmentId();
507 if ((fSelectMinEquipmentId >= 0) &&
508 (equipmentId < fSelectMinEquipmentId))
510 if ((fSelectMaxEquipmentId >= 0) &&
511 (equipmentId > fSelectMaxEquipmentId))
517 Bool_t AliRawReader::IsEventSelected() const
519 // apply the event selection (if any)
521 // First check the event type
522 if (fSelectEventType >= 0) {
523 if (GetType() != (UInt_t) fSelectEventType) return kFALSE;
526 // Then check the trigger pattern and compared it
527 // to the required trigger mask
528 if (fSelectTriggerMask != 0) {
529 if ((GetClassMask() & fSelectTriggerMask) != fSelectTriggerMask) return kFALSE;
532 if ( fIsTriggerClassLoaded && !fSelectTriggerExpr.IsNull()) {
533 TString expr(fSelectTriggerExpr);
534 ULong64_t mask = GetClassMask();
535 for(Int_t itrigger = 0; itrigger < 50; itrigger++) {
536 if (mask & (1 << itrigger)) {
537 expr.ReplaceAll(Form("[%d]",itrigger),"1");
540 expr.ReplaceAll(Form("[%d]",itrigger),"0");
543 // Possibility to introduce downscaling
544 TPRegexp("(%\\s*\\d+)").Substitute(expr,Form("&& !(%d$1)",GetEventIndex()),"g");
546 if ((gROOT->ProcessLineFast(expr.Data(),&error) == 0) &&
547 (error == TInterpreter::kNoError)) {
555 UInt_t AliRawReader::SwapWord(UInt_t x) const
557 // Swap the endianess of the integer value 'x'
559 return (((x & 0x000000ffU) << 24) | ((x & 0x0000ff00U) << 8) |
560 ((x & 0x00ff0000U) >> 8) | ((x & 0xff000000U) >> 24));
563 UShort_t AliRawReader::SwapShort(UShort_t x) const
565 // Swap the endianess of the short value 'x'
567 return (((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8)) ;
570 Bool_t AliRawReader::ReadNextInt(UInt_t& data)
572 // reads the next 4 bytes at the current position
573 // returns kFALSE if the data could not be read
575 while (fCount == 0) {
576 if (!ReadHeader()) return kFALSE;
578 if (fCount < (Int_t) sizeof(data)) {
580 "too few data left (%d bytes) to read an UInt_t!", fCount);
583 if (!ReadNext((UChar_t*) &data, sizeof(data))) {
584 Error("ReadNextInt", "could not read data!");
593 Bool_t AliRawReader::ReadNextShort(UShort_t& data)
595 // reads the next 2 bytes at the current position
596 // returns kFALSE if the data could not be read
598 while (fCount == 0) {
599 if (!ReadHeader()) return kFALSE;
601 if (fCount < (Int_t) sizeof(data)) {
602 Error("ReadNextShort",
603 "too few data left (%d bytes) to read an UShort_t!", fCount);
606 if (!ReadNext((UChar_t*) &data, sizeof(data))) {
607 Error("ReadNextShort", "could not read data!");
611 data=SwapShort(data);
616 Bool_t AliRawReader::ReadNextChar(UChar_t& data)
618 // reads the next 1 byte at the current stream position
619 // returns kFALSE if the data could not be read
621 while (fCount == 0) {
622 if (!ReadHeader()) return kFALSE;
624 if (!ReadNext((UChar_t*) &data, sizeof(data))) {
625 Error("ReadNextChar", "could not read data!");
631 Bool_t AliRawReader::GotoEvent(Int_t event)
633 // Random access to certain
634 // event index. Could be very slow
635 // for some non-root raw-readers.
636 // So it should be reimplemented there.
637 if (event < fEventNumber) RewindEvents();
639 while (fEventNumber < event) {
640 if (!NextEvent()) return kFALSE;
646 Int_t AliRawReader::CheckData() const
648 // check the consistency of the data
649 // derived classes should overwrite the default method which returns 0 (no err)
655 void AliRawReader::DumpData(Int_t limit)
657 // print the raw data
658 // if limit is not negative, only the first and last "limit" lines of raw data
663 Error("DumpData", "no header");
667 " type = %d run = %d ", GetType(), GetRunNumber());
669 printf("event = %8.8x %8.8x\n", GetEventId()[1], GetEventId()[0]);
671 printf("event = -------- --------\n");
673 if (GetTriggerPattern()) {
674 printf(" trigger = %8.8x %8.8x ",
675 GetTriggerPattern()[1], GetTriggerPattern()[0]);
677 printf(" trigger = -------- -------- ");
679 if (GetDetectorPattern()) {
680 printf("detector = %8.8x\n", GetDetectorPattern()[0]);
682 printf("detector = --------\n");
684 if (GetAttributes()) {
685 printf(" attributes = %8.8x %8.8x %8.8x ",
686 GetAttributes()[2], GetAttributes()[1], GetAttributes()[0]);
688 printf(" attributes = -------- -------- -------- ");
690 printf("GDC = %d\n", GetGDCId());
694 printf("-------------------------------------------------------------------------------\n");
695 printf("LDC = %d\n", GetLDCId());
697 printf("equipment:\n"
698 " size = %d type = %d id = %d\n",
699 GetEquipmentSize(), GetEquipmentType(), GetEquipmentId());
700 if (GetEquipmentAttributes()) {
701 printf(" attributes = %8.8x %8.8x %8.8x ", GetEquipmentAttributes()[2],
702 GetEquipmentAttributes()[1], GetEquipmentAttributes()[0]);
704 printf(" attributes = -------- -------- -------- ");
706 printf("element size = %d\n", GetEquipmentElementSize());
708 printf("data header:\n"
709 " size = %d version = %d valid = %d compression = %d\n",
710 GetDataSize(), GetVersion(), IsValid(), IsCompressed());
713 if (limit == 0) continue;
715 Int_t size = GetDataSize();
717 for (Int_t i = 0; i < 70; i++) line[i] = ' ';
723 for (Int_t n = 0; n < size; n++) {
724 if (!ReadNextChar(byte)) {
725 Error("DumpData", "couldn't read byte number %d\n", n);
729 printf("%8.8x %s\n", n-pos, line);
730 for (Int_t i = 0; i < 70; i++) line[i] = ' ';
733 if ((limit > 0) && (n/max == limit)) {
734 Int_t nContinue = ((size-1)/max+1-limit) * max;
736 printf(" [skipping %d bytes]\n", nContinue-n);
742 Int_t offset = pos/4;
743 if ((byte > 0x20) && (byte < 0x7f)) {
744 line[pos+offset] = byte;
746 line[pos+offset] = '.';
749 snprintf(hex, 3, "%2.2x", byte);
750 line[max+max/4+3+2*pos+offset] = hex[0];
751 line[max+max/4+4+2*pos+offset] = hex[1];
755 if (pos > 0) printf("%8.8x %s\n", size-pos, line);
758 } while (ReadHeader());
761 void AliRawReader::AddErrorLog(AliRawDataErrorLog::ERawDataErrorLevel level,
765 // Add a raw data error message to the list
766 // of raw-data decoding errors
767 if (fEventNumber < 0) {
770 Int_t ddlId = GetEquipmentId();
772 AliError("No ddl raw data have been read so far! Impossible to add a raw data error log!");
776 Int_t prevEventNumber = -1;
777 Int_t prevDdlId = -1;
778 Int_t prevErrorCode = -1;
779 AliRawDataErrorLog *prevLog = (AliRawDataErrorLog *)fErrorLogs.Last();
781 prevEventNumber = prevLog->GetEventNumber();
782 prevDdlId = prevLog->GetDdlID();
783 prevErrorCode = prevLog->GetErrorCode();
786 if ((prevEventNumber != fEventNumber) ||
787 (prevDdlId != ddlId) ||
788 (prevErrorCode != code)) {
789 new (fErrorLogs[fErrorLogs.GetEntriesFast()])
790 AliRawDataErrorLog(fEventNumber,
797 if (prevLog) prevLog->AddCount();
801 Bool_t AliRawReader::GotoEventWithID(Int_t event,
806 // Go to certain event number by
807 // checking the event ID.
808 // Useful in case event-selection
809 // is applied and the 'event' is
811 if (!GotoEvent(event)) return kFALSE;
813 while (GetBCID() != period ||
814 GetOrbitID() != orbitID ||
815 GetPeriod() != bcID) {
816 if (!NextEvent()) return kFALSE;