Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
DbgRecoEventInterface.cxx
1/*
2 * DbgRecoEventInterface.cxx
3 *
4 * Created on: 28 maj 2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "DbgRecoEventInterface.h"
11
12#include "DataManager.h"
13
14#include <RtypesCore.h>
15
16namespace HalDbg {
17 RecoEventInterface::RecoEventInterface() : fEvent(nullptr), fCanDelete(kFALSE) {}
18
19 void RecoEventInterface::ConnectToTreeInternal(eMode mode) {
20 Hal::DataManager* manager = Hal::DataManager::Instance();
21 switch (mode) {
22 case Hal::EventInterface::eMode::kRead: {
23 fEvent = (Dbg::RecoEvent*) manager->GetObject("Dbg::RecoEvent.");
24 } break;
25 case Hal::EventInterface::eMode::kWrite: {
26 fEvent = new Dbg::RecoEvent();
27 manager->Register("Dbg::RecoEvent.", "Dbg", fEvent, kTRUE);
28 } break;
29 case Hal::EventInterface::eMode::kWriteVirtual: {
30 fEvent = new Dbg::RecoEvent();
31 manager->Register("Dbg::RecoEvent.", "Dbg", fEvent, kFALSE);
32 fCanDelete = kTRUE;
33 } break;
34 }
35 }
36
37 RecoEventInterface::~RecoEventInterface() {
38 if (fCanDelete && fEvent) delete fEvent;
39 }
40} // namespace HalDbg
void Register(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)