]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackReconstructorK.cxx
Checking the TreeR content before reading rawcluster and trigger data for tracking...
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackReconstructorK.cxx
index 8a69c5f649b7767acea62acc1948846f8914220e..858c3b07d328c2491897db6cef5041ef93518830 100644 (file)
@@ -76,20 +76,28 @@ AliMUONTrackReconstructorK::~AliMUONTrackReconstructorK(void)
 void AliMUONTrackReconstructorK::AddHitsForRecFromRawClusters()
 {
   /// To add to the list of hits for reconstruction all the raw clusters
-  TTree *TR = fMUONData->TreeR();
+  TTree *treeR;
   AliMUONHitForRec *hitForRec;
   AliMUONRawCluster *clus;
   Int_t iclus, nclus, nTRentries;
   TClonesArray *rawclusters;
   AliDebug(1,"Enter AddHitsForRecFromRawClusters");
 
+  treeR = fMUONData->TreeR();
+  if (!treeR) {
+    AliError("TreeR must be loaded");
+    exit(0);
+  }
+  
   if (fTrackMethod != 3) { //AZ
-    fMUONData->SetTreeAddress("RC"); //AZ
-    nTRentries = Int_t(TR->GetEntries());
-    if (nTRentries != 1) {
-      AliError(Form("nTRentries = %d not equal to 1 ",nTRentries));
+    nTRentries = Int_t(treeR->GetEntries());
+    
+    if (!(fMUONData->IsRawClusterBranchesInTree())) {
+      AliError(Form("RawCluster information is not avalaible, nTRentries = %d not equal to 1",nTRentries));
       exit(0);
     }
+
+    fMUONData->SetTreeAddress("RC"); //AZ
     fMUONData->GetRawClusters(); // only one entry  
   }