X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliRawEvent.cxx;h=851ae27a49a46599865329c0a8bfaf1d53602dca;hb=c82061140660e5e2284cbafc4fe73e3c93c6a272;hp=e5fa3cf837a7ef2239c1043f177f91a233945301;hpb=94d918a7f5afe6299763f444a7ef1a7164566ded;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliRawEvent.cxx b/RAW/AliRawEvent.cxx index e5fa3cf837a..851ae27a49a 100644 --- a/RAW/AliRawEvent.cxx +++ b/RAW/AliRawEvent.cxx @@ -1,4 +1,4 @@ -// @(#)alimdc:$Name$:$Id$ +// @(#) $Id$ // Author: Fons Rademakers 26/11/99 /************************************************************************** @@ -30,8 +30,6 @@ // AliRawRFIODB or via rootd using AliRawRootdDB or to CASTOR via // // rootd using AliRawCastorDB (and for performance testing there is // // also AliRawNullDB). // -// The AliRunDB class provides the interface to the run and file // -// catalogues (AliEn or plain MySQL). // // The AliStats class provides statics information that is added as // // a single keyed object to each raw file. // // The AliTagDB provides an interface to a TAG database. // @@ -42,7 +40,9 @@ #include -#include "AliRawEventHeader.h" +#include "AliLog.h" + +#include "AliRawEventHeaderBase.h" #include "AliRawEquipment.h" #include "AliRawEvent.h" @@ -52,73 +52,31 @@ ClassImp(AliRawEvent) //______________________________________________________________________________ -AliRawEvent::AliRawEvent() +AliRawEvent::AliRawEvent(): +fNEquipments(0), +fNSubEvents(0), +fEvtHdr(NULL), +fEquipments(NULL), +fSubEvents(NULL) { // Create ALICE event object. If ownData is kFALSE we will use a static // raw data object, otherwise a private copy will be made. - fNEquipments = 0; - fNSubEvents = 0; - fEvtHdr = 0; - fEquipments = 0; - fSubEvents = 0; -} - -//______________________________________________________________________________ -AliRawEvent::AliRawEvent(const AliRawEvent& rawEvent): TObject(rawEvent) -{ -// copy constructor - - Fatal("AliRawEvent", "copy constructor not implemented"); -} - -//______________________________________________________________________________ -AliRawEvent& AliRawEvent::operator = (const AliRawEvent& /*rawEvent*/) -{ -// assignment operator - - Fatal("operator =", "assignment operator not implemented"); - return *this; -} - -//______________________________________________________________________________ -AliRawEventHeader *AliRawEvent::GetHeader() -{ - // Get event header part of AliRawEvent. - - if (!fEvtHdr) - fEvtHdr = new AliRawEventHeader; - - return fEvtHdr; } //______________________________________________________________________________ -AliRawEquipment *AliRawEvent::NextEquipment() +AliRawEventHeaderBase *AliRawEvent::GetHeader() { - // Returns next equipment object. - - if (!fEquipments) - fEquipments = new TObjArray(100); // arbitrary, probably enough to prevent resizing - - if (fEquipments->GetSize() <= fNEquipments) { - fEquipments->Expand(fNEquipments+10); - Warning("NextEquipment", "expanded fEquipments by 10 to %d", - fEquipments->GetSize()); - } - - AliRawEquipment *eq; - if (!(eq = (AliRawEquipment *)fEquipments->At(fNEquipments))) { - eq = new AliRawEquipment; - fEquipments->AddAt(eq, fNEquipments); - } - - fNEquipments++; + if (!fEvtHdr) { + AliFatal("Event header does not exist!"); + return 0x0; + } - return eq; + return fEvtHdr; } //______________________________________________________________________________ -AliRawEquipment *AliRawEvent::GetEquipment(Int_t index) const +AliRawVEquipment *AliRawEvent::GetEquipment(Int_t index) const { // Get specified equipment. Returns 0 if equipment does not exist. @@ -129,32 +87,7 @@ AliRawEquipment *AliRawEvent::GetEquipment(Int_t index) const } //______________________________________________________________________________ -AliRawEvent *AliRawEvent::NextSubEvent() -{ - // Returns next sub-event object. - - if (!fSubEvents) - fSubEvents = new TObjArray(100); // arbitrary, probably enough to prevent resizing - - if (fSubEvents->GetSize() <= fNSubEvents) { - fSubEvents->Expand(fNSubEvents+10); - Warning("NextSubEvent", "expanded fSubEvents by 10 to %d", - fSubEvents->GetSize()); - } - - AliRawEvent *ev; - if (!(ev = (AliRawEvent *)fSubEvents->At(fNSubEvents))) { - ev = new AliRawEvent; - fSubEvents->AddAt(ev, fNSubEvents); - } - - fNSubEvents++; - - return ev; -} - -//______________________________________________________________________________ -AliRawEvent *AliRawEvent::GetSubEvent(Int_t index) const +AliRawVEvent *AliRawEvent::GetSubEvent(Int_t index) { // Get specified sub event. Returns 0 if sub event does not exist. @@ -164,25 +97,6 @@ AliRawEvent *AliRawEvent::GetSubEvent(Int_t index) const return (AliRawEvent *) fSubEvents->At(index); } -//______________________________________________________________________________ -void AliRawEvent::Reset() -{ - // Reset the event in case it needs to be re-used (avoiding costly - // new/delete cycle). We reset the size marker for the AliRawData - // objects and the sub event counter. - - for (int i = 0; i < fNEquipments; i++) { - AliRawEquipment *eq = (AliRawEquipment *)fEquipments->At(i); - eq->Reset(); - } - fNEquipments = 0; - for (int i = 0; i < fNSubEvents; i++) { - AliRawEvent *ev = (AliRawEvent *)fSubEvents->At(i); - ev->Reset(); - } - fNSubEvents = 0; -} - //______________________________________________________________________________ AliRawEvent::~AliRawEvent() { @@ -196,3 +110,30 @@ AliRawEvent::~AliRawEvent() fSubEvents->Delete(); delete fSubEvents; } + +//______________________________________________________________________________ +void AliRawEvent::Streamer(TBuffer &R__b) +{ + // Stream an object of class AliRawEvent. + + UInt_t R__s, R__c; + if (R__b.IsReading()) { + Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { } + TObject::Streamer(R__b); + R__b >> fNEquipments; + R__b >> fNSubEvents; + R__b >> fEvtHdr; + R__b >> fEquipments; + R__b >> fSubEvents; + R__b.CheckByteCount(R__s, R__c, AliRawEvent::IsA()); + } else { + R__c = R__b.WriteVersion(AliRawEvent::IsA(), kTRUE); + TObject::Streamer(R__b); + R__b << fNEquipments; + R__b << fNSubEvents; + R__b << fEvtHdr; + R__b << fEquipments; + R__b << fSubEvents; + R__b.SetByteCount(R__c, kTRUE); + } +}