15#define TRG_SHORT_NAMES
16#define TRGCDC_SHORT_NAMES
19#include "trg/cdc/TRGCDC.h"
20#include "trg/cdc/Wire.h"
21#include "trg/cdc/Segment.h"
22#include "framework/gearbox/Gearbox.h"
23#include "trg/cdc/DisplayRphi.h"
24#include "trg/cdc/DisplayHough.h"
25namespace Belle2_TRGCDC {
26 Belle2::TRGCDCDisplayRphi* D = 0;
32using namespace Belle2_TRGCDC;
36#define PROGRAM_NAME "TRGCDCDisplay"
37#define PROGRAM_VERSION "version 0.00"
38#define ENV_PATH "BELLE2_LOCAL_DIR"
39#define CONFIG "TRGCDCWireConfig_0_20101110_0836.dat"
45 cout << PROGRAM_NAME <<
" ... " << PROGRAM_VERSION << endl;
49 const string path = getenv(ENV_PATH);
50 vector<std::string> m_backends;
51 string m_filename = path +
"/data/geometry/Belle2.xml";
52 m_backends.push_back(
"file:");
53 Gearbox& gearbox = Gearbox::getInstance();
54 gearbox.setBackends(m_backends);
55 gearbox.open(m_filename);
58 const string cname = path +
"/data/trg/" + CONFIG;
60 TRGCDC* cdc = TRGCDC::getTRGCDC(cname);
67 string inf =
"1/8 of TS";
69 string target =
"none";
70 for (
unsigned i = 0; i < cdc->nSegments(); i++) {
72 D->area().append(cdc->segment(i));
74 for (
unsigned i = 0; i < cdc->nWires(); i++) {
75 const TCWire& w = * cdc->wire(i);
76 if ((w.layerId() != 2) &&
77 (w.layerId() != 10) &&
78 (w.layerId() != 16) &&
79 (w.layerId() != 22) &&
80 (w.layerId() != 28) &&
81 (w.layerId() != 34) &&
82 (w.layerId() != 40) &&
83 (w.layerId() != 46) &&
84 (w.layerId() != 52))
continue;
86 vector<const TCWire*> v;
87 v.push_back(cdc->wire(i));
88 D->area().append(v, Gdk::Color(
"red"));
98 cout <<
"Enter a target to display" << endl;
100 if (target ==
"clear") {
103 cout <<
"targets cleared" << endl;
104 }
else if (target.find(
"TS") != string::npos) {
106 for (
unsigned i = 0; i < cdc->nSegments(); i++) {
107 if (target == cdc->segment(i).name()) {
108 D->area().append(cdc->segment(i));
109 if (inf.size()) inf +=
",";
120 cout <<
"!!! " << target <<
" not found" << endl;
121 }
else if (target ==
"draw") {
123 }
else if (target ==
"quit") {
126 cout <<
"!!! unknown target" << endl;
132 cout << PROGRAM_NAME <<
" ... terminated" << endl;
140 std::cout <<
"Please turn on TRG*_DISPLAY flags in trg/SConscript to get "
141 <<
"a display" << std::endl;
Singleton class responsible for loading detector parameters from an XML file.
The instance of TRGCDC is a singleton.
Abstract base class for different kinds of events.