Skip to content

Commit 47775f5

Browse files
committed
Fix of singleItems to work.
This is a fix of all the single item: They now ALL work. This can be checked with the script: CheckSingle.sh in the new directory PostCompile.
1 parent 27f57c2 commit 47775f5

File tree

12 files changed

+160
-44
lines changed

12 files changed

+160
-44
lines changed

Model/MaxIV/Linac/SPFCameraShield.cxx

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: Model/MaxIV/Linac/SPFCameraShield.cxx
55
*
6-
* Copyright (c) 2004-2021 by Konstantin Batkov
6+
* Copyright (c) 2004-2022 by Konstantin Batkov
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -67,7 +67,8 @@ namespace tdcSystem
6767
SPFCameraShield::SPFCameraShield(const std::string& Key) :
6868
attachSystem::ContainedComp(),
6969
attachSystem::FixedRotate(Key,6),
70-
attachSystem::CellMap()
70+
attachSystem::CellMap(),
71+
attachSystem::SurfMap()
7172
/*!
7273
Constructor BUT ALL variable are left unpopulated.
7374
\param Key :: Name for item in search
@@ -78,6 +79,7 @@ SPFCameraShield::SPFCameraShield(const SPFCameraShield& A) :
7879
attachSystem::ContainedComp(A),
7980
attachSystem::FixedRotate(A),
8081
attachSystem::CellMap(A),
82+
attachSystem::SurfMap(A),
8183
length(A.length),width(A.width),height(A.height),
8284
wallThick(A.wallThick),
8385
roofLength(A.roofLength),
@@ -104,6 +106,7 @@ SPFCameraShield::operator=(const SPFCameraShield& A)
104106
attachSystem::ContainedComp::operator=(A);
105107
attachSystem::FixedRotate::operator=(A);
106108
attachSystem::CellMap::operator=(A);
109+
attachSystem::SurfMap::operator=(A);
107110
length=A.length;
108111
width=A.width;
109112
height=A.height;

Model/MaxIV/LinacInc/SPFCameraShield.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: Model/MaxIV/LinacInc/SPFCameraShield.h
55
*
6-
* Copyright (c) 2004-2021 by Konstantin Batkov
6+
* Copyright (c) 2004-2022 by Konstantin Batkov
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
1616
* GNU General Public License for more details.
1717
*
1818
* You should have received a copy of the GNU General Public License
19-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*
2121
****************************************************************************/
2222
#ifndef tdcSystem_SPFCameraShield_h
@@ -35,10 +35,11 @@ namespace tdcSystem
3535
\brief SPF Chamera shield
3636
*/
3737

38-
class SPFCameraShield : public attachSystem::ContainedComp,
39-
public attachSystem::FixedRotate,
40-
public attachSystem::CellMap,
41-
public attachSystem::SurfMap
38+
class SPFCameraShield :
39+
public attachSystem::ContainedComp,
40+
public attachSystem::FixedRotate,
41+
public attachSystem::CellMap,
42+
public attachSystem::SurfMap
4243
{
4344
private:
4445

Model/MaxIV/commonBeam/SquareFMask.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ SquareFMask::createSurfaces()
189189
ModelSupport::buildCylinder(SMap,buildIndex+8,Origin,Y,flangeBInRadius);
190190
ModelSupport::buildCylinder(SMap,buildIndex+18,Origin,Y,flangeBOutRadius);
191191

192-
// Inner Structure
193-
//ModelSupport::buildPlane(SMap,buildIndex+101,MPt,Y);
194192

195193
const double AH2(innerAHeight/2.0);
196194
const double MH2(innerMinHeight/2.0);
197195
const double BH2(innerBHeight/2.0);
198196
const double AW2(innerAWidth/2.0);
199197
const double MW2(innerMinWidth/2.0);
200198
const double BW2(innerBWidth/2.0);
199+
// Inner Structure (no pipe)
200+
ModelSupport::buildPlane(SMap,buildIndex+101,MPt,Y);
201201

202202
ModelSupport::buildPlane(SMap,buildIndex+103,
203203
APt-X*AW2-Z*AH2,

Model/MaxIV/commonGenerator/YagScreenGenerator.cxx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: commonGenerator/YagScreenGenerator.cxx
55
*
6-
* Copyright (c) 2004-2021 by Konstantin Batkov
6+
* Copyright (c) 2004-2022 by Konstantin Batkov
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -66,9 +66,9 @@ YagScreenGenerator::YagScreenGenerator() :
6666
screenHolderRadius(1.3), screenHolderThick(0.3), // measured,
6767

6868
holderMat("Stainless304L"),
69-
mirrorMat("SiO2"),
7069
screenMat("SiO2"),
71-
screenHolderMat("Aluminium")
70+
screenHolderMat("Aluminium"),
71+
mirrorMat("SiO2")
7272
/*!
7373
Constructor and defaults
7474
*/

Model/MaxIV/commonGeneratorInc/YagScreenGenerator.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: Model/MaxIV/LinacInc/YagScreenGenerator.h
55
*
6-
* Copyright (c) 2004-2021 by Konstantin Batkov
6+
* Copyright (c) 2004-2022 by Konstantin Batkov
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ class YagScreenGenerator :
5757
double screenThick; ///< Thickness of screen
5858

5959
double screenHolderRadius; ///< screen holder thickness
60-
double screenHolderThick; ///< screen holder thickness
60+
double screenHolderThick; ///< screen holder thickness
6161

6262

6363
std::string holderMat; ///< mirror holder material

Model/essBuild/BilbaoWheel.cxx

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: essBuild/BilbaoWheel.cxx
55
*
6-
* Copyright (c) 2004-2019 by Konstantin Batkov
6+
* Copyright (c) 2004-2022 by Konstantin Batkov
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -1397,7 +1397,8 @@ BilbaoWheel::buildSectors(Simulation& System) const
13971397
c(new BilbaoWheelCassette(keyName,"Sec",i));
13981398
OR.addObject(c);
13991399
c->createAll(System,*this,0,
1400-
7,8,9,12,i*360.0/static_cast<double>(nSectors));
1400+
7,8,9,12,
1401+
static_cast<double>(i)*360.0/static_cast<double>(nSectors));
14011402
}
14021403
}
14031404

Model/essBuild/Box.cxx

+25-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: essBuild/Box.cxx
55
*
6-
* Copyright (c) 2004-2021 by Konstantin Batkov
6+
* Copyright (c) 2004-2022 by Konstantin Batkov
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -308,9 +308,20 @@ Box::getLayerSurf(const size_t layerIndex,
308308
\return Surface string
309309
*/
310310
{
311-
ELog::RegMethod RegA("Box","getLinkSurf");
311+
ELog::RegMethod RegA("Box","getLayerSurf");
312312

313-
throw ColErr::AbsObjMethod("Not implemented yet - do it similar to DiskPreMod?");
313+
if (layerIndex>nLayers)
314+
throw ColErr::IndexError<size_t>(layerIndex,nLayers,"layerIndex");
315+
316+
const int uSIndex(std::abs(static_cast<int>(sideIndex)));
317+
const int signValue((sideIndex>0) ? 1 : -1);
318+
const int SI(10*static_cast<int>(layerIndex)+buildIndex);
319+
320+
321+
if (uSIndex<1 || uSIndex>6)
322+
throw ColErr::IndexError<long int>(sideIndex,6,"sideIndex");
323+
324+
return signValue*SMap.realSurf(SI+uSIndex);
314325
}
315326

316327

@@ -320,7 +331,7 @@ Box::getLayerString(const size_t layerIndex,
320331
/*!
321332
Given a side and a layer calculate the layer string
322333
\param layerIndex :: layer, 0 is inner moderator [0-4]
323-
\param sideIndex :: Side [0-3]
334+
\param sideIndex :: Side [1-6]
324335
\return Surface string
325336
*/
326337
{
@@ -331,44 +342,40 @@ Box::getLayerString(const size_t layerIndex,
331342

332343
const int SI(10*static_cast<int>(layerIndex)+buildIndex);
333344

334-
std::string Out;
345+
HeadRule HR;
335346
const long int uSIndex(std::abs(sideIndex));
336347
switch(uSIndex)
337348
{
338349
case 1:
339-
Out=ModelSupport::getComposite(SMap,SI," -1 ");
350+
HR=ModelSupport::getHeadRule(SMap,SI,"-1");
340351
break;
341352
case 2:
342-
Out=ModelSupport::getComposite(SMap,SI," 2 ");
353+
HR=ModelSupport::getHeadRule(SMap,SI,"2");
343354
break;
344355
case 3:
345-
Out=ModelSupport::getComposite(SMap,SI," -3 ");
356+
HR=ModelSupport::getHeadRule(SMap,SI,"-3");
346357
break;
347358
case 4:
348-
Out=ModelSupport::getComposite(SMap,SI," 4 ");
359+
HR=ModelSupport::getHeadRule(SMap,SI,"4");
349360
break;
350361
case 5:
351-
Out=ModelSupport::getComposite(SMap,SI," -5 ");
362+
HR=ModelSupport::getHeadRule(SMap,SI,"-5");
352363
break;
353364
case 6:
354-
Out=ModelSupport::getComposite(SMap,SI," 6 ");
365+
HR=ModelSupport::getHeadRule(SMap,SI,"6");
355366
break;
356367
default:
357368
throw ColErr::IndexError<long int>(sideIndex,6,"sideIndex");
358369
}
359370
if (sideIndex<0)
360-
{
361-
HeadRule HR(Out);
362-
HR.makeComplement();
363-
return HR.display();
364-
}
371+
HR.makeComplement();
365372

366-
return Out;
373+
return HR.display();
367374
}
368375

369376
Geometry::Vec3D
370377
Box::getSurfacePoint(const size_t layerIndex,
371-
const long int sideIndex) const
378+
const long int sideIndex) const
372379
/*!
373380
Given a side and a layer calculate the surface point
374381
\param layerIndex :: layer, 0 is inner moderator

Model/essBuild/DiskLayerMod.cxx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: essBuild/DiskLayerMod.cxx
55
*
6-
* Copyright (c) 2004-2019 by Stuart Ansell
6+
* Copyright (c) 2004-2022 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -354,10 +354,10 @@ DiskLayerMod::getLayerSurf(const size_t layerIndex,
354354
\return Surface string
355355
*/
356356
{
357-
ELog::RegMethod RegA("H2Moderator","getLinkSurf");
357+
ELog::RegMethod RegA("H2Moderator","getLayerSurf");
358358

359359
const size_t SI(static_cast<size_t>(std::abs(sideIndex)));
360-
const int signValue((SI>0) ? 1 : -1);
360+
const int signValue((sideIndex>0) ? 1 : -1);
361361

362362
// Z direction is nLayer
363363
if (SI==5 || SI==6)

Model/essBuildInc/Box.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ namespace essSystem
3535
\brief Box with layers
3636
*/
3737

38-
class Box : public attachSystem::ContainedComp,
39-
public attachSystem::FixedOffset,
40-
public attachSystem::LayerComp,
41-
public attachSystem::CellMap
38+
class Box :
39+
public attachSystem::ContainedComp,
40+
public attachSystem::FixedOffset,
41+
public attachSystem::LayerComp,
42+
public attachSystem::CellMap
4243
{
4344
private:
4445

Model/singleItemBuild/makeSingleItem.cxx

+8-1
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,17 @@ makeSingleItem::build(Simulation& System,
504504
fm->addInsertCell(voidCell);
505505
fm->createAll(System,World::masterOrigin(),0);
506506

507+
// with pipes:
508+
std::shared_ptr<xraySystem::SquareFMask>
509+
fmb(new xraySystem::SquareFMask("FMaskB"));
510+
OR.addObject(fmb);
511+
512+
fmb->addInsertCell(voidCell);
513+
fmb->createAll(System,World::masterOrigin(),0);
514+
507515
return;
508516
}
509517

510-
511518
if (item == "Jaws")
512519
{
513520
// diagnostic box

Model/singleItemBuild/singleItemVariables.cxx

+5-1
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,17 @@ SingleItemVariables(FuncDataBase& Control)
253253

254254
// collimator block
255255
setVariable::SqrFMaskGenerator FMaskGen;
256+
257+
// B is standard
258+
FMaskGen.generateColl(Control,"FMask",0.0,15.0);
259+
256260
FMaskGen.setPipeRadius(-10.0);
257261
// FMaskGen.setCF<CF63>();
258262
// FMaskGen.setBFlangeCF<CF40>();
259263
// FMaskGen.setFrontGap(3.99,1.97); //1033.8
260264
// FMaskGen.setBackGap(0.71,0.71);
261265
// FMaskGen.setMinSize(10.2,0.71,0.71);
262-
FMaskGen.generateColl(Control,"FMask",0.0,15.0);
266+
FMaskGen.generateColl(Control,"FMaskB",40.0,15.0);
263267

264268

265269
setVariable::EPSeparatorGenerator EPSGen;

0 commit comments

Comments
 (0)