Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHSiliconTpcTrackMatching.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHSiliconTpcTrackMatching.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef PHSILICONTPCTRACKMATCHING_H
4 #define PHSILICONTPCTRACKMATCHING_H
5 
6 #include <fun4all/SubsysReco.h>
8 #include <phparameter/PHParameterInterface.h>
9 
10 #include <string>
11 #include <map>
12 
13 class PHCompositeNode;
14 class TrackSeedContainer;
15 class TrackSeed;
17 class TF1;
19 
21 {
22  public:
23 
24  PHSiliconTpcTrackMatching(const std::string &name = "PHSiliconTpcTrackMatching");
25 
26  ~PHSiliconTpcTrackMatching() override;
27 
28  void SetDefaultParameters() override;
29 
30  void set_phi_search_window(const double win){_phi_search_win = win;}
31  void set_eta_search_window(const double win){_eta_search_win = win;}
32  void set_x_search_window(const double win){_x_search_win = win;}
33  void set_y_search_window(const double win){_y_search_win = win;}
34  void set_z_search_window(const double win){_z_search_win = win;}
35 
37  void set_pp_mode(const bool flag){_pp_mode = flag ;}
38  void set_use_intt_crossing(const bool flag){_use_intt_crossing = flag ;}
39 
40  int InitRun(PHCompositeNode* topNode) override;
41 
42  int process_event(PHCompositeNode*) override;
43 
44  int End(PHCompositeNode*) override;
45 
46  void fieldMap(std::string& fieldmap) { m_fieldMap = fieldmap; }
47 
48  void set_silicon_track_map_name(const std::string &map_name) { _silicon_track_map_name = map_name; }
49  void set_track_map_name(const std::string &map_name) { _track_map_name = map_name; }
50  void SetIteration(int iter){_n_iteration = iter;}
51  private:
52 
53  int GetNodes(PHCompositeNode* topNode);
54 
55  void findEtaPhiMatches( std::set<unsigned int> &tpc_matched_set,
56  std::set<unsigned int> &tpc_unmatched_set,
57  std::multimap<unsigned int, unsigned int> &tpc_matches );
58  std::vector<short int> getInttCrossings(TrackSeed *si_track);
59  void checkCrossingMatches( std::multimap<unsigned int, unsigned int> &tpc_matches);
61  //void findCrossingGeometrically(std::multimap<unsigned int, unsigned int> tpc_matches);
62  short int findCrossingGeometrically(unsigned int tpc_id, unsigned int si_id);
63  double getBunchCrossing(unsigned int trid, double z_mismatch);
64 
65  // void checkCrossingMatches( std::multimap<short int, std::pair<unsigned int, unsigned int>> &crossing_matches, std::map<unsigned int, short int> &tpc_crossing_map );
66  //double getMedian(std::vector<double> &v);
67  //void addSiliconClusters( std::multimap<short int, std::pair<unsigned int, unsigned int>> &crossing_matches);
68  //void addSiliconClusters( std::multimap<unsigned int, unsigned int> &tpc_matches);
69  //void tagInTimeTracks( std::multimap<unsigned int, unsigned int> &tpc_matches,
70  // std::multimap<int, std::pair<unsigned int, unsigned int>> &crossing_matches,
71  // std::map<unsigned int, int> &tpc_crossing_map );
72  //void tagMatchCrossing( std::multimap<unsigned int, unsigned int> &tpc_matches,
73  // std::multimap<short int, std::pair<unsigned int, unsigned int>> &crossing_matches,
74  // std::map<unsigned int, short int> &tpc_crossing_map );
75  // void copySiliconClustersToCorrectedMap( );
76  //void correctTpcClusterZIntt( std::map<unsigned int, short int> &tpc_crossing_map );
77  //void getMatchCrossingIntt(
78  // std::multimap<unsigned int, unsigned int> &tpc_matches,
79  // std::multimap<short int, std::pair<unsigned int, unsigned int>> &crossing_matches,
80  // std::map<unsigned int, short int> &tpc_crossing_map );
81  // void addTrackBunchCrossing(std::multimap<unsigned int, unsigned int> &tpc_matches);
82  // void addTrackBunchCrossing( std::map<unsigned int, short int> &tpc_crossing_map);
83  // void addTrackBunchCrossing(
84  // std::map<unsigned int, short int> &vertex_crossings_map,
85  // std::multimap<unsigned int, std::pair<unsigned int, unsigned int>> &vertex_map);
86  // void cleanVertexMap( std::map<unsigned int, short int> &vertex_crossings_map,
87  // std::multimap<unsigned int, std::pair<unsigned int, unsigned int>> &vertex_map,
88  // std::map<unsigned int, short int> &tpc_crossing_map );
89  // void getCrossingNumber( std::vector<double> &vertex_list,
90  // std::multimap<unsigned int, std::pair<unsigned int, unsigned int>> &vertex_map,
91  // std::map<unsigned int, short int> &vertex_crossings_map);
92  //void getSiVertexList( std::multimap<double, std::pair<unsigned int, unsigned int>> &si_sorted_map,
93  // std::vector<double> &vertex_list,
94  // std::multimap<unsigned int, std::pair<unsigned int, unsigned int>> &vertex_map);
95  // void addSiliconClusters( std::multimap<unsigned int, std::pair<unsigned int, unsigned int>> &vertex_map);
96  // void correctTpcClusterZ( std::map<unsigned int, double> &vertex_crossings_map,
97  // std::multimap<unsigned int, std::pair<unsigned int, unsigned int>> &vertex_map );
98 
99  // default values, can be replaced from the macro
100  double _phi_search_win = 0.01;
101  double _eta_search_win = 0.004;
102  double _x_search_win = 0.3;
103  double _y_search_win = 0.3;
104  double _z_search_win = 0.4;
105 
114 
115  std::map<unsigned int, double> _z_mismatch_map;
116 
117  double _collision_rate = 50e3; // input rate for phi correction
118  double _reference_collision_rate = 50e3; // reference rate for phi correction
119  double _si_vertex_dzmax = 0.25; // mm
120  double crossing_period = 106.0; // ns
121 
122  bool _test_windows = false;
123  bool _pp_mode = false;
124  bool _use_intt_crossing = true; // should always be true except for testing
125 
126  int _n_iteration = 0;
127  std::string _track_map_name = "TpcTrackSeedContainer";
128  std::string _silicon_track_map_name = "SiliconTrackSeedContainer";
130 };
131 
132 #endif // PHTRUTHSILICONASSOCIATION_H