Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 
0004 /*!
0005  * \file ${file_name}
0006  * \brief
0007  * \author Jin Huang <jhuang@bnl.gov>
0008  * \version $$Revision: 1.2 $$
0009  * \date $$Date: 2015/02/10 15:39:26 $$
0010  */
0011 
0012 #ifndef G4DETECTORS_PHG4FULLPROJTILTEDSPACALDETECTOR_H
0013 #define G4DETECTORS_PHG4FULLPROJTILTEDSPACALDETECTOR_H
0014 
0015 #include "PHG4CylinderGeom_Spacalv3.h"
0016 #include "PHG4SpacalDetector.h"
0017 
0018 #include <Geant4/G4Transform3D.hh>
0019 
0020 #include <cassert>
0021 #include <string>   // for string
0022 #include <utility>  // for pair
0023 
0024 class G4LogicalVolume;
0025 class PHCompositeNode;
0026 class PHG4CylinderGeom;
0027 class PHG4Subsystem;
0028 class PHParameters;
0029 
0030 //! Fully projective SPACAL built from 2D tapered modules and allow azimuthal tilts
0031 class PHG4FullProjTiltedSpacalDetector : public PHG4SpacalDetector
0032 {
0033  public:
0034   typedef PHG4CylinderGeom_Spacalv3 SpacalGeom_t;
0035 
0036   PHG4FullProjTiltedSpacalDetector(PHG4Subsystem* subsys, PHCompositeNode* Node, const std::string& dnam,
0037                                    PHParameters* parameters, const int layer = 0);
0038 
0039   // empty dtor, step limits are deleted in base class
0040   ~PHG4FullProjTiltedSpacalDetector(void) override {}
0041 
0042   void
0043   ConstructMe(G4LogicalVolume* world) override;
0044 
0045   std::pair<G4LogicalVolume*, G4Transform3D>
0046   Construct_AzimuthalSeg() override;
0047 
0048   //! a block along z axis built with G4Trd that is slightly tapered in x dimension
0049   virtual G4LogicalVolume*
0050   Construct_Tower(const SpacalGeom_t::geom_tower& tower);
0051   //! a block for the light guide along z axis that fit to the tower
0052   virtual G4LogicalVolume*
0053   Construct_LightGuide(const SpacalGeom_t::geom_tower& tower, const int index_x, const int index_y);
0054 
0055   //! a block along z axis built with G4Trd that is slightly tapered in x dimension
0056   virtual int
0057   Construct_Fibers(const SpacalGeom_t::geom_tower& tower, G4LogicalVolume* LV_tower);
0058 
0059   //! Fully projective spacal with 2D tapered modules. To speed up construction, same-length fiber is used cross one tower
0060   virtual int
0061   Construct_Fibers_SameLengthFiberPerTower(const SpacalGeom_t::geom_tower& tower, G4LogicalVolume* LV_tower);
0062 
0063   void
0064   Print(const std::string& what = "ALL") const override;
0065 
0066   PHG4CylinderGeom* clone_geom() const override
0067   {
0068     return new SpacalGeom_t(*get_geom_v3());
0069   }
0070 
0071  private:
0072   PHParameters* m_Params = nullptr;
0073   //  SpacalGeom_t* _geom;
0074   //! get the v3 cast of the geometry object
0075   SpacalGeom_t*
0076   get_geom_v3()
0077   {
0078     SpacalGeom_t* v3_geom = dynamic_cast<SpacalGeom_t*>(_geom);
0079     assert(v3_geom);
0080     return v3_geom;
0081   }
0082 
0083   const SpacalGeom_t*
0084   get_geom_v3() const
0085   {
0086     SpacalGeom_t* v3_geom = dynamic_cast<SpacalGeom_t*>(_geom);
0087     assert(v3_geom);
0088     return v3_geom;
0089   }
0090 };
0091 
0092 #endif