Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:19:27

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MVTX_PHG4MVTXSUBSYSTEM_H
0004 #define G4MVTX_PHG4MVTXSUBSYSTEM_H
0005 
0006 #include <g4detectors/PHG4DetectorGroupSubsystem.h>
0007 
0008 #include <cmath>   // for asin
0009 #include <string>  // for string
0010 
0011 class PHCompositeNode;
0012 class PHG4Detector;
0013 class PHG4DisplayAction;
0014 class PHG4MvtxDetector;
0015 class PHG4SteppingAction;
0016 
0017 class PHG4MvtxSubsystem : public PHG4DetectorGroupSubsystem
0018 {
0019  public:
0020   //! constructor
0021   PHG4MvtxSubsystem(const std::string& name = "PHG4MvtxSubsystem", const int _n_layers = 3);
0022 
0023   //! destructor
0024   ~PHG4MvtxSubsystem() override;
0025 
0026   //! InitRunSubsystem
0027   /*!
0028   called during InitRun (the original InitRun does common setup and calls this one)
0029   creates the detector object
0030   creates the stepping action
0031   creates relevant hit nodes that will be populated by the stepping action and stored in the output DST
0032   */
0033   int InitRunSubsystem(PHCompositeNode*) override;
0034 
0035   //! event processing
0036   /*!
0037   get all relevant nodes from top nodes (namely hit list)
0038   and pass that to the stepping action
0039   */
0040   int process_event(PHCompositeNode*) override;
0041 
0042   //! accessors (reimplemented)
0043   PHG4Detector* GetDetector(void) const override;
0044   PHG4SteppingAction* GetSteppingAction(void) const override { return m_SteppingAction; }
0045 
0046   PHG4DisplayAction* GetDisplayAction() const override { return m_DisplayAction; }
0047 
0048   void Apply_Misalignment(bool b) { m_ApplyMisalignment = b; }
0049   void MisalignmentFile(const std::string& filename) { m_misalignmentFile = filename; }
0050 
0051  private:
0052   void SetDefaultParameters() override;
0053   static double radii2Turbo(double rMin, double rMid, double rMax, double sensW)
0054   {
0055     // compute turbo angle from radii and sensor width
0056     return std::asin((rMax * rMax - rMin * rMin) / (2 * rMid * sensW));
0057   }
0058   //! detector geometry
0059   /*! defives from PHG4Detector */
0060   PHG4MvtxDetector* m_Detector{nullptr};
0061 
0062   //! particle tracking "stepping" action
0063   /*! derives from PHG4SteppingActions */
0064   PHG4SteppingAction* m_SteppingAction{nullptr};
0065 
0066   //! display attribute setting
0067   /*! derives from PHG4DisplayAction */
0068   PHG4DisplayAction* m_DisplayAction{nullptr};
0069 
0070   // These are passed on to the detector class
0071   unsigned int n_layers{0};
0072 
0073   std::string detector_type;
0074   std::string m_HitNodeName;
0075   std::string m_SupportNodeName;
0076   std::string m_misalignmentFile = "";
0077   bool m_ApplyMisalignment{false};
0078 };
0079 
0080 #endif