bug fix
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Dec 2009 14:37:38 +0000 (14:37 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Dec 2009 14:37:38 +0000 (14:37 +0000)
setter for physics selection in task

PWG0/AliPhysicsSelection.cxx
PWG0/eventStats/AliEventStatsTask.cxx
PWG0/eventStats/AliEventStatsTask.h
PWG0/eventStats/run.C

index ffd5146..b7fbded 100644 (file)
@@ -316,7 +316,7 @@ void AliPhysicsSelection::Print(Option_t* /* option */) const
 {
   // print the configuration
   
-  Printf("Configuration:");
+  Printf("Configuration initialized for run %d:", fCurrentRun);
   
   Printf("Collision trigger classes:");
   for (Int_t i=0; i < fCollTrigClasses.GetEntries(); i++)
@@ -338,10 +338,13 @@ void AliPhysicsSelection::Print(Option_t* /* option */) const
     triggerAnalysis->PrintTriggerClasses();
   }
   
-  Printf("\nSelection statistics for first collision trigger:");
-  
-  Printf("Total events with correct trigger class: %d", (Int_t) fHistStatistics->GetBinContent(1, 1));
-  Printf("Selected collision candidates: %d", (Int_t) fHistStatistics->GetBinContent(12, 1));
+  if (fHistStatistics)
+  {
+    Printf("\nSelection statistics for first collision trigger:");
+    
+    Printf("Total events with correct trigger class: %d", (Int_t) fHistStatistics->GetBinContent(1, 1));
+    Printf("Selected collision candidates: %d", (Int_t) fHistStatistics->GetBinContent(12, 1));
+  }
 }
 
 Long64_t AliPhysicsSelection::Merge(TCollection* list)
index 3a9b6b0..6f9996e 100644 (file)
@@ -2,23 +2,16 @@
 
 #include "AliEventStatsTask.h"
 
-#include <TCanvas.h>
 #include <TFile.h>
-#include <TChain.h>
 #include <TH1F.h>
 #include <TH2F.h>
-#include <TH3F.h>
 
 #include <AliLog.h>
 #include <AliESDEvent.h>
 #include <AliHeader.h>
-#include <AliAnalysisManager.h>
-#include <AliESDInputHandler.h>
-#include <AliESDHeader.h>
-#include <AliTriggerAnalysis.h>
 
 #include "AliPhysicsSelection.h"
-#include "AliBackgroundSelection.h"
+//#include "AliBackgroundSelection.h"
 
 ClassImp(AliEventStatsTask)
 
@@ -62,12 +55,15 @@ void AliEventStatsTask::UserCreateOutputObjects()
   fOutput = new TList;
   fOutput->SetOwner();
   
-  fPhysicsSelection = new AliPhysicsSelection;
-  AliBackgroundSelection* background = new AliBackgroundSelection("AliBackgroundSelection", "AliBackgroundSelection");
-  background->Init();
-  //fPhysicsSelection->AddBackgroundIdentification(background);
-  //AliLog::SetClassDebugLevel("AliPhysicsSelection", AliLog::kDebug);
-
+  if (!fPhysicsSelection)
+  {
+    fPhysicsSelection = new AliPhysicsSelection;
+    //AliBackgroundSelection* background = new AliBackgroundSelection("AliBackgroundSelection", "AliBackgroundSelection");
+    //background->Init();
+    //fPhysicsSelection->AddBackgroundIdentification(background);
+    //AliLog::SetClassDebugLevel("AliPhysicsSelection", AliLog::kDebug);
+  }
+  
   fOutput->Add(fPhysicsSelection);
 }
 
index 6d98727..8922f36 100644 (file)
@@ -17,13 +17,15 @@ class AliEventStatsTask : public AliAnalysisTaskSE {
     virtual void   Terminate(Option_t*);
 
     void SetOption(const char* opt) { fOption = opt; }
+    
+    void SetPhysicsSelection(AliPhysicsSelection* physicsSelection) { fPhysicsSelection = physicsSelection; }
 
  protected:
     TList* fOutput;                  //! list send on output slot 1
 
     TString fOption;      // option string  
     
-    AliPhysicsSelection* fPhysicsSelection; //! event selection class
+    AliPhysicsSelection* fPhysicsSelection; // event selection class
 
  private:
     AliEventStatsTask(const AliEventStatsTask&);
index f913578..1e7b726 100644 (file)
@@ -95,7 +95,9 @@ void run(const Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFA
   }
   
   task = new AliEventStatsTask(optStr);
-
+  physicsSelection = new AliPhysicsSelection;
+  task->SetPhysicsSelection(physicsSelection);
+  
   mgr->AddTask(task);
 
   // Attach input