Skip to content
Snippets Groups Projects

Fix UT geometry and tracking

Merged Hangyi Wu requested to merge ut-geo-fixes into master
Compare and
23 files
+ 556
1162
Compare changes
  • Side-by-side
  • Inline
Files
23
@@ -126,7 +126,9 @@ static long test_load_deut( dd4hep::Detector& description, int argc, char** argv
}
dd4hep::printout( dd4hep::INFO, "UT", "Checked global position of A-side" );
// check ChannelID vs VolumeID
/////////////////////////////////
/* check ChannelID vs VolumeID */
/////////////////////////////////
for ( const auto& side : ut.sides() )
for ( const auto& layer : side.layers() )
for ( const auto& stave : layer.staves() )
@@ -158,15 +160,45 @@ static long test_load_deut( dd4hep::Detector& description, int argc, char** argv
dd4hep::printout( dd4hep::DEBUG, "UTCondition", "values[%d]: %.0f", i, values[i].get<double>() );
}
}
// for ( const std::string& layer_name : layer_names ) {
// const auto& values = readoutMapCond[layer_name + "Map"]; // implement for all layers
// for ( std::size_t i = 0; i < values.size(); i++ ) {
// dd4hep::printout( dd4hep::DEBUG, layer_name + "ReadoutMap", "values[%d]: %.0f", i, values[i].get<double>() );
// }
// }
} catch ( const char* msg ) { allChecksOK = false; }
dd4hep::printout( dd4hep::INFO, "UTCondition", "Successfully accessed ReadoutMap condition" );
////////////////////////
/* check getLayerGeom */
////////////////////////
std::array<float, 4> z_values{{2328.15, 2383.15, 2593.15, 2648.15}};
std::array<float, 4> invHalfSectorYSize_values{{0.0209205, 0.0210004, 0.0210004, 0.0209205}};
std::array<float, 4> invHalfSectorXSize_values{{0.0209263, 0.0209166, 0.0209166, 0.0209263}};
std::array<float, 4> dxDy_values{{0, 0.0874886, -0.0874886, 0}};
for ( unsigned int i = 0; i < 4; i++ ) {
auto layerGeom = ut.getLayerGeom( i );
if ( layerGeom.z - z_values[i] > 0.01 ) {
std::cerr << "layer " << layer_names[i] << " has z=" << layerGeom.z << ", expected z=" << z_values[i]
<< ", diff=" << layerGeom.z - z_values[i] << std::endl;
allChecksOK = false;
}
if ( layerGeom.invHalfSectorYSize - invHalfSectorYSize_values[i] > 1e-5 ) {
std::cerr << "layer " << layer_names[i] << " has invHalfSectorYSize=" << layerGeom.invHalfSectorYSize
<< ", expected invHalfSectorYSize=" << invHalfSectorYSize_values[i]
<< ", diff=" << layerGeom.invHalfSectorYSize - invHalfSectorYSize_values[i] << std::endl;
allChecksOK = false;
}
if ( layerGeom.invHalfSectorXSize - invHalfSectorXSize_values[i] > 1e-5 ) {
std::cerr << "layer " << layer_names[i] << " has invHalfSectorXSize=" << layerGeom.invHalfSectorXSize
<< ", expected invHalfSectorXSize=" << invHalfSectorXSize_values[i]
<< ", diff=" << layerGeom.invHalfSectorXSize - invHalfSectorXSize_values[i] << std::endl;
allChecksOK = false;
}
if ( layerGeom.dxDy - dxDy_values[i] > 1e-5 ) {
std::cerr << "layer " << layer_names[i] << "has dxDy=" << layerGeom.dxDy << ", expected dxDy=" << dxDy_values[i]
<< ", diff=" << layerGeom.dxDy - dxDy_values[i] << std::endl;
allChecksOK = false;
}
}
////////////////////////////////////////////////
/* sector and stave names based on GeoVersion */
////////////////////////////////////////////////
std::vector<std::string> sector_names;
std::vector<std::string> stave_names;
if ( ut.version() == LHCb::Detector::UT::DeUT::GeoVersion::v1 ) {
@@ -1080,17 +1112,6 @@ static long test_load_deut( dd4hep::Detector& description, int argc, char** argv
"UTbXLayerR3Module7Sector9"};
}
// // FIXME: testing accessibility of production map from Condition DB
// dd4hep::printout( dd4hep::INFO, "UT", "Accessing ProductionMap.yml" );
// try {
// const auto& prodMapCond = slice->get( utdet, LHCb::Detector::item_key( "ProductionMap" ) ).get<nlohmann::json>();
// for ( const std::string& stave_name : stave_names ) {
// dd4hep::printout( dd4hep::INFO, "UT", "Accessing " + stave_name );
// dd4hep::printout( dd4hep::DEBUG, stave_name, +"ProdID: %.0f", prodMapCond[stave_name]["ProdID"].get<double>()
// );
// }
// } catch ( const char* msg ) { allChecksOK = false; }
// testing accessibility of noise values
try {
const auto& noiseValueCond = slice->get( utdet, LHCb::Detector::item_key( "NoiseValues" ) ).get<nlohmann::json>();
Loading