Skip to content

Draft: Improve the handling of the TRD parameters and some othe minor code style improvements.

Pascal Raisig requested to merge praisig/cbmroot:improveParHandlingTrd1D into master

PAL edit 22/02/2024: Redmine refs #2646 #2853

Important remark this MR changes the IO of CbmTrdParSetAsic from the ascii parameter files. Thus, it needs to merged into the master in sync with the merge request CbmSoft/cbmroot_parameter!72 (closed) to the parameter repositor!

  1. Drop unnecessary name tags for CbmTrd Asic type enum, since, the enum is part of CbmTrdDigi and thus, the tags are already part of the namespace of the enum.

  2. Provide static helper function in CbmTrdGeoHandler, which extract the module type from the module label in our geometries.

  3. Drop unnecessary name tags for HardwareSetupVersion enum ECbmTrdHardwareSetupVersion -> eHardwareSetupVersion

  4. Add mcbm2021 component id setup to CbmTrdHardwareSetupR

  5. Move functions creating the hardware to software address translation maps from CbmTrdHardwareSetupR to CbmTrdParSpadic and make them static. Allows to remove CbmTrdHardwareSetupR from the include files and the functions do not need to any class members. In addition the code handling the creation was further improved and trimmed down.

  6. Trim down code in CbmTrdHardwareSetupR::WriteComponentIdsToParams()

  7. Drop enum for component Id position composition and use static constexpr instead. Using an enum only assigning fixed numbers does not seem to be optimal. Thus, now static constexpr functions are used. The functions are emplaced in CbmTrdParAsic instead of CbmTrdParSpadic, since, the component Id itself is also stored their and the functionality should be common for Spadic and Fasp.

  8. CbmTrdParFasp: remove casting in print statements and use correct variable place holders instead.

  9. Adjust used types for GetNrChannels (former GetNchannels) functions in CbmTrdParAsic and the derived classes. The number of channels can not be negative and using a unsigned type here removes potential issues in comparing statements.

  10. Implement a workaround for mcbm2021 where a 2D chamber was used with a Spadic in CbmTrdParManager::CreateModuleParameters, allowing correct automatic parameter creation.

  11. Instead of using a hardcoded function returning the number of spadics on a chamber, this is now calculated based on the amount of channels on the chamber. (Mainly used in CbmTrdParManager)

  12. CbmTrdParSet drop ROOT variable types together with RtypesCore include statement

  13. CbmTrdParSetAsic adjust the code to further use range based loops, which should make the code more readable and less error prone. Adjust the code for changes in other classes. Drop const from return statement of CbmTrdParSetAsic::GetModuleSet, since this blocked static_casting and some stages, where it is required in the restructured code.

  14. Drop NSPADICCH define statement in CbmTrdParSpadic and use a static constexpr in CbmTrdSpadic instead. This should be better handled by the compiler.

  15. Add a safety to the unpacker which handles wrongly assigned eLinks in case of less than the maximum of eLinks are connected to a chamber. Now when a wrong eLink number is in a HitMessage it is the data is attached to a dummy eLink with the ID 99.

  16. Change parameter setting for CbmTrdParSetAsic for asic type parameter to use the eAsicType enum instead of the module type. This change requires an update of all parameter files.

I would propose @a.bercuci as reviewer and add @a_meye37_AT_uni-muenster.de, @apuntke and @p.kaehler for the 1D group. I will still try to check it in the new year, but can not guarantee quick responding. Nevertheless, I think the updates will help, since, they also fix the automatic parameter creation for the TRD-1D for mCbm2021. Feel free to change things in the MR if you think changes are necessary.

Cheers and "einen guten Rutsch", Pascal

Edited by Pierre-Alain Loizeau

Merge request reports