Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4CONESUBSYSTEM_H
0004 #define G4DETECTORS_PHG4CONESUBSYSTEM_H
0005 
0006 #include "PHG4DetectorSubsystem.h"
0007 
0008 #include <array>   // for array
0009 #include <string>  // for string
0010 
0011 class PHCompositeNode;
0012 class PHG4ConeDetector;
0013 class PHG4Detector;
0014 class PHG4DisplayAction;
0015 class PHG4SteppingAction;
0016 
0017 class PHG4ConeSubsystem : public PHG4DetectorSubsystem
0018 {
0019  public:
0020   //! constructor
0021   PHG4ConeSubsystem(const std::string& name = "CONE", const int layer = 0);
0022 
0023   //! destructor
0024   ~PHG4ConeSubsystem(void) override;
0025 
0026   //! init runwise stuff
0027   /*!
0028   creates the m_Detector object
0029   creates the stepping action
0030   creates relevant hit nodes that will be populated by the stepping action and stored in the output DST
0031   */
0032   int InitRunSubsystem(PHCompositeNode*) override;
0033 
0034   //! event processing
0035   /*!
0036   get all relevant nodes from top nodes (namely hit list)
0037   and pass that to the stepping action
0038   */
0039   int process_event(PHCompositeNode*) override;
0040 
0041   //! accessors (reimplemented)
0042   PHG4Detector* GetDetector(void) const override;
0043   PHG4SteppingAction* GetSteppingAction(void) const override { return m_SteppingAction; };
0044 
0045   PHG4DisplayAction* GetDisplayAction() const override { return m_DisplayAction; }
0046   void set_color(const double red, const double green, const double blue, const double alpha = 1.)
0047   {
0048     m_ColorArray[0] = red;
0049     m_ColorArray[1] = green;
0050     m_ColorArray[2] = blue;
0051     m_ColorArray[3] = alpha;
0052   }
0053 
0054   //! set inner and outter radius1
0055   void SetR1(const double min, const double max);
0056 
0057   //! set inner and outter radius2
0058   void SetR2(const double min, const double max);
0059 
0060   //! set length in Z
0061   void SetZlength(const double a);
0062 
0063   //! set phi offset and extention
0064   void SetPhi(const double a, const double b);
0065 
0066   //! set rmaximum and minimums according to the eta range
0067   void Set_eta_range(double etaMin, double etaMax);
0068 
0069   void SetPlaceZ(const double dbl);
0070   void SetPlace(const double place_x, const double place_y, const double place_z);
0071 
0072   void SetZRot(const double dbl);
0073   void SetMaterial(const std::string& mat);
0074 
0075   // this method is used to check if it can be used as mothervolume
0076   // Subsystems which can be mothervolume need to implement this
0077   // and return true
0078   bool CanBeMotherSubsystem() const override { return true; }
0079 
0080  private:
0081   void SetDefaultParameters() override;
0082 
0083   //! detector geometry
0084   /*! derives from PHG4Detector */
0085   PHG4ConeDetector* m_Detector = nullptr;
0086 
0087   //! particle tracking "stepping" action
0088   /*! derives from PHG4SteppingActions */
0089   PHG4SteppingAction* m_SteppingAction = nullptr;
0090 
0091   //! display attribute setting
0092   /*! derives from PHG4DisplayAction */
0093   PHG4DisplayAction* m_DisplayAction = nullptr;
0094 
0095   //! Color setting if we want to override the default
0096   std::array<double, 4> m_ColorArray{};
0097 };
0098 
0099 #endif  // G4DETECTORS_PHG4CONESUBSYSTEM_H