Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4MAIN_PHG4ETAPARAMETERIZATION_H
0004 #define G4MAIN_PHG4ETAPARAMETERIZATION_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 PHG4EtaParameterization : public G4VPVParameterisation
0019 {
0020  public:
0021   PHG4EtaParameterization(
0022       unsigned int neta,  // Binning in eta
0023       double minEta,      // "
0024       double maxEta,      // "
0025       double startPhi,
0026       double deltaPhi,
0027       double radiusIn,   // Radius of inner face of cylinder
0028       double radiusOut,  // Radius of outer face of cylinder
0029       double centerZ     // overall Z of center of rings
0030   );
0031 
0032   ~PHG4EtaParameterization() override;
0033 
0034   virtual void Print(std::ostream& os = std::cout) const;
0035 
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 
0045  private:  // Dummy declarations to get rid of warnings ...
0046            //   void ComputeDimensions(G4Trd&,const G4int,const G4VPhysicalVolume*) const {}
0047            //   void ComputeDimensions(G4Trap&,const G4int,const G4VPhysicalVolume*) const {}
0048            //   void ComputeDimensions(G4Cons&,const G4int,const G4VPhysicalVolume*) const {}
0049            //   void ComputeDimensions(G4Sphere&,const G4int,const G4VPhysicalVolume*) const {}
0050            //   void ComputeDimensions(G4Orb&,const G4int,const G4VPhysicalVolume*) const {}
0051            //   void ComputeDimensions(G4Torus&,const G4int,const G4VPhysicalVolume*) const {}
0052            //   void ComputeDimensions(G4Para&,const G4int,const G4VPhysicalVolume*) const {}
0053            //   void ComputeDimensions(G4Hype&,const G4int,const G4VPhysicalVolume*) const {}
0054            //   void ComputeDimensions(G4Box&,const G4int,const G4VPhysicalVolume*) const {}
0055            //   void ComputeDimensions(G4Polycone&,const G4int,const G4VPhysicalVolume*) const {}
0056            //   void ComputeDimensions(G4Polyhedra&,const G4int,const G4VPhysicalVolume*) const {}
0057  private:
0058   unsigned int _neta;
0059   double _minEta;
0060   double _maxEta;
0061   double _startPhi;
0062   double _deltaPhi;
0063   double _radiusIn;
0064   double _radiusOut;
0065   double _centerZ;
0066   std::vector<double> _zpos;   // Z positions of the rings
0067   std::vector<double> _zhalf;  // Z half-widths of the rings
0068   std::vector<double> _phi0;   // Lower edge of phi bins
0069   std::vector<double> _phi1;   // Upper edge of phi bins
0070   std::vector<int> _ieta;
0071   std::vector<int> _iphi;
0072 };
0073 
0074 #endif