]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Digits and Sdigits go to separate files
authorkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Apr 2002 16:38:52 +0000 (16:38 +0000)
committerkowal2 <kowal2@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Apr 2002 16:38:52 +0000 (16:38 +0000)
CONTAINERS/AliSegmentArray.cxx
CONTAINERS/AliSegmentArray.h

index 07bdbef31e1b2dac14f30feb28516240115c9e65..f1b4c909663910ed782afe12f6502788714a6fc8 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.7  2001/10/21 18:22:54  hristov
+BranchOld replaced by Branch. It works correctly with Root 2.02.xx
+
 Revision 1.6  2001/08/30 09:25:24  hristov
 The operator[] is replaced by At() or AddAt() in case of TObjArray. A temporary replacement of Branch with BranchOld is introduced
 
@@ -62,6 +65,7 @@ New data structure handling
 #include "AliArrayI.h"
 #include "TError.h"
 #include "TClass.h"
+#include "TFile.h"
 
 #include "AliRun.h"
 #include "AliSegmentID.h"
@@ -272,6 +276,24 @@ void AliSegmentArray::MakeTree(char *file)
   delete psegment;
 }              
 
+////////////////////////////////////////////////////////////////////////
+TTree* AliSegmentArray::MakeTree(TFile *file)
+{
+  // 
+  //  create the whole tree in the file file
+  //
+  AliSegmentID * psegment = NewSegment();  
+  if (fTree) delete fTree;
+  TDirectory *wd = gDirectory;
+  file->cd();
+  fTree = new TTree("Segment Tree","Tree with segments");
+  fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000,99);
+  wd->cd(); 
+  delete psegment;
+  return fTree;
+}              
+////////////////////////////////////////////////////////////////////////
+
 Bool_t  AliSegmentArray::MakeDictionary(Int_t size)
 {
   //
index ddc408b3ccc1ab00e7ba5f6fe45b6c95d7390b24..f3f73619e0adeae514f2a7b60c6e0e4b4d57dde8 100644 (file)
@@ -37,7 +37,8 @@ public:
   //input output functions
   TTree * GetTree(){return fTree;}      //return pointer to connected tree
   
-  virtual void MakeTree(char *file=0);              //Make tree with the name
+  virtual void MakeTree(char *file=0);            //Make tree with the name
+  virtual TTree* MakeTree(TFile *file);           //Make tree in the file file
   virtual Bool_t ConnectTree(const char * treeName); //connect tree from current directory 
   virtual AliSegmentID * LoadSegment(Int_t index);//load segment with index to the memory
   virtual AliSegmentID * LoadEntry(Int_t index); //load segment entry from position index in tree