/*
$Log$
+Revision 1.21 2003/02/04 17:26:00 cblume
+Include a reset of the digits arrays in order to process several events
+
+Revision 1.20 2002/10/22 15:53:08 alibrary
+Introducing Riostream.h
+
+Revision 1.19 2002/10/14 14:57:43 hristov
+Merging the VirtualMC branch to the main development branch (HEAD)
+
Revision 1.16.6.2 2002/07/24 10:09:30 alibrary
Updating VirtualMC
// //
///////////////////////////////////////////////////////////////////////////////
-#include <iostream.h>
+#include <Riostream.h>
#include <TROOT.h>
#include <TTree.h>
fSDigits = 0;
fFile = NULL;
+ fFileCreated = kFALSE;
fTree = NULL;
fDigits = NULL;
for (Int_t iDict = 0; iDict < kNDict; iDict++) {
// AliTRDdigitsManager destructor
//
- if (fFile) {
+ if (fFile && fFileCreated) {
fFile->Close();
delete fFile;
fFile = NULL;
,AliTRDgeometry::Ndet());
}
+}
+//_____________________________________________________________________________
+void AliTRDdigitsManager::ResetArrays()
+{
+ //
+ // Reset the data arrays
+ //
+
+ if (fDigits) {
+ delete fDigits;
+ }
+ fDigits = new AliTRDsegmentArray("AliTRDdataArrayI",AliTRDgeometry::Ndet());
+
+ for (Int_t iDict = 0; iDict < kNDict; iDict++) {
+ if (fDictionary[iDict]) {
+ delete fDictionary[iDict];
+ }
+ fDictionary[iDict] = new AliTRDsegmentArray("AliTRDdataArrayI"
+ ,AliTRDgeometry::Ndet());
+ }
+
}
//_____________________________________________________________________________
printf("Open the AliROOT-file %s.\n",file);
}
fFile = new TFile(file,"UPDATE");
+ fFileCreated = kTRUE;
if (!fFile) return kFALSE;
}
else {