Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-08-31 08:21:41

0001 #ifndef TPC_MODULETRACKDISPLAY_H
0002 #define TPC_MODULETRACKDISPLAY_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 #include <trackbase/TrkrDefs.h>
0006 
0007 #include <string>
0008 
0009 class PHCompositeNode;
0010 class TFile;
0011 class Tpc_ModuleTrackContainer;
0012 class TrkrHitSetContainer;
0013 class IdealPadMap;
0014 
0015 class Tpc_ModuleTrackDisplay : public SubsysReco
0016 {
0017  public:
0018   Tpc_ModuleTrackDisplay(const std::string& name = "Tpc_ModuleTrackDisplay",
0019                          const std::string& outfilename = "tpc_moduletrack_display.root",
0020                          const std::string& trackNodeName = "TPC_MODULETRACKS",
0021                          unsigned int maxEventDisplays = 5);
0022   ~Tpc_ModuleTrackDisplay() override;
0023 
0024   int Init(PHCompositeNode* topNode) override;
0025   int process_event(PHCompositeNode* topNode) override;
0026   int End(PHCompositeNode* topNode) override;
0027 
0028   struct HitPoint
0029   {
0030     HitPoint();
0031 
0032     bool ok;
0033     TrkrDefs::hitsetkey hitsetkey;
0034     TrkrDefs::hitkey hitkey;
0035 
0036     int side;
0037     unsigned int sector;
0038     unsigned int layer;
0039     unsigned int pad;
0040     unsigned int tbin;
0041     unsigned short adc;
0042 
0043     // Only display/fitter coordinates.  No global/local x/y are used.
0044     double radius;
0045     double phi;
0046   };
0047 
0048   // Display-only fit mode. Use Tpc_FittingTools::FIT_SAGITTA for field-on curvature
0049   // or Tpc_FittingTools::FIT_LINEAR for straight-line fits. Default is sagitta.
0050   void setFitMode(int mode) { m_fitMode = mode; }
0051   void setFitWithSagitta(bool v) { m_fitMode = v ? 1 : 0; }
0052 
0053   void setFitWeightPower(double v) { m_fitWeightPower = v; }
0054   void setFitWeightFloorFrac(double v) { m_fitWeightFloorFrac = v; }
0055 
0056  private:
0057   bool get_nodes(PHCompositeNode* topNode);
0058   HitPoint make_hit_point(TrkrDefs::hitsetkey hsk,
0059                           TrkrDefs::hitkey hk) const;
0060 
0061   double ideal_radius(unsigned int layer) const;
0062   double ideal_phi(int side,
0063                    unsigned int sector,
0064                    unsigned int layer,
0065                    unsigned int pad) const;
0066 
0067   std::string m_outfilename;
0068   std::string m_trackNodeName;
0069   unsigned int m_maxEventDisplays;
0070   unsigned int m_evt;
0071   unsigned int m_eventsSaved;
0072 
0073   TFile* m_outfile;
0074   Tpc_ModuleTrackContainer* m_tracks;
0075   TrkrHitSetContainer* m_hits;
0076   IdealPadMap* m_idealPadMap;
0077 
0078   int m_fitMode;
0079   double m_fitWeightPower;
0080   double m_fitWeightFloorFrac;
0081 };
0082 
0083 #endif