Fix writing of tracklets for first event
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Jul 2009 07:53:40 +0000 (07:53 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Jul 2009 07:53:40 +0000 (07:53 +0000)
TRD/AliTRDReconstructor.cxx
TRD/AliTRDclusterizer.cxx
TRD/AliTRDclusterizer.h
TRD/AliTRDrawData.cxx

index 4f62790..e24a499 100644 (file)
@@ -214,6 +214,7 @@ void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader
   AliTRDclusterizer clusterer(fgTaskNames[kClusterizer], fgTaskNames[kClusterizer]);
   clusterer.SetReconstructor(this);
   clusterer.OpenOutput(clusterTree);
+  clusterer.OpenTrackletOutput();
   clusterer.SetUseLabels(kFALSE);
   clusterer.Raw2ClustersChamber(rawReader);
   
index 6631537..97cf806 100644 (file)
@@ -360,8 +360,16 @@ Bool_t AliTRDclusterizer::OpenOutput(TTree *clusterTree)
     fClusterTree = clusterTree;
     fClusterTree->Branch("TRDcluster", "TObjArray", &ioArray, 32000, 0);
   }
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+Bool_t AliTRDclusterizer::OpenTrackletOutput()
+{
+  //
+  // Tracklet writing
+  //
 
-  // tracklet writing
   if (fReconstructor->IsWritingTracklets()){
     TString evfoldname = AliConfig::GetDefaultEventFolderName();
     fRunLoader         = AliRunLoader::GetRunLoader(evfoldname);
@@ -381,21 +389,18 @@ Bool_t AliTRDclusterizer::OpenOutput(TTree *clusterTree)
       dl = new AliDataLoader("TRD.Tracklets.root","tracklets", "tracklets");
       fRunLoader->GetLoader("TRDLoader")->AddDataLoader(dl);
     }
-    else {
-      fTrackletTree = dl->Tree();
-      if (!fTrackletTree)
-        {
-        dl->MakeTree();
-        fTrackletTree = dl->Tree();
-        }
-      TBranch *trkbranch = fTrackletTree->GetBranch("trkbranch");
-      if (!trkbranch)
-        fTrackletTree->Branch("trkbranch",leaves[0],"det/i:side/i:tracklets[256]/i");
-    }
+    fTrackletTree = dl->Tree();
+    if (!fTrackletTree)
+      {
+       dl->MakeTree();
+       fTrackletTree = dl->Tree();
+      }
+    TBranch *trkbranch = fTrackletTree->GetBranch("trkbranch");
+    if (!trkbranch)
+      fTrackletTree->Branch("trkbranch",leaves[0],"det/i:side/i:tracklets[256]/i");
   }
 
   return kTRUE;
-
 }
 
 //_____________________________________________________________________________
index f6adbf3..5d33d1a 100644 (file)
@@ -74,6 +74,7 @@ class AliTRDclusterizer : public TNamed
   Bool_t   OpenInput(Int_t nEvent = 0);
   Bool_t   OpenOutput();
   Bool_t   OpenOutput(TTree *clusterTree);
+  Bool_t   OpenTrackletOutput();
 
   Bool_t   ReadDigits();
   Bool_t   ReadDigits(AliRawReader *rawReader);
index a4b5de1..57ecb56 100644 (file)
@@ -1296,17 +1296,15 @@ Bool_t AliTRDrawData::OpenOutput()
       dl = new AliDataLoader("TRD.Tracklets.root","tracklets", "tracklets");
       fRunLoader->GetLoader("TRDLoader")->AddDataLoader(dl);
     }
-    else {
-      fTrackletTree = dl->Tree();
-      if (!fTrackletTree)
-        {
-        dl->MakeTree();
-        fTrackletTree = dl->Tree();
-        }
-      TBranch *trkbranch = fTrackletTree->GetBranch("trkbranch");
-      if (!trkbranch)
-        fTrackletTree->Branch("trkbranch",leaves[0],"det/i:side/i:tracklets[256]/i");
-    }
+    fTrackletTree = dl->Tree();
+    if (!fTrackletTree)
+      {
+       dl->MakeTree();
+       fTrackletTree = dl->Tree();
+      }
+    TBranch *trkbranch = fTrackletTree->GetBranch("trkbranch");
+    if (!trkbranch)
+      fTrackletTree->Branch("trkbranch",leaves[0],"det/i:side/i:tracklets[256]/i");
   }
   return kTRUE;