Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
albajacas_a
src
Commits
70f06d91
Commit
70f06d91
authored
Jan 14, 2013
by
adelmann
🎗
Browse files
add Degrader element
parent
e756d1cf
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
258 additions
and
1 deletion
+258
-1
.gitattributes
.gitattributes
+2
-0
src/Algorithms/LieMapper.cpp
src/Algorithms/LieMapper.cpp
+6
-0
src/Algorithms/LieMapper.h
src/Algorithms/LieMapper.h
+3
-0
src/Algorithms/ParallelCyclotronTracker.cpp
src/Algorithms/ParallelCyclotronTracker.cpp
+13
-0
src/Algorithms/ParallelCyclotronTracker.h
src/Algorithms/ParallelCyclotronTracker.h
+3
-0
src/Algorithms/ParallelSliceTracker.h
src/Algorithms/ParallelSliceTracker.h
+4
-0
src/Algorithms/ParallelTTracker.h
src/Algorithms/ParallelTTracker.h
+10
-0
src/Algorithms/ThickMapper.cpp
src/Algorithms/ThickMapper.cpp
+4
-0
src/Algorithms/ThickMapper.h
src/Algorithms/ThickMapper.h
+3
-0
src/Algorithms/ThickTracker.cpp
src/Algorithms/ThickTracker.cpp
+4
-0
src/Algorithms/ThickTracker.h
src/Algorithms/ThickTracker.h
+3
-0
src/Algorithms/TransportMapper.cpp
src/Algorithms/TransportMapper.cpp
+4
-0
src/Algorithms/TransportMapper.h
src/Algorithms/TransportMapper.h
+3
-0
src/Elements/CMakeLists.txt
src/Elements/CMakeLists.txt
+1
-0
src/Elements/OpalBeamline.h
src/Elements/OpalBeamline.h
+1
-0
src/Elements/OpalDegrader.cpp
src/Elements/OpalDegrader.cpp
+121
-0
src/Elements/OpalDegrader.h
src/Elements/OpalDegrader.h
+70
-0
src/OpalConfigure/Configure.cpp
src/OpalConfigure/Configure.cpp
+2
-0
src/Structure/SurfacePhysics.cpp
src/Structure/SurfacePhysics.cpp
+1
-1
No files found.
.gitattributes
View file @
70f06d91
...
...
@@ -703,6 +703,8 @@ src/Elements/OpalCyclotron.cpp -text
src/Elements/OpalCyclotron.h -text
src/Elements/OpalCyclotronValley.cpp -text
src/Elements/OpalCyclotronValley.h -text
src/Elements/OpalDegrader.cpp -text
src/Elements/OpalDegrader.h -text
src/Elements/OpalDrift.cpp -text
src/Elements/OpalDrift.h -text
src/Elements/OpalECollimator.cpp -text
...
...
src/Algorithms/LieMapper.cpp
View file @
70f06d91
...
...
@@ -22,6 +22,7 @@
#include "AbsBeamline/Collimator.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Degrader.h"
#include "AbsBeamline/Diagnostic.h"
#include "AbsBeamline/Drift.h"
#include "AbsBeamline/ElementBase.h"
...
...
@@ -141,6 +142,11 @@ void LieMapper::visitCorrector(const Corrector &corr) {
}
void
LieMapper
::
visitDegrader
(
const
Degrader
&
deg
)
{
// The diagnostic has no effect on the map.
applyDrift
(
flip_s
*
deg
.
getElementLength
());
}
void
LieMapper
::
visitDiagnostic
(
const
Diagnostic
&
diag
)
{
// The diagnostic has no effect on the map.
applyDrift
(
flip_s
*
diag
.
getElementLength
());
...
...
src/Algorithms/LieMapper.h
View file @
70f06d91
...
...
@@ -102,6 +102,9 @@ public:
/// Apply the algorithm to a Corrector.
virtual
void
visitCorrector
(
const
Corrector
&
);
/// Apply the algorithm to a Degrader
virtual
void
visitDegrader
(
const
Degrader
&
);
/// Apply the algorithm to a Diagnostic.
virtual
void
visitDiagnostic
(
const
Diagnostic
&
);
...
...
src/Algorithms/ParallelCyclotronTracker.cpp
View file @
70f06d91
...
...
@@ -25,6 +25,7 @@
#include "AbsBeamline/Collimator.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Cyclotron.h"
#include "AbsBeamline/Degrader.h"
#include "AbsBeamline/Diagnostic.h"
#include "AbsBeamline/Drift.h"
#include "AbsBeamline/ElementBase.h"
...
...
@@ -404,6 +405,18 @@ void ParallelCyclotronTracker::visitCorrector(const Corrector &corr) {
myElements
.
push_back
(
dynamic_cast
<
Corrector
*>
(
corr
.
clone
()));
}
/**
*
*
* @param degrader
*/
void
ParallelCyclotronTracker
::
visitDegrader
(
const
Degrader
&
deg
)
{
*
gmsg
<<
"In Degrader; L= "
<<
deg
.
getElementLength
()
<<
endl
;
myElements
.
push_back
(
dynamic_cast
<
Degrader
*>
(
deg
.
clone
()));
}
/**
*
*
...
...
src/Algorithms/ParallelCyclotronTracker.h
View file @
70f06d91
...
...
@@ -76,6 +76,9 @@ public:
/// Apply the algorithm to a Corrector.
virtual
void
visitCorrector
(
const
Corrector
&
);
/// Apply the algorithm to a Degrader
virtual
void
visitDegrader
(
const
Degrader
&
);
/// Apply the algorithm to a Diagnostic.
virtual
void
visitDiagnostic
(
const
Diagnostic
&
);
...
...
src/Algorithms/ParallelSliceTracker.h
View file @
70f06d91
...
...
@@ -64,6 +64,7 @@ public:
virtual
void
visitBeamBeam
(
const
BeamBeam
&
);
virtual
void
visitCollimator
(
const
Collimator
&
);
virtual
void
visitCorrector
(
const
Corrector
&
);
virtual
void
visitDegrader
(
const
Degrader
&
);
virtual
void
visitDiagnostic
(
const
Diagnostic
&
);
virtual
void
visitDrift
(
const
Drift
&
);
virtual
void
visitLambertson
(
const
Lambertson
&
);
...
...
@@ -174,6 +175,9 @@ inline void ParallelSliceTracker::visitCorrector(const Corrector &corr) {
itsOpalBeamline_m
->
visit
(
corr
,
*
this
,
itsBunch_m
);
}
inline
void
ParallelSliceTracker
::
visitDegrader
(
const
Degrader
&
deg
)
{
itsOpalBeamline_m
->
visit
(
deg
,
*
this
,
itsBunch_m
);
}
inline
void
ParallelSliceTracker
::
visitDiagnostic
(
const
Diagnostic
&
diag
)
{
itsOpalBeamline_m
->
visit
(
diag
,
*
this
,
itsBunch_m
);
...
...
src/Algorithms/ParallelTTracker.h
View file @
70f06d91
...
...
@@ -31,6 +31,7 @@ class AlignWrapper;
class
BeamBeam
;
class
Collimator
;
class
Corrector
;
class
Degrader
;
class
Diagnostic
;
class
Drift
;
class
ElementBase
;
...
...
@@ -133,9 +134,13 @@ public:
/// Apply the algorithm to a collimator.
virtual
void
visitCollimator
(
const
Collimator
&
);
/// Apply the algorithm to a Corrector.
virtual
void
visitCorrector
(
const
Corrector
&
);
/// Apply the algorithm to a Degrader.
virtual
void
visitDegrader
(
const
Degrader
&
);
/// Apply the algorithm to a Diagnostic.
virtual
void
visitDiagnostic
(
const
Diagnostic
&
);
...
...
@@ -434,6 +439,11 @@ inline void ParallelTTracker::visitCorrector(const Corrector &corr) {
}
inline
void
ParallelTTracker
::
visitDegrader
(
const
Degrader
&
deg
)
{
itsOpalBeamline_m
.
visit
(
deg
,
*
this
,
itsBunch
);
}
inline
void
ParallelTTracker
::
visitDiagnostic
(
const
Diagnostic
&
diag
)
{
itsOpalBeamline_m
.
visit
(
diag
,
*
this
,
itsBunch
);
}
...
...
src/Algorithms/ThickMapper.cpp
View file @
70f06d91
...
...
@@ -22,6 +22,7 @@
#include "AbsBeamline/Collimator.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Degrader.h"
#include "AbsBeamline/Diagnostic.h"
#include "AbsBeamline/Drift.h"
#include "AbsBeamline/ElementBase.h"
...
...
@@ -113,6 +114,9 @@ void ThickMapper::visitCorrector(const Corrector &corr) {
if
(
length
!=
0.0
)
applyDrift
(
length
/
2.0
);
}
void
ThickMapper
::
visitDegrader
(
const
Degrader
&
deg
)
{
applyDrift
(
flip_s
*
deg
.
getElementLength
());
}
void
ThickMapper
::
visitDiagnostic
(
const
Diagnostic
&
diag
)
{
// The diagnostic has no effect on the map.
...
...
src/Algorithms/ThickMapper.h
View file @
70f06d91
...
...
@@ -104,6 +104,9 @@ public:
/// Apply the algorithm to a Corrector.
virtual
void
visitCorrector
(
const
Corrector
&
);
/// Apply the algorithm to a Degrader.
virtual
void
visitDegrader
(
const
Degrader
&
);
/// Apply the algorithm to a Diagnostic.
virtual
void
visitDiagnostic
(
const
Diagnostic
&
);
...
...
src/Algorithms/ThickTracker.cpp
View file @
70f06d91
...
...
@@ -25,6 +25,7 @@
#include "AbsBeamline/Collimator.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Diagnostic.h"
#include "AbsBeamline/Degrader.h"
#include "AbsBeamline/Drift.h"
#include "AbsBeamline/ElementBase.h"
#include "AbsBeamline/Lambertson.h"
...
...
@@ -135,6 +136,9 @@ void ThickTracker::visitCorrector(const Corrector &corr) {
if
(
length
!=
0.0
)
applyDrift
(
length
/
2.0
);
}
void
ThickTracker
::
visitDegrader
(
const
Degrader
&
deg
)
{
applyDrift
(
flip_s
*
deg
.
getElementLength
());
}
void
ThickTracker
::
visitDiagnostic
(
const
Diagnostic
&
diag
)
{
// The diagnostic has no effect on particle tracking.
...
...
src/Algorithms/ThickTracker.h
View file @
70f06d91
...
...
@@ -96,6 +96,9 @@ public:
/// Apply the algorithm to a Corrector.
virtual
void
visitCorrector
(
const
Corrector
&
);
/// Apply the algorithm to a Degrader.
virtual
void
visitDegrader
(
const
Degrader
&
);
/// Apply the algorithm to a Diagnostic.
virtual
void
visitDiagnostic
(
const
Diagnostic
&
);
...
...
src/Algorithms/TransportMapper.cpp
View file @
70f06d91
...
...
@@ -23,6 +23,7 @@
#include "AbsBeamline/Collimator.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Diagnostic.h"
#include "AbsBeamline/Degrader.h"
#include "AbsBeamline/Drift.h"
#include "AbsBeamline/ElementBase.h"
#include "AbsBeamline/Lambertson.h"
...
...
@@ -146,6 +147,9 @@ void TransportMapper::visitCorrector(const Corrector &corr) {
if
(
length
)
applyDrift
(
length
/
2.0
);
}
void
TransportMapper
::
visitDegrader
(
const
Degrader
&
deg
)
{
applyDrift
(
flip_s
*
deg
.
getElementLength
());
}
void
TransportMapper
::
visitDiagnostic
(
const
Diagnostic
&
diag
)
{
applyDrift
(
flip_s
*
diag
.
getElementLength
());
...
...
src/Algorithms/TransportMapper.h
View file @
70f06d91
...
...
@@ -112,6 +112,9 @@ public:
/// Apply the algorithm to a Corrector.
virtual
void
visitCorrector
(
const
Corrector
&
);
/// Apply the algorithm to a Degrader.
virtual
void
visitDegrader
(
const
Degrader
&
);
/// Apply the algorithm to a Diagnostic.
virtual
void
visitDiagnostic
(
const
Diagnostic
&
);
...
...
src/Elements/CMakeLists.txt
View file @
70f06d91
...
...
@@ -9,6 +9,7 @@ set (_SRCS
OpalCyclotron.cpp
OpalDrift.cpp
OpalECollimator.cpp
OpalDegrader.cpp
OpalElement.cpp
OpalHKicker.cpp
OpalHMonitor.cpp
...
...
src/Elements/OpalBeamline.h
View file @
70f06d91
...
...
@@ -10,6 +10,7 @@
#include "AbsBeamline/AlignWrapper.h"
#include "AbsBeamline/BeamBeam.h"
#include "AbsBeamline/Corrector.h"
#include "AbsBeamline/Degrader.h"
#include "AbsBeamline/Diagnostic.h"
#include "AbsBeamline/Lambertson.h"
#include "AbsBeamline/Marker.h"
...
...
src/Elements/OpalDegrader.cpp
0 → 100644
View file @
70f06d91
// ------------------------------------------------------------------------
// $RCSfile: OpalDegrader.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: OpalDegrader
// The class of OPAL Degrader.
//
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:33:39 $
// $Author: Andreas Adelmann $
//
// ------------------------------------------------------------------------
#include "Elements/OpalDegrader.h"
#include "Attributes/Attributes.h"
#include "BeamlineCore/DegraderRep.h"
#include "Structure/SurfacePhysics.h"
// Class OpalDegrader
// ------------------------------------------------------------------------
OpalDegrader
::
OpalDegrader
()
:
OpalElement
(
SIZE
,
"DEGRADER"
,
"The
\"
DEGRADER
\"
element defines a degrader."
),
sphys_m
(
NULL
)
{
itsAttr
[
XSIZE
]
=
Attributes
::
makeReal
(
"XSIZE"
,
"Horizontal half-aperture in m"
);
itsAttr
[
YSIZE
]
=
Attributes
::
makeReal
(
"YSIZE"
,
"Vertical half-aperture in m"
);
itsAttr
[
OUTFN
]
=
Attributes
::
makeString
(
"OUTFN"
,
"Monitor output filename"
);
itsAttr
[
DX
]
=
Attributes
::
makeReal
(
"DX"
,
"Misalignment in x direction"
,
0.0
);
itsAttr
[
DY
]
=
Attributes
::
makeReal
(
"DY"
,
"Misalignment in y direction"
,
0.0
);
itsAttr
[
DZ
]
=
Attributes
::
makeReal
(
"DZ"
,
"Misalignment in z direction"
,
0.0
);
registerStringAttribute
(
"OUTFN"
);
registerRealAttribute
(
"XSIZE"
);
registerRealAttribute
(
"YSIZE"
);
registerRealAttribute
(
"DX"
);
registerRealAttribute
(
"DY"
);
registerRealAttribute
(
"DZ"
);
setElement
((
new
DegraderRep
(
"DEGRADER"
))
->
makeAlignWrapper
());
}
OpalDegrader
::
OpalDegrader
(
const
string
&
name
,
OpalDegrader
*
parent
)
:
OpalElement
(
name
,
parent
),
sphys_m
(
NULL
)
{
setElement
((
new
DegraderRep
(
name
))
->
makeAlignWrapper
());
}
OpalDegrader
::~
OpalDegrader
()
{
if
(
sphys_m
)
delete
sphys_m
;
}
OpalDegrader
*
OpalDegrader
::
clone
(
const
string
&
name
)
{
return
new
OpalDegrader
(
name
,
this
);
}
void
OpalDegrader
::
fillRegisteredAttributes
(
const
ElementBase
&
base
,
ValueFlag
flag
)
{
OpalElement
::
fillRegisteredAttributes
(
base
,
flag
);
const
DegraderRep
*
deg
=
dynamic_cast
<
const
DegraderRep
*>
(
base
.
removeWrappers
());
attributeRegistry
[
"XSIZE"
]
->
setReal
(
deg
->
getXsize
());
attributeRegistry
[
"YSIZE"
]
->
setReal
(
deg
->
getYsize
());
double
dx
,
dy
,
dz
;
deg
->
getMisalignment
(
dx
,
dy
,
dz
);
attributeRegistry
[
"DX"
]
->
setReal
(
dx
);
attributeRegistry
[
"DY"
]
->
setReal
(
dy
);
attributeRegistry
[
"DZ"
]
->
setReal
(
dz
);
}
void
OpalDegrader
::
update
()
{
double
dx
=
Attributes
::
getReal
(
itsAttr
[
DX
]);
double
dy
=
Attributes
::
getReal
(
itsAttr
[
DY
]);
double
dz
=
Attributes
::
getReal
(
itsAttr
[
DZ
]);
DegraderRep
*
deg
=
dynamic_cast
<
DegraderRep
*>
(
getElement
()
->
removeWrappers
());
double
length
=
Attributes
::
getReal
(
itsAttr
[
LENGTH
]);
deg
->
setElementLength
(
length
);
deg
->
setXsize
(
Attributes
::
getReal
(
itsAttr
[
XSIZE
]));
deg
->
setYsize
(
Attributes
::
getReal
(
itsAttr
[
YSIZE
]));
deg
->
setOutputFN
(
Attributes
::
getString
(
itsAttr
[
OUTFN
]));
deg
->
setMisalignment
(
dx
,
dy
,
dz
);
std
::
vector
<
double
>
apert
=
getApert
();
double
apert_major
=
-
1.
,
apert_minor
=
-
1.
;
if
(
apert
.
size
()
>
0
)
{
apert_major
=
apert
[
0
];
if
(
apert
.
size
()
>
1
)
{
apert_minor
=
apert
[
1
];
}
else
{
apert_minor
=
apert
[
0
];
}
}
if
(
itsAttr
[
SURFACEPHYSICS
]
&&
sphys_m
==
NULL
)
{
sphys_m
=
(
SurfacePhysics
::
find
(
Attributes
::
getString
(
itsAttr
[
SURFACEPHYSICS
])))
->
clone
(
getOpalName
()
+
string
(
"_sphys"
));
sphys_m
->
initSurfacePhysicsHandler
(
*
deg
,
apert_major
,
apert_minor
);
deg
->
setSurfacePhysics
(
sphys_m
->
handler_m
);
}
// Transmit "unknown" attributes.
OpalElement
::
updateUnknown
(
deg
);
}
src/Elements/OpalDegrader.h
0 → 100644
View file @
70f06d91
#ifndef OPAL_OpalDegrader_HH
#define OPAL_OpalDegrader_HH
// ------------------------------------------------------------------------
// $RCSfile: OpalDegrader.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: OpalDegrader
//
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:33:39 $
// $Author: Andreas Adelmann $
//
// ------------------------------------------------------------------------
#include "Elements/OpalElement.h"
class
SurfacePhysics
;
// Class OpalDegrader
// ------------------------------------------------------------------------
/// The DEGRADER element.
class
OpalDegrader
:
public
OpalElement
{
public:
/// The attributes of class OpalDegrader.
enum
{
XSIZE
=
COMMON
,
// The horizontal half-size.
YSIZE
,
// The vertical half-size.
OUTFN
,
DX
,
// Misalignment: translation in x direction
DY
,
// Misalignment: translation in y direction
DZ
,
// Misalignment: translation in z direction
SIZE
};
/// Exemplar constructor.
OpalDegrader
();
virtual
~
OpalDegrader
();
/// Make clone.
virtual
OpalDegrader
*
clone
(
const
string
&
name
);
/// Fill in all registered attributes.
virtual
void
fillRegisteredAttributes
(
const
ElementBase
&
,
ValueFlag
);
/// Update the embedded CLASSIC collimator.
virtual
void
update
();
private:
// Not implemented.
OpalDegrader
(
const
OpalDegrader
&
);
void
operator
=
(
const
OpalDegrader
&
);
// Clone constructor.
OpalDegrader
(
const
string
&
name
,
OpalDegrader
*
parent
);
SurfacePhysics
*
sphys_m
;
};
#endif // OPAL_OpalDegrader_HH
src/OpalConfigure/Configure.cpp
View file @
70f06d91
...
...
@@ -91,6 +91,7 @@
#include "Elements/OpalCyclotron.h"
#include "Elements/OpalDrift.h"
#include "Elements/OpalECollimator.h"
#include "Elements/OpalDegrader.h"
#include "Elements/OpalHKicker.h"
#include "Elements/OpalHMonitor.h"
#include "Elements/OpalInstrument.h"
...
...
@@ -205,6 +206,7 @@ namespace Configure {
OPAL
->
create
(
new
OpalCyclotron
());
OPAL
->
create
(
new
OpalDrift
());
OPAL
->
create
(
new
OpalECollimator
());
OPAL
->
create
(
new
OpalDegrader
());
OPAL
->
create
(
new
OpalHKicker
());
OPAL
->
create
(
new
OpalHMonitor
());
OPAL
->
create
(
new
OpalInstrument
());
...
...
src/Structure/SurfacePhysics.cpp
View file @
70f06d91
...
...
@@ -127,7 +127,7 @@ void SurfacePhysics::initSurfacePhysicsHandler(ElementBase &element, const doubl
itsElement_m
=
&
element
;
material_m
=
Attributes
::
getString
(
itsAttr
[
MATERIAL
]);
if
(
Attributes
::
getString
(
itsAttr
[
TYPE
])
==
"COLLIMATOR"
)
{
if
(
Attributes
::
getString
(
itsAttr
[
TYPE
])
==
"COLLIMATOR"
||
Attributes
::
getString
(
itsAttr
[
TYPE
])
==
"DEGRADER"
)
{
Inform
m
(
"sph "
);
handler_m
=
new
CollimatorPhysics
(
getOpalName
(),
itsElement_m
,
major
,
minor
,
material_m
);
m
<<
*
this
<<
endl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment