]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
debug options works now also with derived classes
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 24 Jul 2006 17:05:29 +0000 (17:05 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 24 Jul 2006 17:05:29 +0000 (17:05 +0000)
PWG0/AliSelector.cxx
PWG0/AliSelector.h

index be5c417efd196186d47ee1808157c834b5c33554..26ab17f9cfbfd142c8b160b7b6f5109f625058dc 100644 (file)
@@ -69,19 +69,29 @@ AliSelector::~AliSelector()
  }
 }
 
-void AliSelector::Begin(TTree*)
+void AliSelector::CheckOptions()
 {
-  // The Begin() function is called at the start of the query.
-  // When running with PROOF Begin() is only called on the client.
-  // The tree argument is deprecated (on PROOF 0 is passed).
+  // checks the option string for the debug flag
+
+  AliLog::SetClassDebugLevel(ClassName(), AliLog::kInfo);
 
   TString option = GetOption();
 
   if (option.Contains("debug"))
   {
-    AliLog::SetClassDebugLevel("AliSelector", AliLog::kDebug);
+    printf("Enabling debug more for %s\n", ClassName());
+    AliLog::SetClassDebugLevel(ClassName(), AliLog::kDebug);
     AliInfo(Form("Called with option %s.", option.Data()));
   }
+}
+
+void AliSelector::Begin(TTree*)
+{
+  // The Begin() function is called at the start of the query.
+  // When running with PROOF Begin() is only called on the client.
+  // The tree argument is deprecated (on PROOF 0 is passed).
+
+  CheckOptions();
 
   AliDebug(AliLog::kDebug, "============BEGIN===========");
 }
@@ -92,13 +102,7 @@ void AliSelector::SlaveBegin(TTree* tree)
   // When running with PROOF SlaveBegin() is called on each slave server.
   // The tree argument is deprecated (on PROOF 0 is passed).
 
-  TString option = GetOption();
-
-  if (option.Contains("debug"))
-  {
-    AliLog::SetClassDebugLevel("AliSelector", AliLog::kDebug);
-    AliInfo(Form("Called with option %s.", option.Data()));
-  }
+  CheckOptions();
 
   AliDebug(AliLog::kDebug, "=======SLAVEBEGIN========");
   AliDebug(AliLog::kDebug, Form("Hostname: %s", gSystem->HostName()));
index 07c0ce265dd3de6c2bf6fb88a9f309d73d20c60b..307365629d7c2bc8ff196c9c865fa22086ad23f9 100644 (file)
@@ -30,6 +30,7 @@ class AliSelector : public TSelector {
 
  protected:
     TTree*  GetKinematics();
+    void CheckOptions();
 
     TTree          *fTree;     //! pointer to the TTree containing the events
     AliESD*          fESD;     //! "ESD" branch in fChain