11 #include "TObjArray.h"
13 #include "TGeoVolume.h"
14 #include "TGeoMatrix.h"
15 #include "TGeoManager.h"
16 #include "TGeoCompositeShape.h"
40 if (fileName.EndsWith(
".root")) {
41 std::cout<<
"<I> PndPipe - Using geometry " << fileName <<std::endl;
43 }
else if (fileName.EndsWith(
".geo")) {
44 std::cout<<
"<I> PndPipe - Using geometry " << fileName <<std::endl;
47 std::cout<<
"<I> PndPipe - Using default geometry" <<std::endl;
67 Double_t parPipeLeft[9] = { 0., 360., 2,
72 Double_t parPipeCentral[12] = { 0., 360., 3,
77 Double_t parPipeRight[18] = { 0., 360., 5,
84 Double_t parPipeVacuumLeft[9] = { 0., 360., 2,
88 Double_t parPipeVacuumCentral[12] = { 0., 360., 3,
93 Double_t parPipeVacuumRight[18] = { 0., 360., 5,
101 Double_t parPipeTargetDown[27] = { 0., 360., 8,
111 Double_t parPipeTargetCentral[9] = { 0., 360., 2,
115 Double_t parPipeTargetUp[27] = { 0., 360., 8,
125 Double_t parPipeVacuumTargetDown[27] = { 0., 360., 8,
135 Double_t parPipeVacuumTargetCentral[9] = { 0., 360., 2,
139 Double_t parPipeVacuumTargetUp[27] = { 0., 360., 8,
149 TGeoPcon *pipeLeft =
new TGeoPcon(parPipeLeft);
150 TGeoPcon *pipeCentral =
new TGeoPcon(parPipeCentral);pipeCentral->SetName(
"PIPE_CN");
151 TGeoPcon *pipeRight =
new TGeoPcon(parPipeRight);
152 TGeoPcon *pipeTargetDown =
new TGeoPcon(parPipeTargetDown);
153 TGeoPcon *pipeTargetCentral =
new TGeoPcon(parPipeTargetCentral); pipeTargetCentral->SetName(
"TRG_CN");
154 TGeoPcon *pipeTargetUp =
new TGeoPcon(parPipeTargetUp);
156 TGeoPcon *pipeVacuumLeft =
new TGeoPcon(parPipeVacuumLeft);
157 TGeoPcon *pipeVacuumCentral =
new TGeoPcon(parPipeVacuumCentral); pipeVacuumCentral->SetName(
"PIPEV_CN");
158 TGeoPcon *pipeVacuumRight =
new TGeoPcon(parPipeVacuumRight);
159 TGeoPcon *pipeVacuumTargetDown =
new TGeoPcon(parPipeVacuumTargetDown);
160 TGeoPcon *pipeVacuumTargetCentral =
new TGeoPcon(parPipeVacuumTargetCentral); pipeVacuumTargetCentral->SetName(
"TRGV_CN");
161 TGeoPcon *pipeVacuumTargetUp =
new TGeoPcon(parPipeVacuumTargetUp);
163 TGeoRotation *
r1 =
new TGeoRotation(
"r1");
165 r1->RegisterYourself();
167 TGeoCompositeShape *pipeCross =
new TGeoCompositeShape(
"pipeCross",
"(PIPE_CN+TRG_CN:r1) - (PIPEV_CN+TRGV_CN:r1)");
168 TGeoCompositeShape *pipeVacuumCross =
new TGeoCompositeShape(
"pipeVacuumCross",
"PIPEV_CN+TRGV_CN:r1");
171 TGeoVolume *volPipeLeft =
new TGeoVolume(
"PipeLeft", pipeLeft, gGeoManager->GetMedium(
"steel"));
172 TGeoVolume *volPipeCross =
new TGeoVolume(
"PipeCross", pipeCross, gGeoManager->GetMedium(
"Al+Be"));
173 TGeoVolume *volPipeRight =
new TGeoVolume(
"PipeRight", pipeRight, gGeoManager->GetMedium(
"steel"));
174 TGeoVolume *volPipeTargetUp =
new TGeoVolume(
"PipeTargetUp", pipeTargetUp, gGeoManager->GetMedium(
"steel"));
175 TGeoVolume *volPipeTargetDown =
new TGeoVolume(
"PipeTargetDown", pipeTargetDown, gGeoManager->GetMedium(
"steel"));
177 TGeoVolume *volPipeVacuumLeft =
new TGeoVolume(
"PipeVacuumLeft", pipeVacuumLeft, gGeoManager->GetMedium(
"vacuum"));
178 TGeoVolume *volPipeVacuumCross =
new TGeoVolume(
"PipeVacuumCross", pipeVacuumCross, gGeoManager->GetMedium(
"vacuum"));
179 TGeoVolume *volPipeVacuumRight =
new TGeoVolume(
"PipeVacuumRight", pipeVacuumRight, gGeoManager->GetMedium(
"vacuum"));
180 TGeoVolume *volPipeVacuumTargetUp =
new TGeoVolume(
"PipeVacuumTargetUp", pipeVacuumTargetUp, gGeoManager->GetMedium(
"vacuum"));
181 TGeoVolume *volPipeVacuumTargetDown =
new TGeoVolume(
"PipeVacuumTargetDown", pipeVacuumTargetDown, gGeoManager->GetMedium(
"vacuum"));
186 TGeoVolume *beamPipe =
new TGeoVolumeAssembly(
"BeamPipe");
187 beamPipe->AddNode(volPipeLeft, 0);
188 beamPipe->AddNode(volPipeRight, 0);
189 beamPipe->AddNode(volPipeVacuumLeft, 0);
190 beamPipe->AddNode(volPipeVacuumRight, 0);
191 beamPipe->AddNode(volPipeTargetUp, 0,
new TGeoRotation(rot));
192 beamPipe->AddNode(volPipeTargetDown, 0,
new TGeoRotation(rot));
193 beamPipe->AddNode(volPipeVacuumTargetUp, 0,
new TGeoRotation(rot));
194 beamPipe->AddNode(volPipeVacuumTargetDown, 0,
new TGeoRotation(rot));
195 beamPipe->AddNode(volPipeCross, 0);
196 beamPipe->AddNode(volPipeVacuumCross, 0);
198 TGeoVolume *cave = gGeoManager->GetTopVolume();
199 cave->AddNode(beamPipe, 1);