File indexing completed on 2025-08-06 08:18:34
0001
0002
0003
0004
0005
0006
0007 #ifndef TRACKRECO_PHTRUTHCLUSTERING_H
0008 #define TRACKRECO_PHTRUTHCLUSTERING_H
0009
0010 #include <fun4all/SubsysReco.h>
0011 #include <trackbase/TrkrDefs.h>
0012
0013
0014 #include <gsl/gsl_rng.h>
0015
0016 class PHG4Hit;
0017 class PHG4HitContainer;
0018 class PHG4Particle;
0019 class PHG4TruthInfoContainer;
0020 class PHG4CylinderGeomContainer;
0021 class PHG4TpcCylinderGeomContainer;
0022 class TrkrCluster;
0023 class TrkrClusterContainer;
0024 class ActsGeometry;
0025
0026 #include <string> // for string
0027 #include <vector>
0028 #include <map>
0029 #include <set>
0030 #include <memory>
0031
0032
0033 class PHCompositeNode;
0034 class PHG4TruthInfoContainer;
0035
0036 class PHTruthClustering : public SubsysReco
0037 {
0038 public:
0039 PHTruthClustering(const std::string &name = "PHTruthClustering");
0040 ~PHTruthClustering() override;
0041
0042 int InitRun(PHCompositeNode *topNode) override;
0043 int process_event(PHCompositeNode *topNode) override;
0044 int End(PHCompositeNode *topNode) override;
0045
0046 void UsePrimaryTrackClustersOnly(bool flag) {_primary_clusters_only = flag;}
0047
0048 private:
0049
0050 int GetNodes(PHCompositeNode *topNode);
0051
0052 std::map<TrkrDefs::cluskey, TrkrCluster* > all_truth_clusters(PHG4Particle* particle);
0053 std::set<PHG4Hit*> all_truth_hits(PHG4Particle* particle);
0054
0055 void LayerClusterG4Hits(const std::set<PHG4Hit*> &truth_hits, std::vector<PHG4Hit*> &contributing_hits, std::vector<double> &contributing_hits_energy, std::vector<std::vector<double>> &contributing_hits_entry, std::vector<std::vector<double>> &contributing_hits_exit, float layer, float &x, float &y, float &z, float &t, float &e);
0056
0057 void G4ClusterSize(TrkrDefs::cluskey& ckey, unsigned int layer, const std::vector<std::vector<double>> &contributing_hits_entry, const std::vector<std::vector<double>> &contributing_hits_exit, float &g4phisize, float &g4zsize);
0058
0059 float line_circle_intersection(float x[], float y[], float z[], float radius);
0060 unsigned int getTpcSector(double x, double y);
0061
0062 unsigned int getAdcValue(double gedep);
0063
0064 int iclus = 0;
0065
0066 TrkrClusterContainer *_reco_cluster_map{nullptr};
0067 PHG4TruthInfoContainer *_g4truth_container{nullptr};
0068
0069 PHG4HitContainer* _g4hits_svtx{nullptr};
0070 PHG4HitContainer* _g4hits_mms{nullptr};
0071 PHG4HitContainer* _g4hits_tracker{nullptr};
0072 PHG4HitContainer* _g4hits_maps{nullptr};
0073
0074 PHG4TpcCylinderGeomContainer* _tpc_geom_container{nullptr};
0075 PHG4CylinderGeomContainer *_intt_geom_container{nullptr};
0076 PHG4CylinderGeomContainer* _mvtx_geom_container{nullptr};
0077 PHG4CylinderGeomContainer* _mms_geom_container{nullptr};
0078 ActsGeometry* _tgeometry{nullptr};
0079 const unsigned int _nlayers_maps = 3;
0080 const unsigned int _nlayers_intt = 4;
0081 const unsigned int _nlayers_tpc = 48;
0082 const unsigned int _nlayers_mms = 2;
0083
0084 double clus_err_rphi[57] = {0};
0085 double clus_err_z[57] = {0};
0086
0087 double mvtx_clus_err_rphi = 5e-04;
0088 double mvtx_clus_err_z = 5e-04;
0089 double intt_clus_err_rphi = 25e-04;
0090 double intt_clus_err_z = 1.0;
0091 double tpc_inner_clus_err_rphi = 200e-04;
0092 double tpc_inner_clus_err_z = 750e-04;
0093 double tpc_outer_clus_err_rphi = 150e-04;
0094 double tpc_outer_clus_err_z = 500e-04;
0095 double mms_layer55_clus_err_rphi = 100e-04;
0096 double mms_layer55_clus_err_z = 25.0;
0097 double mms_layer56_clus_err_rphi = 12.5;
0098 double mms_layer56_clus_err_z = 200e-04;
0099
0100 bool _primary_clusters_only= false;
0101
0102 };
0103
0104 #endif