IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 04a217ae authored by Nikos Karastathis's avatar Nikos Karastathis :ocean:
Browse files

fixes after rebase

parent dbec0af2
No related branches found
No related tags found
1 merge request!329Radio interface
......@@ -235,6 +235,7 @@ target_link_libraries (
CONAN_PKG::yaml-cpp
CONAN_PKG::arrow
CONAN_PKG::cli11
CONAN_PKG::xtensor
cnpy # for SaveBoostHistogram
)
......
......@@ -35,10 +35,6 @@ namespace corsika {
return getCoordinates(pCS).getZ();
}
inline LengthType Point::distance_to(Point const& point) const {
return (*this - point).getNorm();
}
/// this always returns a QuantityVector as triple
inline QuantityVector<length_d> Point::getCoordinates(
CoordinateSystemPtr const& pCS) const {
......
......@@ -15,74 +15,74 @@
namespace corsika {
/*!
* A Point represents a point in position space. It is defined by its
* coordinates with respect to some CoordinateSystem.
*/
class Point : public BaseVector<length_d> {
public:
Point(CoordinateSystemPtr const& pCS, QuantityVector<length_d> const& pQVector)
: BaseVector<length_d>(pCS, pQVector) {}
Point(CoordinateSystemPtr const& cs, LengthType x, LengthType y, LengthType z)
: BaseVector<length_d>(cs, {x, y, z}) {}
/** \todo TODO: this should be private or protected, we don NOT want to expose numbers
* without reference to outside:
*/
inline QuantityVector<length_d> const& getCoordinates() const;
inline QuantityVector<length_d>& getCoordinates();
/**
this always returns a QuantityVector as triple
\returns A value type QuantityVector, since it may have to create a temporary
object to transform to pCS.
**/
inline QuantityVector<length_d> getCoordinates(CoordinateSystemPtr const& pCS) const;
/**
* this always returns a QuantityVector as triple
*
* \returns A reference type QuantityVector&, but be aware, the underlying class data
* is actually transformed to pCS, if needed. Thus, there may be an implicit call to
* \ref rebase.
**/
inline QuantityVector<length_d>& getCoordinates(CoordinateSystemPtr const& pCS);
/**
* \name access coordinate components
* \{
*
* Note, if you access components in a different CoordinateSystem
* pCS than the stored data, internally a temporary object will be
* created and destroyed each call. This can be avoided by using
* \ref rebase first.
**/
inline LengthType getX(CoordinateSystemPtr const& pCS) const;
inline LengthType getY(CoordinateSystemPtr const& pCS) const;
inline LengthType getZ(CoordinateSystemPtr const& pCS) const;
/** \} **/
/*!
* transforms the Point into another CoordinateSystem by changing its
* coordinates interally
* A Point represents a point in position space. It is defined by its
* coordinates with respect to some CoordinateSystem.
*/
inline void rebase(CoordinateSystemPtr const& pCS);
inline Point operator+(Vector<length_d> const& pVec) const;
/*!
* returns the distance Vector between two points
class Point : public BaseVector<length_d> {
public:
Point(CoordinateSystemPtr const& pCS, QuantityVector<length_d> const& pQVector)
: BaseVector<length_d>(pCS, pQVector) {}
Point(CoordinateSystemPtr const& cs, LengthType x, LengthType y, LengthType z)
: BaseVector<length_d>(cs, {x, y, z}) {}
/** \todo TODO: this should be private or protected, we don NOT want to expose numbers
* without reference to outside:
*/
inline QuantityVector<length_d> const& getCoordinates() const;
inline QuantityVector<length_d>& getCoordinates();
/**
this always returns a QuantityVector as triple
\returns A value type QuantityVector, since it may have to create a temporary
object to transform to pCS.
**/
inline QuantityVector<length_d> getCoordinates(CoordinateSystemPtr const& pCS) const;
/**
* this always returns a QuantityVector as triple
*
* \returns A reference type QuantityVector&, but be aware, the underlying class data
* is actually transformed to pCS, if needed. Thus, there may be an implicit call to
* \ref rebase.
**/
inline QuantityVector<length_d>& getCoordinates(CoordinateSystemPtr const& pCS);
/**
* \name access coordinate components
* \{
*
* Note, if you access components in a different CoordinateSystem
* pCS than the stored data, internally a temporary object will be
* created and destroyed each call. This can be avoided by using
* \ref rebase first.
**/
inline LengthType getX(CoordinateSystemPtr const& pCS) const;
inline LengthType getY(CoordinateSystemPtr const& pCS) const;
inline LengthType getZ(CoordinateSystemPtr const& pCS) const;
/** \} **/
/*!
* transforms the Point into another CoordinateSystem by changing its
* coordinates interally
*/
inline void rebase(CoordinateSystemPtr const& pCS);
inline Point operator+(Vector<length_d> const& pVec) const;
/*!
* returns the distance Vector between two points
*/
inline Vector<length_d> operator-(Point const& pB) const;
};
/*
* calculates the distance between two points
*/
inline Vector<length_d> operator-(Point const& pB) const;
};
/*
* calculates the distance between two points
*/
inline LengthType distance(Point const& p1, Point const& p2);
inline LengthType distance(Point const& p1, Point const& p2);
} // namespace corsika
......
......@@ -215,7 +215,7 @@ TEST_CASE("Radio", "[processes]") {
const Point pos(rootCSCoREAS, 50_m, 10_m, 80_m);
// add the particle to the stack
auto const particle1{stack.addParticle(std::make_tuple(particle, E0, plab, pos, 0_ns))};
auto const particle1{stack.addParticle(std::make_tuple(particle, plab, pos, 0_ns))};
auto const charge_ {get_charge(particle1.getPID())};
// std::cout << "charge: " << charge_ << std::endl;
......@@ -265,7 +265,7 @@ TEST_CASE("Radio", "[processes]") {
// coreas1.simulate(particle1, base);
// check writeOutput method -> should produce 2 csv files for each antenna
coreas.writeOutput();
// coreas.writeOutput();
}
......@@ -347,7 +347,7 @@ TEST_CASE("Radio", "[processes]") {
// construct an energy
const HEPEnergyType E0{1_TeV};
// compute the necessary momentumn
// compute the necessary momentum
const HEPMomentumType P0{sqrt(E0 * E0 - pmass * pmass)};
// and create the momentum vector
......@@ -357,7 +357,7 @@ TEST_CASE("Radio", "[processes]") {
const Point pos(rootCSZHS, 50_m, 10_m, 80_m);
// add the particle to the stack
auto const particle1{stack.addParticle(std::make_tuple(particle, E0, plab, pos, 0_ns))};
auto const particle1{stack.addParticle(std::make_tuple(particle, plab, pos, 0_ns))};
auto const charge_ {get_charge(particle1.getPID())};
......@@ -370,7 +370,7 @@ TEST_CASE("Radio", "[processes]") {
// zhs.simulate(particle1, base);
// check writeOutput method -> should produce 2 csv files for each antenna
zhs.writeOutput();
// zhs.writeOutput();
}
......@@ -909,7 +909,7 @@ TEST_CASE("Radio", "[processes]") {
auto plab {beta * pmass * gamma};
Line l {points_[i-1],v};
StraightTrajectory track {l,t};
auto particle1{stack.addParticle(std::make_tuple(particle, E0, plab, points_[i-1], timeCounter))}; //TODO: plab is inconsistent
auto particle1{stack.addParticle(std::make_tuple(particle, plab, points_[i-1], timeCounter))}; //TODO: plab is inconsistent
coreas.doContinuous(particle1,track,true);
}
......@@ -921,7 +921,7 @@ TEST_CASE("Radio", "[processes]") {
auto plab {beta * pmass * gamma};
Line l {points_[399],v};
StraightTrajectory track {l,t};
auto particle1{stack.addParticle(std::make_tuple(particle, E0, plab, points_[399], t))};
auto particle1{stack.addParticle(std::make_tuple(particle, plab, points_[399], t))};
coreas.doContinuous(particle1,track,true);
// get the output
......@@ -1023,14 +1023,14 @@ auto gamma {E0/pmass};
auto plab {beta * pmass * gamma};
Line l {point_1,v};
StraightTrajectory track {l,t};
auto particle1{stack.addParticle(std::make_tuple(particle, E0, plab, point_1, timeCounter))};
auto particle1{stack.addParticle(std::make_tuple(particle, plab, point_1, timeCounter))};
coreas.doContinuous(particle1,track,true);
stack.clear();
}
// get the output
coreas.writeOutput();
// coreas.writeOutput();
}
SECTION("Synchrotron radiation 2") {
......@@ -1125,13 +1125,13 @@ auto gamma {E0/pmass};
auto plab {beta * pmass * gamma};
Line l {point_1,v};
StraightTrajectory track {l,t};
auto particle1{stack.addParticle(std::make_tuple(particle, E0, plab, point_1, timeCounter))};
auto particle1{stack.addParticle(std::make_tuple(particle, plab, point_1, timeCounter))};
coreas.doContinuous(particle1,track,true);
stack.clear();
}
// get the output
coreas.writeOutput();
// coreas.writeOutput();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment