return NULL;
}
}
+ else if (fileURI.BeginsWith("amore://")) {
+ // A special raw-data URL used in case
+ // the raw-data reading is steered from
+ // ouside, i.e. from AMORE
+ fileURI.ReplaceAll("amore://","");
+ AliInfoClass("Creating raw-reader in order to read events sent by AMORE");
+ rawReader = new AliRawReaderDate((void *)NULL);
+ }
else if (fileURI.BeginsWith("collection://")) {
fileURI.ReplaceAll("collection://","");
AliInfoClass(Form("Creating raw-reader in order to read raw-data files collection defined in %s",fileURI.Data()));
rawReader = new AliRawReaderChain(fileURI);
}
+ else if (fileURI.BeginsWith("raw://run")) {
+ fileURI.ReplaceAll("raw://run","");
+ if (fileURI.IsDigit()) {
+ rawReader = new AliRawReaderChain(fileURI.Atoi());
+ }
+ else {
+ AliErrorClass(Form("Invalid syntax: %s",fileURI.Data()));
+ fields->Delete();
+ return NULL;
+ }
+ }
else {
AliInfoClass(Form("Creating raw-reader in order to read raw-data file: %s",fileURI.Data()));
TString filename(gSystem->ExpandPathName(fileURI.Data()));
expr.ReplaceAll(Form("[%d]",itrigger),"0");
}
}
+ // Possibility to introduce downscaling
+ expr.ReplaceAll("%",Form("&& !%d %%",GetEventIndex()));
Int_t error;
if ((gROOT->ProcessLineFast(expr.Data(),&error) == 0) &&
(error == TInterpreter::kNoError)) {
return kTRUE;
}
-Bool_t AliRawReader::GotoEvent(Int_t /*event*/)
+Bool_t AliRawReader::GotoEvent(Int_t event)
{
- Error("GotoEvent","Method not implemented! Nothing done");
- return kFALSE;
+ // Random access to certain
+ // event index. Could be very slow
+ // for some non-root raw-readers.
+ // So it should be reimplemented there.
+ if (event < fEventNumber) RewindEvents();
+
+ while (fEventNumber < event) {
+ if (!NextEvent()) return kFALSE;
+ }
+
+ return kTRUE;
}
Int_t AliRawReader::CheckData() const
line[pos+offset] = '.';
}
char hex[3];
- sprintf(hex, "%2.2x", byte);
+ snprintf(hex, 3, "%2.2x", byte);
line[max+max/4+3+2*pos+offset] = hex[0];
line[max+max/4+4+2*pos+offset] = hex[1];
pos++;
if (prevLog) prevLog->AddCount();
}
+
+Bool_t AliRawReader::GotoEventWithID(Int_t event,
+ UInt_t period,
+ UInt_t orbitID,
+ UShort_t bcID)
+{
+ // Go to certain event number by
+ // checking the event ID.
+ // Useful in case event-selection
+ // is applied and the 'event' is
+ // relative
+ if (!GotoEvent(event)) return kFALSE;
+
+ while (GetBCID() != period ||
+ GetOrbitID() != orbitID ||
+ GetPeriod() != bcID) {
+ if (!NextEvent()) return kFALSE;
+ }
+
+ return kTRUE;
+}
+