Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
OTFSource.cxx
1
/*
2
* OTFSource.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 "OTFSource.h"
11
12
#include "DataManager.h"
13
#include "OTFData.h"
14
#include "OTFEventGenerator.h"
15
#include "OTFIOManager.h"
16
17
namespace
HalOTF
{
18
Source::Source(Int_t events) :
Hal
::Source(
"root_virtual.root"
), fEvents(events) {
19
fManager =
new
HalOTF::IOManager
(
"root_virtual.root"
,
this
, fEvents);
20
}
21
22
Hal::IOManager
* Source::GetIOManager()
const
{
return
fManager; }
23
24
Source::~Source() {
25
if
(fManager)
delete
fManager;
26
if
(fMcEvent)
delete
fMcEvent;
27
if
(fRecoEvent)
delete
fRecoEvent;
28
}
29
30
Bool_t Source::Init() {
31
if
(fGenerators.size() == 0)
return
kFALSE;
32
for
(
auto
& gen : fGenerators) {
33
if
(!gen->Init())
return
kFALSE;
34
}
35
return
kTRUE;
36
}
37
void
Source::GetEvent() {
38
fRecoEvent->Clear();
39
fMcEvent->Clear();
40
for
(
auto
& gen : fGenerators)
41
gen->GenerateEvent();
42
++fEvents;
43
}
44
45
void
Source::RegisterOutputs(
HalOTF::IOManager
* mngr) {
46
fMcEvent =
new
OTF::McEvent
();
47
fRecoEvent =
new
OTF::RecoEvent
();
48
mngr->
Register
(
"OTF::McEvent."
,
"HalEvents"
, fMcEvent, fRegister);
49
mngr->
Register
(
"OTF::RecoEvent."
,
"HalEvents"
, fRecoEvent, fRegister);
50
for
(
auto
& gen : fGenerators)
51
gen->SetEvents(fMcEvent, fRecoEvent);
52
}
53
54
}
// namespace HalOTF
HalOTF::IOManager
Definition
OTFIOManager.h:22
Hal::IOManager
Definition
IOManager.h:52
Hal::IOManager::Register
void Register(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)
Definition
IOManager.cxx:50
OTF::McEvent
Definition
OTFData.h:91
OTF::RecoEvent
Definition
OTFData.h:72
HalOTF
Definition
OTFComplexEvent.cxx:17
Hal
Definition
EventAnaChain.cxx:28
examples
onthefly
OTFSource.cxx
Generated on Wed Oct 23 2024 15:07:52 for Heavy ion Analysis Libriares by
1.12.0