CbmRoot
CbmStsTracksConverter.h
Go to the documentation of this file.
1 #ifndef ANALYSIS_TREE_STSTRACKSCONVERTER_H_
2 #define ANALYSIS_TREE_STSTRACKSCONVERTER_H_
3 
4 #include "CbmConverterTask.h"
5 
6 #include "AnalysisTree/Detector.hpp"
7 
8 class TClonesArray;
9 class CbmVertex;
10 class CbmStsTrack;
11 class CbmTrackMatchNew;
12 
13 namespace AnalysisTree {
14  class Matching;
15 }
16 
18 
19 public:
20  enum kInBranches {
25  };
26 
27  explicit CbmStsTracksConverter(std::string out_branch_name,
28  std::string match_to = "")
29  : CbmConverterTask(std::move(out_branch_name), std::move(match_to)) {
30  in_branches_.resize(eNumberOfInputBranches);
31  in_branches_.at(eStsTracks) = "StsTrack";
32  in_branches_.at(ePrimiryVertex) = "PrimaryVertex.";
33  in_branches_.at(eSimTracks) = "MCTrack";
34  }
35 
36  ~CbmStsTracksConverter() final;
37 
38  void Init(std::map<std::string, void*>&) final;
39  void Exec() final;
40  void Finish() final {}
41 
42  void SetIsWriteKFInfo(bool is = true) { is_write_kfinfo_ = is; }
43  void SetIsReproduceCbmKFPF(bool is = true) { is_reproduce_cbmkfpf_ = is; }
44 
45 private:
46  void ReadVertexTracks();
47  void MapTracks();
48  void InitInput();
49  float ExtrapolateToVertex(CbmStsTrack* sts_track,
50  AnalysisTree::Track* track,
51  int pdg);
52  void WriteKFInfo(AnalysisTree::Track* track,
53  const CbmStsTrack* sts_track,
54  bool is_good_track) const;
55  bool IsGoodCovMatrix(const CbmStsTrack* sts_track) const;
56  int GetMcPid(const CbmTrackMatchNew* match, AnalysisTree::Track* track) const;
57 
58  AnalysisTree::TrackDetector* vtx_tracks_ {
59  nullptr};
60  AnalysisTree::Matching* vtx_tracks_2_sim_ {
61  nullptr};
62 
64  TClonesArray* cbm_mc_tracks_ {nullptr};
65  TClonesArray* cbm_sts_tracks_ {nullptr};
66  TClonesArray* cbm_sts_match_ {nullptr};
67 
68  bool is_write_kfinfo_ {true};
69  bool is_reproduce_cbmkfpf_ {true};
70 
71  int ipar_ {-1};
72  int imf_ {-1};
73  int icov_ {-1};
74  int imc_pdg_ {-1};
75  int imother_pdg_ {-1};
76  int ipasscuts_ {-1};
77 
78  ClassDef(CbmStsTracksConverter, 1)
79 };
80 
81 #endif // ANALYSIS_TREE_STSTRACKSCONVERTER_H_
CbmStsTracksConverter::is_write_kfinfo_
bool is_write_kfinfo_
Definition: CbmStsTracksConverter.h:68
CbmStsTracksConverter::SetIsWriteKFInfo
void SetIsWriteKFInfo(bool is=true)
Definition: CbmStsTracksConverter.h:42
CbmStsTracksConverter::icov_
int icov_
Definition: CbmStsTracksConverter.h:73
CbmStsTracksConverter::IsGoodCovMatrix
bool IsGoodCovMatrix(const CbmStsTrack *sts_track) const
Definition: CbmStsTracksConverter.cxx:153
CbmStsTracksConverter::ePrimiryVertex
@ ePrimiryVertex
Definition: CbmStsTracksConverter.h:22
CbmStsTracksConverter::imc_pdg_
int imc_pdg_
Definition: CbmStsTracksConverter.h:74
CbmStsTracksConverter::~CbmStsTracksConverter
~CbmStsTracksConverter() final
Definition: CbmStsTracksConverter.cxx:33
CbmConverterTask.h
CbmStsTracksConverter::vtx_tracks_
AnalysisTree::TrackDetector * vtx_tracks_
raw pointers are needed for TTree::Branch
Definition: CbmStsTracksConverter.h:58
CbmStsTracksConverter::ExtrapolateToVertex
float ExtrapolateToVertex(CbmStsTrack *sts_track, AnalysisTree::Track *track, int pdg)
Definition: CbmStsTracksConverter.cxx:39
CbmStsTracksConverter
Definition: CbmStsTracksConverter.h:17
CbmStsTracksConverter::cbm_sts_match_
TClonesArray * cbm_sts_match_
non-owning pointer
Definition: CbmStsTracksConverter.h:66
CbmVertex
Definition: CbmVertex.h:26
CbmStsTracksConverter::eStsTracks
@ eStsTracks
Definition: CbmStsTracksConverter.h:21
CbmStsTracksConverter::cbm_mc_tracks_
TClonesArray * cbm_mc_tracks_
non-owning pointer
Definition: CbmStsTracksConverter.h:64
CbmStsTracksConverter::is_reproduce_cbmkfpf_
bool is_reproduce_cbmkfpf_
Definition: CbmStsTracksConverter.h:69
CbmStsTracksConverter::imf_
int imf_
Definition: CbmStsTracksConverter.h:72
AnalysisTree
Definition: CbmConverterManager.h:6
CbmStsTracksConverter::SetIsReproduceCbmKFPF
void SetIsReproduceCbmKFPF(bool is=true)
Definition: CbmStsTracksConverter.h:43
CbmStsTracksConverter::cbm_prim_vertex_
CbmVertex * cbm_prim_vertex_
non-owning pointer
Definition: CbmStsTracksConverter.h:63
CbmStsTracksConverter::ReadVertexTracks
void ReadVertexTracks()
Definition: CbmStsTracksConverter.cxx:71
CbmStsTracksConverter::vtx_tracks_2_sim_
AnalysisTree::Matching * vtx_tracks_2_sim_
raw pointers are needed for TTree::Branch
Definition: CbmStsTracksConverter.h:60
CbmStsTracksConverter::kInBranches
kInBranches
Definition: CbmStsTracksConverter.h:20
CbmStsTracksConverter::Exec
void Exec() final
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmStsTracksConverter::Finish
void Finish() final
Definition: CbmStsTracksConverter.h:40
CbmStsTracksConverter::MapTracks
void MapTracks()
Definition: CbmStsTracksConverter.cxx:315
CbmStsTracksConverter::ipar_
int ipar_
Definition: CbmStsTracksConverter.h:71
CbmStsTracksConverter::WriteKFInfo
void WriteKFInfo(AnalysisTree::Track *track, const CbmStsTrack *sts_track, bool is_good_track) const
Definition: CbmStsTracksConverter.cxx:131
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmStsTracksConverter::imother_pdg_
int imother_pdg_
Definition: CbmStsTracksConverter.h:75
CbmStsTracksConverter::InitInput
void InitInput()
Definition: CbmStsTracksConverter.cxx:242
CbmStsTracksConverter::CbmStsTracksConverter
CbmStsTracksConverter(std::string out_branch_name, std::string match_to="")
Definition: CbmStsTracksConverter.h:27
CbmStsTracksConverter::ipasscuts_
int ipasscuts_
Definition: CbmStsTracksConverter.h:76
CbmStsTracksConverter::eNumberOfInputBranches
@ eNumberOfInputBranches
Definition: CbmStsTracksConverter.h:24
CbmConverterTask
Definition: CbmConverterTask.h:8
CbmStsTracksConverter::GetMcPid
int GetMcPid(const CbmTrackMatchNew *match, AnalysisTree::Track *track) const
Definition: CbmStsTracksConverter.cxx:190
CbmStsTracksConverter::eSimTracks
@ eSimTracks
Definition: CbmStsTracksConverter.h:23
CbmStsTracksConverter::Init
void Init(std::map< std::string, void * > &) final
Definition: CbmStsTracksConverter.cxx:254
CbmStsTracksConverter::cbm_sts_tracks_
TClonesArray * cbm_sts_tracks_
non-owning pointer
Definition: CbmStsTracksConverter.h:65