10#include "EventAnaChain.h"
14#include "CutCollection.h"
15#include "CutContainer.h"
16#include "EventVirtualCut.h"
17#include "MemoryMapManager.h"
18#include "MultiTrackAna.h"
29 EventAnaChain::EventAnaChain() : fTaskNo(0), fTask(NULL) {}
33 for (
int i = 0; i < fTaskNo; i++) {
41 Cout::PrintInfo(
"Tasks with track buffering cannot be processed vy this task", EInfo::kWarning);
45 Cout::PrintInfo(Form(
"Task %s inherits from TrackAna, any features connected to "
46 "linking collections might not work correltly",
51 if (fTask ==
nullptr) {
57 for (
int i = 0; i < fTaskNo; i++) {
58 if (ana == fTask[i]) {
65 for (
int i = 0; i < fTaskNo; i++) {
78 metadata_new->
SetName(
"RunInfo");
85 TDirectory* dir = (TDirectory*) gFile;
86 TDirectory* metadatata = (TDirectory*) dir->Get(
"HalInfo");
87 if (metadatata->Get(
"RunInfo")) {
90 metadata_new->Write(
"RunInfo");
92 GoToDir(
"HalPhysics");
93 pack->Write(Form(
"AnaPackage_%i",
GetTaskID()));
94 if (pack) {
delete pack; }
95 for (
int i = 0; i < fTaskNo; i++) {
98 subtask_pack->Write(Form(
"AnaPackage_%i", fTask[i]->
GetTaskID()));
103 Cout::PrintInfo(Form(
"%s done, writing results", this->ClassName()), EInfo::kInfo);
107 for (
int i = 0; i < fTaskNo; i++) {
115 if (stat == Task::EInitFlag::kSUCCESS) {
116 for (
int i = 0; i < fTaskNo; i++) {
120 if (Task::EInitFlag::kFATAL == fTask[i]->
Init()) {
126 return Task::EInitFlag::kSUCCESS;
128 return Task::EInitFlag::kFATAL;
134 for (
int i = 0; i < fTaskNo; i++)
145 for (
int i = 0; i < fTaskNo; i++) {
146 if (i == no)
continue;
155 void EventAnaChain::GoToDir(TString name) {
156 TDirectory* dir = (TDirectory*) gFile;
157 TDirectory* target = (TDirectory*) dir->FindObject(name);
158 if (!target) { dir->mkdir(name); }
174 EventAnaChain::~EventAnaChain() {
175 for (
int i = 0; i < fTaskNo; i++) {
static void PrintInfo(TString text, Hal::EInfo status)
Bool_t PassEvent(Event *event, const Int_t collection)
void MakeDummyCopies(ECutUpdate update, CutContainer *other, Bool_t copy_link)
virtual void FinishTask()
virtual Task::EInitFlag Init()
virtual void AddAnalysis(EventAna *ana)
virtual void RemoveTask(Int_t no)
virtual void LinkTask(EventAna *ana) const
virtual void ProcessEvent()
virtual void SynchronizeCutContainers(EventAna *ana, Bool_t end) const
virtual void Exec(Option_t *opt)
virtual Package * Report() const
virtual void UnlinkTask(EventAna *ana) const
CutContainer * fCutContainer
Int_t fEventCollectionsNo
TString GetInputFileName() const
MemoryMapManager * fMemoryMap
virtual void AddCut(const Cut &cut, Option_t *opt="")
virtual Package * Report() const
Int_t fCurrentEventCollectionID
virtual void SetFormat(Event *format, EFormatDepth depth=EFormatDepth::kAll)
virtual void ProcessEvent()
virtual Task::EInitFlag Init()
Event * GetTemporaryEvent()
void SetName(TString name)
void AddObject(TObject *object)