added separate histogram entry for V0A and C BG flag
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Dec 2009 16:17:34 +0000 (16:17 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Dec 2009 16:17:34 +0000 (16:17 +0000)
PWG0/AliPhysicsSelection.cxx
PWG0/eventStats/AliEventStatsTask.cxx
PWG0/eventStats/run.C

index b7fbded40f455bf772040b98382eacd72d2e4f71..abf940d3dc7fef1f874e9f69f8df9aeac99b9c1a 100644 (file)
@@ -179,7 +179,9 @@ Bool_t AliPhysicsSelection::IsCollisionCandidate(const AliESDEvent* aEsd)
       Int_t fastOR = triggerAnalysis->SPDFiredChips(aEsd, 0);
       Bool_t v0A = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0A);
       Bool_t v0C = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0C);
       Int_t fastOR = triggerAnalysis->SPDFiredChips(aEsd, 0);
       Bool_t v0A = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0A);
       Bool_t v0C = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0C);
-      Bool_t v0BG = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0ABG) || triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0CBG);
+      Bool_t v0ABG = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0ABG);
+      Bool_t v0CBG = triggerAnalysis->IsOfflineTriggerFired(aEsd, AliTriggerAnalysis::kV0CBG);
+      Bool_t v0BG = v0ABG || v0CBG;
     
       if (fastOR > 0)
         fHistStatistics->Fill(2, i);
     
       if (fastOR > 0)
         fHistStatistics->Fill(2, i);
@@ -190,34 +192,36 @@ Bool_t AliPhysicsSelection::IsCollisionCandidate(const AliESDEvent* aEsd)
         fHistStatistics->Fill(4, i);
       if (v0C)
         fHistStatistics->Fill(5, i);
         fHistStatistics->Fill(4, i);
       if (v0C)
         fHistStatistics->Fill(5, i);
-      if (v0BG)
+      if (v0ABG)
         fHistStatistics->Fill(6, i);
         fHistStatistics->Fill(6, i);
+      if (v0CBG)
+        fHistStatistics->Fill(7, i);
         
       if ((fastOR > 0 || v0A || v0C) && !v0BG)
         
       if ((fastOR > 0 || v0A || v0C) && !v0BG)
-        fHistStatistics->Fill(7, i);
+        fHistStatistics->Fill(8, i);
     
       if (fastOR > 0 && (v0A || v0C) && !v0BG)
     
       if (fastOR > 0 && (v0A || v0C) && !v0BG)
-        fHistStatistics->Fill(8, i);
+        fHistStatistics->Fill(9, i);
   
       if (v0A && v0C && !v0BG)
   
       if (v0A && v0C && !v0BG)
-        fHistStatistics->Fill(9, i);
+        fHistStatistics->Fill(10, i);
         
       if (fastOR > 1 || (fastOR > 0 && (v0A || v0C)) || (v0A && v0C))
       {
         if (!v0BG)
         {
         
       if (fastOR > 1 || (fastOR > 0 && (v0A || v0C)) || (v0A && v0C))
       {
         if (!v0BG)
         {
-          fHistStatistics->Fill(10, i);
+          fHistStatistics->Fill(11, i);
       
           if (fBackgroundIdentification && !fBackgroundIdentification->IsSelected(const_cast<AliESDEvent*> (aEsd)))
           {
             AliDebug(AliLog::kDebug, "Rejecting event because of background identification");
       
           if (fBackgroundIdentification && !fBackgroundIdentification->IsSelected(const_cast<AliESDEvent*> (aEsd)))
           {
             AliDebug(AliLog::kDebug, "Rejecting event because of background identification");
-            fHistStatistics->Fill(11, i);
+            fHistStatistics->Fill(12, i);
           }
           else
           {
             AliDebug(AliLog::kDebug, "Accepted event for histograms");
             
           }
           else
           {
             AliDebug(AliLog::kDebug, "Accepted event for histograms");
             
-            fHistStatistics->Fill(12, i);
+            fHistStatistics->Fill(13, i);
             fHistBunchCrossing->Fill(aEsd->GetBunchCrossNumber(), i);
             if (i < fCollTrigClasses.GetEntries())
               accept = kTRUE;
             fHistBunchCrossing->Fill(aEsd->GetBunchCrossNumber(), i);
             if (i < fCollTrigClasses.GetEntries())
               accept = kTRUE;
@@ -282,7 +286,7 @@ Bool_t AliPhysicsSelection::Initialize(UInt_t runNumber)
   if (fHistStatistics)
     delete fHistStatistics;
 
   if (fHistStatistics)
     delete fHistStatistics;
 
-  fHistStatistics = new TH2F("fHistStatistics", "fHistStatistics;;", 12, 0.5, 12.5, count, -0.5, -0.5 + count);
+  fHistStatistics = new TH2F("fHistStatistics", "fHistStatistics;;", 13, 0.5, 13.5, count, -0.5, -0.5 + count);
     
   Int_t n = 1;
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "Correct trigger class(es)");
     
   Int_t n = 1;
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "Correct trigger class(es)");
@@ -290,7 +294,8 @@ Bool_t AliPhysicsSelection::Initialize(UInt_t runNumber)
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "FO >= 2");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0A");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0C");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "FO >= 2");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0A");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0C");
-  fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0 BG");
+  fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0A BG");
+  fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0C BG");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "(FO >= 1 | V0A | VOC) & !V0 BG");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "FO >= 1 & (V0A | VOC) & !V0 BG");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0A & VOC & !V0 BG");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "(FO >= 1 | V0A | VOC) & !V0 BG");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "FO >= 1 & (V0A | VOC) & !V0 BG");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "V0A & VOC & !V0 BG");
@@ -298,17 +303,25 @@ Bool_t AliPhysicsSelection::Initialize(UInt_t runNumber)
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "Background identification");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "Accepted");
   
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "Background identification");
   fHistStatistics->GetXaxis()->SetBinLabel(n++, "Accepted");
   
-  n = 1;
-  for (Int_t i=0; i < fCollTrigClasses.GetEntries(); i++)
-    fHistStatistics->GetYaxis()->SetBinLabel(n++, ((TObjString*) fCollTrigClasses.At(i))->String());
-  for (Int_t i=0; i < fBGTrigClasses.GetEntries(); i++)
-    fHistStatistics->GetYaxis()->SetBinLabel(n++, ((TObjString*) fBGTrigClasses.At(i))->String());
-  
   if (fHistBunchCrossing)
     delete fHistBunchCrossing;
 
   fHistBunchCrossing = new TH2F("fHistBunchCrossing", "fHistBunchCrossing;bunch crossing number;", 4000, -0.5, 3999.5,  count, -0.5, -0.5 + count);
     
   if (fHistBunchCrossing)
     delete fHistBunchCrossing;
 
   fHistBunchCrossing = new TH2F("fHistBunchCrossing", "fHistBunchCrossing;bunch crossing number;", 4000, -0.5, 3999.5,  count, -0.5, -0.5 + count);
     
+  n = 1;
+  for (Int_t i=0; i < fCollTrigClasses.GetEntries(); i++)
+  {
+    fHistStatistics->GetYaxis()->SetBinLabel(n, ((TObjString*) fCollTrigClasses.At(i))->String());
+    fHistBunchCrossing->GetYaxis()->SetBinLabel(n, ((TObjString*) fCollTrigClasses.At(i))->String());
+    n++;
+  }
+  for (Int_t i=0; i < fBGTrigClasses.GetEntries(); i++)
+  {
+    fHistStatistics->GetYaxis()->SetBinLabel(n, ((TObjString*) fBGTrigClasses.At(i))->String());
+    fHistBunchCrossing->GetYaxis()->SetBinLabel(n, ((TObjString*) fBGTrigClasses.At(i))->String());
+    n++;
+  }
+    
   return kTRUE;
 }
 
   return kTRUE;
 }
 
@@ -343,7 +356,7 @@ void AliPhysicsSelection::Print(Option_t* /* option */) const
     Printf("\nSelection statistics for first collision trigger:");
     
     Printf("Total events with correct trigger class: %d", (Int_t) fHistStatistics->GetBinContent(1, 1));
     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));
+    Printf("Selected collision candidates: %d", (Int_t) fHistStatistics->GetBinContent(13, 1));
   }
 }
 
   }
 }
 
index 6f9996ed965a5640bf308a924088f6d3f68bc162..d624126be36f898fb3b86ce79266f0e23bc42855 100644 (file)
@@ -56,13 +56,7 @@ void AliEventStatsTask::UserCreateOutputObjects()
   fOutput->SetOwner();
   
   if (!fPhysicsSelection)
   fOutput->SetOwner();
   
   if (!fPhysicsSelection)
-  {
     fPhysicsSelection = new AliPhysicsSelection;
     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 1e7b7265ab7e8f9dc0bfc7be818f42f87ef9d1f1..d2ab2406a52d9fc004b98eac115b47f8ee726914 100644 (file)
@@ -96,7 +96,11 @@ 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 = new AliEventStatsTask(optStr);
   physicsSelection = new AliPhysicsSelection;
+  if (aDebug)
+    AliLog::SetClassDebugLevel("AliPhysicsSelection", AliLog::kDebug);
   task->SetPhysicsSelection(physicsSelection);
   task->SetPhysicsSelection(physicsSelection);
+  //AliBackgroundSelection* background = new AliBackgroundSelection("AliBackgroundSelection", "AliBackgroundSelection");
+  //physicsSelection->AddBackgroundIdentification(background);
   
   mgr->AddTask(task);
 
   
   mgr->AddTask(task);