EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4FPbScDetector.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4FPbScDetector.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4DETECTORS_PHG4FPBSCDETECTOR_H
4 #define G4DETECTORS_PHG4FPBSCDETECTOR_H
5 
6 #include "g4main/PHG4Detector.h"
7 
8 #include <Geant4/G4Region.hh>
9 #include <Geant4/G4String.hh> // for G4String
10 #include <Geant4/G4SystemOfUnits.hh>
11 #include <Geant4/G4Types.hh>
12 
13 #include <cstddef> // for size_t
14 #include <map>
15 #include <string> // for string
16 
17 class G4Material;
18 class G4Box;
19 class G4LogicalVolume;
20 class G4UserSteppingAction;
21 class G4VPhysicalVolume;
22 class PHCompositeNode;
23 class PHG4Subsystem;
24 
26 {
27  public:
28  PHG4FPbScDetector(PHG4Subsystem* subsys, PHCompositeNode* Node, const std::string& nam);
29 
30  virtual ~PHG4FPbScDetector(void) {}
31 
32  virtual void ConstructMe(G4LogicalVolume* world);
33 
34  virtual G4UserSteppingAction* GetSteppingAction()
35  {
36  if (_region)
37  return _region->GetRegionalSteppingAction();
38  else
39  return 0;
40  }
41 
42  bool isInScintillator(G4VPhysicalVolume* volume);
43  int getScintillatorLayer(G4VPhysicalVolume* volume);
44  // compute tower index
45  unsigned int computeIndex(unsigned int layer, G4double x, G4double y, G4double z, G4double& xcenter, G4double& ycenter, G4double& zcenter);
46  void set_Place(G4double x, G4double y, G4double z)
47  {
48  x_position = x * cm;
49  y_position = y * cm;
50  z_position = z * cm;
51  }
52 
53  private:
57  unsigned int nlayers; //, segments_per_thickness;
59  G4double layer_separation;
60 
61  G4Material* SetMaterial(G4String);
62 
63  G4Material* AbsorberMaterial;
64  G4Material* ScintillatorMaterial;
65 
66  std::map<unsigned int, G4Box*> absorber_solid_;
67  std::map<unsigned int, G4LogicalVolume*> absorber_logic_;
68  std::map<unsigned int, G4VPhysicalVolume*> absorber_physi_;
69 
70  std::map<unsigned int, G4Box*> scintillator_solid_;
71  std::map<unsigned int, G4LogicalVolume*> scintillator_logic_;
72  std::map<unsigned int, G4VPhysicalVolume*> scintillator_physi_;
73 
74  G4Region* _region;
75 };
76 
77 #endif