//
-// Class AliRsnAnalysisME
+// Class AliRsnAnalysisSE
//
-// TODO
+// Virtual Class derivated from AliRsnVAnalysisTaskSE which will be base class
+// for all RSN SE tasks
//
-// authors: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
-// Martin Vala (martin.vala@cern.ch)
+// authors: Martin Vala (martin.vala@cern.ch)
+// Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
//
+
#include <Riostream.h>
+#include <TList.h>
#include "AliESDEvent.h"
#include "AliMCEvent.h"
#include "AliAODEvent.h"
ClassImp(AliRsnAnalysisSE)
//_____________________________________________________________________________
-AliRsnAnalysisSE::AliRsnAnalysisSE(const char *name,Int_t numOfOutputs,Bool_t useKine) :
- AliRsnVAnalysisTaskSE(name,numOfOutputs,useKine),
- fRsnAnalysisManager(),
- fEventCuts(0x0),
- fZeroEventPercentWarning(50),
- fUseZeroEventWarning(kTRUE)
+AliRsnAnalysisSE::AliRsnAnalysisSE(const char *name, Bool_t useKine) :
+ AliRsnVAnalysisTaskSE(name, useKine),
+ fRsnAnalysisManager(),
+ fEventCuts(0x0),
+ fOutList(0x0),
+ fZeroEventPercentWarning(50),
+ fUseZeroEventWarning(kTRUE)
{
//
// Default constructor.
//
- AliDebug(AliLog::kDebug+2,"<-");
- for (Int_t i=0;i<fNumberOfOutputs;i++) {
- DefineOutput(i+2, TList::Class());
- }
+ DefineOutput(2, TList::Class());
AliDebug(AliLog::kDebug+2,"->");
}
AliRsnVAnalysisTaskSE(copy),
fRsnAnalysisManager(copy.fRsnAnalysisManager),
fEventCuts(copy.fEventCuts),
+ fOutList(0x0),
fZeroEventPercentWarning(copy.fZeroEventPercentWarning),
fUseZeroEventWarning(copy.fUseZeroEventWarning)
{
AliDebug(AliLog::kDebug+2,"<-");
- Int_t i;
- for (i = 1; i < kMaxNumberOfOutputs + 1; i++)
- {
- if (i <= fNumberOfOutputs + 1) OpenFile(i+1);
- fOutList[i] = new TList();
- fOutList[i]->SetOwner();
- }
+ fOutList = new TList;
+ fRsnAnalysisManager.InitAllPairs(fOutList);
+
+ AliError("\n\n***LIST***\n\n");
+ fOutList->Print();
- for (i = 0; i < fNumberOfOutputs; i++)
- {
- fRsnAnalysisManager[i].InitAllPairMgrs(fOutList[i+1]);
- }
+ PostData(2, fOutList);
AliDebug(AliLog::kDebug+2,"->");
}
fTaskInfo.SetEventUsed(kFALSE);
if (fUseZeroEventWarning)
{
- TH1I *hist = (TH1I*)fOutList[0]->FindObject(fTaskInfo.GetEventHistogramName());
+ TH1I *hist = (TH1I*)fInfoList->FindObject(fTaskInfo.GetEventHistogramName());
if (!hist) return;
- Double_t zeroEventPercent = (Double_t)hist->GetBinContent(1) / hist->Integral() * 100;
+ Double_t zeroEventPercent = 0.0;
+ if (hist->Integral() > 1) zeroEventPercent = (Double_t)hist->GetBinContent(1) / hist->Integral() * 100;
if ((zeroEventPercent>fZeroEventPercentWarning)&&(fEntry>100))
AliWarning(Form("%3.2f%% Events are with zero tracks (CurrentEvent=%d)!!!",zeroEventPercent,fEntry));
}
// if the event does not pass them, it is skipped and ProcessInfo
// is updated accordingly
if (fEventCuts) {
- if (!fEventCuts->IsSelected(AliRsnCut::kEvent, &fRsnEvent)) {
+ if (!fEventCuts->IsSelected(&fRsnEvent)) {
fTaskInfo.SetEventUsed(kFALSE);
return;
}
// the virtual class has already sorted tracks in the PID index
// so we need here just to call the execution of analysis
- for (Int_t i = 0; i < fNumberOfOutputs; i++)
- {
- fRsnAnalysisManager[i].ProcessAllPairMgrs(&fRsnPIDIndex, &fRsnEvent);
- PostData(i+2, fOutList[i+1]);
- }
+ fRsnAnalysisManager.ProcessAllPairs(&fRsnEvent, &fRsnEvent);
+ PostData(2, fOutList);
+
AliDebug(AliLog::kDebug+2,"->");
}
AliDebug(AliLog::kDebug+2,"->");
}
-//_____________________________________________________________________________
-AliRsnAnalysisManager* AliRsnAnalysisSE::GetAnalysisManager(Int_t index, TString name)
-{
-//
-// Recovery the analysis manager
-//
-
- if (!name.IsNull())
- {
- SetAnalysisManagerName(name.Data(), index);
- }
-
- return &fRsnAnalysisManager[index];
-}