Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:36

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef FIELDMAPREADBACK_H
0004 #define FIELDMAPREADBACK_H
0005 
0006 #include <fun4all/SubsysReco.h>
0007 
0008 #include <string>
0009 
0010 class PHCompositeNode;
0011 class PHField;
0012 
0013 class FieldMapReadBack : public SubsysReco
0014 {
0015  public:
0016   FieldMapReadBack(const std::string &name = "FieldMapReadBack") {}
0017 
0018   virtual ~FieldMapReadBack() {}
0019 
0020   /** Called for first event when run number is known.
0021       Typically this is where you may want to fetch data from
0022       database, because you know the run number. A place
0023       to book histograms which have to know the run number.
0024    */
0025   int InitRun(PHCompositeNode *topNode) override;
0026 
0027   /** Called for each event.
0028       This is where you do the real work.
0029    */
0030   int process_event(PHCompositeNode *topNode) override;
0031 
0032   void Load3dCartMap(const std::string &fname, const float magfield_rescale = 1.0);
0033   void PrintField(const double x, const double y, const double z, const double t = 0.);
0034   void Verbosity(const int i) override;
0035   void SetFieldPoint(const double x, const double y, const double z, const double t = 0.);
0036 
0037  private:
0038   PHField *fieldmap = nullptr;
0039   double Point[4] = {0};
0040 };
0041 
0042 #endif  // FIELDMAPREADBACK_H