/////////////////////////////////////////////////////////////////////////////// /// RAT::GeoUtils /// /// \brief Implement auxiliary functions to patch geometry classes /// /// \author Nuno Barros /// /// REVISION HISTORY:\n /// 14-11-2019 : N Barros - Initial release /// 8-12-2020 : J Tseng - add AV offset code /// /// \details This file implements a few utilitary functions that can be used by the /// main geometry classes to correct for effects that can be runtime dependent, such as the /// scintillator level during partial fill. /// /// /////////////////////////////////////////////////////////////////////////////// /* * GeoUtils.hh * * Created on: Nov 14, 2019 * Author: nbarros */ #ifndef GEO_GEOUTILS_HH_ #define GEO_GEOUTILS_HH_ #include namespace RAT { namespace GeoUtil { // JCT: Check for an AV offset // 1. check if GEO[av].position has been defined on user plane // (this includes situation that these methods have been // called before, in which case the overridden value has // been written into a user plane table) // 2. if not on the user plane, look for an AV_OFFSET_RUNTIME table. // Write value into GEO[av].position on user plane. // 3. if there's no AV_OFFSET_RUNTIME table either, // read AV offset from GEO[av].position on default plane. // (no need to duplicate on user plane) // The following version returns the 3-vector, // which reflects the x,y,z of the AV center, in PSUP coordinates. std::vector UpdateAVOffsetVectorFromDB(); // the following version returns just the z offset of the AV, // in PSUP coordinates. double UpdateAVOffsetFromDB(); // NFB: Check if there is a corresponding split_z runtime table // -- There are two things that one needs to check: // 1. The split_z value is set in the user plane (i.e., macro) // * In this case we no longer need to check the runtime table, as // a user plane value has priority // (means the user *wants* the split to be something specific) // // 2. The split_z value exists in the runtime table (run plane) // * The runtime table is not a geometry table, so we want to 'transfer' // the split into the geometry object. // We do this by setting a user plane value // (equivalent to set it in the macro) // * AV offset is also taken out in this case // (note that this is NOT done if split_z defined in user plane, // as we assume the user is working in a consistent coordinate system) void UpdatePartialSplitFromDB(double &split_pos); // Wrapper function that does not care about a return void CheckPartialSplitAndUpdate(); } } #endif /* GEO_GEOUTILS_HH_ */