Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:18:23

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 /*!
0004  * \file ${file_name}
0005  * \brief
0006  * \author Jin Huang <jhuang@bnl.gov>
0007  * \version $$Revision: 1.2 $$
0008  * \date $$Date: 2014/08/12 03:49:12 $$
0009  */
0010 
0011 #ifndef G4DETECTORS_PHG4SPACALSUBSYSTEM_H
0012 #define G4DETECTORS_PHG4SPACALSUBSYSTEM_H
0013 
0014 #include "PHG4DetectorSubsystem.h"
0015 #include "PHG4SpacalSteppingAction.h"
0016 
0017 #include <string>  // for string
0018 
0019 class PHCompositeNode;
0020 class PHG4Detector;
0021 class PHG4DisplayAction;
0022 class PHG4SpacalDetector;
0023 class PHG4SpacalSteppingAction;
0024 
0025 class PHG4SpacalSubsystem : public PHG4DetectorSubsystem
0026 {
0027  public:
0028   //! constructor
0029   PHG4SpacalSubsystem(const std::string &name = "PHG4SpacalSubsystem",
0030                       const int layer = 0);
0031 
0032   //! destructor
0033   ~PHG4SpacalSubsystem() override;
0034 
0035   //! init
0036   /*!
0037   called during InitRun (the original InitRun does common setup and calls this one)
0038   creates the detector object
0039   ceates the stepping action
0040   creates relevant hit nodes that will be populated by the stepping action and stored in the output DST
0041    */
0042   int InitRunSubsystem(PHCompositeNode *) override;
0043 
0044   //! event processing
0045   /*!
0046    get all relevant nodes from top nodes (namely hit list)
0047    and pass that to the stepping action
0048    */
0049   int process_event(PHCompositeNode *) override;
0050 
0051   //! accessors (reimplemented)
0052   PHG4Detector *GetDetector() const override;
0053   PHG4SteppingAction *GetSteppingAction() const override { return steppingAction_; }
0054 
0055   PHG4DisplayAction *GetDisplayAction() const override { return m_DisplayAction; }
0056 
0057   void
0058   Print(const std::string &what = "ALL") const override;
0059 
0060   void CosmicSetup(const int i) { m_CosmicSetupFlag = i; }
0061   int CosmicSetup() const { return m_CosmicSetupFlag; }
0062 
0063  private:
0064   void SetDefaultParameters() override;
0065   //  SpacalGeom_t _geom;
0066 
0067   //! detector geometry
0068   /*! defives from PHG4Detector */
0069   PHG4SpacalDetector *detector_ = nullptr;
0070 
0071   //! particle tracking "stepping" action
0072   /*! derives from PHG4SteppingActions */
0073   PHG4SpacalSteppingAction *steppingAction_ = nullptr;
0074 
0075   //! display attribute setting
0076   /*! derives from PHG4DisplayAction */
0077   PHG4DisplayAction *m_DisplayAction = nullptr;
0078 
0079   int m_CosmicSetupFlag = 0;
0080 
0081   std::string m_HitNodeName;
0082   std::string m_AbsorberNodeName;
0083 };
0084 
0085 #endif