File indexing completed on 2025-08-03 08:17:12
0001 #ifndef JETBASE_JETRECO_H
0002 #define JETBASE_JETRECO_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <fun4all/SubsysReco.h>
0012
0013
0014 #include <string> // for string
0015 #include <vector>
0016
0017
0018 class Jet;
0019 class JetAlgo;
0020 class JetInput;
0021 class PHCompositeNode;
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 class JetReco : public SubsysReco
0032 {
0033 public:
0034 enum TRANSITION
0035 {
0036 JET_CONTAINER,
0037 JET_MAP,
0038 BOTH,
0039 PRETEND_BOTH
0040 };
0041
0042 JetReco(const std::string &name = "JetReco", TRANSITION _which_fill = JET_CONTAINER);
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
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
0073
0074
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;
0083 bool use_jetcon;
0084 bool use_jetmap;
0085 };
0086
0087 #endif