Error on AliMUONData and AliMUONv1
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Sep 2003 13:18:26 +0000 (13:18 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Sep 2003 13:18:26 +0000 (13:18 +0000)
MUON/AliMUONData.cxx
MUON/AliMUONData.h
MUON/AliMUONv1.cxx

index 1c023fc6df0aad416d3efba88bc12c66a877a4dd..ec89bdf6b6c7340dee24f8a4d0532c0992ba764f 100644 (file)
@@ -146,6 +146,38 @@ void AliMUONData::AddRecTrack(const AliMUONTrack& track)
   new(lrectracks[fNrectracks++]) AliMUONTrack(track);
 }
 //____________________________________________________________________________
+Bool_t   AliMUONData::IsRawClusterBranchesInTree()
+{
+  if (TreeR()==0x0) {
+    Error("TreeR","No treeR in memory");
+    return kFALSE;
+  }
+  else {
+     char branchname[30];
+     sprintf(branchname,"%sRawClusters1",GetName());
+     TBranch * branch = 0x0;
+     branch = TreeR()->GetBranch(branchname);
+     if (branch)  return kTRUE;
+     else return kFALSE;    
+  }
+}
+//____________________________________________________________________________
+Bool_t   AliMUONData::IsTriggerBranchesInTree()
+{
+ if (TreeR()==0x0) {
+    Error("TreeR","No treeR in memory");
+    return kFALSE;
+  }
+  else {
+     char branchname[30];
+     sprintf(branchname,"%sLocalTrigger",GetName());
+     TBranch * branch = 0x0;
+     branch = TreeR()->GetBranch(branchname);
+     if (branch)  return kTRUE;
+     else return kFALSE;    
+  }
+}
+//____________________________________________________________________________
 void AliMUONData::Fill(Option_t* option)
 {
   // Method to fill the trees
@@ -169,25 +201,34 @@ void AliMUONData::Fill(Option_t* option)
   if ( TreeD() && cD) {
     TreeD()->Fill();
   }
+
   //
   // filling rawclusters
-  if ( TreeR()  && cRC) {
-    TreeR()->Fill();
-    //  for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
-//        sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
-//        branch = TreeR()->GetBranch(branchname);
-//        branch->Fill();
-//      }
+  if ( TreeR()  && cRC ) {
+    if ( IsTriggerBranchesInTree() ) {
+      // Branch per branch filling
+      for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
+       sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
+       branch = TreeR()->GetBranch(branchname);
+       branch->Fill();
+      }
+    }
+    else  TreeR()->Fill();
   }
+  
  //
   // filling trigger 
   if ( TreeR()  && cGLT) {
-    sprintf(branchname,"%sLocalTrigger",GetName());
-    branch = TreeR()->GetBranch(branchname); 
-    branch->Fill();
-    sprintf(branchname,"%sGlobalTrigger",GetName());
-    branch = TreeR()->GetBranch(branchname);
-    branch->Fill();
+    if (IsTriggerBranchesInTree()) {
+      // Branch per branch filling
+      sprintf(branchname,"%sLocalTrigger",GetName());
+      branch = TreeR()->GetBranch(branchname); 
+      branch->Fill();
+      sprintf(branchname,"%sGlobalTrigger",GetName());
+      branch = TreeR()->GetBranch(branchname);
+      branch->Fill();
+    }
+    else  TreeR()->Fill();
   }
   //
   // filling tracks
index 467a9c35c5c6d57aed95e9adb7e05f501aafa1b8..168459f2202ac62992b473e644b800ae1538b685 100644 (file)
@@ -59,6 +59,9 @@ class AliMUONData : public TNamed {
     void           GetRawClusters() {fLoader->TreeR()->GetEvent(0);}
     void           GetTrigger() {fLoader->TreeR()->GetEvent(0);}
 
+    Bool_t        IsRawClusterBranchesInTree();
+    Bool_t        IsTriggerBranchesInTree();
+
     virtual AliLoader* GetLoader() {return fLoader;}
     virtual void       SetLoader(AliLoader * loader) {fLoader=loader;}    
     
@@ -99,12 +102,12 @@ class AliMUONData : public TNamed {
     // pointer to array of reconstructed tracks
     TClonesArray*   fRecTracks; 
 
-    Int_t           fNhits;
-    Int_t*          fNdigits;
-    Int_t*          fNrawclusters;
-    Int_t           fNglobaltrigger;
-    Int_t           fNlocaltrigger;
-    Int_t           fNrectracks; 
+    Int_t           fNhits; //!
+    Int_t*          fNdigits;//!
+    Int_t*          fNrawclusters;//!
+    Int_t           fNglobaltrigger;//!
+    Int_t           fNlocaltrigger;//!
+    Int_t           fNrectracks; //!
 
     ClassDef(AliMUONData,1)
  };
index a86a5f103c02ffb3c1f500d5ab020ba3d8ae3e55..925edb051b1ff718bd7a0901389cdc1fa29d6e87 100644 (file)
@@ -1644,7 +1644,7 @@ void AliMUONv1::StepManager()
   }
   if (idvol == -1) return;
 
-   printf(">>>> This Chamber %d\n",iChamber);
+  //   printf(">>>> This Chamber %d\n",iChamber);
 
   // record hits when track enters ...
   if( gMC->IsTrackEntering()) gMC->SetMaxStep(fStepMaxInActiveGas);