Improve error handling (M. Richter)
authorarossi <arossi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jan 2013 14:51:20 +0000 (14:51 +0000)
committerarossi <arossi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jan 2013 14:51:20 +0000 (14:51 +0000)
PWGHF/correlationHF/AliHFAssociatedTrackCuts.cxx
PWGHF/correlationHF/AliHFAssociatedTrackCuts.h

index a08788f..049bdd7 100644 (file)
@@ -468,10 +468,29 @@ void AliHFAssociatedTrackCuts::SetPidAssociated()
   }
 }
 
+void AliHFAssociatedTrackCuts::Print(Option_t *option) const
+{
+  /// overloaded from TObject: print info
+  if (strcmp(option, "parameters")==0) {
+    PrintPoolParameters();
+    return;
+  } else if (strcmp(option, "selectedMC")==0) {
+    PrintSelectedMCevents();
+    return;
+  }
+  PrintAll();
+}
+
 //--------------------------------------------------------------------------
-void AliHFAssociatedTrackCuts::PrintAll()
+void AliHFAssociatedTrackCuts::PrintAll() const
 {
        
+       if(fDescription){
+         printf("=================================================");
+         printf("\nAdditional description\n");
+         std::cout << fDescription << std::endl;
+         printf("\n");
+       }
        printf("\n=================================================");
        if(fESDTrackCuts){
          printf("\nCuts for the associated track: \n \n");
@@ -514,17 +533,11 @@ void AliHFAssociatedTrackCuts::PrintAll()
        std::cout << " " << std::endl;
        PrintPoolParameters();
        PrintSelectedMCevents();
-       if(fDescription){
-         printf("=================================================");
-         printf("\nAdditional description\n");
-         std::cout << fDescription << std::endl;
-         printf("\n");
-       }
 
 }
 
 //--------------------------------------------------------------------------
-void AliHFAssociatedTrackCuts::PrintPoolParameters()
+void AliHFAssociatedTrackCuts::PrintPoolParameters() const
 {   
        printf("=================================================");
        printf("\nEvent Pool settings: \n \n");
@@ -547,7 +560,7 @@ void AliHFAssociatedTrackCuts::PrintPoolParameters()
 }
 
 //--------------------------------------------------------------------------
-void AliHFAssociatedTrackCuts::PrintSelectedMCevents()
+void AliHFAssociatedTrackCuts::PrintSelectedMCevents() const
 {
        printf("\n=================================================");
        
index 2348e38..aeead55 100644 (file)
@@ -118,9 +118,10 @@ class AliHFAssociatedTrackCuts : public AliAnalysisCuts
        void SetPidHF(AliAODPidHF* pid) {fPidObj = pid; return;}
        void SetCharge(Short_t charge) {fCharge = charge;}
        void SetFilterBit(Int_t bit) {fBit = bit;}
-       virtual void PrintAll();
-       virtual void PrintPoolParameters();
-       virtual void PrintSelectedMCevents();
+       void Print(Option_t *option) const;
+       virtual void PrintAll() const;
+       virtual void PrintPoolParameters() const;
+       virtual void PrintSelectedMCevents() const;