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);
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);
79 TGeoVolume* shape = geom->MakeSphere(
"Module", medium, 0.4, 0.5);
81 shape->SetLineColor(kBlue);
85 for (JDetector::const_iterator i =
detector.begin(); i !=
detector.end(); ++i) {
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();
Data structure for detector geometry and calibration.
int main(int argc, char **argv)
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getRadius() const
Get radius.
double getY() const
Get y position.
double getX() const
Get x position.
double getZmin() const
Get minimal z position.
double getZmax() const
Get maximal z position.
Utility class to parse command line options.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).