]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Update docs.
authorcholm <Christian.Holm.Christensen@cern.ch>
Tue, 11 Nov 2014 08:13:21 +0000 (09:13 +0100)
committercholm <Christian.Holm.Christensen@cern.ch>
Tue, 11 Nov 2014 08:13:21 +0000 (09:13 +0100)
Fill in status histogram.
Enable timing of execution
Updated b->centrality mapping.

PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx
PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.h

index 131a984f64fe770039c611a439ad535530b7167a..8cfb37a569ecf6398c251b9fcb956f700c871891 100644 (file)
 # define DEFINE(N,C) do { } while(false)
 # define POST(N,O)   do { } while(false)
 #endif
+#ifndef ENABLE_TIMING
+# define MAKE_SW(NAME) do {} while(false)
+# define START_SW(NAME) do {} while(false)
+# define FILL_SW(NAME,WHICH) do {} while(false)
+#else
+# define MAKE_SW(NAME) TStopwatch NAME
+# define START_SW(NAME) if (fDoTiming) NAME.Start(true)
+# define FILL_SW(NAME,WHICH)                           \
+  if (fDoTiming) fHTiming->Fill(WHICH,NAME.CpuTime())
+#endif
 
 //====================================================================
 AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask()
@@ -197,6 +207,10 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
   // Parameters:
   //    option Not used
   //  
+  MAKE_SW(total);
+  MAKE_SW(individual);
+  START_SW(total);
+  START_SW(individual);
 
   // Read production details 
     
@@ -223,13 +237,22 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
   fEventInspector.ProcessMC(mcEvent, triggers, ivzMC, vzMC, b, cMC,
                            npart, nbin, phiR);
   fEventInspector.CompareResults(ip.Z(), vzMC, cent, cMC, b, npart, nbin);
+  FILL_SW(individual,kTimingEventInspector);
   
   //Store all events
   MarkEventForStore();
   
   Bool_t isAccepted = true;
-  if (found & AliFMDEventInspector::kNoEvent)    isAccepted = false; // return;
-  if (found & AliFMDEventInspector::kNoTriggers) isAccepted = false; // return;
+  if (found & AliFMDEventInspector::kNoEvent)    {
+    fHStatus->Fill(1);
+    isAccepted = false;
+    // return;
+  }
+  if (found & AliFMDEventInspector::kNoTriggers) {
+    fHStatus->Fill(2);
+    isAccepted = false; 
+    // return;
+  }
   //MarkEventForStore();
   // Always set the B trigger - each MC event _is_ a collision 
   triggers |= AliAODForwardMult::kB;
@@ -248,8 +271,16 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
   
   // Disable this check on SPD - will bias data 
   // if (found & AliFMDEventInspector::kNoSPD)  isAccepted = false; // return;
-  if (found & AliFMDEventInspector::kNoFMD)     isAccepted = false; // return;
-  if (found & AliFMDEventInspector::kNoVertex)  isAccepted = false; // return;
+  if (found & AliFMDEventInspector::kNoFMD)     {
+    fHStatus->Fill(4);
+    isAccepted = false; 
+    // return;
+  }
+  if (found & AliFMDEventInspector::kNoVertex)  {
+    fHStatus->Fill(5);
+    isAccepted = false; 
+    // return;
+  }
 
   if (isAccepted) {
     fAODFMD.SetIpZ(ip.Z());
@@ -269,12 +300,15 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
   GetESDFixer().Fix(*esdFMD, ip.Z());
 
   // Apply the sharing filter (or hit merging or clustering if you like)
+  START_SW(individual);
   if (isAccepted && !fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD,ip.Z())){
     AliWarning("Sharing filter failed!");
+    fHStatus->Fill(8);
     return false;
   }
   if (!fSharingFilter.FilterMC(*esdFMD, *mcEvent, ip.Z(),fMCESDFMD,fPrimary)){
     AliWarning("MC Sharing filter failed!");
+    fHStatus->Fill(8);
     return false;
   }
 
@@ -284,43 +318,61 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
   fPrimary->SetBinContent(fPrimary->GetNbinsX()+1,fPrimary->GetNbinsY(),cMC);
   
 
-  if (!isAccepted) 
+  if (!isAccepted) {
     // Exit on MC event w/o trigger, vertex, data - since there's no more 
     // to be done for MC 
+    FILL_SW(individual,kTimingSharingFilter);
     return false; 
+  }
   
   //MarkEventForStore();
   fSharingFilter.CompareResults(fESDFMD, fMCESDFMD);
+  FILL_SW(individual,kTimingSharingFilter);
+
 
   // Calculate the inclusive charged particle density 
+  START_SW(individual);
   if (!fDensityCalculator.Calculate(fESDFMD, fHistos, lowFlux, cent, ip)) { 
     AliWarning("Density calculator failed!");
+    fHStatus->Fill(9);
     return false;
   }
   if (!fDensityCalculator.CalculateMC(fMCESDFMD, fMCHistos)) { 
     AliWarning("MC Density calculator failed!");
+    fHStatus->Fill(9);
     return false;
   }
   fDensityCalculator.CompareResults(fHistos, fMCHistos);
+  FILL_SW(individual,kTimingDensityCalculator);
   
   if (fEventInspector.GetCollisionSystem() == AliFMDEventInspector::kPbPb) {
+    START_SW(individual);
     if (!fEventPlaneFinder.FindEventplane(&esd, fAODEP, 
-                                         &(fAODFMD.GetHistogram()), &fHistos))
+                                         &(fAODFMD.GetHistogram()), &fHistos)){
       AliWarning("Eventplane finder failed!");
+      fHStatus->Fill(10);
+    } 
+    FILL_SW(individual,kTimingEventPlaneFinder);   
   }
 
   // Do the secondary and other corrections. 
+  START_SW(individual);
   if (!fCorrections.Correct(fHistos, ivz)) { 
     AliWarning("Corrections failed");
+    fHStatus->Fill(12);
     return false;
   }
   if (!fCorrections.CorrectMC(fMCHistos, ivz)) { 
     AliWarning("MC Corrections failed");
+    fHStatus->Fill(12);
     return false;
   }
   fCorrections.CompareResults(fHistos, fMCHistos);
-   
+  FILL_SW(individual,kTimingCorrections);
+
+  // Collect our 'super' histogram
   Bool_t add = fAODFMD.IsTriggerBits(AliAODForwardMult::kInel);
+  START_SW(individual);
   if (!fHistCollector.Collect(fHistos, 
                              fRingSums, 
                              ivz, 
@@ -329,6 +381,7 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
                              false,
                              add)) {
     AliWarning("Histogram collector failed");
+    fHStatus->Fill(13);
     return false;
   }
   if (!fHistCollector.Collect(fMCHistos, 
@@ -339,8 +392,10 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
                              true,
                              add)) {
     AliWarning("MC Histogram collector failed");
+    fHStatus->Fill(13);
     return false;
   }
+  FILL_SW(individual,kTimingHistCollector);
 #if 0
   // Copy underflow bins to overflow bins - always full phi coverage 
   TH2&  hMC  = fMCAODFMD.GetHistogram();
@@ -351,8 +406,14 @@ AliForwardMCMultiplicityTask::Event(AliESDEvent& esd)
   }
 #endif
 
-  if (add)
+  if (add) {
     fHData->Add(&(fAODFMD.GetHistogram()));
+    fHStatus->Fill(15);
+  }
+  else {
+    fHStatus->Fill(14);
+  }
+  FILL_SW(total,kTimingTotal);
 
   return true;
 }
index 89a0e61b06fa211e372abb98aa11268c82ec4ad4..ecf56aef6cc6a3ac46fab10f8d209c7b37f7bf35 100644 (file)
@@ -26,6 +26,7 @@
 class AliESDEvent;
 class TH2D;
 class TList;
+class AliFMDMCTrackDensity;
 
 /** 
  * Calculate the multiplicity in the forward regions event-by-event 
@@ -145,6 +146,18 @@ public:
    * @return Reference to AliFMDHistCollector object 
    */
   AliFMDHistCollector& GetHistCollector() { return fHistCollector; }
+   /**
+   * Get reference to the EventPlaneFinder algorithm 
+   * 
+   * @return Reference to AliFMDEventPlaneFinder object 
+   */
+  AliFMDEventPlaneFinder& GetEventPlaneFinder() { return fEventPlaneFinder; }
+  /** 
+   * Get the track density calculator in the sharing filter 
+   * 
+   * @return Reference to AliFMDMCTrackDensity object in sharing filter 
+   */
+  AliFMDMCTrackDensity& GetTrackDensity() { return fSharingFilter.GetTrackDensity(); }
   /**
    * Get reference to the EventInspector algorithm 
    * 
@@ -181,18 +194,18 @@ public:
    * @return Reference to AliFMDHistCollector object 
    */
   const AliFMDHistCollector& GetHistCollector() const { return fHistCollector; }
-   /**
-   * Get reference to the EventPlaneFinder algorithm 
-   * 
-   * @return Reference to AliFMDEventPlaneFinder object 
-   */
-  AliFMDEventPlaneFinder& GetEventPlaneFinder() { return fEventPlaneFinder; }
   /**
    * Get reference to the EventPlaneFinder algorithm 
    * 
    * @return Reference to AliFMDEventPlaneFinder object 
    */
   const AliFMDEventPlaneFinder& GetEventPlaneFinder() const { return fEventPlaneFinder; }
+  /** 
+   * Get the track density calculator in the sharing filter 
+   * 
+   * @return Reference to AliFMDMCTrackDensity object in sharing filter 
+   */
+  const AliFMDMCTrackDensity& GetTrackDensity() const { return fSharingFilter.GetTrackDensity(); }
   /** 
    * @} 
    */