Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4TPC_PHG4TPCENDCAPDETECTOR_H
0004 #define G4TPC_PHG4TPCENDCAPDETECTOR_H
0005 
0006 #include <g4main/PHG4Detector.h>
0007 
0008 #include <Geant4/G4Types.hh>
0009 
0010 #include <set>
0011 #include <string>  // for string
0012 #include <vector>
0013 
0014 class G4LogicalVolume;
0015 class G4VPhysicalVolume;
0016 class PHCompositeNode;
0017 class PHG4Subsystem;
0018 class PHParameters;
0019 class G4AssemblyVolume;
0020 class PHG4TpcEndCapDisplayAction;
0021 
0022 class PHG4TpcEndCapDetector : public PHG4Detector
0023 {
0024  public:
0025   //! constructor
0026   PHG4TpcEndCapDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam);
0027 
0028   //! destructor
0029   ~PHG4TpcEndCapDetector() override;
0030 
0031   //! construct
0032   void ConstructMe(G4LogicalVolume *world) override;
0033 
0034   void Print(const std::string &what = "ALL") const override;
0035 
0036   //!@name volume accessors
0037   //@{
0038   int IsInDetector(G4VPhysicalVolume *) const;
0039   //@}
0040 
0041   void SuperDetector(const std::string &name) { m_SuperDetector = name; }
0042   const std::string &SuperDetector() const { return m_SuperDetector; }
0043 
0044  private:
0045   PHParameters *m_Params{nullptr};
0046   PHG4TpcEndCapDisplayAction *m_DisplayAction{nullptr};
0047 
0048   // active volumes
0049   std::set<G4LogicalVolume *> m_LogicalVolumesSet;
0050 
0051   std::string m_SuperDetector;
0052 
0053   G4AssemblyVolume *m_EndCapAssembly{nullptr};
0054 
0055   G4AssemblyVolume *ConstructEndCapAssembly();
0056 
0057   void ConstructWagonWheel(G4AssemblyVolume *assmeblyvol,
0058                            G4double &z_start);  // careful z_start is modified and being used later
0059 
0060   void ConstructElectronics(G4AssemblyVolume *assmeblyvol,
0061                             G4double z_start);
0062 
0063   void
0064   AddLayer(  //
0065       G4AssemblyVolume *assmeblyvol,
0066       G4double &z_start,
0067       const std::string &_name,        //! name base for this layer
0068       const std::string &_material,    //! material name in G4
0069       G4double _depth,                 //! depth in G4 units
0070       double _percentage_filled = 100  //! percentage filled//
0071   );
0072 
0073   void CreateCompositeMaterial(               //
0074       const std::string &compositeName,       //! desired name for the new material
0075       std::vector<std::string> materialName,  //! vector of the names of the component materials in G4
0076       const std::vector<double> &thickness           //! thickness of this particular layer (assuming 100 percent filled)
0077   );
0078 };
0079 
0080 #endif  // PHG4TPCENDCAPDETECTOR_H