33 Hal::Task::EInitFlag Reader::Init() {
37 if (mng->GetObject(
"OTF::McEvent.")) {
38 fMcEvent = (
OTF::McEvent*) mng->GetObject(
"OTF::McEvent.");
43 return Hal::Task::EInitFlag::kERROR;
47 return Hal::Task::EInitFlag::kERROR;
51 case ETranslate::kMc: {
52 if (mng->GetObject(
"HalOTF::McEvent.")) {
53 return Hal::Task::EInitFlag::kERROR;
56 mng->
Register(
"HalEvent.",
"HalEvents", fHalMcEvent, kFALSE);
57 fTranslateInterface = fHalMcEvent->CreateInterface();
60 case ETranslate::kReco: {
61 if (mng->GetObject(
"HalOTF::RecoEvent.")) {
62 return Hal::Task::EInitFlag::kERROR;
65 mng->
Register(
"HalEvent.",
"HalEvents", fHalRecoEvent, kFALSE);
66 fTranslateInterface = fHalRecoEvent->CreateInterface();
69 case ETranslate::kComplex: {
70 if (mng->GetObject(
"HalOTF::ComplexEvent.")) {
71 return Hal::Task::EInitFlag::kERROR;
74 mng->
Register(
"HalEvent.",
"HalEvents", fHalComplexEvent, kFALSE);
75 fTranslateInterface = fHalComplexEvent->CreateInterface();
80 if (fTranslateInterface) fTranslateInterface->ConnectToTree(Hal::EventInterface::eMode::kRead);
81 return Hal::Task::EInitFlag::kSUCCESS;
103 void Reader::Translate(TString opt) {
105 if (Hal::Std::FindParam(opt,
"sim")) { flag = 1; }
106 if (Hal::Std::FindParam(opt,
"reco")) { flag += 2; }
108 case 1: fTranslate = ETranslate::kMc;
break;
109 case 2: fTranslate = ETranslate::kReco;
break;
110 case 3: fTranslate = ETranslate::kComplex;
break;