Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:12:55

0001 #ifndef HFTRIGGER_H
0002 #define HFTRIGGER_H
0003 
0004 //sPHENIX stuff
0005 #include <fun4all/Fun4AllReturnCodes.h>
0006 #include <fun4all/SubsysReco.h>
0007 #include <phool/getClass.h>
0008 #include <trackbase/TrkrDefs.h>
0009 #include <trackbase/TrkrHitSet.h>
0010 #include <trackbase/TrkrHitSetContainer.h>
0011 #include <trackbase_historic/SvtxTrack.h>
0012 #include <trackbase_historic/SvtxTrackMap.h>
0013 #include <trackbase_historic/SvtxVertex.h>
0014 #include <trackbase_historic/SvtxVertexMap.h>
0015 
0016 #include <Eigen/Core>
0017 #include <Eigen/Dense>
0018 
0019 #include <algorithm>
0020 #include <cfloat>
0021 #include <cmath>
0022 #include <iostream>
0023 #include <map>
0024 #include <numeric>
0025 #include <string>
0026 
0027 typedef Eigen::Matrix<float, 6, 1> Track;
0028 typedef Eigen::Matrix<float, 3, 1> Vertex;
0029 typedef Eigen::Matrix<float, 3, 1> TrackX;
0030 typedef Eigen::Matrix<float, 3, 1> TrackP;
0031 typedef Eigen::Matrix<float, 3, 1> DCA;
0032 
0033 class SvtxTrack;
0034 class SvtxTrackMap;
0035 class SvtxVertexMap;
0036 class SvtxVertex;
0037 
0038 class HFTrigger : public SubsysReco
0039 {
0040  public:
0041   HFTrigger();
0042 
0043   explicit HFTrigger(const std::string &name);
0044 
0045   virtual ~HFTrigger(){}
0046 
0047   int Init(PHCompositeNode *topNode);
0048 
0049   int process_event(PHCompositeNode *topNode);
0050 
0051   int End(PHCompositeNode *topNode);
0052 
0053   bool runTrigger(PHCompositeNode *topNode);
0054 
0055   bool runOneTrackTrigger(std::vector<Track> Tracks, std::vector<Vertex> Vertices);
0056 
0057   bool runTwoTrackTrigger(std::vector<Track> Tracks, std::vector<Vertex> Vertices);
0058 
0059   void calculateMultiplicity(PHCompositeNode *topNode, float& meanMultiplicity, float& asymmetryMultiplicity);
0060 
0061   bool runHighMultiplicityTrigger(float meanMultiplicity, float asymmetryMultiplicity);
0062 
0063   bool runLowMultiplicityTrigger(float meanMultiplicity, float asymmetryMultiplicity);
0064 
0065   Vertex makeVertex(PHCompositeNode *topNode);
0066 
0067   std::vector<Vertex> makeAllPrimaryVertices(PHCompositeNode *topNode);
0068 
0069   Track makeTrack(PHCompositeNode *topNode);
0070 
0071   std::vector<Track> makeAllTracks(PHCompositeNode *topNode);
0072 
0073   int decomposeTrack(Track track, TrackX& trackPosition, TrackP& trackMomentum);
0074 
0075   float calcualteTrackVertex2DDCA(Track track, Vertex vertex);
0076 
0077   float calcualteTrackVertexDCA(Track track, Vertex vertex);
0078 
0079   float calcualteTrackTrackDCA(Track trackOne, Track trackTwo);
0080 
0081   void printTrigger();
0082 
0083   //User configuration
0084   void requireOneTrackTrigger(bool useTrigger) { m_useOneTrackTrigger = useTrigger; }
0085   void requireTwoTrackTrigger(bool useTrigger) { m_useTwoTrackTrigger = useTrigger; }
0086   void requireLowMultiplicityTrigger(bool useTrigger) { m_useLowMultiplicityTrigger = useTrigger; }
0087   void requireHighMultiplicityTrigger(bool useTrigger) { m_useHighMultiplicityTrigger = useTrigger; }
0088 
0089  private:
0090 
0091   bool m_useOneTrackTrigger = false;
0092   bool m_useTwoTrackTrigger = false;
0093   bool m_useLowMultiplicityTrigger = false;
0094   bool m_useHighMultiplicityTrigger = false;
0095 
0096   SvtxVertexMap *m_dst_vertexmap = nullptr;
0097   SvtxTrackMap *m_dst_trackmap = nullptr;
0098   SvtxVertex *m_dst_vertex = nullptr;
0099   SvtxTrack *m_dst_track = nullptr;
0100 };
0101 
0102 #endif  //HFTRIGGER_H