Auxiliary program to draw the detector in 3D.
More...
#include <string>
#include <iostream>
#include <limits>
#include <memory>
#include "TROOT.h"
#include "TApplication.h"
#include "TCanvas.h"
#include "TView.h"
#include "TGeometry.h"
#include "TGeoManager.h"
#include "TGeoMatrix.h"
#include "TGeoMaterial.h"
#include "TGeoMedium.h"
#include "TGeoVolume.h"
#include "JDetector/JDetector.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JGeometry3D/JCylinder3D.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Auxiliary program to draw the detector in 3D.
- Author
- mdejong
Definition in file JDrawDetector3D.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 31 of file JDrawDetector3D.cc.
41 JParser<> zap(
"Auxiliary program to draw the detector in 3D.");
48 catch(
const exception &error) {
49 FATAL(error.what() << endl);
58 catch(
const JException& error) {
63 FATAL(
"Empty detector " << detectorFile << endl);
68 NOTICE(
"Detector volume: " << cylinder << endl);
70 TApplication* tp =
new TApplication(
"user", NULL, NULL);
71 TCanvas* cv =
new TCanvas(
"a", detectorFile.c_str(), 1200, 1200);
75 TGeoManager* geom =
new TGeoManager (
"geometry",
"");
76 TGeoMaterial* material =
new TGeoMaterial(
"vacuum", 0, 0, 0);
77 TGeoMedium* medium =
new TGeoMedium (
"vacuum", 1, material);
78 TGeoVolume* top = geom->MakeBox (
"Top", medium, cylinder.getRadius(), cylinder.getRadius(), cylinder.getZmax() - cylinder.getZmin());
79 TGeoVolume* shape = geom->MakeSphere(
"Module", medium, 0.4, 0.5);
81 shape->SetLineColor(kBlue);
86 top->AddNode(shape,
N++,
new TGeoTranslation(
i->getX() - cylinder.getX(),
i->getY() - cylinder.getY(),
i->getZ() - cylinder.getZmin()));
89 geom->SetTopVolume(top);
90 geom->CloseGeometry();
95 cv->GetView()->ShowAxis();
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
do set_variable DETECTOR_TXT $WORKDIR detector