32 void TrackAnaChain::ProcessEvent() {
33 CutCollection* cont = fCutContainer->GetEventCollection(fCurrentEventCollectionID);
34 for (
int i = 0; i < fTaskNo; i++) {
35 fTask[i]->fCurrentEventCollectionID = fCurrentEventCollectionID;
37 for (
int i = 0; i < fMemoryMap->GetTemporaryTotalTracksNo(); i++) {
38 for (
int j = 0; j < cont->
GetNextNo(); j++) {
40 fCurrentTrack = fCurrentEvent->GetTrack(i);
41 if (fCutContainer->PassTrack(fCurrentTrack, fCurrentTrackCollectionID)) {
42 fMemoryMap->AddTrackToMapTrack(fCurrentEventCollectionID,
43 fCurrentTrackCollectionID,
45 for (
int k = 0; k < fTaskNo; k++) {
46 fTask[k]->fCurrentTrackCollectionID = fCurrentTrackCollectionID;
47 fTask[k]->ProcessTrack();
54 Task::EInitFlag TrackAnaChain::Init() {
55 Task::EInitFlag stat = TrackAna::Init();
56 if (stat == Task::EInitFlag::kSUCCESS) {
57 fTrackCollectionsNo = fCutContainer->GetTrackCollectionsNo();
58 for (
int i = 0; i < fTaskNo; i++) {
59 fTask[i]->SetFormat(fCurrentEvent);
60 SynchronizeCutContainers(fTask[i], kTRUE);
61 if (Task::EInitFlag::kFATAL == fTask[i]->Init()) {
67 return Task::EInitFlag::kSUCCESS;
69 return Task::EInitFlag::kFATAL;
94 void TrackAnaChain::Exec(Option_t* ) {
96 fCurrentEvent = fMemoryMap->GetTemporaryEvent();
97 for (fCurrentEventCollectionID = 0; fCurrentEventCollectionID < fEventCollectionsNo; fCurrentEventCollectionID++) {
98 if (fCutContainer->PassEvent(fCurrentEvent, fCurrentEventCollectionID)) { ProcessEvent(); }
131 void TrackAnaChain::FinishTask() {
134 metadata_new->
SetName(
"RunInfo");
141 TDirectory* dir = (TDirectory*) gFile;
143 TDirectory* metadatata = (TDirectory*) dir->Get(
"HalInfo");
144 if (metadatata->Get(
"RunInfo")) {
147 metadata_new->Write(
"RunInfo");
149 GoToDir(
"HalPhysics");
150 pack->Write(Form(
"AnaPackage_%i", GetTaskID()));
151 if (pack) {
delete pack; }
152 for (
int i = 0; i < fTaskNo; i++) {
153 SynchronizeCutContainers(fTask[i], kFALSE);
155 subtask_pack->Write(Form(
"AnaPackage_%i", fTask[i]->GetTaskID()));
156 fTask[i]->fCurrentTrack = NULL;
157 fTask[i]->fCurrentEvent = NULL;
161 Cout::PrintInfo(Form(
"%s done, writing results", this->ClassName()), EInfo::kInfo);