Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4CEMCTESTBEAMSUBSYSTEM_H
0004 #define G4DETECTORS_PHG4CEMCTESTBEAMSUBSYSTEM_H
0005 
0006 #include <g4main/PHG4Subsystem.h>
0007 
0008 #include <Geant4/G4Types.hh>
0009 
0010 #include <string>  // for string
0011 
0012 class PHCompositeNode;
0013 class PHG4CEmcTestBeamDetector;
0014 class PHG4CEmcTestBeamSteppingAction;
0015 class PHG4Detector;
0016 class PHG4EventAction;
0017 class PHG4SteppingAction;
0018 
0019 class PHG4CEmcTestBeamSubsystem : public PHG4Subsystem
0020 {
0021  public:
0022   //! constructor
0023   PHG4CEmcTestBeamSubsystem(const std::string& name = "BLOCK", const int layer = 0);
0024 
0025   //! destructor
0026   ~PHG4CEmcTestBeamSubsystem() override = default;
0027 
0028   //! init
0029   /*!
0030   creates the detector_ object and place it on the node tree, under "DETECTORS" node (or whatever)
0031   reates the stepping action and place it on the node tree, under "ACTIONS" node
0032   creates relevant hit nodes that will be populated by the stepping action and stored in the output DST
0033   */
0034   int Init(PHCompositeNode*) override;
0035 
0036   //! event processing
0037   /*!
0038   get all relevant nodes from top nodes (namely hit list)
0039   and pass that to the stepping action
0040   */
0041   int process_event(PHCompositeNode*) override;
0042 
0043   //! accessors (reimplemented)
0044   PHG4Detector* GetDetector(void) const override;
0045   PHG4SteppingAction* GetSteppingAction(void) const override;
0046 
0047   void SetSize(const G4double sizex, const G4double sizey, const G4double sizez)
0048   {
0049     dimension[0] = sizex;
0050     dimension[1] = sizey;
0051     dimension[2] = sizez;
0052   }
0053   void SetPlaceZ(const G4double dbl);
0054   void SetPlace(const G4double place_x, const G4double place_y, const G4double place_z);
0055   void SetXRot(const G4double dbl);
0056   void SetYRot(const G4double dbl);
0057   void SetZRot(const G4double dbl);
0058   PHG4EventAction* GetEventAction() const override { return eventAction_; }
0059   void SetActive(const int i = 1) { active = i; }
0060   void SetAbsorberActive(const int i = 1) { absorberactive = i; }
0061   void SuperDetector(const std::string& name) { superdetector = name; }
0062   const std::string &SuperDetector() { return superdetector; }
0063 
0064   void BlackHole(const int i = 1) { blackhole = i; }
0065 
0066  private:
0067   //! detector geometry
0068   /*! defives from PHG4Detector */
0069   PHG4CEmcTestBeamDetector* detector_;
0070 
0071   //! particle tracking "stepping" action
0072   /*! derives from PHG4SteppingActions */
0073   PHG4CEmcTestBeamSteppingAction* steppingAction_;
0074   PHG4EventAction* eventAction_;
0075   G4double dimension[3]{};
0076   G4double place_in_x;
0077   G4double place_in_y;
0078   G4double place_in_z;
0079   G4double rot_in_x;
0080   G4double rot_in_y;
0081   G4double rot_in_z;
0082 
0083   int active;
0084   int absorberactive;
0085   int layer;
0086   int blackhole;
0087   std::string detector_type;
0088   std::string superdetector;
0089 };
0090 
0091 #endif