110{
112
113 string detectorFile;
114 int moduleID;
116
117 try {
118
119 JParser<> zap(
"Auxiliary program to draw a given module in 3D.");
120
124
125 zap(argc, argv);
126 }
127 catch(const exception &error) {
128 FATAL(error.what() << endl);
129 }
130
131
133
134
136
137 try {
139 }
142 }
143
145 FATAL(
"Empty detector.");
146 }
147
148
150
151 if (moduleID == -1) {
152
153 module = detector.front();
154
155 } else {
156
158
159 if (!router.hasModule(moduleID)) {
160 FATAL(
"Missing module " << moduleID <<
endl);
161 } else {
162 module = router.getModule(moduleID);
163 }
164 }
165
166 module -= module.getPosition();
167
168
171
172
174
177
178 ((
TRootCanvas *)
c1->GetCanvasImp())->
Connect(
"CloseWindow()",
"TApplication", tp,
"Terminate()");
179
181
183 p1->SetBorderSize(0);
184 p1->SetTextSize(0.03);
185
187
191
192
193
194
195
196
197
198
199
200
201
202 const double dz = 3.0;
203 const double R1 = 2.0;
204 const double R2 = 4.0;
205
206
208
209 for (unsigned int tdc = 0; tdc != module.size(); ++tdc) {
210
212 const int index = address.
ring -
'A';
213
214 ostringstream os[2];
215
217 os[1] <<
"TDC " <<
setw(2) << tdc;
218
220
223
224 for (int i = 0; i != sizeof(os)/sizeof(os[0]); ++i) {
225 pTube->AddText(os[i].str());
226 pCone->AddText(os[i].str());
227 }
228
231
234
235 const JPMT& pmt =
module.getPMT(tdc);
236
240
243
248 << " TDC "
249 <<
setw(2) << tdc <<
" "
250 <<
FIXED(3,0) << x <<
" [cm] "
251 <<
FIXED(3,0) << y <<
" [cm] "
252 <<
FIXED(3,0) << z <<
" [cm] "
253 <<
FIXED(4,0) << theta <<
" [deg] "
254 <<
FIXED(4,0) << phi <<
" [deg] "
256
258
261
263 }
264
267
269
270 c1->GetView()->ShowAxis();
272
273 tp->Run();
274}
TCanvas * c1
Global variables to handle mouse events.
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Lookup table for PMT addresses in detector.
Lookup table for PMT addresses in optical module.
Router for direct addressing of module data in detector data structure.
Data structure for a composite optical module.
char ring
ring number ['A','F']
int position
position within ring [1,6]
Data structure for PMT geometry, calibration and status.
double getY() const
Get y position.
double getZ() const
Get z position.
double getX() const
Get x position.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
int getID() const
Get identifier.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Data structure to translate PMT physical to readout address.