3 // Task to debug problems
7 #include "AliEmcalDebugTask.h"
8 #include <TClonesArray.h>
12 #include "AliAnalysisManager.h"
13 #include "AliESDEvent.h"
14 #include "AliInputEventHandler.h"
17 ClassImp(AliEmcalDebugTask)
19 //________________________________________________________________________
20 AliEmcalDebugTask::AliEmcalDebugTask() :
32 //________________________________________________________________________
33 AliEmcalDebugTask::AliEmcalDebugTask(const char *name) :
34 AliAnalysisTaskSE(name),
44 DefineOutput(1, TList::Class());
45 fBranchNames = "ESD:AliESDHeader.,AliESDRun.,Tracks";
48 //________________________________________________________________________
49 AliEmcalDebugTask::~AliEmcalDebugTask()
54 //________________________________________________________________________
55 void AliEmcalDebugTask::UserCreateOutputObjects()
57 // Create user objects
59 fOutput = new TList();
63 fRand = r.Integer(kMaxUInt);
64 fOutput->Add(new TNamed(Form("%u",fId),Form("%u",fRand)));
66 AliInfo(Form("AliEmcalDebug: %u %u",fId,fRand));
73 //________________________________________________________________________
74 void AliEmcalDebugTask::UserExec(Option_t *)
76 // Main loop, called for each event.
78 AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
80 AliError("Manager zero, returning");
86 TTree *t = am->GetTree();
88 TFile *f = t->GetCurrentFile();
90 filename = f->GetName();
94 if (filename==fFileName)
97 if (fFileTest.Length()>0) {
98 if (!fFileName.Contains(fFileTest)) {
99 AliError(Form("Filename %s does not contain %s", fFileName.Data(), fFileTest.Data()));
103 fFileName = filename;
105 AliInfo(Form("New file: %s", fFileName.Data()));
106 fOutput->Add(new TNamed(Form("%u:%u",fId,fRand),fFileName.Data()));