Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrkrNtuplizer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrkrNtuplizer.h
1 #ifndef TRACKRECO_TRKRNTUPLIZER_H
2 #define TRACKRECO_TRKRNTUPLIZER_H
3 
4 //===============================================
8 //===============================================
9 
10 #include <fun4all/SubsysReco.h>
11 #include <trackbase/TrkrDefs.h>
12 
13 #include <TMatrixFfwd.h>
14 #include <TMatrixT.h>
15 #include <TMatrixTUtils.h>
16 #include <string>
17 #include <map>
18 #include <set>
19 
20 class PHCompositeNode;
21 class PHTimer;
22 class TrkrCluster;
23 class TFile;
24 class TNtuple;
25 class SvtxTrack;
26 class SvtxTrackMap;
27 class SvtxVertexMap;
28 
29 // class TrkrClusterContainer;
30 
39 class TrkrNtuplizer : public SubsysReco
40 {
41  public:
42  TrkrNtuplizer(const std::string &name = "TRKRNTUPLEIZER",
43  const std::string &filename = "trkrntuple.root",
44  const std::string &trackmapname = "SvtxTrackMap",
45  unsigned int nlayers_maps = 3,
46  unsigned int nlayers_intt = 8,
47  unsigned int nlayers_tpc = 48,
48  unsigned int nlayers_mms = 2);
49  ~TrkrNtuplizer() override;
50 
51  int Init(PHCompositeNode *topNode) override;
52  int InitRun(PHCompositeNode *topNode) override;
53  int process_event(PHCompositeNode *topNode) override;
54  int End(PHCompositeNode *topNode) override;
55  // void do_primaries(bool b);
56 
57  void do_info_eval(bool b) { _do_info_eval = b; }
58  void do_vertex_eval(bool b) { _do_vertex_eval = b; }
59  void do_hit_eval(bool b) { _do_hit_eval = b; }
60  void do_cluster_eval(bool b) { _do_cluster_eval = b; }
62  void do_track_eval(bool b) { _do_track_eval = b; }
63  void do_tpcseed_eval(bool b) { _do_tpcseed_eval = b; }
64  void do_siseed_eval(bool b) { _do_siseed_eval = b; }
69  std::set<SvtxTrack*> all_tracks_from(TrkrDefs::cluskey cluster_key);
71  std::vector<TrkrDefs::cluskey> get_track_ckeys(SvtxTrack* track);
72 
73  private:
74  unsigned int _ievent;
75  unsigned int _iseed;
76  float m_fSeed;
77  // eval stack
78 
79  TMatrixF calculateClusterError(TrkrCluster *c, float &clusphi);
80  void get_dca(SvtxTrack *track, SvtxVertexMap *vertexmap,
81  float &dca3dxy, float &dca3dz,
82  float &dca3dxysigma, float &dca3dzsigma);
83  // TrkrClusterContainer *cluster_map{nullptr};
84 
85  //----------------------------------
86  // evaluator output ntuples
87 
96 
97  unsigned int _nlayers_maps = 3;
98  unsigned int _nlayers_intt = 4;
99  unsigned int _nlayers_tpc = 48;
100  unsigned int _nlayers_mms = 2;
101 
102  TNtuple *_ntp_info;
103  TNtuple *_ntp_vertex;
104  TNtuple *_ntp_hit;
105  TNtuple *_ntp_cluster;
106  TNtuple *_ntp_clus_trk;
107  TNtuple *_ntp_track;
108  TNtuple *_ntp_tpcseed;
109  TNtuple *_ntp_siseed;
110 
111  // evaluator output file
113  // Track map name
116 
117  std::string _clustrackseedcontainer = "TpcTrackSeedContainer";
118 
119  TFile *_tfile;
121 
122  // output subroutines
123  void fillOutputNtuples(PHCompositeNode *topNode);
124  void printInputInfo(PHCompositeNode *topNode);
125  void printOutputInfo(PHCompositeNode *topNode);
126  double AdcClockPeriod = 53.0; // ns
127 
129  std::map<TrkrDefs::cluskey, std::set<SvtxTrack*> > _cache_all_tracks_from_cluster;
130  std::map<TrkrDefs::cluskey, SvtxTrack*> _cache_best_track_from_cluster;
131 };
132 
133 #endif // G4EVAL_SVTXEVALUATOR_H