Skip to content

Commit 2b61457

Browse files
committed
Updates to fix Vac
1 parent e12068a commit 2b61457

14 files changed

+82
-45
lines changed

CMake.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136

137137
elsif ($mainProg eq "fullBuild")
138138
{
139-
my @fullBuild = qw( t2Build ralBuild );
139+
my @fullBuild = qw( t2Build ralBuild ralVar);
140140
push(@fullBuild,@mainLib);
141141
$gM->addDepUnit("fullBuild", [@fullBuild]),
142142
}

Model/ralBuild/BlockShutter.cxx

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ BlockShutter::populate(const FuncDataBase& Control)
115115
colletFGap=Control.EvalVar<double>(blockKey+"ColletFGap");
116116
colletMat=ModelSupport::EvalMat<int>(Control,blockKey+"ColletMat");
117117

118-
119118
return;
120119
}
121120

Model/ralBuild/GeneralShutter.cxx

+4-4
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ GeneralShutter::applyRotations()
295295

296296
attachSystem::FixedComp& mainFC=FixedGroup::getKey("Main");
297297
attachSystem::FixedComp& beamFC=FixedGroup::getKey("Beam");
298-
298+
299+
ELog::EM<<"P = "<<keyName<<" == "<<ZOffset<<ELog::endDiag;
299300
// Now do rotation:
300301

301302
mainFC.setCentre(Y*voidXoffset);
@@ -315,6 +316,7 @@ GeneralShutter::applyRotations()
315316
// [close == 3: close imp =-1]
316317

317318
targetPt=Origin+XYAxis*outerRadius;
319+
318320
frontPt=Origin+XYAxis*innerRadius+Z*openZShift;
319321
endPt=frontPt+XYAxis*(outerRadius-innerRadius);
320322

@@ -366,18 +368,17 @@ GeneralShutter::createSurfaces()
366368
*/
367369
{
368370
ELog::RegMethod RegA("GeneralShutter","createSurfaces");
371+
ELog::EM<<"START = "<<keyName<<ELog::endDiag;
369372

370373
// Divide:
371374
// ModelSupport::buildPlane(SMap,buildIndex+10,Origin,Y);
372-
373375
// Fixed Steel
374376
ModelSupport::buildPlane(SMap,buildIndex+5,
375377
Origin+Z*(totalHeight-upperSteel),Z);
376378

377379
// Top blade [NOTE : BeamAxis]
378380
ModelSupport::buildPlane(SMap,buildIndex+15,
379381
frontPt+Z*shutterHeight,Z);
380-
381382
// Inner cut [on flightline]
382383
ModelSupport::buildPlane(SMap,buildIndex+25,
383384
frontPt+Z*(voidZOffset+voidHeight/2.0+centZOffset),zSlope);
@@ -404,7 +405,6 @@ GeneralShutter::createSurfaces()
404405
// Outer cut [on flightline]
405406
ModelSupport::buildPlane(SMap,buildIndex+225,
406407
frontPt+Z*(voidZOffset+voidHeightOuter/2.0+centZOffset),zSlope);
407-
408408
// Outer cut [on flightline]
409409
ModelSupport::buildPlane(SMap,buildIndex+226,
410410
frontPt-Z*(-voidZOffset+voidHeightOuter/2.0-centZOffset),zSlope);

Model/ralBuildInc/GeneralShutter.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class GeneralShutter :
108108
int lowerCell; ///< Block that stops the beam
109109
int innerVoidCell; ///< inner void cell
110110

111-
double ZOffset;
111+
double ZOffset; ///< Working ZOffset
112112
//--------------
113113
// FUNCTIONS:
114114
//--------------
@@ -123,7 +123,6 @@ class GeneralShutter :
123123
void createBlocks(Simulation&);
124124
void createLinks();
125125
void applyRotations();
126-
127126

128127
public:
129128

@@ -164,7 +163,7 @@ class GeneralShutter :
164163
virtual int exitWindow(const double,std::vector<int>&,
165164
Geometry::Vec3D&) const;
166165

167-
void setZOffset(const double D) { ZOffset=D; }
166+
void setZOffset(const double D) { ZOffset=D; ELog::EM<<"ERROR "<<keyName<<ELog::endErr;}
168167
void createAll(Simulation&,const attachSystem::FixedComp&,
169168
const long int sideIndex);
170169

Model/t1Build/t1BulkShield.cxx

+3-3
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ t1BulkShield::createShutters(Simulation& System)
257257
else if (i==merlinShutter)
258258
GData.push_back(std::shared_ptr<GeneralShutter>
259259
(new BlockShutter(i,"shutter","merlinShutter")));
260-
// else if (i==s5Shutter)
261-
// GData.push_back(std::shared_ptr<GeneralShutter>
262-
// (new BlockShutter(i,"shutter","s5Shutter")));
260+
else if (i==s5Shutter)
261+
GData.push_back(std::shared_ptr<GeneralShutter>
262+
(new BlockShutter(i,"shutter","s5Shutter")));
263263
else if (i==mariShutter)
264264
GData.push_back(std::shared_ptr<GeneralShutter>
265265
(new BlockShutter(i,"shutter","mariShutter")));

Model/t2Build/BulkShield.cxx

+8-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
#include "ContainedGroup.h"
7070
#include "ExternalCut.h"
7171
#include "GeneralShutter.h"
72+
#include "BlockShutter.h"
7273
#include "BulkInsert.h"
7374
#include "Torpedo.h"
7475
#include "BulkShield.h"
@@ -260,9 +261,14 @@ BulkShield::createShutters(Simulation& System)
260261

261262
// This is ugly since it is also declared in makeZoom/makeChipIR
262263

264+
const std::vector<std::string> shutterName=
265+
{
266+
"chipIR", "T2", "T3", "T4", "T5", "T6", "T7", "T8", "T9",
267+
"Wish", "T11", "T12", "T13","T14", "T15", "T16", "T17", "T18"};
263268
ModelSupport::objectRegister& OR=
264269
ModelSupport::objectRegister::Instance();
265270

271+
266272
// const bool chipFlag(excludeSet.find("chipIR")==excludeSet.end());
267273
// const bool zoomFlag(excludeSet.find("zoom")==excludeSet.end());
268274
// const bool letFlag(excludeSet.find("LET")==excludeSet.end());
@@ -281,10 +287,10 @@ BulkShield::createShutters(Simulation& System)
281287
// (new BlockShutter(i+1,"shutter","letShutter")));
282288
// else
283289
GData.push_back(std::shared_ptr<GeneralShutter>
284-
(new GeneralShutter(i+1,"shutter")));
290+
(new BlockShutter(i+1,"shutter",shutterName[i])));
285291
OR.addObject(GData.back());
286292
}
287-
293+
ELog::EM<<"HED == "<<ELog::endDiag;
288294
// const int shutterCell=getCell("Shutter");
289295
// MonteCarlo::Object* shutterObj=System.findObject(shutterCell);
290296
// if (!shutterObj)

Model/t2Build/ReflectorAssembly.cxx

+2-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ ReflectorAssembly::createObjects(Simulation& System)
232232
(DMod->getKeyName(),"DMod to CC failed");
233233

234234
DVacObj->addInsertCell(refCell);
235-
DVacObj->buildSingle(System,*DMod,CMod->getExclude());
235+
DVacObj->setCutSurf("Internal",CMod->getOuterSurf());
236+
DVacObj->buildSingle(System,*DMod);
236237
RefObj->insertComponent(System,"FLNarrow",DVacObj->getMainRule("front"));
237238
RefObj->insertComponent(System,"FLWish",DVacObj->getMainRule("back"));
238239

Model/t2Build/TS2variables.cxx

+27
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "Code.h"
4141
#include "varList.h"
4242
#include "FuncDataBase.h"
43+
#include "BlockShutterGenerator.h"
4344

4445
namespace setVariable
4546
{
@@ -770,6 +771,32 @@ TS2layout(FuncDataBase& Control)
770771
Control.addVariable("shutterBlock1Mat2","Aluminium");
771772
Control.addVariable("shutterBlock1Mat3","B-Poly");
772773

774+
// SHUTTERS COLLIMATION:
775+
776+
BlockShutterGenerator BSGen;
777+
778+
// x/z step : x/zAngle : beamSize : beam change angle (+ve is focused)
779+
// BSGen.generateCyl(Control,"sandals",-1.6,0.0, -1.6,0.0, 7.3309,0.3595 );
780+
BSGen.generateBox(Control,"chipIR",-1.6,0.0, -1.6, 0.0, 6.17,8.61, 0.35,0.47); // USE ABOVE
781+
BSGen.generateBox(Control,"T2", -1.7,0.0, 0.0,0.0, 6.17,8.61, 0.35,0.47);
782+
BSGen.generateBox(Control,"T3", 2.2,0.0, 2.0,-1.5, 6.74,4.8, 0.05,0.44);
783+
BSGen.generateBox(Control,"T4", 2.2,0.0, 2.2,-1.5, 7.91,4.57, 0.22,0.275);
784+
BSGen.generateBox(Control,"T5", 2.2,0.0, 0.0,0.0, 7.9, 7.9, 0.395,0.395);
785+
BSGen.generateBox(Control,"T6", 2.0,0.0, 0.0,0.0, 6.79,6.79, 0.0,0.0);
786+
BSGen.generateBox(Control,"nimrod",-1.7,0.0, 0.0,0.0, 8.22,7.93, 0.35,0.22);
787+
BSGen.generateBox(Control,"T8", -1.5,0.0, 0.0,0.0, 8.4,8.0, 0.16,0.088);
788+
BSGen.generateBox(Control,"T9", -1.3,0.0, -0.6,0.0, 7.90,7.90, 0.63,0.63);
789+
BSGen.generateBox(Control,"zoom", 1.3,0.0, 0.0,0.0, 7.34,7.34, 0.22,0.22);
790+
BSGen.generateBox(Control,"sans2d", 1.7,0.0, 0.0,0.0, 7.38,7.38, 0.58,0.58);
791+
BSGen.generateBox(Control,"T12", 2.0,0.0, 2.0,0.0, 8.88,8.88, 0.58,0.58);
792+
BSGen.generateBox(Control,"polref", -2.2,0.0, -1.0,0.0, 9.4,9.4, 0.0,0.0);
793+
BSGen.generateBox(Control,"offspec", 0.0,0.0, 0.0,0.0, 7.0,7.0, 0.0,0.0); // CLOSED
794+
BSGen.generateBox(Control,"T15", 2.0,0.0, 0.7,0.0, 7.74,7.74, 0.48,0.48);
795+
BSGen.generateBox(Control,"T16", 1.4,0.0, 0.0,0.0, 7.4,8.6, 0.115,0.172);
796+
BSGen.generateBox(Control,"T17", 1.4,0.0, 0.0,0.0, 7.4,8.6, 0.115,0.172);
797+
BSGen.generateBox(Control,"wish", 1.5,0.0, 1.5,0.0, 8.0,6.0, 0.143,0.0);
798+
799+
773800
// BULK INSERT
774801
Control.addVariable("bulkInsertIHeight",56.25);
775802
Control.addVariable("bulkInsertIWidth",32.50);

Model/t2Build/VacVessel.cxx

+21-20
Original file line numberDiff line numberDiff line change
@@ -335,43 +335,45 @@ VacVessel::createSurfaces()
335335
}
336336

337337
void
338-
VacVessel::createObjects(Simulation& System,const std::string& Exclude)
338+
VacVessel::createObjects(Simulation& System)
339339
/*!
340340
Adds the Chip guide components
341341
\param System :: Simulation to create objects in
342342
\param Exclude :: ContainedObject exclude string
343343
*/
344344
{
345345
ELog::RegMethod RegA("VacVessel","createObjects");
346+
347+
HeadRule HR;
348+
349+
const HeadRule excludeHR=getRule("Internal");
346350

347-
std::string Out;
348-
Out=ModelSupport::getComposite(SMap,buildIndex,"-41 -42 43 -44 45 -46");
349-
addOuterSurf(Out);
351+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"-41 -42 43 -44 45 -46");
352+
addOuterSurf(HR);
350353

351354
// Inner
352-
Out=ModelSupport::getComposite(SMap,buildIndex,"-1 -2 3 -4 5 -6");
353-
Out+=" "+Exclude;
354-
System.addCell(MonteCarlo::Object(cellIndex++,0,0.0,Out));
355+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"-1 -2 3 -4 5 -6");
356+
System.addCell(cellIndex++,0,0.0,HR*excludeHR);
355357

356358
// First Al layer
357-
Out=ModelSupport::getComposite(SMap,buildIndex,"-11 -12 13 -14 15 -16 "
359+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"-11 -12 13 -14 15 -16 "
358360
" (1:2:-3:4:-5:6) ");
359-
System.addCell(MonteCarlo::Object(cellIndex++,alMat,0.0,Out));
361+
System.addCell(cellIndex++,alMat,0.0,HR);
360362

361363
// Tertiay layer
362-
Out=ModelSupport::getComposite(SMap,buildIndex,"-21 -22 23 -24 25 -26 "
364+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"-21 -22 23 -24 25 -26 "
363365
" (11:12:-13:14:-15:16) ");
364-
System.addCell(MonteCarlo::Object(cellIndex++,0,0.0,Out));
366+
System.addCell(cellIndex++,0,0.0,HR);
365367

366368
// Tertiay layer
367-
Out=ModelSupport::getComposite(SMap,buildIndex,"-31 -32 33 -34 35 -36 "
369+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"-31 -32 33 -34 35 -36 "
368370
" (21:22:-23:24:-25:26) ");
369-
System.addCell(MonteCarlo::Object(cellIndex++,outMat,0.0,Out));
371+
System.addCell(cellIndex++,outMat,0.0,HR);
370372

371373
// Outer clearance
372-
Out=ModelSupport::getComposite(SMap,buildIndex,"-41 -42 43 -44 45 -46 "
374+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"-41 -42 43 -44 45 -46 "
373375
" (31:32:-33:34:-35:36) ");
374-
System.addCell(MonteCarlo::Object(cellIndex++,0,0.0,Out));
376+
System.addCell(cellIndex++,0,0.0,HR);
375377

376378
return;
377379
}
@@ -502,7 +504,7 @@ VacVessel::buildPair(Simulation& System,const Groove& GMod,
502504
createUnitVector(GMod,0);
503505
createBoundary(GMod,HMod);
504506
createSurfaces();
505-
createObjects(System,GMod.getExclude()+" "+HMod.getExclude());
507+
createObjects(System); //GMod.getExclude()+" "+HMod.getExclude());
506508
createLinks();
507509
insertObjects(System);
508510

@@ -526,13 +528,12 @@ VacVessel::buildPair(Simulation& System,const Groove& GMod,
526528

527529
void
528530
VacVessel::buildSingle(Simulation& System,
529-
const attachSystem::FixedComp& AFC,
530-
const std::string& exclude)
531+
const attachSystem::FixedComp& AFC)
531532

532533
/*!
533534
Global creation of the vac-vessel
534535
\param System :: Simulation to add vessel to
535-
\param FC :: Previously build moderator
536+
\param AFC :: Previously build moderator
536537
\param CC :: Container to wrap
537538
*/
538539
{
@@ -542,7 +543,7 @@ VacVessel::buildSingle(Simulation& System,
542543
createUnitVector(AFC,0); // fixed
543544
createBoundary(AFC);
544545
createSurfaces();
545-
createObjects(System,exclude); // CC.getExclude()
546+
createObjects(System);
546547
createLinks();
547548
insertObjects(System);
548549

Model/t2Build/makeTS2.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*********************************************************************
22
CombLayer : MCNP(X) Input builder
33
4-
* File: moderator/makeTS2.cxx
4+
* File: t2Build/makeTS2.cxx
55
*
66
* Copyright (c) 2004-2022 by Stuart Ansell
77
*

Model/t2BuildInc/BulkShield.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ namespace shutterSystem
4343
\brief Specialized for for the BulkShield
4444
*/
4545

46-
class BulkShield : public attachSystem::FixedComp,
47-
public attachSystem::ContainedComp,
48-
public attachSystem::CellMap,
49-
public attachSystem::ExternalCut
46+
class BulkShield :
47+
public attachSystem::FixedComp,
48+
public attachSystem::ContainedComp,
49+
public attachSystem::CellMap,
50+
public attachSystem::ExternalCut
5051
{
5152
private:
5253

Model/t2BuildInc/VacVessel.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class VacVessel :
9595
const attachSystem::FixedComp&);
9696
void createSurfaces();
9797
void createLinks();
98-
void createObjects(Simulation&,const std::string&);
98+
void createObjects(Simulation&);
9999

100100
Geometry::Vec3D getDirection(const size_t) const;
101101

@@ -111,8 +111,8 @@ class VacVessel :
111111
int getDivideSurf() const { return divideSurf; }
112112

113113
void buildPair(Simulation&,const Groove&,const Hydrogen&);
114-
void buildSingle(Simulation&, const attachSystem::FixedComp&,
115-
const std::string&);
114+
void buildSingle(Simulation&, const attachSystem::FixedComp&);
115+
116116

117117

118118

add.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use strict;
33
my $text=
44
'*
5-
* Copyright (c) 2004-2014 by Stuart Ansell
5+
* Copyright (c) 2004-2022 by Stuart Ansell
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

beamline/PlateUnit.cxx

+4-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ PlateUnit::~PlateUnit()
122122
/*!
123123
Destructor
124124
*/
125-
{}
125+
{
126+
delete frontCV;
127+
delete backCV;
128+
}
126129

127130
PlateUnit*
128131
PlateUnit::clone() const

0 commit comments

Comments
 (0)