}
//______________________________________________________________________________
-void AliAnalysisManager::AddStatisticsTask()
+void AliAnalysisManager::AddStatisticsTask(UInt_t offlineMask)
{
// Add the statistics task to the manager.
if (fStatistics) {
Info("AddStatisticsTask", "Already added");
return;
- }
- fStatistics = (AliAnalysisStatistics*)gROOT->ProcessLine("AliAnalysisTaskStat::AddToManager()->GetStatistics();");
+ }
+ TString line = Form("AliAnalysisTaskStat::AddToManager(%u);", offlineMask);
+ gROOT->ProcessLine(line);
}
//______________________________________________________________________________
{
// Write the statistics message in a file named <nevents.stat>.
// If fStatistics is present, write the file in the format ninput_nprocessed_nfailed_naccepted.stat
+ static Bool_t done = kFALSE;
+ if (done) return;
+ done = kTRUE;
ofstream out;
if (fStatistics) {
AddStatisticsMsg(Form("Number of input events: %lld",fStatistics->GetNinput()));
AddStatisticsMsg(Form("Number of processed events: %lld",fStatistics->GetNprocessed()));
AddStatisticsMsg(Form("Number of failed events (I/O): %lld",fStatistics->GetNfailed()));
- AddStatisticsMsg(Form("Number of accepted events: %lld",fStatistics->GetNaccepted()));
+ AddStatisticsMsg(Form("Number of accepted events for mask %s: %lld", AliAnalysisStatistics::GetMaskAsString(fStatistics->GetOfflineMask()), fStatistics->GetNaccepted()));
out.open(Form("%lld_%lld_%lld_%lld.stat",fStatistics->GetNinput(),
fStatistics->GetNprocessed(),fStatistics->GetNfailed(),
fStatistics->GetNaccepted()), ios::out);