Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:17:12

0001 #ifndef JETBASE_JETRECO_H
0002 #define JETBASE_JETRECO_H
0003 
0004 //===========================================================
0005 /// \file JetReco.h
0006 /// \brief simple jet reco using FastJet
0007 /// \author Mike McCumber
0008 //===========================================================
0009 
0010 // PHENIX includes
0011 #include <fun4all/SubsysReco.h>
0012 
0013 // standard includes
0014 #include <string>  // for string
0015 #include <vector>
0016 
0017 // forward declarations
0018 class Jet;
0019 class JetAlgo;
0020 class JetInput;
0021 class PHCompositeNode;
0022 
0023 /// \class JetReco
0024 ///
0025 /// \brief jet reco with user def inputs and algos
0026 ///
0027 /// This module can be used to reconstruct truth jets
0028 /// and will get me started on filling some jet nodes and getting
0029 /// source material for jet evaluation
0030 ///
0031 class JetReco : public SubsysReco
0032 {
0033  public:
0034   enum TRANSITION
0035   {
0036     JET_CONTAINER,
0037     JET_MAP,
0038     BOTH,
0039     PRETEND_BOTH  // do just JET_CONTAINER, but still append _JC to the name
0040   };
0041 
0042   JetReco(const std::string &name = "JetReco", TRANSITION _which_fill = JET_CONTAINER);  // , bool fill_JetContainer=false);
0043   ~JetReco() override;
0044 
0045   int InitRun(PHCompositeNode *topNode) override;
0046   int process_event(PHCompositeNode *topNode) override;
0047 
0048   void add_input(JetInput *input) { _inputs.push_back(input); }
0049   void add_algo(JetAlgo *algo, const std::string &output)
0050   {
0051     _algos.push_back(algo);
0052     _outputs.push_back(output);
0053   }
0054 
0055   void set_algo_node(const std::string &algonode) { _algonode = algonode; }
0056   void set_input_node(const std::string &inputnode) { _inputnode = inputnode; }
0057   /* void set_fill_JetContainer(bool b) { _fill_JetContainer = b; } */
0058 
0059   JetAlgo *get_algo(unsigned int which_algo = 0);
0060 
0061  private:
0062   int CreateNodes(PHCompositeNode *topNode);
0063   void FillJetNode(PHCompositeNode *topNode, int ipos, const std::vector<Jet *> &jets);
0064   void FillJetContainer(PHCompositeNode *topNode, int ipos, std::vector<Jet *> &inputs);
0065 
0066   std::vector<JetInput *> _inputs;
0067   std::vector<JetAlgo *> _algos;
0068   std::string _algonode;
0069   std::string _inputnode;
0070   std::vector<std::string> _outputs;
0071 
0072   // transition functions, while moving from JetMap to JetContainer.
0073   // May be removed after transition is made, depending on state of
0074   // functions
0075   std::string JC_name(const std::string &name)
0076   {
0077     if (which_fill == TRANSITION::BOTH || which_fill == TRANSITION::PRETEND_BOTH)
0078       return name + "_JC";
0079     else
0080       return name;
0081   }
0082   TRANSITION which_fill;  // fill both container and map
0083   bool use_jetcon;
0084   bool use_jetmap;
0085 };
0086 
0087 #endif  // JETBASE_JETRECO_H