# 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()
// Parameters:
// option Not used
//
+ MAKE_SW(total);
+ MAKE_SW(individual);
+ START_SW(total);
+ START_SW(individual);
// Read production details
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;
// 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());
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;
}
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,
false,
add)) {
AliWarning("Histogram collector failed");
+ fHStatus->Fill(13);
return false;
}
if (!fHistCollector.Collect(fMCHistos,
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();
}
#endif
- if (add)
+ if (add) {
fHData->Add(&(fAODFMD.GetHistogram()));
+ fHStatus->Fill(15);
+ }
+ else {
+ fHStatus->Fill(14);
+ }
+ FILL_SW(total,kTimingTotal);
return true;
}
class AliESDEvent;
class TH2D;
class TList;
+class AliFMDMCTrackDensity;
/**
* Calculate the multiplicity in the forward regions event-by-event
* @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
*
* @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(); }
/**
* @}
*/