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);
51 string m_filename = path +
"/data/geometry/Belle2.xml";
52 m_backends.push_back(
"file:");
54 gearbox.setBackends(m_backends);
55 gearbox.open(m_filename);
58 const string cname = path +
"/data/trg/" + CONFIG;
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;
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.
static Gearbox & getInstance()
Return reference to the Gearbox instance.
static TRGCDC * getTRGCDC(const std::string &configFile, unsigned simulationMode=0, unsigned fastSimulationMode=0, unsigned firmwareSimulationMode=0, int firmwareSimulationStart=0, int firmwareSimulationStop=32 *32 - 1, bool _makeRootFile=0, bool perfect2DFinder=false, bool perfect3DFinder=false, const std::string &innerTSLUTFile="?", const std::string &outerTSLUTFile="?", const std::string &rootTRGCDCFile="?", const std::string &rootFitter3DFile="?", unsigned houghFinderPeakMin=5, const std::string &houghMappingFilePlus="?", const std::string &houghMappingFileMinus="?", unsigned houghDoit=2, bool fLogicLUTTSF=0, bool fLRLUT=1, bool fFitter3Dsmclr=0, bool fFitter3Ds2DFit=1, bool fFitter3Ds2DFitDrift=0, double inefficiency=0, bool fileTSF=0, bool fileETF=0, int fverETF=0, bool fprintFirmETF=0, bool fileHough3D=0, int finder3DMode=0, bool fileFitter3D=0, bool fXtSimpleFitter3D=0, double TdcBinWidth=1., int trgCDCDataInputMode=0, const std::string &cdchitCollectionName="")
returns TRGCDC object with specific configuration.
Abstract base class for different kinds of events.