Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:19:21

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_PHG4ETAPHIPARAMETERIZATION_H
0004 #define G4MAIN_PHG4ETAPHIPARAMETERIZATION_H
0005 
0006 #include <Geant4/G4Types.hh>  // for G4int
0007 #include <Geant4/G4VPVParameterisation.hh>
0008 
0009 #include <iostream>  // for cout, ostream
0010 #include <vector>
0011 
0012 class G4Tubs;
0013 class G4VPhysicalVolume;
0014 
0015 // Parameterization to define rings whose size changes with Z to
0016 // correspond to fixed width in eta.
0017 
0018 class PHG4EtaPhiParameterization : public G4VPVParameterisation
0019 {
0020  public:
0021   PHG4EtaPhiParameterization(
0022       unsigned int neta,  // Binning in eta
0023       double minEta,      // "
0024       double maxEta,      // "
0025       unsigned int nphi,
0026       double startPhi,
0027       double deltaPhi,
0028       double radiusIn,   // Radius of inner face of cylinder
0029       double radiusOut,  // Radius of outer face of cylinder
0030       double centerZ     // overall Z of center of rings
0031   );
0032 
0033   ~PHG4EtaPhiParameterization() override;
0034 
0035   virtual void Print(std::ostream& os = std::cout) const;
0036   void ComputeTransformation(const G4int copyNo,
0037                              G4VPhysicalVolume* physVol) const override;
0038 
0039   using G4VPVParameterisation::ComputeDimensions;  // avoid warning for not implemented ComputeDimension methods
0040   void ComputeDimensions(G4Tubs& ring, const G4int copyNo,
0041                          const G4VPhysicalVolume* physVol) const override;
0042 
0043   int GetIEta(int copyNo) const { return _ieta.at(copyNo); }
0044   int GetIPhi(int copyNo) const { return _iphi.at(copyNo); }
0045 
0046  private:  // Dummy declarations to get rid of warnings ...
0047            //   void ComputeDimensions(G4Trd&,const G4int,const G4VPhysicalVolume*) const {}
0048            //   void ComputeDimensions(G4Trap&,const G4int,const G4VPhysicalVolume*) const {}
0049            //   void ComputeDimensions(G4Cons&,const G4int,const G4VPhysicalVolume*) const {}
0050            //   void ComputeDimensions(G4Sphere&,const G4int,const G4VPhysicalVolume*) const {}
0051            //   void ComputeDimensions(G4Orb&,const G4int,const G4VPhysicalVolume*) const {}
0052            //   void ComputeDimensions(G4Torus&,const G4int,const G4VPhysicalVolume*) const {}
0053            //   void ComputeDimensions(G4Para&,const G4int,const G4VPhysicalVolume*) const {}
0054            //   void ComputeDimensions(G4Hype&,const G4int,const G4VPhysicalVolume*) const {}
0055            //   void ComputeDimensions(G4Box&,const G4int,const G4VPhysicalVolume*) const {}
0056            //   void ComputeDimensions(G4Polycone&,const G4int,const G4VPhysicalVolume*) const {}
0057            //   void ComputeDimensions(G4Polyhedra&,const G4int,const G4VPhysicalVolume*) const {}
0058  private:
0059   unsigned int _neta;
0060   double _minEta;
0061   double _maxEta;
0062   unsigned int _nphi;
0063   double _startPhi;
0064   double _deltaPhi;
0065   double _radiusIn;
0066   double _radiusOut;
0067   double _centerZ;
0068   std::vector<double> _zpos;   // Z positions of the rings
0069   std::vector<double> _zhalf;  // Z half-widths of the rings
0070   std::vector<double> _phi0;   // Lower edge of phi bins
0071   std::vector<double> _phi1;   // Upper edge of phi bins
0072   std::vector<int> _ieta;
0073   std::vector<int> _iphi;
0074 };
0075 
0076 #endif