3
3
4
4
* File: d4cModel/DetectorBank.cxx
5
5
*
6
- * Copyright (c) 2004-2019 by Stuart Ansell
6
+ * Copyright (c) 2004-2024 by Stuart Ansell
7
7
*
8
8
* This program is free software: you can redistribute it and/or modify
9
9
* it under the terms of the GNU General Public License as published by
57
57
#include " TallyCreate.h"
58
58
#include " LinkUnit.h"
59
59
#include " FixedComp.h"
60
- #include " FixedOffset .h"
60
+ #include " FixedRotate .h"
61
61
#include " ContainedComp.h"
62
62
#include " DetectorBank.h"
63
63
@@ -69,8 +69,8 @@ namespace d4cSystem
69
69
{
70
70
71
71
DetectorBank::DetectorBank (const size_t BN,const std::string& Key) :
72
+ attachSystem::FixedRotate (Key+std::to_string(BN),6 ),
72
73
attachSystem::ContainedComp (),
73
- attachSystem::FixedOffset (Key+std::to_string(BN),6 ),
74
74
bankNumber (BN),baseName(Key)
75
75
/* !
76
76
Constructor
@@ -79,8 +79,9 @@ DetectorBank::DetectorBank(const size_t BN,const std::string& Key) :
79
79
*/
80
80
{}
81
81
82
- DetectorBank::DetectorBank (const DetectorBank& A) :
83
- attachSystem::ContainedComp (A),attachSystem::FixedOffset(A),
82
+ DetectorBank::DetectorBank (const DetectorBank& A) :
83
+ attachSystem::FixedRotate (A),
84
+ attachSystem::ContainedComp (A),
84
85
bankNumber (A.bankNumber),baseName(A.baseName),
85
86
centreOffset (A.centreOffset),
86
87
centreAngle (A.centreAngle),detDepth(A.detDepth),
@@ -103,8 +104,8 @@ DetectorBank::operator=(const DetectorBank& A)
103
104
{
104
105
if (this !=&A)
105
106
{
107
+ attachSystem::FixedRotate::operator =(A);
106
108
attachSystem::ContainedComp::operator =(A);
107
- attachSystem::FixedOffset::operator =(A);
108
109
centreOffset=A.centreOffset ;
109
110
centreAngle=A.centreAngle ;
110
111
detDepth=A.detDepth ;
@@ -133,11 +134,11 @@ DetectorBank::populate(const FuncDataBase& Control)
133
134
{
134
135
ELog::RegMethod RegA (" DetectorBank" ," populate" );
135
136
136
- FixedOffset ::populate (Control);
137
+ FixedRotate ::populate (Control);
137
138
138
139
centreOffset=Control.EvalTail <double >(keyName,baseName," CentreOffset" );
139
140
centreAngle=Control.EvalTail <double >(keyName,baseName," CentreAngle" );
140
- xyAngle -=centreAngle;
141
+ zAngle -=centreAngle;
141
142
centreAngle*=M_PI/180.0 ;
142
143
143
144
detHeight=Control.EvalTail <double >(keyName,baseName," DetHeight" );
@@ -152,8 +153,7 @@ DetectorBank::populate(const FuncDataBase& Control)
152
153
baseName+" DetMat" );
153
154
154
155
// trick to get def var of a pair.
155
- nDet=Control.EvalDefVar <size_t >(baseName+" NDet" ,0 );
156
- nDet=Control.EvalDefVar <size_t >(keyName+" NDet" ,nDet);
156
+ nDet=Control.EvalDefTail <size_t >(keyName,baseName," NDet" ,0 );
157
157
return ;
158
158
}
159
159
@@ -170,7 +170,7 @@ DetectorBank::createUnitVector(const attachSystem::FixedComp& FC,
170
170
171
171
Origin += (X*sin (centreAngle)+Y*cos (centreAngle))*centreOffset;
172
172
applyShift (xStep,yStep,zStep);
173
- applyAngleRotate (xyAngle ,zAngle);
173
+ applyAngleRotate (xAngle,yAngle ,zAngle);
174
174
175
175
return ;
176
176
}
@@ -222,17 +222,17 @@ DetectorBank::createObjects(Simulation& System)
222
222
{
223
223
ELog::RegMethod RegA (" DetectorBank" ," createObjects" );
224
224
225
- std::string Out ;
225
+ HeadRule HR ;
226
226
// First make inner/outer void/wall and top/base
227
227
228
- Out =ModelSupport::getComposite (SMap,buildIndex," 11 -12 13 -14 15 -16" );
229
- addOuterSurf (Out );
228
+ HR =ModelSupport::getHeadRule (SMap,buildIndex," 11 -12 13 -14 15 -16" );
229
+ addOuterSurf (HR );
230
230
231
- Out =ModelSupport::getComposite (SMap,buildIndex," 1 -2 3 -4 5 -6 " );
232
- System.addCell (MonteCarlo::Object ( cellIndex++,detMat,0.0 ,Out) );
233
- Out =ModelSupport::getComposite (SMap,buildIndex,
234
- " 11 -12 13 -14 15 -16 (-1:2:-3:4:-5:6)" );
235
- System.addCell (MonteCarlo::Object ( cellIndex++,wallMat,0.0 ,Out) );
231
+ HR =ModelSupport::getHeadRule (SMap,buildIndex," 1 -2 3 -4 5 -6" );
232
+ System.addCell (cellIndex++,detMat,0.0 ,HR );
233
+ HR =ModelSupport::getHeadRule (SMap,buildIndex,
234
+ " 11 -12 13 -14 15 -16 (-1:2:-3:4:-5:6)" );
235
+ System.addCell (cellIndex++,wallMat,0.0 ,HR );
236
236
return ;
237
237
}
238
238
0 commit comments