Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef HEPMCJETTRIGGER_H
0004 #define HEPMCJETTRIGGER_H
0005 #pragma GCC diagnostic push
0006 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0007 #include <string>
0008 #include <vector>
0009 #include <fun4all/SubsysReco.h>
0010 #include <phhepmc/PHHepMCGenEvent.h>
0011 #include <phhepmc/PHHepMCGenEventMap.h>
0012 
0013 #include <phool/phool.h>
0014 #include <phool/getClass.h>
0015 #include <phool/PHCompositeNode.h>
0016 #include <phool/PHObject.h>
0017 #include <fastjet/JetDefinition.hh>
0018 #include <fastjet/PseudoJet.hh>
0019 
0020 #include <HepMC/GenEvent.h>
0021 
0022 
0023 class PHCompositeNode;
0024 
0025 class HepMCJetTrigger : public SubsysReco
0026 {
0027  public:
0028 
0029   HepMCJetTrigger(float trigger_thresh=10., int n_incom=1000, bool up_lim=false, const std::string &name = "HepMCJetTrigger");
0030 
0031   ~HepMCJetTrigger() override;
0032 
0033   /** Called during initialization.
0034       Typically this is where you can book histograms, and e.g.
0035       register them to Fun4AllServer (so they can be output to file
0036       using Fun4AllServer::dumpHistos() method).
0037    */
0038   int Init(PHCompositeNode *topNode) override;
0039 
0040   /** Called for first event when run number is known.
0041       Typically this is where you may want to fetch data from
0042       database, because you know the run number. A place
0043       to book histograms which have to know the run number.
0044    */
0045   int InitRun(PHCompositeNode *topNode) override;
0046 
0047   /** Called for each event.
0048       This is where you do the real work.
0049    */
0050   int process_event(PHCompositeNode *topNode) override;
0051 
0052   /// Clean up internals after each event.
0053   int ResetEvent(PHCompositeNode *topNode) override;
0054 
0055   /// Called at the end of each run.
0056   int EndRun(const int runnumber) override;
0057 
0058   /// Called at the end of all processing.
0059   int End(PHCompositeNode *topNode) override;
0060 
0061   /// Reset
0062   int Reset(PHCompositeNode * /*topNode*/) override;
0063 
0064   void Print(const std::string &what = "ALL") const override;
0065   int n_evts=0;
0066   int n_good=0;
0067  private:
0068     bool isGoodEvent(HepMC::GenEvent* e1);
0069     std::vector<fastjet::PseudoJet> findAllJets(HepMC::GenEvent* e1);
0070     int jetsAboveThreshold(std::vector<fastjet::PseudoJet> jets);
0071     float threshold=0.;
0072     int goal_event_number=1000;
0073     bool set_event_limit=false;
0074 };
0075 
0076 #endif // HEPMCJETTRIGGER_H