40 using namespace catalogue;
48 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject()));
49 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock()));
50 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo()));
51 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy()));
52 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster()));
53 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void()));
54 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo()));
55 else if (objType==ObjectType::_ChainMeshCell_)
return move(unique_ptr<ChainMeshCell>(
new ChainMeshCell()));
56 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
64 std::shared_ptr<Object>
cbl::catalogue::Object::Create (
const ObjectType objType,
const comovingCoordinates coord,
const double weight,
const long region,
const int ID,
const std::string field,
const double x_displacement,
const double y_displacement,
const double z_displacement)
66 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
67 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
68 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
69 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
70 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
71 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
72 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
73 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
81 std::shared_ptr<Object>
cbl::catalogue::Object::Create (
const ObjectType objType,
const comovingCoordinates coord,
const cosmology::Cosmology &cosm,
const double z1_guess,
const double z2_guess,
const double weight,
const long region,
const int ID,
const std::string field,
const double x_displacement,
const double y_displacement,
const double z_displacement)
83 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
84 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
85 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
86 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
87 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
88 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
89 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
90 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
97 std::shared_ptr<Object>
cbl::catalogue::Object::Create (
const ObjectType objType,
const observedCoordinates coord,
const double weight,
const long region,
const int ID,
const std::string field,
const double x_displacement,
const double y_displacement,
const double z_displacement)
99 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
100 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
101 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
102 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
103 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
104 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
105 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo(coord, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
106 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
113 std::shared_ptr<Object>
cbl::catalogue::Object::Create (
const ObjectType objType,
const observedCoordinates coord,
const CoordinateUnits inputUnits,
const double weight,
const long region,
const int ID,
const std::string field,
const double x_displacement,
const double y_displacement,
const double z_displacement)
115 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject(coord, inputUnits, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
116 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock(coord, inputUnits, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
117 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo(coord, inputUnits, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
118 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy(coord, inputUnits, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
119 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster(coord, inputUnits, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
120 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void(coord, inputUnits, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
121 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo(coord, inputUnits, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
122 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
129 std::shared_ptr<Object>
cbl::catalogue::Object::Create (
const ObjectType objType,
const observedCoordinates coord,
const cosmology::Cosmology &cosm,
const double weight,
const long region,
const int ID,
const std::string field,
const double x_displacement,
const double y_displacement,
const double z_displacement)
131 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject(coord, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
132 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock(coord, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
133 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo(coord, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
134 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy(coord, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
135 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster(coord, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
136 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void(coord, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
137 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo(coord, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
138 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
145 std::shared_ptr<Object>
cbl::catalogue::Object::Create (
const ObjectType objType,
const observedCoordinates coord,
const CoordinateUnits inputUnits,
const cosmology::Cosmology &cosm,
const double weight,
const long region,
const int ID,
const std::string field,
const double x_displacement,
const double y_displacement,
const double z_displacement)
147 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
148 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
149 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
150 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
151 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
152 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
153 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
154 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
161 std::shared_ptr<Object>
cbl::catalogue::Object::Create (
const ObjectType objType,
const double xx,
const double yy,
const double zz,
const double ra,
const double dec,
const double redshift,
const double weight,
const long region,
const int ID,
const std::string field,
const double x_displacement,
const double y_displacement,
const double z_displacement)
163 if (objType==ObjectType::_Random_)
return move(unique_ptr<RandomObject>(
new RandomObject(xx, yy, zz, ra, dec, redshift, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
164 else if (objType==ObjectType::_Mock_)
return move(unique_ptr<Mock>(
new Mock(xx, yy, zz, ra, dec, redshift, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
165 else if (objType==ObjectType::_Halo_)
return move(unique_ptr<Halo>(
new Halo(xx, yy, zz, ra, dec, redshift, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
166 else if (objType==ObjectType::_Galaxy_)
return move(unique_ptr<Galaxy>(
new Galaxy(xx, yy, zz, ra, dec, redshift, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
167 else if (objType==ObjectType::_Cluster_)
return move(unique_ptr<Cluster>(
new Cluster(xx, yy, zz, ra, dec, redshift, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
168 else if (objType==ObjectType::_Void_)
return move(unique_ptr<Void>(
new Void(xx, yy, zz, ra, dec, redshift, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
169 else if (objType==ObjectType::_HostHalo_)
return move(unique_ptr<HostHalo>(
new HostHalo(xx, yy, zz, ra, dec, redshift, weight, region, ID, field, x_displacement, y_displacement, z_displacement)));
170 else ErrorCBL(
"no such type of object!",
"Create",
"Object.cpp");
177 return move(unique_ptr<ChainMeshCell>(
new ChainMeshCell(ID, part, nearCells)));
The class CatalogueChainMesh.
static std::shared_ptr< Object > Create(const ObjectType ObjectType)
static factory used to construct objects of any type, providing in input comoving coordinates
ObjectType
the object types
The global namespace of the CosmoBolognaLib
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
CoordinateUnits
the coordinate units