Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:13:21

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef PPG04_EVENTSELECTOR_H
0004 #define PPG04_EVENTSELECTOR_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 #include <utility> 
0010 
0011 // Simple module to select events based on various criteria
0012 /// template for cut:
0013 // 1. setter for cut
0014 // 2. bool for cut
0015 // 3. value for cut
0016 // 4. function to apply cut (return bool)
0017 
0018 class PHCompositeNode;
0019 
0020 class PPG04EventSelector : public SubsysReco
0021 {
0022     public:
0023 
0024         PPG04EventSelector(const std::string &name = "PPG04EventSelector") : SubsysReco(name) {};
0025         ~PPG04EventSelector() override {};
0026 
0027         int process_event(PHCompositeNode *topNode) override;
0028 
0029         // template for cut
0030         void do_A_cut(double value_criteria)
0031         {
0032             m_do_A_cut = true;
0033             m_A_cut = value_criteria;
0034         }
0035 
0036         // bad chi2
0037         void do_badChi2_cut(bool doCut) { m_do_badChi2_cut = doCut; }
0038 
0039         // Do event selection on leading R=0.4 truth jet pT range
0040         void do_MCLeadingTruthJetpT_cut(float low, float high)
0041         {
0042             m_do_MCLeadingTruthJetpT_cut = true;
0043             m_MCLeadingTruthJetpT_range.first = low;
0044             m_MCLeadingTruthJetpT_range.second = high;
0045         }
0046 
0047         // MinBias event selection
0048         void do_minBias_cut(bool doCut) { m_do_minBias_cut = doCut; }
0049 
0050         // zvtx cut
0051         void do_zvtx_cut(float low, float high)
0052         {
0053             m_do_zvtx_cut = true;
0054             m_zvtx_range.first = low;
0055             m_zvtx_range.second = high;
0056         }
0057 
0058     private:
0059 
0060         // template for cut
0061         bool m_do_A_cut{false};
0062         double m_A_cut{0};
0063         bool A_cut(PHCompositeNode *topNode);
0064 
0065         // chi2 cut
0066         bool m_do_badChi2_cut{false};
0067         bool badChi2_cut(PHCompositeNode *topNode);
0068 
0069         // event trigger (for simulation)
0070         bool m_do_MCLeadingTruthJetpT_cut{false};
0071         std::pair<float, float> m_MCLeadingTruthJetpT_range{0.0,1000.0};
0072         bool MCLeadingTruthJetpT_cut(PHCompositeNode *topNode);
0073 
0074         // MinBias event selection
0075         bool m_do_minBias_cut{false};
0076         bool minBias_cut(PHCompositeNode *topNode);
0077 
0078         // zvtx cut
0079         bool m_do_zvtx_cut{false};
0080         std::pair<float, float> m_zvtx_range{-60.0,60.0};
0081         bool zvtx_cut(PHCompositeNode *topNode);
0082 
0083 
0084 
0085 };
0086 
0087 #endif // PPG04_EVENTSELECTOR_H