Back to home page

sPhenix code displayed by LXR

 
 

    


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

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