8 #include "TApplication.h" 
   38 int main(
int argc, 
char**argv)
 
   54     JParser<> zap(
"Auxiliary program to draw the footprint of detector(s).");
 
   56     zap[
'w'] = 
make_field(canvas,       
"size of canvas <nx>x<ny> [pixels]")  = 
JCanvas(500, 500);
 
   57     zap[
'a'] = 
make_field(detectorFile, 
"detector file");
 
   60     zap[
'L'] = 
make_field(legend,       
"optional legend");
 
   61     zap[
'S'] = 
make_field(markerSize,   
"marker size")                        = 1.0;
 
   62     zap[
'B'] = 
make_field(batch,        
"batch processing");
 
   67   catch(
const exception &error) {
 
   68     FATAL(error.what() << endl);
 
   72   gROOT->SetBatch(batch);
 
   74   gErrorIgnoreLevel = kWarning;
 
   76   TApplication* tp = 
new TApplication(
"user", NULL, NULL);
 
   77   TCanvas*      cv = 
new TCanvas(
"detector", 
"", canvas.x, canvas.y);
 
   81   gROOT->SetStyle(
"gplot");
 
   84   cv->SetFillStyle(4000);
 
   85   cv->SetFillColor(kWhite);
 
   92   int number_of_positions = 0;
 
  104       load(*file_name, detector);
 
  110     if (detector.empty()) {
 
  111       ERROR(
"Empty detector." << endl);
 
  114     circle   = 
JCircle2D(detector.begin(), detector.end());
 
  117     TGraph* graph = 
new TGraph(detector.size());
 
  123     for (JDetector::const_iterator i = detector.begin(); i != detector.end(); ++i, ++
n) {      
 
  125       number_of_positions += 1;
 
  127       graph->GetX()[
n] = i->getX();
 
  128       graph->GetY()[
n] = i->getY();
 
  133     buffer.push_back(graph);
 
  136   if (!tripods.empty()) {
 
  138     if (number_of_positions == 0) {
 
  144       position /= tripods.size();
 
  150       zbuf.push_back(*i - position);
 
  153     circle   = 
JCircle2D(zbuf.begin(), zbuf.end());
 
  155     TGraph* graph = 
new TGraph(zbuf.size());
 
  157     graph->SetTitle(
"tripod");
 
  159     for (
size_t i = 0; i != zbuf.size(); ++i) {
 
  160       graph->GetX()[i] = zbuf[i].getPosition().getX();
 
  161       graph->GetY()[i] = zbuf[i].getPosition().getY();
 
  166     buffer.push_back(graph);
 
  169   if (number_of_positions == 0 && tripods.empty()) {
 
  170     FATAL(
"No detector elements." << endl);
 
  174   DEBUG(
"Detector (x,y,R): " << circle.getX() << 
' ' << circle.getY() << 
' ' << circle.getRadius() << endl);
 
  177     for (
int i = 0; i != (*graph)->GetN(); ++i) {
 
  178       (*graph)->GetX()[i] -= circle.getX();
 
  179       (*graph)->GetY()[i] -= circle.getY();
 
  183   circle.sub(circle.getPosition());
 
  185   Double_t 
R    = circle.getRadius();
 
  191   Double_t xmin = circle.getX() - 
R;
 
  192   Double_t xmax = circle.getX() + 
R;
 
  193   Double_t ymin = circle.getY() - 
R;
 
  194   Double_t ymax = circle.getY() + 
R;
 
  197   const Double_t dx = (xmax - xmin);
 
  198   const Double_t dy = (ymax - ymin);
 
  208   TH2D h2(
"h2", 
"", 1, xmin, xmax, 1, ymin, ymax);
 
  210   h2.GetXaxis()->SetTitle(
"x [m]");
 
  211   h2.GetYaxis()->SetTitle(
"y [m]");
 
  213   h2.GetXaxis()->CenterTitle(
true);
 
  214   h2.GetYaxis()->CenterTitle(
true);
 
  220   TEllipse ellipse(circle.getX(), circle.getY(), circle.getRadius());
 
  231     const Double_t x2  = gPad->GetX2() - gStyle->GetPadRightMargin();
 
  232     const Double_t y2  = gPad->GetY2() - gStyle->GetPadTopMargin();
 
  235     Double_t font_size = 0.03; 
 
  238       length = max(length, strlen((*graph)->GetTitle()));
 
  241     TLegend* legend = 
new TLegend(x2 - length        * font_size * 0.65 - 0.02, 
 
  242                                   y2 - buffer.size() * font_size, 
 
  247     legend->SetFillColor(0);
 
  248     legend->SetBorderSize(0);
 
  249     legend->SetTextSize(font_size);
 
  252       legend->AddEntry(*graph, (*graph)->GetTitle(), 
"P"); 
 
Utility class to parse command line options. 
 
virtual const pointer_type & next()
Get next element. 
 
Data structure for size of TCanvas. 
 
const JUTMPosition & getUTMPosition() const 
Get UTM position. 
 
Data structure for circle in two dimensions. 
 
std::vector< T >::const_iterator const_iterator
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
 
Data structure for detector geometry and calibration. 
 
Data structure for UTM position. 
 
The template JSinglePointer class can be used to hold a pointer to an object. 
 
T & getInstance(const T &object)
Get static instance from temporary object. 
 
Auxiliary container for detector elements. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
void load(const JString &file_name, JDetector &detector)
Load detector from input file. 
 
then usage $script[distance] fi case set_variable R
 
General purpose messaging. 
 
Wrapper class around ROOT TStyle. 
 
Utility class to parse command line options. 
 
alias put_queue eval echo n
 
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any. 
 
std::vector< T >::iterator iterator
 
Data structure for tripod. 
 
#define DEBUG(A)
Message macros. 
 
static JMarkerAttributes & getInstance()
Get reference to unique instance of this class object. 
 
int main(int argc, char *argv[])