File indexing completed on 2025-08-05 08:18:12
0001
0002
0003 #ifndef PHG4MICROMEGASDETECTOR_H
0004 #define PHG4MICROMEGASDETECTOR_H
0005
0006
0007
0008
0009
0010
0011 #include <g4main/PHG4Detector.h>
0012 #include <micromegas/MicromegasDefs.h>
0013 #include <micromegas/MicromegasTile.h>
0014
0015 #include <map>
0016 #include <set>
0017 #include <string>
0018
0019 class G4LogicalVolume;
0020 class G4VPhysicalVolume;
0021 class PHCompositeNode;
0022 class PHG4MicromegasDisplayAction;
0023 class PHG4Subsystem;
0024 class PHParameters;
0025
0026 class PHG4MicromegasDetector : public PHG4Detector
0027 {
0028 public:
0029
0030 PHG4MicromegasDetector(PHG4Subsystem*, PHCompositeNode*, PHParameters*, const std::string&);
0031
0032
0033 void ConstructMe(G4LogicalVolume*) override;
0034
0035 void Print(const std::string& what = "ALL") const override;
0036
0037
0038 void set_first_layer(int layer) { m_FirstLayer = layer; }
0039
0040
0041 int get_first_layer() const { return m_FirstLayer; }
0042
0043
0044 int IsInDetector(G4VPhysicalVolume*) const;
0045
0046
0047 int get_layer(G4VPhysicalVolume*) const;
0048
0049
0050 int get_tileid(G4VPhysicalVolume*) const;
0051
0052
0053 void SuperDetector(const std::string& name) { m_SuperDetector = name; }
0054
0055
0056 const std::string &SuperDetector() const { return m_SuperDetector; }
0057
0058
0059 PHG4MicromegasDisplayAction* GetDisplayAction() { return m_DisplayAction; }
0060
0061 private:
0062
0063
0064 void setup_tiles();
0065
0066
0067 void create_materials() const;
0068
0069
0070 void construct_micromegas(G4LogicalVolume*);
0071
0072
0073
0074 G4LogicalVolume* construct_micromegas_tile(int tileid, MicromegasDefs::SegmentationType);
0075
0076
0077 G4LogicalVolume* construct_fee_board(int id);
0078
0079
0080
0081 void add_geometry_node();
0082
0083
0084 PHG4MicromegasDisplayAction* m_DisplayAction{nullptr};
0085
0086
0087 PHParameters* m_Params{nullptr};
0088
0089
0090
0091 int m_FirstLayer{0};
0092
0093
0094 bool m_ActiveFlag{false};
0095
0096
0097 bool m_SupportActiveFlag{false};
0098
0099
0100
0101 std::map<int, double> m_layer_radius;
0102
0103
0104
0105 std::map<int, double> m_layer_thickness;
0106
0107
0108
0109 std::map<G4VPhysicalVolume*, int> m_activeVolumes;
0110
0111
0112
0113 std::map<G4VPhysicalVolume*, int> m_tiles_map;
0114
0115
0116 std::set<G4VPhysicalVolume*> m_passiveVolumes;
0117
0118
0119 std::string m_SuperDetector;
0120
0121
0122 MicromegasTile::List m_tiles;
0123 };
0124
0125 #endif