27 auto* ioman = FairRootManager::Instance();
28 assert(ioman !=
nullptr);
33 if (!
cbm_mc_event_list_) {
throw std::runtime_error(
"CbmSimEventHeaderConverter::Init - ERROR! No fMCEventList!"); }
36 AnalysisTree::BranchConfig SimEventHeaderBranch(
"SimEventHeader", AnalysisTree::DetType::kEventHeader);
37 SimEventHeaderBranch.AddField<
float>(
"psi_RP",
"reaction plane orientation");
38 SimEventHeaderBranch.AddField<
float>(
"b",
"fm, impact parameter");
39 SimEventHeaderBranch.AddFields<
float>({
"start_time",
"end_time"},
"ns (?), event time");
40 SimEventHeaderBranch.AddField<
int>(
"run_id",
"run identifier");
41 SimEventHeaderBranch.AddField<
int>(
"event_id",
"event identifier");
42 SimEventHeaderBranch.AddField<
float>(
"T0",
"MC event time, ns");
44 ipsi_RP_ = SimEventHeaderBranch.GetFieldId(
"psi_RP");
45 ib_ = SimEventHeaderBranch.GetFieldId(
"b");
46 istart_time_ = SimEventHeaderBranch.GetFieldId(
"start_time");
47 iend_time_ = SimEventHeaderBranch.GetFieldId(
"end_time");
48 irun_id_ = SimEventHeaderBranch.GetFieldId(
"run_id");
49 ievent_id_ = SimEventHeaderBranch.GetFieldId(
"event_id");
50 iT0_ = SimEventHeaderBranch.GetFieldId(
"T0");
52 auto* man = AnalysisTree::TaskManager::GetInstance();
59 FairMCEventHeader* cbm_header {
nullptr};
60 int file_id {0}, event_id {0};
63 const auto& link =
event->GetMatch()->GetMatchedLink();
64 file_id =
event->GetMatch()->GetMatchedLink().GetFile();
65 event_id =
event->GetMatch()->GetMatchedLink().GetEntry();
69 cbm_header = (FairMCEventHeader*) (
cbm_header_obj_->
Get(0, FairRootManager::Instance()->GetEntryNr()));
72 if (!cbm_header) {
throw std::runtime_error(
"CbmSimEventHeaderConverter::Exec - ERROR! No fHeader!"); }
74 LOG(info) <<
"MCEvent " << cbm_header->GetEventID() <<
" with T0 "
77 TVector3
pos {cbm_header->GetX(), cbm_header->GetY(), cbm_header->GetZ()};
87 LOG(info) <<
"TIME: " <<
event->GetStartTime() <<
" " <<
event->GetEndTime();