We do not care whether the orientation of the coordinate system along the wire flips for negative chambers or not
The ultimate goal is to have the tube positioned at the same place. We maybe need the origin position later when we are adding the alignable transforms...
122 {
124
126 std::string the_arg{
argv[
arg]};
127 if (the_arg == "--refFile" && arg +1 < argc) {
130 } else if (the_arg == "--testFile" && arg + 1 < argc) {
133 }
134 }
136 std::cerr<<"Please parse the path of the reference file via --refFile "<<std::endl;
137 return EXIT_FAILURE;
138 }
140 std::cerr<<"Please parse the path of the test file via --testFile "<<std::endl;
141 return EXIT_FAILURE;
142 }
147 std::set<ActiveSensor> refSensors =
readTreeDump(refFile);
148 if (refSensors.empty()) {
149 std::cerr<<
"The file "<<
refFile<<
" should contain at least one chamber "<<std::endl;
150 return EXIT_FAILURE;
151 }
152 std::set<ActiveSensor> testSensors =
readTreeDump(testFile);
153 if (testSensors.empty()) {
154 std::cerr<<
"The file "<<
testFile<<
" should contain at least one chamber "<<std::endl;
155 return EXIT_FAILURE;
156 }
157 int return_code = EXIT_SUCCESS;
158 unsigned int goodSensors{0};
161 std::set<ActiveSensor>::const_iterator test_itr = testSensors.find(
reference);
162 if (test_itr == testSensors.end()) {
163 std::cerr<<
"runActsGeoComparison() "<<__LINE__<<
": The chamber "<<
reference
164 <<" is not part of the testing "<<std::endl;
165 return_code = EXIT_FAILURE;
166 continue;
167 }
168 bool sensorOkay = true;
170
171
173 std::cerr<<
"runActsGeoComparison() "<<__LINE__<<
": The detector element types are different for "<<
reference<<
" test: "<<
to_string(
test.detType)<<std::endl;
174 sensorOkay = false;
175 }
176
178 std::cerr<<
"runActsGeoComparison() "<<__LINE__<<
": The bound types are different for "<<
reference<<
" test: "<<
test.boundType<<std::endl;
179 sensorOkay = false;
180 } else {
181 for (std::size_t b = 0;
b <
test.boundaryValues.size(); ++
b) {
182 if (std::abs(
reference.boundaryValues[b] -
test.boundaryValues[b]) > Acts::s_epsilon) {
183 std::cerr<<"runActsGeoComparison() "<<__LINE__<<": The bounds are different for "
185 sensorOkay = false;
186 }
187 }
188 }
189 if (std::abs(
test.thickness -
reference.thickness) > Acts::s_epsilon) {
190 std::cerr<<
"runActsGeoComparison() "<<__LINE__<<
": "<<
reference
191 <<" has different thickness w.r.t the test "
193 sensorOkay = false;
194 }
199 std::cerr<<"runActsGeoComparison() "<<__LINE__<<": The chamber coordinate systems rotate differently for "
203 sensorOkay = false;
204 }
207 if (distortion.translation().mag() > Acts::s_onSurfaceTolerance ) {
208 std::cout<<"runActsGeoComparison() "<<__LINE__
209 <<": The origins of the chamber coordinate systems are not exactly at the same point for "
211 sensorOkay = false;
212 }
213 if (sensorOkay){
214 ++goodSensors;
215 }
216 }
218 if (!refSensors.count(test)) {
219 std::cerr<<
"runActsGeoComparison() "<<__LINE__<<
": "<<
test<<
" is only in the test set."<<std::endl;
220 return_code = EXIT_FAILURE;
221 }
222 }
223 std::cout<<"runActsGeoComparison() "<<__LINE__<<": "<<goodSensors<<"/"<<refSensors.size()
224 <<" sensors are in perfect agreement. "<<std::endl;
225 return return_code;
226
227}
static std::string FindCalibFile(const std::string &logical_file_name)
std::string to_string(const DetectorType &type)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
Eigen::Affine3d Transform3D
std::set< ActiveSensor > readTreeDump(const std::string &inputFile)