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_PHG4FULLPROJSPACALDETECTOR_H
0013 #define G4DETECTORS_PHG4FULLPROJSPACALDETECTOR_H
0014 
0015 #include "PHG4CylinderGeom_Spacalv3.h"
0016 #include "PHG4SpacalDetector.h"
0017 
0018 #include <Geant4/G4Transform3D.hh>  // for G4Transform3D
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.
0031 //! This class is obsolete and for comparison study only. Use PHG4FullProjTiltedSpacalDetector instead.
0032 //! It loads Chris Cullen 2D spacal design July 2015 by default.
0033 class PHG4FullProjSpacalDetector : public PHG4SpacalDetector
0034 {
0035  public:
0036   typedef PHG4CylinderGeom_Spacalv3 SpacalGeom_t;
0037 
0038   PHG4FullProjSpacalDetector(PHG4Subsystem* subsys,
0039                              PHCompositeNode* Node, const std::string& dnam,
0040                              PHParameters* parameters, const int layer = 0);
0041 
0042   // empty dtor, step limits are deleted in base class
0043   ~PHG4FullProjSpacalDetector(void) override {}
0044   void
0045   ConstructMe(G4LogicalVolume* world) override;
0046 
0047   std::pair<G4LogicalVolume*, G4Transform3D>
0048   Construct_AzimuthalSeg() override;
0049 
0050   //! a block along z axis built with G4Trd that is slightly tapered in x dimension
0051   virtual G4LogicalVolume*
0052   Construct_Tower(const SpacalGeom_t::geom_tower& tower);
0053 
0054   //! a block along z axis built with G4Trd that is slightly tapered in x dimension
0055   virtual int
0056   Construct_Fibers(const SpacalGeom_t::geom_tower& tower, G4LogicalVolume* LV_tower);
0057 
0058   //! Fully projective spacal with 2D tapered modules. To speed up construction, same-length fiber is used cross one tower
0059   virtual int
0060   Construct_Fibers_SameLengthFiberPerTower(const SpacalGeom_t::geom_tower& tower, G4LogicalVolume* LV_tower);
0061 
0062   void
0063   Print(const std::string& what = "ALL") const override;
0064 
0065   PHG4CylinderGeom* clone_geom() const override
0066   {
0067     return new SpacalGeom_t(*get_geom_v3());
0068   }
0069 
0070  private:
0071   //  SpacalGeom_t* _geom;
0072 
0073   //! get the v3 cast of the geometry object
0074   SpacalGeom_t*
0075   get_geom_v3()
0076   {
0077     SpacalGeom_t* v3_geom = dynamic_cast<SpacalGeom_t*>(_geom);
0078     assert(v3_geom);
0079     return v3_geom;
0080   }
0081 
0082   const SpacalGeom_t*
0083   get_geom_v3() const
0084   {
0085     SpacalGeom_t* v3_geom = dynamic_cast<SpacalGeom_t*>(_geom);
0086     assert(v3_geom);
0087     return v3_geom;
0088   }
0089 };
0090 
0091 #endif