]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
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 ffd514665fa1b5199eedc505a976c90fc24f0ec7..b7fbded40f455bf772040b98382eacd72d2e4f71 100644 (file)
@@ -316,7 +316,7 @@ void AliPhysicsSelection::Print(Option_t* /* option */) const
 {
   // print the configuration
   
 {
   // 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++)
   
   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();
   }
   
     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)
 }
 
 Long64_t AliPhysicsSelection::Merge(TCollection* list)
index 3a9b6b05f06fdbc520b8c5182ef8c63473a72ad9..6f9996ed965a5640bf308a924088f6d3f68bc162 100644 (file)
@@ -2,23 +2,16 @@
 
 #include "AliEventStatsTask.h"
 
 
 #include "AliEventStatsTask.h"
 
-#include <TCanvas.h>
 #include <TFile.h>
 #include <TFile.h>
-#include <TChain.h>
 #include <TH1F.h>
 #include <TH2F.h>
 #include <TH1F.h>
 #include <TH2F.h>
-#include <TH3F.h>
 
 #include <AliLog.h>
 #include <AliESDEvent.h>
 #include <AliHeader.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 "AliPhysicsSelection.h"
-#include "AliBackgroundSelection.h"
+//#include "AliBackgroundSelection.h"
 
 ClassImp(AliEventStatsTask)
 
 
 ClassImp(AliEventStatsTask)
 
@@ -62,12 +55,15 @@ void AliEventStatsTask::UserCreateOutputObjects()
   fOutput = new TList;
   fOutput->SetOwner();
   
   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);
 }
 
   fOutput->Add(fPhysicsSelection);
 }
 
index 6d9872711bf6e1aee1bf9eaae008018eac93d283..8922f36ca03b5eb9b81f1732d1cd6d431c80557c 100644 (file)
@@ -17,13 +17,15 @@ class AliEventStatsTask : public AliAnalysisTaskSE {
     virtual void   Terminate(Option_t*);
 
     void SetOption(const char* opt) { fOption = opt; }
     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  
     
 
  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&);
 
  private:
     AliEventStatsTask(const AliEventStatsTask&);
index f91357824cd931cc98d315f603c8725493f679a3..1e7b7265ab7e8f9dc0bfc7be818f42f87ef9d1f1 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);
   }
   
   task = new AliEventStatsTask(optStr);
-
+  physicsSelection = new AliPhysicsSelection;
+  task->SetPhysicsSelection(physicsSelection);
+  
   mgr->AddTask(task);
 
   // Attach input
   mgr->AddTask(task);
 
   // Attach input