Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HFTrigger.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file HFTrigger.h
1 #ifndef HFTRIGGER_H
2 #define HFTRIGGER_H
3 
4 //sPHENIX stuff
6 #include <fun4all/SubsysReco.h>
7 #include <phool/getClass.h>
8 #include <trackbase/TrkrDefs.h>
9 #include <trackbase/TrkrHitSet.h>
13 #include <trackbase_historic/SvtxVertex.h>
14 #include <trackbase_historic/SvtxVertexMap.h>
15 
16 #include <Eigen/Core>
17 #include <Eigen/Dense>
18 
19 #include <algorithm>
20 #include <cfloat>
21 #include <cmath>
22 #include <iostream>
23 #include <map>
24 #include <numeric>
25 #include <string>
26 
27 typedef Eigen::Matrix<float, 6, 1> Track;
28 typedef Eigen::Matrix<float, 3, 1> Vertex;
29 typedef Eigen::Matrix<float, 3, 1> TrackX;
30 typedef Eigen::Matrix<float, 3, 1> TrackP;
31 typedef Eigen::Matrix<float, 3, 1> DCA;
32 
33 class SvtxTrack;
34 class SvtxTrackMap;
35 class SvtxVertexMap;
36 class SvtxVertex;
37 
38 class HFTrigger : public SubsysReco
39 {
40  public:
41  HFTrigger();
42 
43  explicit HFTrigger(const std::string &name);
44 
45  virtual ~HFTrigger(){}
46 
47  int Init(PHCompositeNode *topNode);
48 
49  int process_event(PHCompositeNode *topNode);
50 
51  int End(PHCompositeNode *topNode);
52 
53  bool runTrigger(PHCompositeNode *topNode);
54 
55  bool runOneTrackTrigger(std::vector<Track> Tracks, std::vector<Vertex> Vertices);
56 
57  bool runTwoTrackTrigger(std::vector<Track> Tracks, std::vector<Vertex> Vertices);
58 
59  void calculateMultiplicity(PHCompositeNode *topNode, float& meanMultiplicity, float& asymmetryMultiplicity);
60 
61  bool runHighMultiplicityTrigger(float meanMultiplicity, float asymmetryMultiplicity);
62 
63  bool runLowMultiplicityTrigger(float meanMultiplicity, float asymmetryMultiplicity);
64 
66 
67  std::vector<Vertex> makeAllPrimaryVertices(PHCompositeNode *topNode);
68 
70 
71  std::vector<Track> makeAllTracks(PHCompositeNode *topNode);
72 
73  int decomposeTrack(Track track, TrackX& trackPosition, TrackP& trackMomentum);
74 
76 
78 
79  float calcualteTrackTrackDCA(Track trackOne, Track trackTwo);
80 
81  void printTrigger();
82 
83  //User configuration
84  void requireOneTrackTrigger(bool useTrigger) { m_useOneTrackTrigger = useTrigger; }
85  void requireTwoTrackTrigger(bool useTrigger) { m_useTwoTrackTrigger = useTrigger; }
86  void requireLowMultiplicityTrigger(bool useTrigger) { m_useLowMultiplicityTrigger = useTrigger; }
87  void requireHighMultiplicityTrigger(bool useTrigger) { m_useHighMultiplicityTrigger = useTrigger; }
88 
89  private:
90 
91  bool m_useOneTrackTrigger = false;
92  bool m_useTwoTrackTrigger = false;
95 
99  SvtxTrack *m_dst_track = nullptr;
100 };
101 
102 #endif //HFTRIGGER_H