205 properties[
"focus"] = focus;
207 JParser<> zap(
"Auxiliary program to draw the footprint of detector(s).");
209 zap[
'w'] =
make_field(canvas,
"size of canvas <nx>x<ny> [pixels]") =
JCanvas(500, 500);
215 zap[
'L'] =
make_field(legend,
"position legend e.g. TR") =
"",
"TL",
"TR",
"BR",
"BL";
216 zap[
'S'] =
make_field(markerSize,
"marker size") = 1.0;
217 zap[
's'] =
make_field(textSize,
"text size") = 0.02;
218 zap[
'C'] =
make_field(drawCircle,
"draw smallest enclosing cicrle");
219 zap[
'A'] =
make_field(all,
"draw all modules");
220 zap[
'B'] =
make_field(batch,
"batch processing");
225 catch(
const exception &error) {
226 FATAL(error.what() << endl);
230 if (detectorFile.empty() && tripodsFile.empty()) {
231 FATAL(
"No detector elements." << endl);
235 gROOT->SetBatch(batch);
237 gErrorIgnoreLevel = kWarning;
239 TApplication* tp =
new TApplication(
"user", NULL, NULL);
240 TCanvas* cv =
new TCanvas(
"detector",
"", canvas.
x, canvas.
y);
243 ((TRootCanvas *) cv->GetCanvasImp())->Connect(
"CloseWindow()",
"TApplication", tp,
"Terminate()");
246 unique_ptr<TStyle> gStyle(
new JStyle(
"gplot", cv->GetWw(), cv->GetWh()));
248 gROOT->SetStyle(
"gplot");
251 cv->SetFillStyle(4000);
252 cv->SetFillColor(kWhite);
256 JMarkerAttributes::getInstance().setMarkerSize(markerSize);
259 TAttText(kHAlignLeft + kVAlignBottom, 0.25*PI, kBlack, 62, textSize),
260 TAttText(kHAlignRight + kVAlignBottom, 0.75*PI, kBlack, 62, textSize),
261 TAttText(kHAlignRight + kVAlignTop, 1.25*PI, kBlack, 62, textSize),
262 TAttText(kHAlignLeft + kVAlignTop, 1.75*PI, kBlack, 62, textSize)
269 for (
size_t i = 0; i != detectorFile.size(); ++i) {
280 position =
detector.getUTMPosition();
282 const TAttMarker& marker = *JMarkerAttributes::getInstance().next();
283 const TAttText&
text = text_attributes[(0+i)%text_attributes.size()];
292 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
294 if (module->getFloor() == 0) {
296 buffer.push_back(JPoint_t(
MAKE_STRING(module->getString()),
302 counter.insert(module->getString());
306 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
308 const bool status = (counter.count(module->getString()) == 0);
312 buffer.push_back(JPoint_t((status ?
MAKE_STRING(module->getString()) :
""),
318 counter.insert(module->getString());
323 for (
size_t i = 0; i != tripodsFile.size(); ++i) {
327 tripods.
load(tripodsFile[i].c_str());
329 const TAttMarker& marker = *JMarkerAttributes::getInstance().next();
330 const TAttText&
text = text_attributes[(0+i)%text_attributes.size()];
337 for (tripods_container::iterator i = tripods.begin(); i != tripods.end(); ++i) {
347 if (!transmittersFile.empty()) {
349 if (transmittersFile.size() == detectorFile.size()) {
351 for (
size_t i = 0; i != transmittersFile.size(); ++i) {
355 transmitters.
load(transmittersFile[i].c_str());
361 const TAttMarker& marker = *JMarkerAttributes::getInstance().next();
362 const TAttText&
text = text_attributes[(2+i)%text_attributes.size()];
366 offset = 3.0 * textSize *
JCircle2D(transmitters.begin(), transmitters.end()).
getRadius();
369 for (transmitters_container::iterator i = transmitters.begin(); i != transmitters.end(); ++i) {
383 FATAL(
"Tranmitter files and detector files should match one-to-one." << endl);
390 copy(i->second.begin(), i->second.end(), back_inserter(buffer));
393 JCircle2D circle(buffer.begin(), buffer.end());
404 i->second.sub(circle.
getX(), circle.
getY());
414 const Double_t xmin = circle.
getX() - 1.15 * circle.
getRadius();
415 const Double_t xmax = circle.
getX() + 1.15 * circle.
getRadius();
416 const Double_t ymin = circle.
getY() - 1.15 * circle.
getRadius();
417 const Double_t ymax = circle.
getY() + 1.15 * circle.
getRadius();
419 TH2D h2(
"h2",
"", 200, xmin, xmax, 200, ymin, ymax);
421 h2.GetXaxis()->SetTitle(
"x [m]");
422 h2.GetYaxis()->SetTitle(
"y [m]");
424 h2.GetXaxis()->CenterTitle(
true);
425 h2.GetYaxis()->CenterTitle(
true);
443 Ssiz_t height = data.size();
447 width = max(width, (Ssiz_t) i->first.size());
450 TLegend* lg = getLegend(width, height, legend);
452 lg->SetTextSize(textSize);
455 if (!i->second.empty()) {
456 lg->AddEntry(&i->second[0].marker, i->first.c_str(),
"P");