7 #include <Geant4/G4Colour.hh>
8 #include <Geant4/G4LogicalVolume.hh>
9 #include <Geant4/G4String.hh>
10 #include <Geant4/G4VisAttributes.hh>
35 G4Colour colour_air ( 0.0, 0.0, 0.0, 0.0 );
36 G4Colour colour_CFRP ( 0.4, 0.4, 0.4, 1 );
37 G4Colour colour_endcap ( 0.0, 0.0, 1.0, 0.2 );
38 G4Colour colour_endcap_Al ( 0.3, 0.0, 1.0, 0.4);
39 G4Colour colour_endcap_C ( 0.4, 0.4, 0.4, 0.4 );
40 G4Colour colour_copper ( 0.7, 0.4, 0, 1 );
44 G4LogicalVolume *logvol =
it.first;
45 if (logvol->GetVisAttributes())
50 G4VisAttributes *visatt =
new G4VisAttributes();
51 visatt->SetVisibility(
true);
52 visatt->SetForceSolid(
true);
55 if (
it.second ==
"FPHX")
57 visatt->SetColour( G4Colour(1.0, 0.843, 0.0, 0.5) );
58 visatt->SetVisibility(
true );
61 else if (
it.second ==
"Ladder"
62 ||
it.second ==
"FPHXContainer"
63 ||
it.second ==
"FPHXGlueContainer"
64 ||
it.second ==
"StaveBox" )
66 visatt->SetColour( colour_air );
67 visatt->SetForceWireframe(
true );
68 visatt->SetVisibility(
false );
71 else if (
it.second ==
"Rail")
73 visatt->SetColour( G4Colour::Cyan());
75 visatt->SetVisibility(
true );
78 else if (
it.second ==
"RohaCell")
80 visatt->SetColour( G4Colour(0.9, 0.9, 0.9, 0.5) );
81 visatt->SetVisibility(
true );
84 else if (
it.second ==
"SiActive")
86 visatt->SetColour( G4Colour(1.0, 0, 0.0, 0.5) );
87 visatt->SetVisibility(
true );
90 else if (
it.second ==
"SiInActive")
92 visatt->SetColour( G4Colour(0, 0, 1, 0.5) );
93 visatt->SetVisibility(
true );
96 else if (
it.second ==
"StaveCooler")
98 visatt->SetColour( colour_CFRP );
99 visatt->SetVisibility(
true );
102 else if (
it.second ==
"StaveCurve")
104 visatt->SetColour( colour_CFRP );
105 visatt->SetVisibility(
true );
108 else if (
it.second ==
"StaveGlueBox")
110 visatt->SetColour(G4Colour::Cyan());
111 visatt->SetVisibility(
true );
114 else if (
it.second ==
"StavePipe")
116 visatt->SetColour( colour_CFRP );
117 visatt->SetVisibility(
true );
120 else if (
it.second ==
"StaveStraightInner")
122 visatt->SetColour(G4Colour::Grey());
123 visatt->SetVisibility(
true );
125 else if (
it.second ==
"StaveStraightOuter")
127 visatt->SetColour( colour_CFRP );
128 visatt->SetVisibility(
true );
131 else if (
it.second ==
"StaveWater")
133 visatt->SetColour(G4Colour::Blue());
134 visatt->SetVisibility(
true );
136 else if (
it.second.find(
"Endcap") != string::npos )
138 if(
it.second.find(
"_Al" ) != string::npos )
139 visatt->SetColour( colour_endcap_Al );
140 else if(
it.second.find(
"_C" ) != string::npos )
141 visatt->SetColour( colour_endcap_C );
143 visatt->SetColour( colour_endcap );
144 visatt->SetVisibility(
true );
146 else if(
it.second.find(
"Glue") != string::npos )
148 visatt->SetColour( G4Colour(0.1, 0.1, 0.1, 0.8) );
149 visatt->SetVisibility(
true );
152 else if(
it.second.find(
"Copper" ) != string::npos )
154 visatt->SetColour( colour_copper );
155 visatt->SetVisibility(
true );
158 else if (
it.second.find(
"Kapton") != string::npos )
160 visatt->SetColour( G4Colour(0.0, 0.590, 1.0, 0.5 ) );
161 visatt->SetVisibility(
true );
164 else if (
it.second ==
"Skin")
166 visatt->SetColour( colour_CFRP );
167 visatt->SetVisibility(
true );
172 cout <<
"did not assign color to " <<
it.first->GetName()
173 <<
" under " <<
it.second << endl;
176 logvol->SetVisAttributes(visatt);