/*
$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
+
+Revision 1.16.6.1 2002/06/10 15:28:58 hristov
+Merged with v3-08-02
+
+Revision 1.18 2002/04/12 12:13:23 cblume
+Add Jiris changes
+
+Revision 1.17 2002/03/28 14:59:07 cblume
+Coding conventions
+
+Revision 1.18 2002/04/12 12:13:23 cblume
+Add Jiris changes
+
+Revision 1.17 2002/03/28 14:59:07 cblume
+Coding conventions
+
+Revision 1.16 2002/02/12 11:42:08 cblume
+Remove fTree from destructor
+
Revision 1.15 2002/02/11 14:27:54 cblume
Geometry and hit structure update
// //
///////////////////////////////////////////////////////////////////////////////
-#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());
+ }
+
}
//_____________________________________________________________________________
void AliTRDdigitsManager::SetRaw()
{
+ //
+ // Switch on the raw digits flag
+ //
fIsRaw = kTRUE;
printf("Open the AliROOT-file %s.\n",file);
}
fFile = new TFile(file,"UPDATE");
+ fFileCreated = kTRUE;
if (!fFile) return kFALSE;
}
else {
}
+//_____________________________________________________________________________
+void AliTRDdigitsManager::MakeTreeAndBranches(TFile *file, Int_t iEvent)
+{
+ //
+ // Creates tree for (s)digits in the specified file
+ //
+
+ fEvent = iEvent;
+ TDirectory *wd = gDirectory;
+ file->cd();
+ MakeBranch();
+ wd->cd();
+
+}
+
//_____________________________________________________________________________
Bool_t AliTRDdigitsManager::MakeBranch(const Char_t *file)
{
}
// Write the new tree to the output file
- fTree->Write();
+ //fTree->Write();
+ fTree->AutoSave(); // Modification by Jiri
return kTRUE;