Task and sub-task status histogram
authorcholm <Christian.Holm.Christensen@cern.ch>
Wed, 24 Sep 2014 11:17:15 +0000 (13:17 +0200)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Mon, 29 Sep 2014 08:47:49 +0000 (10:47 +0200)
PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.cxx
PWGLF/FORWARD/analysis2/AliForwardMultiplicityBase.h

index 1dc038a..12e3b42 100644 (file)
@@ -56,7 +56,8 @@ AliForwardMultiplicityBase::AliForwardMultiplicityBase(const char* name)
     fAODEP(false),
     fRingSums(),
     fDoTiming(false),
-    fHTiming(0)
+  fHTiming(0),
+  fHStatus(0)
 {
   DGUARD(fDebug, 3,"Named CTOR of AliForwardMultiplicityBase %s",name);
 
@@ -143,6 +144,31 @@ AliForwardMultiplicityBase::Book()
     xaxis->SetBinLabel(kTimingTotal, "Total");
     fList->Add(fHTiming);
   }
+  fHStatus = new TH1I("status", "Status of task",15, .5, 15.5);
+  fHStatus->SetDirectory(0);
+  fHStatus->SetFillColor(kCyan+2);
+  fHStatus->SetFillStyle(3001);
+  fHStatus->SetLineColor(kBlack);
+  fHStatus->SetMarkerStyle(20);
+  fHStatus->SetMarkerColor(kBlack);
+  fHStatus->SetYTitle("Events");
+  TAxis* a = fHStatus->GetXaxis();
+  a->SetBinLabel(1,"No event");
+  a->SetBinLabel(2,"No triggers");
+  a->SetBinLabel(3,"No SPD (not used)");
+  a->SetBinLabel(4,"No FMD");
+  a->SetBinLabel(5,"No Vertex");
+  a->SetBinLabel(6,"Pile-up");
+  a->SetBinLabel(7,"IP_{z} out of range");
+  a->SetBinLabel(8,"Merger failed");
+  a->SetBinLabel(9,"N_{ch} estimator failed");
+  a->SetBinLabel(10,"#Phi_{R} estimator failed");
+  a->SetBinLabel(11,"Too many outliers");
+  a->SetBinLabel(12,"Corrector failed");
+  a->SetBinLabel(13,"Histogram collector failed");
+  a->SetBinLabel(14,"Not added");
+  a->SetBinLabel(15,"All through");
+  fList->Add(fHStatus);
 
   POST(AOD_SLOT);
   return true;
@@ -298,6 +324,11 @@ AliForwardMultiplicityBase::Finalize()
   TList* output = fResults;
   Double_t nTr = 0, nTrVtx = 0, nAcc = 0;
   MakeSimpledNdeta(list, output, nTr, nTrVtx, nAcc);
+  AliInfoF("\n"
+          "\t# events w/trigger:                 %f\n"
+          "\t# events w/trigger+vertex:          %f\n"
+          "\t# events accepted by cuts:          %f", 
+          nTr, nTrVtx, nAcc);
 
   EstimatedNdeta(list, output);
 
@@ -338,6 +369,7 @@ AliForwardMultiplicityBase::MakeSimpledNdeta(const TList* input,
   TH1I* hEventsTrVtx = 0;
   TH1I* hEventsAcc   = 0;
   TH1I* hTriggers    = 0;
+  TH1*  hStatus      = dynamic_cast<TH1*>(input->FindObject("status"));
   if (!GetEventInspector().FetchHistograms(input, 
                                           hEventsTr, 
                                           hEventsTrVtx, 
@@ -349,10 +381,17 @@ AliForwardMultiplicityBase::MakeSimpledNdeta(const TList* input,
     input->ls();
     return false;
   }
-  nTr             = hEventsTr->Integral();
-  nTrVtx          = hEventsTrVtx->Integral();
-  nAcc            = hEventsAcc->Integral();
-  Double_t vtxEff = nTrVtx / nTr;
+  nTr              = hEventsTr->Integral();
+  nTrVtx           = hEventsTrVtx->Integral();
+  nAcc             = hEventsAcc->Integral();
+  Double_t vtxEff  = nTrVtx / nTr;
+  Double_t vtxEff2 = 0;
+  if (hStatus) {
+    Double_t nTrg    = hStatus->Integral(3,15);
+    Double_t nTrgVtx = hStatus->Integral(6,15);
+    vtxEff2          = (nTrg > 0 ? nTrgVtx / nTrg : 0);
+  }
+    
   TH2D*   hData   = static_cast<TH2D*>(input->FindObject("d2Ndetadphi"));
   if (!hData) { 
     AliError(Form("Couldn't get our summed histogram from output "
@@ -406,6 +445,12 @@ AliForwardMultiplicityBase::MakeSimpledNdeta(const TList* input,
   dNdeta_->SetStats(0);
   dNdeta_->Scale(vtxEff, "width");
 
+  AliInfoF("All\n"
+          "\tNormalization eta:  %d\n"
+          "\tNormalization phi:  %d\n"
+          "\tVertex efficiency:  %f (%f)",
+          Int_t(norm->GetMaximum()), Int_t(phi->GetMaximum()), 
+          vtxEff, vtxEff2);
   output->Add(dNdeta);
   output->Add(dNdeta_);
   output->Add(norm);
@@ -520,6 +565,13 @@ AliForwardMultiplicityBase::MakeRingdNdeta(const TList* input,
     thisList->Add(resPhi);
     thisList->Add(phiAcc);
     dndetaRings->Add(resPhi);
+
+    AliInfoF("%s\n"
+            "\tNormalization eta:  %d\n"
+            "\tNormalization phi:  %d\n",
+            *ptr, 
+            Int_t(etaCov->GetMaximum()), Int_t(phiAcc->GetMaximum()));
+
     ptr++;
   }
   out->Add(dndetaRings);
index 2fa4f54..2a312a2 100644 (file)
@@ -256,7 +256,8 @@ protected:
       fAODEP(),
       fRingSums(),
       fDoTiming(false), 
-      fHTiming(0)
+      fHTiming(0),
+      fHStatus(0)
   {}
   /** 
    * Copy constructor 
@@ -331,9 +332,10 @@ protected:
   AliAODForwardEP        fAODEP;        // Output object
   AliForwardUtil::Histos fRingSums;     // Cache histograms 
   Bool_t                 fDoTiming;     // Whether to do timing or not
-  TProfile*              fHTiming;
+  TProfile*              fHTiming;      // Timing histogram 
+  TH1*                   fHStatus;      // Status histogram
 
-  ClassDef(AliForwardMultiplicityBase,5) // Forward multiplicity class
+  ClassDef(AliForwardMultiplicityBase,6) // Forward multiplicity class
 };
 
 #endif