7 #include "TApplication.h"
10 #include "TGeometry.h"
11 #include "TGeoManager.h"
12 #include "TGeoMatrix.h"
13 #include "TGeoMaterial.h"
14 #include "TGeoMedium.h"
15 #include "TGeoVolume.h"
31 int main(
int argc,
char**argv)
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.
int main(int argc, char *argv[])
Data structure for detector geometry and calibration.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
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.
Utility class to parse command line options.
do set_variable DETECTOR_TXT $WORKDIR detector