Changes needed to be compliant with the updates in the physics selection
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 15:27:50 +0000 (15:27 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Jan 2011 15:27:50 +0000 (15:27 +0000)
ANALYSIS/AliCollisionNormalization.cxx
ANALYSIS/AliCollisionNormalizationTask.cxx

index 252187aeffc85d8434165e47dc8b20bcf6d413e1..b4b06ebfc77602156b7b7e5dd60475bbe6678944 100644 (file)
@@ -290,20 +290,36 @@ Double_t AliCollisionNormalization::ComputeNint() {
   Double_t bg = 0; // This will include beam gas + accidentals
   if (fHistStatBin0->GetNbinsY() > 4) { // FIXME: we need a better criterion to decide...
     AliInfo("Using BG computed by Physics Selection");
-    bg = fHistStatBin0->GetBinContent(fHistStatBin0->GetNbinsX(),AliPhysicsSelection::kStatRowBG);
-    bg += fHistStatBin0->GetBinContent(fHistStatBin0->GetNbinsX(),AliPhysicsSelection::kStatRowAcc);
+    // WARNING
+    // CHECK IF THE COMPUTATION OF BG OFFSET IS STILL OK, IN CASE OF CHANGES TO THE PHYSICS SELECTION
+    Int_t bgOffset = 0; 
+    Int_t nbiny = fHistStatBin0->GetNbinsY();
+    for(Int_t ibiny =1; ibiny <= nbiny; ibiny++){
+      bgOffset++;
+      printf("%d, %s\n", bgOffset, fHistStatBin0->GetYaxis()->GetBinLabel(ibiny) );
+      
+      if(!strncmp("All B", fHistStatBin0->GetYaxis()->GetBinLabel(ibiny),5)) break;
+      if((ibiny+1)==nbiny) AliFatal("Cannot compute bg offset");
+    }
+    
+    if(fVerbose > 2) AliInfo(Form("BG Offset: %d",bgOffset));
+    
+
+    bg = fHistStatBin0->GetBinContent(fHistStatBin0->GetNbinsX(), bgOffset+AliPhysicsSelection::kStatRowBG);
+    bg += fHistStatBin0->GetBinContent(fHistStatBin0->GetNbinsX(),bgOffset+AliPhysicsSelection::kStatRowAcc);
     Int_t cint1B = (Int_t) fHistStatBin0->GetBinContent(fHistStatBin0->GetNbinsX(),1); 
     if (cint1B != Int_t(triggeredEventsWith0MultWithBG)) {
       AliWarning(Form("Events in bin0 from physics selection and local counter not consistent: %d - %d", cint1B, Int_t(triggeredEventsWith0MultWithBG)));
     }
   } else {
     AliInfo("Computing BG using CINT1A/B/C/E, ignoring intensities");
+    AliError("This will only work for early runs!!! USE BG FROM PHYSICS SELECTION INSTEAD");
     Int_t icol = fHistStatBin0->GetNbinsX();
     Int_t cint1B = (Int_t) fHistStatBin0->GetBinContent(icol,1);       
     Int_t cint1A = (Int_t) fHistStatBin0->GetBinContent(icol,2);       
     Int_t cint1C = (Int_t) fHistStatBin0->GetBinContent(icol,3);       
     Int_t cint1E = (Int_t) fHistStatBin0->GetBinContent(icol,4);      
-    bg   = cint1A + cint1C-2*cint1E ;
+    bg   = cint1A + cint1C-2*cint1E ; // FIXME: to be changed to take into account ratios of events
     if (cint1B != triggeredEventsWith0MultWithBG) {
       AliWarning(Form("Events in bin0 from physics selection and local counter not consistent: %d - %d", cint1B, (Int_t)triggeredEventsWith0MultWithBG));
     }
index bab6897bf2a8adced0c48d51e7e7bd1f3b55ed9b..0d6a27695a67bb56ba2184ad9703f69332ec20fc 100644 (file)
@@ -125,7 +125,8 @@ void AliCollisionNormalizationTask::UserExec(Option_t*)
   // NB never call IsEventSelected more than once per event
   // (statistics histogram would be altered)
 
-  Bool_t isSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
+  // FIXME: using only MB events, foresee more events?
+  Bool_t isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB);
 
   // Get the Multiplicity cut
   const AliMultiplicity* mult = aESD->GetMultiplicity();