fRawDataRef = NULL;
}
+//______________________________________________________________________________
+void AliRawEquipmentV2::Clear(Option_t*)
+{
+ // Clear the equipment in case it needs to be re-used (avoiding costly
+ // new/delete cycle). Called by AliRawEventV2 Clear method inside the event loop.
+
+ fEqpHdr.Reset();
+ fRawDataRef = NULL;
+ fRawData = NULL;
+}
+
//______________________________________________________________________________
AliRawEquipmentV2::~AliRawEquipmentV2()
{
virtual AliRawEquipmentHeader *GetEquipmentHeader();
virtual AliRawData *GetRawData();
void Reset();
+ virtual void Clear(Option_t* = "");
AliRawData *NextRawData(AliRawDataArrayV2 *array);
virtual void CloneRawData(const AliRawData *rawData);
fEvtHdrs->Delete();
delete fEvtHdrs;
}
+
+//______________________________________________________________________________
+void AliRawEventV2::Clear(Option_t*)
+{
+ // Clear the event in case it needs to be re-used (avoiding costly
+ // new/delete cycle). Can be used inside the event loop.
+
+ fEquipments.Clear("C");
+
+ if (fEvtHdrs) {
+ for (int i = 0; i < fEvtHdrs->GetEntriesFast(); i++) {
+ AliRawEventHeaderBase *hdr = (AliRawEventHeaderBase *)fEvtHdrs->UncheckedAt(i);
+ hdr->Reset();
+ }
+ fEvtHdrs->Clear();
+ }
+ fIndex = 0;
+}
+
AliRawEventV2 *NextSubEvent();
virtual AliRawVEvent *GetSubEvent(Int_t index);
void Reset();
+ virtual void Clear(Option_t* = "");
private:
TClonesArray fEquipments; // AliRawEquipmentV2's
cout << "*******************************************" << endl;
for(Int_t iEvent=0; iEvent < nEvents; iEvent++) {
- rawEvent=NULL;
+ // rawEvent=NULL;
rawTree->GetEntry(iEvent);
cout << " *********** Event " << iEvent << " *******" << endl;
DumpEvent(argv[0],rawEvent);
- delete rawEvent;
+ // delete rawEvent;
+ rawEvent->Clear();
}
+ delete rawEvent;
+
cout << "*******************************************" << endl;
cout << "EOF" << endl;
cout << "*******************************************" << endl;