6 #include <Geant4/G4Colour.hh>
7 #include <Geant4/G4LogicalVolume.hh>
8 #include <Geant4/G4Material.hh>
9 #include <Geant4/G4String.hh>
10 #include <Geant4/G4VisAttributes.hh>
26 if (!detailed) std::cout <<
"PHG4TTLDisplayAction::disabled detailed view of towers" << std::endl;
43 G4LogicalVolume *logvol =
it.first;
44 if (logvol->GetVisAttributes())
48 G4VisAttributes *visatt =
new G4VisAttributes();
49 visatt->SetVisibility(
true);
50 visatt->SetForceSolid(
true);
52 if (
it.second ==
"TTLDetector")
57 else if (
it.second ==
"TTLLayers")
62 if (
it.first->GetMaterial()->GetName() ==
"CarbonFiberSupport"){
63 visatt->SetVisibility(
false);
64 visatt->SetColour(G4Colour(4 * 21. / 255, 4 * 27. / 255, 4 * 31. / 255));
66 if (
it.first->GetMaterial()->GetName() ==
"G4_Al"){
67 visatt->SetVisibility(
false);
68 visatt->SetColour(G4Colour(132. / 255, 135. / 255, 137. / 255));
70 if (
it.first->GetMaterial()->GetName() ==
"G4_GRAPHITE"){
71 visatt->SetVisibility(
false);
72 visatt->SetColour(G4Colour(2 * 21. / 255, 2 * 27. / 255, 2 * 31. / 255));
74 if (
it.first->GetMaterial()->GetName() ==
"AluminiumNitrate"){
75 visatt->SetVisibility(
false);
76 visatt->SetColour(G4Colour(0.8 * 138, 0.8 * 115, 0.8 * 115));
78 if (
it.first->GetMaterial()->GetName() ==
"G4_PLEXIGLASS"){
79 visatt->SetVisibility(
false);
80 visatt->SetColour(G4Colour(68, 131, 157));
83 else if (
it.second ==
"SHLayers")
87 if (
it.first->GetMaterial()->GetName() ==
"G4_GRAPHITE") visatt->SetColour(G4Colour(2 * 21. / 255, 2 * 27. / 255, 2 * 31. / 255));
88 if (
it.first->GetMaterial()->GetName() ==
"G4_POLYSTYRENE") visatt->SetColour(G4Colour(193, 89, 0));
90 else if (
it.second ==
"Support")
93 visatt->SetColour(G4Colour::Gray());
95 visatt->SetForceSolid(
true);
98 else if (
it.second ==
"StripBox")
100 visatt->SetColour(G4Colour::Blue());
102 visatt->SetForceWireframe(
true);
103 visatt->SetVisibility(
false);
105 else if (
it.second ==
"Cooling_tube")
107 visatt->SetColour(G4Colour(0.7, 0.7, 0.7));
108 visatt->SetForceSolid(
true);
113 else if (
it.second ==
"CoolingPlate")
115 visatt->SetColour(G4Colour(132. / 255, 135. / 255, 137. / 255));
116 visatt->SetForceSolid(
true);
119 else if (
it.second ==
"Epoxy")
121 visatt->SetColour(G4Colour(G4Colour::White()));
122 visatt->SetForceSolid(
true);
125 else if (
it.second ==
"SensorStack" ||
it.second ==
"SensorLadder" ||
it.second ==
"SensorAndReadoutLadder")
127 visatt->SetVisibility(
false);
128 visatt->SetColour(G4Colour(G4Colour::Green()));
129 visatt->SetForceWireframe(
true);
131 else if (
it.second ==
"SHLadder" ||
it.second ==
"SHStack")
133 visatt->SetVisibility(
false);
134 visatt->SetColour(G4Colour(G4Colour::Green()));
135 visatt->SetForceWireframe(
true);
137 else if (
it.second ==
"ModuleEnvelope")
139 visatt->SetVisibility(
false);
140 visatt->SetColour(G4Colour::Red());
142 visatt->SetForceWireframe(
true);
144 else if (
it.second ==
"FullEnvelope")
146 visatt->SetVisibility(
false);
147 visatt->SetColour(G4Colour::Red());
149 visatt->SetForceWireframe(
true);
152 else if (
it.second ==
"Water_cooling")
154 visatt->SetColour(G4Colour(0.823, 0.992, 0.980));
155 visatt->SetForceSolid(
true);
158 else if (
it.second ==
"Cooling_Support" ||
it.second ==
"Carbon_Support")
161 visatt->SetColour(G4Colour(4 * 21. / 255, 4 * 27. / 255, 4 * 31. / 255));
162 visatt->SetForceSolid(
true);
165 else if (
it.second ==
"StripCoolingSupportBox")
167 visatt->SetColour(G4Colour::Green());
169 visatt->SetForceWireframe(
true);
170 visatt->SetVisibility(
false);
172 else if (
it.second ==
"Module_Mother")
174 visatt->SetVisibility(
false);
176 else if (
it.second ==
"DetectorBox")
182 visatt->SetColour(G4Colour::Red());
183 visatt->SetForceWireframe(
true);
184 visatt->SetVisibility(
false);
185 visatt->SetForceLineSegmentsPerCircle(50);
192 else if (
it.second ==
"DetectorBoxFwd")
195 visatt->SetColour(G4Colour::Red());
196 visatt->SetForceWireframe(
true);
197 visatt->SetVisibility(
true);
198 visatt->SetForceLineSegmentsPerCircle(50);
207 std::cout <<
"unknown logical volume " <<
it.second << std::endl;
210 logvol->SetVisAttributes(visatt);