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
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
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.