Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef JETBACKGROUNDCUT_H
0002 #define JETBACKGROUNDCUT_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <globalvertex/GlobalVertex.h>
0006 #include <phparameter/PHParameters.h>
0007 #include <cmath>
0008 #include <string>
0009 class PHCompositeNode;
0010 class CentralityInfo;
0011 class jetBackgroundCut : public SubsysReco
0012 {
0013  public:
0014   explicit jetBackgroundCut(const std::string &jetNodeName, const std::string &name = "jetBackgroundCutModule", int debug = 0, bool doAbort = false, GlobalVertex::VTXTYPE vtxtype = GlobalVertex::MBD, int sysvar = 0);
0015 
0016   ~jetBackgroundCut() override;
0017 
0018   bool failsLoEmFracETCut(float emFrac, float ET, bool dPhiCut, bool isDijet) const
0019   {
0020     float widen = 0;
0021     float shift = 0;
0022     if (_sysvar > 0)
0023     {
0024       widen = 0.05;
0025       shift = -1;
0026     }
0027     else if (_sysvar < 0)
0028     {
0029       widen = -0.05;
0030       shift = 1;
0031     }
0032     return (emFrac < (0.1 + widen) && ET > (50 * emFrac + 20 + shift)) && (dPhiCut || !isDijet);
0033   }
0034 
0035   bool failsHiEmFracETCut(float emFrac, float ET, bool dPhiCut, bool isDijet) const
0036   {
0037     float widen = 0;
0038     float shift = 0;
0039     if (_sysvar > 0)
0040     {
0041       widen = -0.05;
0042       shift = -1;
0043     }
0044     else if (_sysvar < 0)
0045     {
0046       widen = 0.05;
0047       shift = 1;
0048     }
0049     return (emFrac > (0.9 + widen) && ET > (-50 * emFrac + 70 + shift)) && (dPhiCut || !isDijet);
0050   }
0051 
0052   bool failsIhFracCut(float emFrac, float ohFrac) const
0053   {
0054     float shift = 0;
0055     if (_sysvar > 0)
0056     {
0057       shift = 0.05;
0058     }
0059     else if (_sysvar < 0)
0060     {
0061       shift = -0.05;
0062     }
0063     return emFrac + ohFrac < 0.65 + shift;
0064   }
0065 
0066   bool failsdPhiCut(float dPhi, bool isDijet)
0067   {
0068     return dPhi < 3 * M_PI / 4 && isDijet;
0069   }
0070 
0071   int Init(PHCompositeNode *topNode) override;
0072 
0073   int process_event(PHCompositeNode *topNode) override;
0074 
0075   int ResetEvent(PHCompositeNode *topNode) override;
0076 
0077   int End(PHCompositeNode *topNode) override;
0078 
0079   int Reset(PHCompositeNode * /*topNode*/) override;
0080 
0081   void Print(const std::string &what = "ALL") const override;
0082 
0083   void CreateNodeTree(PHCompositeNode *topNode);
0084 
0085   void SetDefaultParams()
0086   {
0087     _cutParams.set_int_param("failsLoEmJetCut", 0);
0088     _cutParams.set_int_param("failsHiEmJetCut", 0);
0089     _cutParams.set_int_param("failsIhJetCut", 0);
0090     _cutParams.set_int_param("failsAnyJetCut", 0);
0091   }
0092 
0093  private:
0094   bool _doAbort;
0095   std::string _name;
0096   int _debug;
0097   bool _missingInfoWarningPrinted = false;
0098   std::string _jetNodeName;
0099   GlobalVertex::VTXTYPE _vtxtype;
0100   int _sysvar;
0101   PHParameters _cutParams;
0102 };
0103 
0104 #endif