14#include <fmt/format.h>
15#include <boost/program_options.hpp>
22 std::cout << fmt::format(
"DE {:4d} DS {:4d} CH {:2d} PADID {:6d} X {:7.2f} Y {:7.2f} SX{:7.2f} SY {:7.2f}\n",
39 std::cout << fmt::format(
"DE {:4d} DS {:4d} CH {:2d} PADID {:6d} (channel not connected to an actual pad)\n",
40 seg.detElemId(), dsId, dsCh, padId);
46 bool existingDualSampa{
false};
48 if (dsId == dualSampaId) {
49 existingDualSampa =
true;
53 if (!existingDualSampa) {
54 std::cout << fmt::format(
"DE {:4d} DS {:4d} does not exist\n",
55 seg.detElemId(), dualSampaId);
59 for (
auto ch = 0; ch < 64; ch++) {
71int main(
int argc,
char** argv)
78 po::options_description
generic(
"Generic options");
82 (
"help,h",
"produce help message")
83 (
"de,d",po::value<int>(&deId)->required(),
"detection element id")
84 (
"ds,s",po::value<int>(&dsId),
"dual sampa id")
85 (
"ch,c",po::value<int>(&dsCh),
"dual sampa ch")
86 (
"padid,p",po::value<int>(&padId),
"padid")
90 po::options_description cmdline;
93 po::store(po::command_line_parser(argc, argv).options(cmdline).run(), vm);
95 if (vm.count(
"help")) {
96 std::cout <<
"This program printout MCH basic mapping information.\n";
97 std::cout <<
" --de # : for a full detection element\n";
98 std::cout <<
" --de # --ds # : for one dual sampa of a detection element\n";
99 std::cout <<
" --de # --ds # --ch # : for one channel of a one dual sampa of a detection element\n";
100 std::cout <<
" --de # --padid # : for one pad of a one dual sampa of a detection element\n";
101 std::cout <<
"Pad sizes and positions are reported in centimeters\n";
102 std::cout <<
generic <<
"\n";
108 }
catch (boost::program_options::error& e) {
109 std::cout <<
"Error: " << e.what() <<
"\n";
115 if (vm.count(
"padid")) {
120 if (vm.count(
"ds") && vm.count(
"ch")) {
125 if (vm.count(
"ds")) {
o2::mch::mapping::CathodeSegmentation seg
void dumpDetectionElement(const o2::mch::mapping::Segmentation &seg)
void dumpDualSampa(const o2::mch::mapping::Segmentation &seg, int dualSampaId)
void dumpPad(const o2::mch::mapping::Segmentation &seg, int padId)
double padSizeY(int catPadIndex) const
double padSizeX(int catPadIndex) const
int padDualSampaChannel(int catPadIndex) const
int padDualSampaId(int catPadIndex) const
void forEachDualSampa(std::function< void(int dualSampaId)> func) const
Loop over dual sampas of this detection element.
double padPositionY(int catPadIndex) const
int findPadByFEE(int dualSampaId, int dualSampaChannel) const
double padPositionX(int catPadIndex) const
bool isValid(int catPadIndex) const
Not every integer is a valid catPadIndex. This method will tell if catPadIndex is a valid one.
A Segmentation lets you find pads of a detection element and then inspect those pads.