CbmRoot
Loading...
Searching...
No Matches
CbmSimTracksConverter.h
Go to the documentation of this file.
1/* Copyright (C) 2020-2021 Physikalisches Institut, Eberhard Karls Universitaet Tuebingen, Tuebingen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Daniel Wielanek, Viktor Klochkov [committer] */
4
5#ifndef ANALYSIS_TREE_SIMTRACKSCONVERTER_H_
6#define ANALYSIS_TREE_SIMTRACKSCONVERTER_H_
7
8#include "CbmConverterTask.h"
9
10#include <TString.h>
11
12#include "AnalysisTree/Detector.hpp"
13
14class TClonesArray;
15class UEvent;
16class TFile;
17class TTree;
18class FairMCEventHeader;
20class CbmMCDataArray;
21
23
24public:
25 explicit CbmSimTracksConverter(std::string out_branch_name, std::string match_to = "")
26 : CbmConverterTask(std::move(out_branch_name), std::move(match_to)) {};
27
29
30 void SetUnigenInfo(const std::string& unigen_name)
31 {
32 use_unigen_ = true;
33 unigen_file_name_ = unigen_name;
34 }
35
36 void Init() final;
37 void ProcessData(CbmEvent* event) final;
38 void Finish() final {};
39
40private:
41 AnalysisTree::Particles* sim_tracks_ {nullptr};
42 FairMCEventHeader* cbm_header_ {nullptr};
43 // TClonesArray* cbm_mc_tracks_ {nullptr};
44
47
48 void InitUnigen();
49
51 TFile* unigen_file_ {nullptr};
52 TTree* unigen_tree_ {nullptr};
53 std::string unigen_file_name_;
54 Int_t entry_ {0};
55 Double_t beta_cm_ {0};
56 Bool_t use_unigen_ {false};
57
58 int imother_id_ {AnalysisTree::UndefValueInt};
59 int igeant_id_ {AnalysisTree::UndefValueInt};
60 int in_hits_ {AnalysisTree::UndefValueInt};
61 int icbm_id_ {AnalysisTree::UndefValueInt};
62 int istart_x_ {AnalysisTree::UndefValueInt};
63
64 ClassDef(CbmSimTracksConverter, 1)
65};
66
67#endif
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
Access to a MC data branch for time-based analysis.
Task class creating and managing CbmMCDataArray objects.
void ProcessData(CbmEvent *event) final
AnalysisTree::Particles * sim_tracks_
CbmMCDataManager * cbm_mc_manager_
CbmSimTracksConverter(std::string out_branch_name, std::string match_to="")
FairMCEventHeader * cbm_header_
CbmMCDataArray * cbm_mc_tracks_new_
void SetUnigenInfo(const std::string &unigen_name)
Double_t beta_cm_
CM velocity in the lab frame.
Hash for CbmL1LinkKey.