Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:55

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4CEMCTESTBEAMDETECTOR_H
0004 #define G4DETECTORS_PHG4CEMCTESTBEAMDETECTOR_H
0005 
0006 #include <g4main/PHG4Detector.h>
0007 
0008 #include <Geant4/G4Types.hh>
0009 
0010 #include <string>  // for string
0011 #include <vector>
0012 
0013 class G4LogicalVolume;
0014 class G4VPhysicalVolume;
0015 class PHCompositeNode;
0016 class PHG4Subsystem;
0017 
0018 class PHG4CEmcTestBeamDetector : public PHG4Detector
0019 {
0020  public:
0021   //! constructor
0022   PHG4CEmcTestBeamDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, const std::string &dnam, const int lyr = 0);
0023 
0024   //! destructor
0025   ~PHG4CEmcTestBeamDetector() override = default;
0026 
0027   //! construct
0028   void ConstructMe(G4LogicalVolume *world) override;
0029 
0030   //!@name volume accessors
0031   //@{
0032   int IsInCEmcTestBeam(G4VPhysicalVolume *) const;
0033   //@}
0034 
0035   void SetPlaceZ(const G4double place_z) { place_in_z = place_z; }
0036   void SetPlace(const G4double place_x, const G4double place_y, const G4double place_z)
0037   {
0038     place_in_x = place_x;
0039     place_in_y = place_y;
0040     place_in_z = place_z;
0041   }
0042   void SetXRot(const G4double angle) { x_rot = angle; }
0043   void SetYRot(const G4double angle) { y_rot = angle; }
0044   void SetZRot(const G4double angle) { z_rot = angle; }
0045   void SetActive(const int i = 1) { active = i; }
0046   void SetAbsorberActive(const int i = 1) { absorberactive = i; }
0047   int IsActive() const { return active; }
0048   void SuperDetector(const std::string &name) { superdetector = name; }
0049   const std::string &SuperDetector() const { return superdetector; }
0050   int get_Layer() const { return layer; }
0051 
0052   void BlackHole(const int i = 1) { blackhole = i; }
0053   int IsBlackHole() const { return blackhole; }
0054 
0055  private:
0056   void CalculateGeometry();
0057   int ConstructTowerVolume(G4LogicalVolume *tower);
0058   int ConstructSandwichVolume(G4LogicalVolume *sandwich);
0059 
0060   std::vector<G4VPhysicalVolume *> sandwich_vol;
0061   G4double w_dimension[3]{};
0062   G4double sc_dimension[3]{};
0063   G4double gap;
0064   G4double place_in_x;
0065   G4double place_in_y;
0066   G4double place_in_z;
0067   double plate_x;
0068   double plate_z;
0069   double sandwich_thickness;
0070   G4double x_rot;
0071   G4double y_rot;
0072   G4double z_rot;
0073   double alpha;
0074   double inner_radius;
0075   double outer_radius;
0076   double tower_angular_coverage;
0077   double cemc_angular_coverage;
0078   double active_scinti_fraction;
0079   int sandwiches_per_tower;
0080   int num_towers;
0081 
0082   int active;
0083   int absorberactive;
0084   int layer;
0085   int blackhole;
0086   std::string detector_type;
0087   std::string superdetector;
0088 };
0089 
0090 #endif