21
21
#include " celeritas/geo/GeoParams.hh"
22
22
#include " accel/SDTestBase.hh"
23
23
#include " accel/SetupOptions.hh"
24
+ #include " accel/detail/HitManagerOutput.hh"
24
25
25
26
#include " celeritas_test.hh"
26
27
@@ -101,6 +102,13 @@ class SimpleCmsTest : public ::celeritas::test::SDTestBase,
101
102
return result;
102
103
}
103
104
105
+ std::string get_diagnostics (HitManager const & hm)
106
+ {
107
+ HitManagerOutput out (
108
+ std::shared_ptr<HitManager const >(&hm, [](HitManager const *) {}));
109
+ return to_string (out);
110
+ }
111
+
104
112
protected:
105
113
SDSetupOptions sd_setup_;
106
114
::celeritas::test::ScopedLogStorer scoped_log_{&celeritas::world_logger ()};
@@ -124,6 +132,13 @@ TEST_F(SimpleCmsTest, no_change)
124
132
{
125
133
EXPECT_TRUE (scoped_log_.empty ()) << scoped_log_;
126
134
}
135
+
136
+ if (CELERITAS_CORE_GEO == CELERITAS_CORE_GEO_ORANGE)
137
+ {
138
+ EXPECT_JSON_EQ (
139
+ R"json( {"_category":"internal","_label":"hit-manager","locate_touchable":true,"lv_name":["em_calorimeter","had_calorimeter"],"sd_name":["em_calorimeter","had_calorimeter"],"sd_type":["celeritas::test::SimpleSensitiveDetector","celeritas::test::SimpleSensitiveDetector"],"vol_id":[3,4]})json" ,
140
+ this ->get_diagnostics (man));
141
+ }
127
142
}
128
143
129
144
TEST_F (SimpleCmsTest, delete_one)
@@ -150,6 +165,13 @@ TEST_F(SimpleCmsTest, delete_one)
150
165
{
151
166
EXPECT_TRUE (scoped_log_.empty ()) << scoped_log_;
152
167
}
168
+
169
+ if (CELERITAS_CORE_GEO == CELERITAS_CORE_GEO_ORANGE)
170
+ {
171
+ EXPECT_JSON_EQ (
172
+ R"json( {"_category":"internal","_label":"hit-manager","locate_touchable":true,"lv_name":["em_calorimeter"],"sd_name":["em_calorimeter"],"sd_type":["celeritas::test::SimpleSensitiveDetector"],"vol_id":[3]})json" ,
173
+ this ->get_diagnostics (man));
174
+ }
153
175
}
154
176
155
177
TEST_F (SimpleCmsTest, add_duplicate)
@@ -180,6 +202,13 @@ TEST_F(SimpleCmsTest, add_duplicate)
180
202
= {" debug" , " debug" , " debug" };
181
203
EXPECT_VEC_EQ (expected_log_levels, scoped_log_.levels ());
182
204
}
205
+
206
+ if (CELERITAS_CORE_GEO == CELERITAS_CORE_GEO_ORANGE)
207
+ {
208
+ EXPECT_JSON_EQ (
209
+ R"json( {"_category":"internal","_label":"hit-manager","locate_touchable":true,"lv_name":["em_calorimeter","had_calorimeter"],"sd_name":["em_calorimeter","had_calorimeter"],"sd_type":["celeritas::test::SimpleSensitiveDetector","celeritas::test::SimpleSensitiveDetector"],"vol_id":[3,4]})json" ,
210
+ this ->get_diagnostics (man));
211
+ }
183
212
}
184
213
185
214
TEST_F (SimpleCmsTest, add_one)
@@ -199,6 +228,12 @@ TEST_F(SimpleCmsTest, add_one)
199
228
{
200
229
EXPECT_TRUE (scoped_log_.empty ()) << scoped_log_;
201
230
}
231
+ if (CELERITAS_CORE_GEO == CELERITAS_CORE_GEO_ORANGE)
232
+ {
233
+ EXPECT_JSON_EQ (
234
+ R"json( {"_category":"internal","_label":"hit-manager","locate_touchable":true,"lv_name":["si_tracker","em_calorimeter","had_calorimeter"],"sd_name":[null,"em_calorimeter","had_calorimeter"],"sd_type":[null,"celeritas::test::SimpleSensitiveDetector","celeritas::test::SimpleSensitiveDetector"],"vol_id":[2,3,4]})json" ,
235
+ this ->get_diagnostics (man));
236
+ }
202
237
}
203
238
204
239
TEST_F (SimpleCmsTest, no_detector)
0 commit comments