Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:51

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4SECTORSUBSYSTEM_H
0004 #define G4DETECTORS_PHG4SECTORSUBSYSTEM_H
0005 
0006 #include "PHG4SectorConstructor.h"
0007 
0008 #include <g4main/PHG4Subsystem.h>
0009 
0010 #include <string>  // for string
0011 
0012 class PHCompositeNode;
0013 class PHG4Detector;
0014 class PHG4DisplayAction;
0015 class PHG4SectorDetector;
0016 class PHG4SteppingAction;
0017 
0018 class PHG4SectorSubsystem : public PHG4Subsystem
0019 {
0020  public:
0021   //! constructor
0022   PHG4SectorSubsystem(const std::string& name = "Sector");
0023 
0024   //! destructor
0025   ~PHG4SectorSubsystem() override;
0026 
0027   //! init
0028   /*!
0029    creates the detector_ object and place it on the node tree, under "DETECTORS" node (or whatever)
0030    reates the stepping action and place it on the node tree, under "ACTIONS" node
0031    creates relevant hit nodes that will be populated by the stepping action and stored in the output DST
0032    */
0033   int Init(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*
0044   GetDetector(void) const override;
0045   PHG4SteppingAction* GetSteppingAction(void) const override { return m_SteppingAction; }
0046 
0047   PHG4DisplayAction* GetDisplayAction() const override { return m_DisplayAction; }
0048 
0049   void
0050   SuperDetector(const std::string& name)
0051   {
0052     superdetector = name;
0053   }
0054 
0055   //! geometry manager PHG4Sector::Sector_Geometry
0056   PHG4Sector::Sector_Geometry&
0057   get_geometry()
0058   {
0059     return geom;
0060   }
0061 
0062   //! geometry manager PHG4Sector::Sector_Geometry
0063   void
0064   set_geometry(const PHG4Sector::Sector_Geometry& geo)
0065   {
0066     geom = geo;
0067   }
0068 
0069  private:
0070   //! detector geometry
0071   /*! defives from PHG4Detector */
0072   PHG4SectorDetector* m_Detector = nullptr;
0073 
0074   //! particle tracking "stepping" action
0075   /*! derives from PHG4SteppingActions */
0076   PHG4SteppingAction* m_SteppingAction = nullptr;
0077 
0078   //! display attribute setting
0079   /*! derives from PHG4DisplayAction */
0080   PHG4DisplayAction* m_DisplayAction = nullptr;
0081 
0082   std::string superdetector = "NONE";
0083 
0084   PHG4Sector::Sector_Geometry geom;
0085 };
0086 
0087 #endif