File indexing completed on 2025-08-06 08:14:24
0001
0002
0003 #ifndef TRUTHJETTAGGING_H
0004 #define TRUTHJETTAGGING_H
0005
0006 #include <fun4all/SubsysReco.h>
0007 #include <g4jets/Jet.h>
0008 #include <g4jets/Jetv1.h>
0009 #include <g4main/PHG4TruthInfoContainer.h>
0010
0011 #pragma GCC diagnostic push
0012 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0013 #include <HepMC/GenEvent.h>
0014 #include <HepMC/GenVertex.h>
0015 #pragma GCC diagnostic pop
0016 #include <phhepmc/PHHepMCGenEvent.h>
0017 #include <phhepmc/PHHepMCGenEventMap.h>
0018 #include <string>
0019 #include <vector>
0020 class PHCompositeNode;
0021
0022 class TruthJetTagging : public SubsysReco
0023 {
0024 public:
0025
0026 TruthJetTagging(const std::string &name = "TruthJetTagging");
0027
0028 ~TruthJetTagging() override;
0029
0030
0031
0032
0033
0034
0035 int Init(PHCompositeNode *topNode) override;
0036
0037
0038
0039
0040
0041
0042 int InitRun(PHCompositeNode *topNode) override;
0043
0044
0045
0046
0047 int process_event(PHCompositeNode *topNode) override;
0048
0049
0050 int ResetEvent(PHCompositeNode *topNode) override;
0051
0052
0053 int EndRun(const int runnumber) override;
0054
0055
0056 int End(PHCompositeNode *topNode) override;
0057
0058
0059 int Reset(PHCompositeNode * ) override;
0060
0061 void Print(const std::string &what = "ALL") const override;
0062
0063
0064
0065 void add_algo(std::string algoname)
0066 {
0067 _algorithms.push_back(algoname);
0068 }
0069
0070 void add_radius(float radius)
0071 {
0072 _radii.push_back(radius);
0073 }
0074 void do_photon_tagging(bool dotag)
0075 {
0076 _do_photon_tagging = dotag;
0077 }
0078 void do_hf_tagging(bool dotag)
0079 {
0080 _do_hf_tagging = dotag;
0081 }
0082 void set_embedding_id(int id)
0083 {
0084 _embedding_id = id;
0085 }
0086
0087 float
0088 deltaR(float eta1, float eta2, float phi1, float phi2)
0089 {
0090 float deta = eta1 - eta2;
0091 float dphi = phi1 - phi2;
0092 if (dphi > +3.14159)
0093 dphi -= 2 * 3.14159;
0094 if (dphi < -3.14159)
0095 dphi += 2 * 3.14159;
0096
0097 return sqrt(pow(deta, 2) + pow(dphi, 2));
0098
0099 }
0100
0101
0102
0103 float TruthPhotonTagging(PHG4TruthInfoContainer* truthnode, Jet* tjet);
0104 int hadron_tagging(Jet* this_jet, HepMC::GenEvent* theEvent, const double match_radius);
0105
0106
0107 private:
0108
0109 std::vector<std::string> _algorithms;
0110 std::vector<float> _radii;
0111 bool _do_photon_tagging;
0112 bool _do_hf_tagging;
0113 int _embedding_id;
0114
0115 };
0116
0117 #endif