ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EICG4LumiDetector.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EICG4LumiDetector.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef EICG4LUMIDETECTOR_H
4 #define EICG4LUMIDETECTOR_H
5 
6 #include <g4main/PHG4Detector.h>
7 
8 #include <phool/recoConsts.h> //For rc WorldMaterial
9 #include <g4main/PHG4Detector.h>
10 #include <g4main/PHG4DisplayAction.h> // for PHG4DisplayAction
11 #include <Geant4/G4Color.hh>
12 #include <Geant4/G4Box.hh>
13 #include <Geant4/G4LogicalVolume.hh>
14 #include <Geant4/G4Material.hh>
15 #include <Geant4/G4PVPlacement.hh>
16 #include <Geant4/G4SubtractionSolid.hh>
17 #include <Geant4/G4SystemOfUnits.hh>
18 #include <Geant4/G4Tubs.hh>
19 #include <Geant4/G4Box.hh>
20 #include <Geant4/G4RotationMatrix.hh>
21 #include <Geant4/G4SystemOfUnits.hh>
22 #include <Geant4/G4TwoVector.hh> // for G4ThreeVector
23 #include <Geant4/G4ThreeVector.hh> // for G4ThreeVector
24 #include <Geant4/G4Transform3D.hh> // for G4Transform3D
25 #include <Geant4/G4Types.hh> // for G4double, G4int
26 #include <Geant4/G4VPhysicalVolume.hh> // for G4VPhysicalVolume
27 #include <TSystem.h>
28 #include <Geant4/G4UnionSolid.hh>
29 #include <Geant4/G4VisAttributes.hh>
30 #include <Geant4/G4UniformMagField.hh>
31 #include <Geant4/G4FieldManager.hh>
32 #include <Geant4/G4NistManager.hh>
33 
34 #include <cmath>
35 #include <iostream>
36 #include <cstdlib>
37 #include <fstream>
38 #include <sstream>
39 #include <utility>
40 #include <map> //?
41 #include <set> //?
42 #include <string> // for string
43 
44 #include <Geant4/G4CSGSolid.hh>
45 #include <Geant4/G4Trap.hh>
46 #include <Geant4/G4NistManager.hh>
47 
48 
49 class G4LogicalVolume;
50 class G4VPhysicalVolume;
51 class PHCompositeNode;
52 class PHG4Subsystem;
53 class PHParameters;
54 
56 {
57  public:
59  EICG4LumiDetector(PHG4Subsystem *subsys, PHCompositeNode *Node, PHParameters *parameters, const std::string &dnam, const int layer =0);
60 
62  virtual ~EICG4LumiDetector() override {}
63 
65  void ConstructMe(G4LogicalVolume *world) override;
66 
67  void Print(const std::string &what = "ALL") const override;
68 
70 
71  int IsInDetector(G4VPhysicalVolume *) const;
73 
75 
76  int GetDetId(G4VPhysicalVolume *) const;
77 
78  void SuperDetector(const std::string &name) { m_SuperDetector = name; }
79  const std::string SuperDetector() const { return m_SuperDetector; }
80  int get_Layer() const { return m_Layer; }
81 
82  void AddLumiWindow(G4ThreeVector size, G4ThreeVector pos, double angle, std::string material, G4LogicalVolume *logicWorld);
83 
84  G4ThreeVector AddLumiExitWindow(G4ThreeVector size, G4ThreeVector pos, double factor, double angle, std::string material, G4LogicalVolume *logicWorld);
85 
86  void AddLumiMag_OuterVessel( G4ThreeVector size, G4ThreeVector pos, std::string material, G4LogicalVolume *logicWorld);
87 
88  void AddLumiMag_MagCore(G4ThreeVector size, G4ThreeVector pos, double Bx, std::string material, G4LogicalVolume *logicWorld);
89 
90  void AddTriangularTrapezoid(G4ThreeVector size, G4ThreeVector pos, double angle, std::string material, G4LogicalVolume *logicWorld);
91 
92  void AddCuboid(G4ThreeVector Wsize, G4ThreeVector Wpos, G4ThreeVector Msize, G4ThreeVector Mpos, double angle, std::string material, G4LogicalVolume *logicWorld);
93 
94  G4LogicalVolume* AddRecCone(G4ThreeVector Wsize, G4ThreeVector Wpos, G4ThreeVector Msize, G4ThreeVector Mpos, G4ThreeVector Tr2size, G4ThreeVector Tr2pos, double angle, std::string material, G4LogicalVolume *logicWorld);
95 
96  void AddExitWindowForV2(G4ThreeVector size, G4ThreeVector pos_daug, double angle, std::string material, G4LogicalVolume *logicRecCone);
97 
98  void AddLumiTracker( std::string name, int copyNum, G4ThreeVector size, G4ThreeVector pos, G4LogicalVolume *logicRecCone);
99 
100  void AddCAL( std::string name, G4ThreeVector size, G4ThreeVector pos, int total_tower, G4LogicalVolume *logicWorld );
101 
102  G4LogicalVolume* MakeTower(G4double calorSizeXY, G4double calorEMZ);
103 
104  void AddExitWindowForV3(G4ThreeVector Wsize, G4ThreeVector Wpos, G4ThreeVector Tr2size, G4ThreeVector Tr2pos, std::string material, G4LogicalVolume *logicWorld);
105 
107 
108  private:
109 
111 
112  // active volumes (e.g. G4_Si)
113  std::set<G4VPhysicalVolume *> m_ActivePhysicalVolumesSet;
114  // virtual volumes (e.g. G4_Galactic)
115  std::map<G4VPhysicalVolume *, int> m_VirtualPhysicalVolumesMap;
116  // passive volumes
117  std::set<G4VPhysicalVolume *> m_PassivePhysicalVolumesSet;
118 
119  int m_Layer;
120  std::string m_SuperDetector;
121 
122  std::string m_Name;
123 
124 };
125 
126 #endif // EICG4LUMIDETECTOR_H