dir->cd();
if (!fFile || !fFile->IsOpen()) {
Error("AliRawReaderRoot", "could not open file %s", fileName);
+ fIsValid = kFALSE;
return;
}
TTree* tree = (TTree*) fFile->Get("RAW");
if (!tree) {
Error("AliRawReaderRoot", "no raw data tree found");
+ fIsValid = kFALSE;
return;
}
fBranch = tree->GetBranch("rawevent");
if (!fBranch) {
Error("AliRawReaderRoot", "no raw data branch found");
+ fIsValid = kFALSE;
return;
}
if (fEventIndex >= 0) {
if (fBranch->GetEntry(fEventIndex) <= 0) {
Error("AliRawReaderRoot", "no event with number %d found", fEventIndex);
+ fIsValid = kFALSE;
return;
}
}
fEnd(NULL)
{
// create an object to read digits from the given raw event
-
+ if (!fEvent) fIsValid = kFALSE;
}
AliRawReaderRoot::AliRawReaderRoot(const AliRawReaderRoot& rawReader) :
if (!fFile || !fFile->IsOpen()) {
Error("AliRawReaderRoot", "could not open file %s",
rawReader.fFile->GetName());
+ fIsValid = kFALSE;
return;
}
TTree* tree = (TTree*) fFile->Get("RAW");
if (!tree) {
Error("AliRawReaderRoot", "no raw data tree found");
+ fIsValid = kFALSE;
return;
}
fBranch = tree->GetBranch("rawevent");
if (!fBranch) {
Error("AliRawReaderRoot", "no raw data branch found");
+ fIsValid = kFALSE;
return;
}
if (fBranch->GetEntry(fEventIndex) <= 0) {
Error("AliRawReaderRoot", "no event with number %d found",
fEventIndex);
+ fIsValid = kFALSE;
return;
}
}
return Reset();
}
+Bool_t AliRawReaderRoot::GotoEvent(Int_t event)
+{
+ // go to a particular event
+ // Uses the absolute event index inside the
+ // raw-data file
+
+ if (!fBranch) return kFALSE;
+
+ delete fEvent;
+ fEvent = new AliRawEvent;
+ fBranch->SetAddress(&fEvent);
+ if (fBranch->GetEntry(event) <= 0)
+ return kFALSE;
+ fEventIndex = event;
+ fEventNumber++;
+ return Reset();
+}
+
+Int_t AliRawReaderRoot::GetNumberOfEvents() const
+{
+ // Get the total number of events in
+ // the raw-data tree
+
+ if (!fBranch) return -1;
+
+ return fBranch->GetEntries();
+}
Int_t AliRawReaderRoot::CheckData() const
{