206 properties[
"focus"] = focus;
208 JParser<> zap(
"Auxiliary program to draw the footprint of detector(s).");
210 zap[
'w'] =
make_field(canvas,
"size of canvas <nx>x<ny> [pixels]") =
JCanvas(500, 500);
216 zap[
'L'] =
make_field(legend,
"position legend e.g. TR") =
"",
"TL",
"TR",
"BR",
"BL";
217 zap[
'S'] =
make_field(markerSize,
"marker size") = 1.0;
218 zap[
's'] =
make_field(textSize,
"text size") = 0.02;
219 zap[
'C'] =
make_field(drawCircle,
"draw smallest enclosing cicrle");
220 zap[
'A'] =
make_field(all,
"draw all modules");
221 zap[
'B'] =
make_field(batch,
"batch processing");
226 catch(
const exception &error) {
227 FATAL(error.what() << endl);
231 if (detectorFile.empty() && tripodsFile.empty()) {
232 FATAL(
"No detector elements." << endl);
236 gROOT->SetBatch(batch);
238 gErrorIgnoreLevel = kWarning;
240 TApplication* tp =
new TApplication(
"user", NULL, NULL);
241 TCanvas* cv =
new TCanvas(
"detector",
"", canvas.
x, canvas.
y);
244 ((TRootCanvas *) cv->GetCanvasImp())->Connect(
"CloseWindow()",
"TApplication", tp,
"Terminate()");
247 unique_ptr<TStyle> gStyle(
new JStyle(
"gplot", cv->GetWw(), cv->GetWh()));
249 gROOT->SetStyle(
"gplot");
252 cv->SetFillStyle(4000);
253 cv->SetFillColor(kWhite);
257 JMarkerAttributes::getInstance().setMarkerSize(markerSize);
260 TAttText(kHAlignLeft + kVAlignBottom, 0.25*PI, kBlack, 62, textSize),
261 TAttText(kHAlignRight + kVAlignBottom, 0.75*PI, kBlack, 62, textSize),
262 TAttText(kHAlignRight + kVAlignTop, 1.25*PI, kBlack, 62, textSize),
263 TAttText(kHAlignLeft + kVAlignTop, 1.75*PI, kBlack, 62, textSize)
270 for (
size_t i = 0; i != detectorFile.size(); ++i) {
281 position =
detector.getUTMPosition();
283 const TAttMarker& marker = *JMarkerAttributes::getInstance().next();
284 const TAttText&
text = text_attributes[(0+i)%text_attributes.size()];
293 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
295 if (module->getFloor() == 0) {
297 buffer.push_back(JPoint_t(
MAKE_STRING(module->getString()),
303 counter.insert(module->getString());
307 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
309 const bool status = (counter.count(module->getString()) == 0);
313 buffer.push_back(JPoint_t((status ?
MAKE_STRING(module->getString()) :
""),
319 counter.insert(module->getString());
324 for (
size_t i = 0; i != tripodsFile.size(); ++i) {
328 tripods.
load(tripodsFile[i].c_str());
330 const TAttMarker& marker = *JMarkerAttributes::getInstance().next();
331 const TAttText&
text = text_attributes[(0+i)%text_attributes.size()];
338 for (tripods_container::iterator i = tripods.begin(); i != tripods.end(); ++i) {
348 if (!transmittersFile.empty()) {
350 if (transmittersFile.size() == detectorFile.size()) {
352 for (
size_t i = 0; i != transmittersFile.size(); ++i) {
356 transmitters.
load(transmittersFile[i].c_str());
362 const TAttMarker& marker = *JMarkerAttributes::getInstance().next();
363 const TAttText&
text = text_attributes[(2+i)%text_attributes.size()];
367 offset = 3.0 * textSize *
JCircle2D(transmitters.begin(), transmitters.end()).
getRadius();
370 for (transmitters_container::iterator i = transmitters.begin(); i != transmitters.end(); ++i) {
384 FATAL(
"Tranmitter files and detector files should match one-to-one." << endl);
391 copy(i->second.begin(), i->second.end(), back_inserter(buffer));
394 JCircle2D circle(buffer.begin(), buffer.end());
405 i->second.sub(circle.
getX(), circle.
getY());
415 const Double_t xmin = circle.
getX() - 1.15 * circle.
getRadius();
416 const Double_t xmax = circle.
getX() + 1.15 * circle.
getRadius();
417 const Double_t ymin = circle.
getY() - 1.15 * circle.
getRadius();
418 const Double_t ymax = circle.
getY() + 1.15 * circle.
getRadius();
420 TH2D h2(
"h2",
"", 200, xmin, xmax, 200, ymin, ymax);
422 h2.GetXaxis()->SetTitle(
"x [m]");
423 h2.GetYaxis()->SetTitle(
"y [m]");
425 h2.GetXaxis()->CenterTitle(
true);
426 h2.GetYaxis()->CenterTitle(
true);
444 Ssiz_t height = data.size();
448 width = max(width, (Ssiz_t) i->first.size());
451 TLegend* lg = getLegend(width, height, legend);
453 lg->SetTextSize(textSize);
456 if (!i->second.empty()) {
457 lg->AddEntry(&i->second[0].marker, i->first.c_str(),
"P");