22{
24
25 if ( argc != 2 && argc != 3 ) {
26 std::cerr << "usage: " << argv[0] << " <source-id>" << std::endl;
27 std::cerr << "usage: " << argv[0] << " <subdetector> "
28 << "<module-id>" << std::endl;
29 std::cerr << " 1. The first format transforms from source identifier"
30 << " into components." << std::endl;
31 std::cerr << " 2. The second format transforms from the components into"
32 << " source identifiers." << std::endl;
33 std::exit(1);
34 }
35
36 if ( argc == 2 ) {
37 uint32_t source_id = static_cast<uint32_t>(std::strtoul(argv[1], 0, 0));
39 std::cout << "Components for event format v3.0 are:" << std::endl;
40 std::cout << " - SubDetector ID => "
41 << my.subdetector_id() << ", "
42 <<
HEX(my.subdetector_id())
43 << std::endl;
44 std::cout << " - Module ID => "
45 <<
HEX(
static_cast<unsigned int>(my.module_id()))
46 << std::endl;
47 }
48
49 if ( argc == 3 ) {
51 uint16_t id = static_cast<uint16_t>(std::strtoul(argv[2], 0, 0));
53 std::cout << "Source identifier for event format v3.0 is: "
54 <<
HEX(my.code()) << std::endl;
55 }
56
57 exit(0);
58
59}