示例#1
0
void KVFAZIALNS2016::RutherfordTelescope()
{
   // Telescope for elastic scattering monitoring
   // Two 5mm diameter silicon detectors of 525um thickness
   // placed 2m20 from the target at theta=1.84deg phi=-90deg.
   // distance between centres of detectors = 1mm

   KVMaterial silicon("Si");

   const double radius = 5 * KVUnits::mm / 2.;

   const double thick = 525 * KVUnits::um;
   const double centre_dist = 1 * KVUnits::mm;
   double total_thickness = thick + centre_dist;

   TGeoVolume* si_det = gGeoManager->MakeTube("DET_SI", silicon.GetGeoMedium(), 0., radius, thick / 2);

   TGeoVolumeAssembly* ruth_tel = gGeoManager->MakeVolumeAssembly("STRUCT_RUTH");

   ruth_tel->AddNode(si_det, 1, new TGeoTranslation(0, 0, -centre_dist / 2));
   ruth_tel->AddNode(si_det, 2, new TGeoTranslation(0, 0, centre_dist / 2));

   // front entrance of first detector at 2 metres from target
   const double distance = 2.20 * KVUnits::m + 0.5 * total_thickness;
   const double theta = 1.84;
   const double phi = -90;

   TGeoRotation rot1, rot2;
   rot2.SetAngles(phi + 90, theta, 0);
   rot1.SetAngles(-90, 0., 0.);
   TGeoTranslation trans(0, 0, distance);
   TGeoHMatrix h = rot2 * trans * rot1;
   gGeoManager->GetTopVolume()->AddNode(ruth_tel, 1, new TGeoHMatrix(h));
}
示例#2
0
int main(int argc, char *argv[])
{
    // Setup Graphic system raster or native engine ===========================//

    SDataBase *db = new SDataBase( QDir::homePath() + "/.config/silicon/config" );
    if( !db->checkHeadExist("Appearance") )
        db->addHead("Appearance");
    if( !db->checkChildExist("Appearance","graphics_system") )
        db->addChild("Appearance","graphics_system");

    delete db;

    // END =================//


    QtSingleApplication app(argc, argv);
        app.setApplicationName( "Silicon" );
        app.setApplicationVersion( "Empire" );
        app.setQuitOnLastWindowClosed( false );

    QStringList args = QApplication::arguments();
        args.replace( 0 , QDir::currentPath() );

    QString args_str = args.join(";");
    if( app.isRunning() )
    {
        app.sendMessage( args_str );
        return 0;
    }

    SDefaults defaults;
    PerConf prc( defaults.Personal_Configs_file );


    int ret_code;
    if( true /*args.contains("-s") || args.count() == 1*/ )
    {
        QString color_str = prc.readOption( PerConf::HIGHLIGHT );
        QColor color = QPalette().color(QPalette::Highlight);
        if( !color_str.isEmpty() )
            color.setNamedColor( color_str );

        QImage image = SImage::colorize( QImage(":/files/Pixs/splash.png"), color.rgb() );

        QPixmap pixmap(QPixmap::fromImage(image));
        QSplashScreen splash(pixmap);
            splash.show();

        SiliconUI silicon( &prc );
            silicon.readMessage( args_str );
            silicon.show();

        QObject::connect( &app , SIGNAL(messageReceived(QString)) , &silicon , SLOT(readMessage(QString)) , Qt::QueuedConnection );

        splash.finish( &silicon );
        app.setActivationWindow( &silicon );

        silicon.initializeFinished();
        ret_code = app.exec();
    }

    qDebug() << "GoodBye";

    return ret_code;
}