Commit 236d53a0 authored by kraus's avatar kraus
Browse files

change return type of ElementBase::getType

parent 81c94886
......@@ -92,7 +92,7 @@ const BGeometryBase &AlignWrapper::getGeometry() const {
}
const std::string &AlignWrapper::getType() const {
ElementBase::ElementBase::ElementType AlignWrapper::getType() const {
return itsElement->getType();
}
......@@ -157,4 +157,4 @@ AlignWrapper::~AlignWrapper()
AlignWrapper::AlignWrapper(ElementBase *elem):
ElementBase(elem->getName()), itsElement(elem), itsOffset() {
shareFlag = false;
}
}
\ No newline at end of file
......@@ -95,7 +95,7 @@ public:
/// Get element type std::string.
// Returns the type std::string for the enclosed item.
virtual const std::string &getType() const;
virtual ElementBase::ElementBase::ElementType getType() const;
/// Disallow misalignment of an already misaligned object.
// This method returns [b]this[/b], since "this" is already an
......@@ -158,4 +158,4 @@ private:
mutable Euclid3D itsOffset;
};
#endif // CLASSIC_AlignWrapper_HH
#endif // CLASSIC_AlignWrapper_HH
\ No newline at end of file
......@@ -76,7 +76,6 @@ void BeamBeam::getDimensions(double &zBegin, double &zEnd) const {
}
const std::string &BeamBeam::getType() const {
static const std::string type("BeamBeam");
return type;
ElementBase::ElementType BeamBeam::getType() const {
return BEAMBEAM;
}
......@@ -75,7 +75,7 @@ public:
virtual bool bends() const;
virtual const std::string &getType() const;
virtual ElementBase::ElementType getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......
......@@ -569,9 +569,8 @@ void Collimator::getDimensions(double &zBegin, double &zEnd) const {
}
const std::string &Collimator::getType() const {
static const std::string type("Collimator");
return type;
ElementBase::ElementType Collimator::getType() const {
return COLLIMATOR;
}
string Collimator::getCollimatorShape() {
......
......@@ -89,7 +89,7 @@ public:
virtual void goOffline();
virtual const std::string &getType() const;
virtual ElementBase::ElementType getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......
......@@ -111,7 +111,6 @@ void Component::getMisalignment(double &x, double &y, double &s) const {
s = ds_m;
}
const std::string &Component::getType() const {
static const std::string type("");
return type;
}
ElementBase::ElementType Component::getType() const {
return ElementBase::ANY;
}
\ No newline at end of file
......@@ -132,7 +132,7 @@ public:
virtual void getDimensions(double &zBegin, double &zEnd) const = 0;
virtual const std::string &getType() const;
virtual ElementBase::ElementType getType() const;
virtual void setComponentType(std::string name) { };
virtual std::string getComponentType() const { return ""; };
......@@ -207,4 +207,4 @@ inline void Component::setOrientation(const Vector_t &direction)
inline void Component::setExitFaceSlope(const double &m)
{ exit_face_slope_m = m; }
#endif // CLASSIC_Component_HH
#endif // CLASSIC_Component_HH
\ No newline at end of file
......@@ -115,7 +115,6 @@ void Corrector::getDimensions(double &zBegin, double &zEnd) const
zEnd = startField_m + getElementLength();
}
const std::string &Corrector::getType() const {
static const std::string type("Corrector");
return type;
}
\ No newline at end of file
ElementBase::ElementType Corrector::getType() const {
return CORRECTOR;
}
......@@ -91,7 +91,7 @@ public:
virtual bool bends() const;
virtual const std::string &getType() const;
virtual ElementBase::ElementType getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......
......@@ -174,10 +174,14 @@ void Cyclotron::setType(std::string t) {
type_m = t;
}
const std::string &Cyclotron::getType() const {
const std::string &Cyclotron::getCyclotronType() const {
return type_m;
}
ElementBase::ElementType Cyclotron::getType() const {
return CYCLOTRON;
}
void Cyclotron::setCyclHarm(double h) {
harm_m = h;
}
......
......@@ -37,21 +37,21 @@ struct BfieldData {
//~ double *dbt; //dBz/dtheta
//~ double *dbtt; //d2Bz/dtheta2
//~ double *dbttt; //d3Bz/dtheta3
//~
//~
//~ // to be calculated in getdiffs: all other derivatives:
//~ double *dbr; // dBz/dr
//~ double *dbrr; // ...
//~ double *dbrrr;
//~
//~
//~ double *dbrt;
//~ double *dbrrt;
//~ double *dbrtt;
//~
//~
//~ // used to get (Br,Btheta,Bz) at any off-plane point
//~ double *f2; // for Bz
//~ double *f3; // for Br
//~ double *g3; // for Btheta
//~
//~
std::vector<double> bfld; //Bz
std::vector<double> dbt; //dBz/dtheta
std::vector<double> dbtt; //d2Bz/dtheta2
......@@ -132,7 +132,8 @@ public:
void setRfFieldMapFN(std::vector<std::string> rffmapfn);
void setType(std::string t);
virtual const std::string &getType() const;
const std::string &getCyclotronType() const;
virtual ElementBase::ElementType getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......@@ -158,7 +159,7 @@ public:
void setZinit(double zinit);
virtual double getZinit() const;
void setPZinit(double zinit);
virtual double getPZinit() const;
......@@ -221,7 +222,7 @@ private:
std::vector<double> rffrequ_m;
std::vector<double> rfphi_m;
std::vector<double> escale_m; // a scale factor for the E-field
std::vector<bool> superpose_m; // electric fields are superposed or not
std::vector<bool> superpose_m; // electric fields are superposed or not
double symmetry_m;
......@@ -260,13 +261,13 @@ private:
BPositions BP;
BFieldType myBFieldType_m;
// RF field map handler
// Fieldmap *RFfield;
std::vector<Fieldmap *> RFfields_m;
std::vector<Fieldmap *> RFfields_m;
std::vector<std::string> RFfilename_m;
// handling for store the particle out of region
// handling for store the particle out of region
std::unique_ptr<LossDataSink> lossDs_m;
void getdiffs();
......@@ -286,4 +287,4 @@ private:
};
#endif // CLASSIC_Cyclotron_HH
#endif // CLASSIC_Cyclotron_HH
\ No newline at end of file
......@@ -205,7 +205,6 @@ void CyclotronValley::getDimensions(double &zBegin, double &zEnd) const {
}
const std::string &CyclotronValley::getType() const {
static const std::string type("CyclotronValley");
return type;
ElementBase::ElementType CyclotronValley::getType() const {
return CYCLOTRONVALLEY;
}
......@@ -57,7 +57,7 @@ public:
void setFast(bool fast);
bool getFast() const;
const std::string &getType() const;
ElementBase::ElementType getType() const;
virtual bool apply(const size_t &i, const double &t, double E[], double B[]);
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B);
......
......@@ -229,9 +229,8 @@ void Degrader::getDimensions(double &zBegin, double &zEnd) const {
}
const std::string &Degrader::getType() const {
static const std::string type("DEGRADER");
return type;
ElementBase::ElementType Degrader::getType() const {
return DEGRADER;
}
string Degrader::getDegraderShape() {
......@@ -245,4 +244,4 @@ void Degrader::setZSize(double z) {
double Degrader::getZSize() {
return deg_width_m;
}
\ No newline at end of file
}
......@@ -78,7 +78,7 @@ public:
virtual void goOffline();
virtual const std::string &getType() const;
virtual ElementBase::ElementType getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......
......@@ -71,9 +71,8 @@ bool Diagnostic::bends() const {
return false;
}
const std::string &Diagnostic::getType() const {
static const std::string type("Diagnostic");
return type;
ElementBase::ElementType Diagnostic::getType() const {
return DIAGNOSTIC;
}
void Diagnostic::getDimensions(double &zBegin, double &zEnd) const
......
......@@ -55,7 +55,7 @@ public:
virtual bool bends() const;
virtual const std::string &getType() const;
virtual ElementBase::ElementType getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......
......@@ -79,7 +79,6 @@ void Drift::getDimensions(double &zBegin, double &zEnd) const {
zEnd = startField_m + getElementLength();
}
const std::string &Drift::getType() const {
static const std::string type("Drift");
return type;
ElementBase::ElementType Drift::getType() const {
return DRIFT;
}
......@@ -56,7 +56,7 @@ public:
virtual bool bends() const;
virtual const std::string &getType() const;
virtual ElementBase::ElementType getType() const;
virtual void getDimensions(double &zBegin, double &zEnd) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment