Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:20:43

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 // This is the header file for the hcal prototype
0004 // created on 1/27/2014, Liang, HeXC
0005 // Updated on 3/21/2014, Liang, HeXC
0006 
0007 #ifndef G4CALOPROTOTYPE_PHG4HCALPROTOTYPEDETECTOR_H
0008 #define G4CALOPROTOTYPE_PHG4HCALPROTOTYPEDETECTOR_H
0009 
0010 #include <g4main/PHG4Detector.h>
0011 
0012 #include <Geant4/G4String.hh>  // for G4String
0013 #include <Geant4/G4SystemOfUnits.hh>
0014 #include <Geant4/G4Types.hh>
0015 
0016 #include <string>  // for string
0017 
0018 class G4Box;
0019 class G4LogicalVolume;
0020 class G4Material;
0021 class G4PVPlacement;
0022 class G4VPhysicalVolume;
0023 class PHCompositeNode;
0024 class PHG4Subsystem;
0025 class PHG4HcalPrototypeDetectorMessenger;
0026 
0027 class PHG4HcalPrototypeDetector : public PHG4Detector
0028 {
0029  public:
0030   //! constructor
0031   PHG4HcalPrototypeDetector(PHG4Subsystem* subsys, PHCompositeNode* Node, const std::string& dnam, const int lyr = 0);
0032 
0033   //! destructor
0034   virtual ~PHG4HcalPrototypeDetector(void)
0035   {
0036   }
0037 
0038   //! construct
0039   virtual void ConstructMe(G4LogicalVolume* world);
0040 
0041   //!@name volume accessors
0042   //@{
0043   int IsInHcalPrototype(G4VPhysicalVolume*) const;
0044   //@}
0045 
0046   // We will keep these functions for now and deal with them later
0047   void SetYRot(const G4double angle) { hcalBoxRotationAngle_z = angle * rad; }
0048   void SetZRot(const G4double angle) { hcalBoxRotationAngle_y = angle * rad; }
0049   void SetActive(const int i = 1) { active = i; }
0050   void SetAbsorberActive(const int i = 1) { absorberactive = i; }
0051   int IsActive() const { return active; }
0052   void SuperDetector(const std::string& name) { superdetector = name; }
0053   const std::string SuperDetector() const { return superdetector; }
0054   int get_Layer() const { return layer; }
0055 
0056   void BlackHole(const int i = 1) { blackhole = i; }
0057   int IsBlackHole() const { return blackhole; }
0058 
0059   // These functions are copied from our standalone simulation
0060   void SetMaterial(G4String);
0061   void SetOuterHcalDPhi(G4double);
0062   void SetInnerHcalDPhi(G4double);
0063   void SetOuterPlateTiltAngle(G4double);
0064   void SetInnerPlateTiltAngle(G4double);
0065   void UpdateGeometry();
0066 
0067  private:
0068   void CalculateGeometry();
0069 
0070   G4int nScint360;
0071   G4int nHcal1Layers;
0072   G4int nHcal2Layers;
0073 
0074   G4double hcal2ScintSizeX, hcal2ScintSizeY, hcal2ScintSizeZ;
0075   G4double hcal1ScintSizeX, hcal1ScintSizeY, hcal1ScintSizeZ;
0076   G4double hcal1TiltAngle;
0077   G4double hcal2TiltAngle;
0078   G4double hcal1DPhi;
0079   G4double hcal2DPhi;
0080 
0081   G4double hcal1RadiusIn;
0082   G4double hcal2RadiusIn;
0083   G4double hcalBoxSizeX, hcalBoxSizeY, hcalBoxSizeZ, hcalBoxRotationAngle_z, hcalBoxRotationAngle_y;
0084 
0085   G4double hcal2Abs_dxa, hcal2Abs_dxb;
0086   G4double hcal2Abs_dya, hcal2Abs_dyb;
0087   G4double hcal2Abs_dz;
0088 
0089   G4double hcal1Abs_dxa, hcal1Abs_dxb;
0090   G4double hcal1Abs_dya, hcal1Abs_dyb;
0091   G4double hcal1Abs_dz;
0092 
0093   G4double hcalJunctionSizeX, hcalJunctionSizeY, hcalJunctionSizeZ;
0094 
0095   G4VPhysicalVolume* physiWorld;
0096   G4LogicalVolume* logicWorld;
0097 
0098   G4LogicalVolume* logicHcalBox;
0099   G4Box* solidHcalBox;
0100   G4PVPlacement* physiHcalBox;
0101 
0102   G4LogicalVolume *logicHcal2ScintLayer, *logicHcal1ScintLayer;
0103   G4LogicalVolume *logicHcal2AbsLayer, *logicHcal1AbsLayer;
0104 
0105   G4Material *world_mat, *steel, *scint_mat;
0106 
0107   void DefineMaterials();
0108   G4VPhysicalVolume* ConstructDetector();
0109 
0110   void SetTiltViaNcross(const int ncross);
0111 
0112   PHG4HcalPrototypeDetectorMessenger* fDetectorMessenger;
0113 
0114   int active;
0115   int absorberactive;
0116   int layer;
0117   int blackhole;
0118   std::string detector_type;
0119   std::string superdetector;
0120 };
0121 
0122 #endif