CbmRoot
NicaGeneratorWriteUnigen.cxx
Go to the documentation of this file.
1 /*
2  * NicaGeneratorWriteUnigen.cxx
3  *
4  * Created on: 13 sie 2015
5  * Author: Daniel Wielanek
6  * E-mail: daniel.wielanek@gmail.com
7  * Warsaw University of Technology, Faculty of Physics
8  */
10 #include "NicaRunSim.h"
11 
13  : NicaGeneratorWrite(4, 3, 1, 0, 9, 9, 0, 0) {
14  fEvent = new UEvent();
15  // parameter 0 is reserverd for random stuff !
16  //register event parameters int
17  Register(4, "Nes", "Step_nr", "Npa", "Nr");
18  //register event parameters double
19  Register(3, "B", "Phi", "Step_t");
20  //register track int parameters
21  Register(9,
22  "index",
23  "pdg",
24  "status",
25  "parent",
26  "parent_decay",
27  "mate",
28  "decay",
29  "first_child",
30  "last_child");
31  //register track double parameters
32  Register(9, "px", "py", "pz", "e", "frx", "fry", "frz", "frt", "weight");
33 }
34 
36  InitStatus stat = NicaGeneratorWrite::Init();
37  NicaRunSim* manager = NicaRunSim::Instance();
38  manager->GetTree()->Branch("event", &fEvent);
39  LOG(info) << "Data will be set to Unigen format";
40  return stat;
41 }
42 
44 
46  fEvent->SetNes(fEventParameters->GetInt(1));
47  fEvent->SetStepNr(fEventParameters->GetInt(2));
48  fEvent->SetEventNr(fEventParameters->GetInt(4));
49  fEvent->SetB(fEventParameters->GetDouble(1));
50  fEvent->SetPhi(fEventParameters->GetDouble(2));
51  fEvent->SetStepT(fEventParameters->GetDouble(3));
52 }
53 
55  Int_t child[2] = {fTrackParameters->GetInt(8), fTrackParameters->GetInt(9)};
56  fEvent->AddParticle(fTrackParameters->GetInt(1), //index
57  fTrackParameters->GetInt(2), //pdg
58  fTrackParameters->GetInt(3),
59  fTrackParameters->GetInt(4), //parent
60  fTrackParameters->GetInt(5), //parent_decay
61  fTrackParameters->GetInt(6), //mate
62  fTrackParameters->GetInt(7), //decay
63  child,
64  fTrackParameters->GetDouble(1),
65  fTrackParameters->GetDouble(2),
66  fTrackParameters->GetDouble(3),
67  fTrackParameters->GetDouble(4),
68  fTrackParameters->GetDouble(5),
69  fTrackParameters->GetDouble(6),
70  fTrackParameters->GetDouble(7),
71  fTrackParameters->GetDouble(8),
72  fTrackParameters->GetDouble(9));
73 }
74 
76  // TODO Auto-generated destructor stub
77 }
UEvent::SetEventNr
void SetEventNr(Int_t eventNr)
Definition: UEvent.h:48
NicaGeneratorWriteUnigen::AddEvent
void AddEvent()
Definition: NicaGeneratorWriteUnigen.cxx:45
UEvent::AddParticle
void AddParticle(Int_t index, Int_t pdg, Int_t status, Int_t parent, Int_t parentDecay, Int_t mate, Int_t decay, Int_t child[2], Double_t px, Double_t py, Double_t pz, Double_t e, Double_t x, Double_t y, Double_t z, Double_t t, Double_t weight)
Definition: UEvent.cxx:103
UEvent
Definition: UEvent.h:12
NicaGeneratorWriteUnigen.h
UEvent::SetStepNr
void SetStepNr(Int_t stepNr)
Definition: UEvent.h:52
NicaGeneratorWriteUnigen::ClearEvent
virtual void ClearEvent()
Definition: NicaGeneratorWriteUnigen.cxx:43
UEvent::SetB
void SetB(Double_t b)
Definition: UEvent.h:49
UEvent::SetNes
void SetNes(Int_t nes)
Definition: UEvent.h:51
UEvent::SetStepT
void SetStepT(Double_t stepT)
Definition: UEvent.h:53
NicaGeneratorWriteUnigen::NicaGeneratorWriteUnigen
NicaGeneratorWriteUnigen()
Definition: NicaGeneratorWriteUnigen.cxx:12
NicaGeneratorWriteUnigen::fEvent
UEvent * fEvent
Definition: NicaGeneratorWriteUnigen.h:19
NicaGeneratorWriteUnigen::~NicaGeneratorWriteUnigen
virtual ~NicaGeneratorWriteUnigen()
Definition: NicaGeneratorWriteUnigen.cxx:75
NicaGeneratorWriteUnigen::AddParticle
void AddParticle()
Definition: NicaGeneratorWriteUnigen.cxx:54
UEvent::SetPhi
void SetPhi(Double_t phi)
Definition: UEvent.h:50
UEvent::Clear
void Clear(Option_t *="")
Definition: UEvent.cxx:221
NicaGeneratorWriteUnigen::Init
virtual InitStatus Init()
Definition: NicaGeneratorWriteUnigen.cxx:35