41 using namespace catalogue;
42 using namespace pairs;
50 if (info==PairInfo::_standard_) {
52 if (type==PairType::_angular_lin_)
53 return move(unique_ptr<Pair1D_angular_lin>{
new Pair1D_angular_lin(
Min,
Max, nbins, shift, angularUnits, angularWeight)});
55 else if (type==PairType::_angular_log_)
56 return move(unique_ptr<Pair1D_angular_log>{
new Pair1D_angular_log(
Min,
Max, nbins, shift, angularUnits, angularWeight)});
58 else if (type==PairType::_comoving_lin_)
59 return move(unique_ptr<Pair1D_comoving_lin>{
new Pair1D_comoving_lin(
Min,
Max, nbins, shift, angularUnits, angularWeight)});
61 else if (type==PairType::_comoving_log_)
62 return move(unique_ptr<Pair1D_comoving_log>{
new Pair1D_comoving_log(
Min,
Max, nbins, shift, angularUnits, angularWeight)});
64 else if (type==PairType::_comoving_multipoles_lin_)
67 else if (type==PairType::_comoving_multipoles_log_)
70 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
74 else if (info==PairInfo::_extra_) {
76 if (type==PairType::_angular_lin_)
79 else if (type==PairType::_angular_log_)
82 else if (type==PairType::_comoving_lin_)
85 else if (type==PairType::_comoving_log_)
88 else if (type==PairType::_comoving_multipoles_lin_)
91 else if (type==PairType::_comoving_multipoles_log_)
94 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
98 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
109 if (info==PairInfo::_standard_) {
111 if (type==PairType::_angular_lin_)
112 return move(unique_ptr<Pair1D_angular_lin>{
new Pair1D_angular_lin(
Min,
Max, binSize, shift, angularUnits, angularWeight)});
114 else if (type==PairType::_angular_log_)
115 return move(unique_ptr<Pair1D_angular_log>{
new Pair1D_angular_log(
Min,
Max, binSize, shift, angularUnits, angularWeight)});
117 else if (type==PairType::_comoving_lin_)
118 return move(unique_ptr<Pair1D_comoving_lin>{
new Pair1D_comoving_lin(
Min,
Max, binSize, shift, angularUnits, angularWeight)});
120 else if (type==PairType::_comoving_log_)
121 return move(unique_ptr<Pair1D_comoving_log>{
new Pair1D_comoving_log(
Min,
Max, binSize, shift, angularUnits, angularWeight)});
123 else if (type==PairType::_comoving_multipoles_lin_)
126 else if (type==PairType::_comoving_multipoles_log_)
129 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
133 else if (info==PairInfo::_extra_) {
135 if (type==PairType::_angular_lin_)
138 else if (type==PairType::_angular_log_)
141 else if (type==PairType::_comoving_lin_)
144 else if (type==PairType::_comoving_log_)
147 else if (type==PairType::_comoving_multipoles_lin_)
150 else if (type==PairType::_comoving_multipoles_log_)
153 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
157 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
166 shared_ptr<Pair>
cbl::pairs::Pair::Create (
const cbl::pairs::PairType type,
const PairInfo info,
const double Min_D1,
const double Max_D1,
const int nbins_D1,
const double shift_D1,
const double Min_D2,
const double Max_D2,
const int nbins_D2,
const double shift_D2,
const CoordinateUnits angularUnits,
FunctionDoubleDouble angularWeight)
168 if (info==PairInfo::_standard_) {
170 if (type==PairType::_comovingCartesian_linlin_)
171 return move(unique_ptr<Pair2D_comovingCartesian_linlin>{
new Pair2D_comovingCartesian_linlin(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
173 else if (type==PairType::_comovingCartesian_linlog_)
174 return move(unique_ptr<Pair2D_comovingCartesian_linlog>{
new Pair2D_comovingCartesian_linlog(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
176 else if (type==PairType::_comovingCartesian_loglin_)
177 return move(unique_ptr<Pair2D_comovingCartesian_loglin>{
new Pair2D_comovingCartesian_loglin(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
179 else if (type==PairType::_comovingCartesian_loglog_)
180 return move(unique_ptr<Pair2D_comovingCartesian_loglog>{
new Pair2D_comovingCartesian_loglog(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
182 else if (type==PairType::_comovingPolar_linlin_)
183 return move(unique_ptr<Pair2D_comovingPolar_linlin>{
new Pair2D_comovingPolar_linlin(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
185 else if (type==PairType::_comovingPolar_linlog_)
186 return move(unique_ptr<Pair2D_comovingPolar_linlog>{
new Pair2D_comovingPolar_linlog(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
188 else if (type==PairType::_comovingPolar_loglin_)
189 return move(unique_ptr<Pair2D_comovingPolar_loglin>{
new Pair2D_comovingPolar_loglin(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
191 else if (type==PairType::_comovingPolar_loglog_)
192 return move(unique_ptr<Pair2D_comovingPolar_loglog>{
new Pair2D_comovingPolar_loglog(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
194 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
198 else if (info==PairInfo::_extra_) {
200 if (type==PairType::_comovingCartesian_linlin_)
201 return move(unique_ptr<Pair2D_comovingCartesian_linlin_extra>{
new Pair2D_comovingCartesian_linlin_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
203 else if (type==PairType::_comovingCartesian_linlog_)
204 return move(unique_ptr<Pair2D_comovingCartesian_linlog_extra>{
new Pair2D_comovingCartesian_linlog_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
206 else if (type==PairType::_comovingCartesian_loglin_)
207 return move(unique_ptr<Pair2D_comovingCartesian_loglin_extra>{
new Pair2D_comovingCartesian_loglin_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
209 else if (type==PairType::_comovingCartesian_loglog_)
210 return move(unique_ptr<Pair2D_comovingCartesian_loglog_extra>{
new Pair2D_comovingCartesian_loglog_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
212 else if (type==PairType::_comovingPolar_linlin_)
213 return move(unique_ptr<Pair2D_comovingPolar_linlin_extra>{
new Pair2D_comovingPolar_linlin_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
215 else if (type==PairType::_comovingPolar_linlog_)
216 return move(unique_ptr<Pair2D_comovingPolar_linlog_extra>{
new Pair2D_comovingPolar_linlog_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
218 else if (type==PairType::_comovingPolar_loglin_)
219 return move(unique_ptr<Pair2D_comovingPolar_loglin_extra>{
new Pair2D_comovingPolar_loglin_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
221 else if (type==PairType::_comovingPolar_loglog_)
222 return move(unique_ptr<Pair2D_comovingPolar_loglog_extra>{
new Pair2D_comovingPolar_loglog_extra(Min_D1, Max_D1, nbins_D1, shift_D1, Min_D2, Max_D2, nbins_D2, shift_D2, angularUnits, angularWeight)});
224 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
228 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
237 shared_ptr<Pair>
cbl::pairs::Pair::Create (
const cbl::pairs::PairType type,
const PairInfo info,
const double Min_D1,
const double Max_D1,
const double binSize_D1,
const double shift_D1,
const double Min_D2,
const double Max_D2,
const double binSize_D2,
const double shift_D2,
const CoordinateUnits angularUnits,
FunctionDoubleDouble angularWeight)
239 if (info==PairInfo::_standard_) {
241 if (type==PairType::_comovingCartesian_linlin_)
242 return move(unique_ptr<Pair2D_comovingCartesian_linlin>{
new Pair2D_comovingCartesian_linlin(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
244 else if (type==PairType::_comovingCartesian_linlog_)
245 return move(unique_ptr<Pair2D_comovingCartesian_linlog>{
new Pair2D_comovingCartesian_linlog(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
247 else if (type==PairType::_comovingCartesian_loglin_)
248 return move(unique_ptr<Pair2D_comovingCartesian_loglin>{
new Pair2D_comovingCartesian_loglin(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
250 else if (type==PairType::_comovingCartesian_loglog_)
251 return move(unique_ptr<Pair2D_comovingCartesian_loglog>{
new Pair2D_comovingCartesian_loglog(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
253 else if (type==PairType::_comovingPolar_linlin_)
254 return move(unique_ptr<Pair2D_comovingPolar_linlin>{
new Pair2D_comovingPolar_linlin(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
256 else if (type==PairType::_comovingPolar_linlog_)
257 return move(unique_ptr<Pair2D_comovingPolar_linlog>{
new Pair2D_comovingPolar_linlog(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
259 else if (type==PairType::_comovingPolar_loglin_)
260 return move(unique_ptr<Pair2D_comovingPolar_loglin>{
new Pair2D_comovingPolar_loglin(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
262 else if (type==PairType::_comovingPolar_loglog_)
263 return move(unique_ptr<Pair2D_comovingPolar_loglog>{
new Pair2D_comovingPolar_loglog(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
267 else if (info==PairInfo::_extra_) {
269 if (type==PairType::_comovingCartesian_linlin_)
270 return move(unique_ptr<Pair2D_comovingCartesian_linlin_extra>{
new Pair2D_comovingCartesian_linlin_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
272 else if (type==PairType::_comovingCartesian_linlog_)
273 return move(unique_ptr<Pair2D_comovingCartesian_linlog_extra>{
new Pair2D_comovingCartesian_linlog_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
275 else if (type==PairType::_comovingCartesian_loglin_)
276 return move(unique_ptr<Pair2D_comovingCartesian_loglin_extra>{
new Pair2D_comovingCartesian_loglin_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
278 else if (type==PairType::_comovingCartesian_loglog_)
279 return move(unique_ptr<Pair2D_comovingCartesian_loglog_extra>{
new Pair2D_comovingCartesian_loglog_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
281 else if (type==PairType::_comovingPolar_linlin_)
282 return move(unique_ptr<Pair2D_comovingPolar_linlin_extra>{
new Pair2D_comovingPolar_linlin_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
284 else if (type==PairType::_comovingPolar_linlog_)
285 return move(unique_ptr<Pair2D_comovingPolar_linlog_extra>{
new Pair2D_comovingPolar_linlog_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
287 else if (type==PairType::_comovingPolar_loglin_)
288 return move(unique_ptr<Pair2D_comovingPolar_loglin_extra>{
new Pair2D_comovingPolar_loglin_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
290 else if (type==PairType::_comovingPolar_loglog_)
291 return move(unique_ptr<Pair2D_comovingPolar_loglog_extra>{
new Pair2D_comovingPolar_loglog_extra(Min_D1, Max_D1, binSize_D1, shift_D1, Min_D2, Max_D2, binSize_D2, shift_D2, angularUnits, angularWeight)});
295 else ErrorCBL(
"no such type of object!",
"Create",
"Pair.cpp");
The class Pair1D_angular_lin.
The class Pair1D_angular_log.
The class Pair1D_comoving_lin.
The class Pair1D_comoving_log.
The class Pair1D_comoving_multipoles_lin.
The class Pair1D_comoving_multipoles_log.
The class Pair2D_comovingCartesian_linlin.
The class Pair2D_comovingCartesian_linlog.
The class Pair2D_comovingCartesian_loglin.
The class Pair2D_comovingCartesian_loglog.
The class Pair2D_comovingPolar_linlin.
The class Pair2D_comovingPolar_linlog.
The class Pair2D_comovingPolar_loglin.
The class Pair2D_comovingPolar_loglog.
static std::shared_ptr< Pair > Create(const PairType type, const PairInfo info, const double Min, const double Max, const int nbins, const double shift, const CoordinateUnits angularUnits=CoordinateUnits::_radians_, FunctionDoubleDouble angularWeight=nullptr)
static factory used to construct pairs of any type
PairInfo
the information contained in the pairs
The global namespace of the CosmoBolognaLib
T Min(const std::vector< T > vect)
minimum element of a std::vector
int ErrorCBL(const std::string msg, const std::string functionCBL, const std::string fileCBL, const cbl::glob::ExitCode exitCode=cbl::glob::ExitCode::_error_)
throw an exception: it is used for handling exceptions inside the CosmoBolognaLib
T Max(const std::vector< T > vect)
maximum element of a std::vector
std::function< double(double)> FunctionDoubleDouble
typedef of a function returning a double with a double in input
CoordinateUnits
the coordinate units