Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
UnigenReader.cxx
1/*
2 * UnigenReader.cxx
3 *
4 * Created on: 18 kwi 2024
5 * Author: daniel
6 */
7
8#include "UnigenReader.h"
9
10#include "DataManager.h"
11#include "UnigenEvent.h"
12#include "UnigenEventInterface.h"
13
14namespace HalUni {
15
16 UnigenReader::UnigenReader() {}
17
18 void UnigenReader::Exec(Option_t* opt) { fUniEvent->Update(fInterface); }
19
20 Hal::Task::EInitFlag UnigenReader::Init() {
21
22 fUniEvent = new HalUni::UnigenEvent();
23 fInterface = (UnigenEventInterface*) fUniEvent->CreateInterface();
24 fInterface->ConnectToTree(Hal::EventInterface::eMode::kRead);
25 Hal::DataManager* mng = Hal::DataManager::Instance();
26 mng->Register("HalEvent.", "HalEvents", fUniEvent, kFALSE);
27 if (!fUniEvent->ExistInTree()) { return Hal::Task::EInitFlag::kFATAL; }
28
29 return Hal::Task::EInitFlag::kSUCCESS;
30 }
31
32 UnigenReader::~UnigenReader() {
33 if (fInterface) delete fInterface;
34 }
35
36} /* namespace HalUni */
Hal::EventInterface * CreateInterface() const
virtual void Update(Hal::EventInterface *interface)
virtual Bool_t ExistInTree() const
virtual Hal::Task::EInitFlag Init()
void Register(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)