Exemple #1
0
void Config()
{
  cout << "Running genConfig.C ... " << endl;

  // IlcRoot setup
  //
  gROOT->LoadMacro("$ILC_ROOT/test/vmctest/ppbench/commonConfig.C");
  commonConfig(kFALSE);

  // Load Geant3 + Geant3 VMC libraries
  //
#if defined(__CINT__)
    gSystem->Load("libgeant321");
#endif

  // Create TGeant3
  //  
  new  TGeant3TGeo("C++ Interface to Geant3");

  // IlcRoot event generator
  // (it has to be created after MC, as it may use decayer via VMC)
  //
  gROOT->LoadMacro("$ILC_ROOT/test/vmctest/ppbench/genPPbenchConfig.C");
  genGunConfig();

  cout << "Running genConfig.C finished ... " << endl;
}  
Exemple #2
0
void Config()
{
  // AliRoot setup
  commonConfig(kFALSE);

  // AliRoot event generator
  genGunConfig();
}  
Exemple #3
0
void Config()
{
  cout << "Running g4Config.C ... " << endl;

  // AliRoot setup
  //
  gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/commonConfig.C");
  commonConfig();

  // TPC primary ionization 
  AliTPC* TPC = (AliTPC*)gAlice->GetDetector("TPC");
  if ( ! TPC )
    cerr << "Cannot get TPC detector" << endl;
  else  { 
    cerr << "Setting TPC primary ionization" << endl;
    TPC->SetPrimaryIonisation(); // not used with Geant3
  }  

  // Load Geant4 + Geant4 VMC libraries
  //
  std::string g4libmacro("$G4VMCINSTALL/share/examples/macro/g4libs.C");
  if (gClassTable->GetID("TGeant4") == -1) {
    // Load Geant4 libraries 
    if (!gInterpreter->IsLoaded(g4libmacro.c_str())) {
      gROOT->LoadMacro(g4libmacro.c_str());
      gInterpreter->ProcessLine("g4libs()");
    }
  }    

  // Create Geant4 VMC
  //  
  TGeant4 *geant4 = 0;
  if ( ! gMC ) {
    TG4RunConfiguration* runConfiguration 
      = new TG4RunConfiguration("geomRoot", 
                                "FTFP_BERT_EMV+optical", 
                                "specialCuts+stackPopper+stepLimiter",
                                 true);
//      = new TG4RunConfiguration("geomRootToGeant4",
//                                "FTFP_BERT_EMV+optical", 
//                                "specialCuts+specialControls+stackPopper+stepLimiter",
//                                 true);
      
    geant4 = new TGeant4("TGeant4", 
                         "The Geant4 Monte Carlo : FTFP_BERT_EMV+optical", 
                         runConfiguration);
             // Repeat physics selection in the title; to be removed
             // with new geant4_vmc tag (1.13)            
                         
    cout << "Geant4 has been created." << endl;
  } 
  else {
    cout << "Monte Carlo has been already created." << endl;
  }  

  // Customization of Geant4 VMC
  //

    geant4->ProcessGeantCommand("/mcVerbose/all 1");  
    geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");  
    geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");  
    geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0");     
    geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm"); 
    geant4->ProcessGeantCommand("/mcTracking/skipNeutrino true");
    geant4->ProcessGeantCommand("/mcDet/setMaxStepInLowDensityMaterials 1 cm");

    // for Geant4 <= 9.4.p03
    //geant4->ProcessGeantCommand("/mcPhysics/selectOpProcess Scintillation");
    //geant4->ProcessGeantCommand("/mcPhysics/setOpProcessActivation false");
    // for Geant4 >= 9.5
    geant4->ProcessGeantCommand("/optics_engine/selectOpProcess Scintillation");
    geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
    geant4->ProcessGeantCommand("/optics_engine/selectOpProcess OpWLS");
    geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
    geant4->ProcessGeantCommand("/optics_engine/selectOpProcess OpMieHG");
    geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
    
    // Activate reading random engine status from a file
    gAlice->GetMCApp()->SetReadRndmStatus(kTRUE);
    gAlice->GetMCApp()->SetRndmFileName("randomEvt4.root");
    geant4->ProcessGeantCommand("/mcRun/readRandom true");
    geant4->ProcessGeantCommand("/mcRun/setRandomFile run0evt4.rndm");

  // Uncomment this line to get a detail info from each step 
  geant4->ProcessGeantCommand("/tracking/verbose 1");  
  
  // More info from the physics list
  // the verbosity level is passed to all contained physics lists and their
  // physics builders
  //geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");  
  
  // More info from optical processes
  //geant4->ProcessGeantCommand("/mcVerbose/opticalPhysicsList 3");  
  
  // More info from geometry building
  //geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");  

  // More info from setting geometry properties (in materials and surfaces)
  // for optical physics
  //geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");  
  
  // More info about regions construction 
  // and conversion of VMC cuts in cuts in range per regions 
  // geant4->ProcessGeantCommand("/mcVerbose/regionsManager 2");
  // geant4->ProcessGeantCommand("/mcRegions/print true");
  
  // Suppress verbose info from tracks which reached maximum number of steps
  // (default value is 30000)  
  //geant4->ProcessGeantCommand("/mcTracking/loopVerbose 0"); 
    
  //
  // Set apply cuts 
/*
  geant4->ProcessGeantCommand("/run/particle/applyCuts");  
  // geant4->ProcessGeantCommand("/mcVerbose/geometryManager 2");  

  geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");  
  geant4->ProcessGeantCommand("/mcDet/volNameSeparator !");
  geant4->ProcessGeantCommand("/mcPhysics/setStackPopperSelection e+ e- pi+ pi- kaon+ kaon- gamma");
  //geant4->ProcessGeantCommand("/tracking/verbose 1");  

  geant4->ProcessGeantCommand("/mcControl/g3Defaults");
!!!!n Generates warnings:
>>> Event 0
G4ProcessTable::Insert : arguments are 0 pointer 
G4ProcessTable::Insert : arguments are 0 pointer 
G4ProcessTable::Insert : arguments are 0 pointer 
G4ProcessTable::Insert : arguments are 0 pointer 
G4ProcessTable::Insert : arguments are 0 pointer 

*/

  // AliRoot event generator
  // (it has to be created after MC, as it may use decayer via VMC)
  //
  gROOT->LoadMacro("$ALICE_ROOT/test/vmctest/gun/genExtFileConfig.C");
  genExtFileConfig(4);

  cout << "Running g4Config.C finished ... " << endl;
}
Exemple #4
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    copyFlag = false;
    ui->setupUi(this);
    setWindowIcon(QIcon(":/hd_32.ico"));

    QAction *newAction = new QAction(QIcon(":/new_32.ico"), tr("Новый проект"), this);
    QAction *saveAction = new QAction(QIcon(":/save_32.ico"), tr("Сохранить проект"), this);
    QAction *openAction = new QAction(QIcon(":/open_32.ico"), tr("Загрузить проект"), this);
    QAction *configAction = new QAction(QIcon(":/opts_32.ico"), tr("Общие настройки"), this);
    //QAction *printAction = new QAction(QIcon(":/edit_32.ico"), tr("Строки и переменные в текстовый файл"), this);
    QAction *plcToAction = new QAction(QIcon(":/impt_32.ico"), tr("Загрузить в пульт"), this);
    QAction *plcFromAction = new QAction(QIcon(":/exp_32.ico"), tr("Прочитать из пульта"), this);
    QAction *varAct = new QAction(QIcon(":/apps_32.ico"), tr("Настройка переменных проекта"), this);
    QAction *aboutAction = new QAction(QIcon(":/about_32.ico"), tr("О программе"), this);
    connect(varAct, SIGNAL(triggered()), this, SLOT(varEdit()));
    connect(saveAction,SIGNAL(triggered()),this,SLOT(saveProject()));
    connect(newAction,SIGNAL(triggered()),this,SLOT(newProject()));
    connect(openAction,SIGNAL(triggered()),this,SLOT(openProject()));
    connect(configAction,SIGNAL(triggered()),this,SLOT(commonConfig()));
    connect(aboutAction,SIGNAL(triggered()),this,SLOT(aboutWindow()));
    connect(plcToAction, SIGNAL(triggered()), this, SLOT(dataToPLC()));

    ui->mainToolBar->addAction(newAction);
    ui->mainToolBar->addAction(saveAction);
    ui->mainToolBar->addAction(openAction);
    ui->mainToolBar->addSeparator();
    ui->mainToolBar->addAction(configAction);
    ui->mainToolBar->addAction(varAct);
    ui->mainToolBar->addSeparator();
    ui->mainToolBar->addAction(plcToAction);
    ui->mainToolBar->addAction(plcFromAction);
    ui->mainToolBar->addSeparator();
    ui->mainToolBar->addAction(aboutAction);
    //ui->mainToolBar->addSeparator();
    //ui->mainToolBar->addAction(printAction);

    Settings conf;
    vars = conf.readVars();
    font = conf.readFont();
    DisplayData* lcdData = conf.readDisplay();
    lcd = new Display(lcdData);


    QVBoxLayout *layout = new QVBoxLayout;

    display = new LcdWidget(lcd);
    display->setFont(font);
    display->setVars(vars);

    connect(display,SIGNAL(updateMessage(QString)),this,SLOT(updateVarMessage(QString)));
    connect(display,SIGNAL(copyStr(unsigned char,uint)),this,SLOT(displayCopy(unsigned char,uint)));
    connect(display,SIGNAL(pasteStr(unsigned char,uint)),this,SLOT(displayReplace(unsigned char,uint)));

    layout->addWidget(display);

    listOfRows1 = new QListWidget();listOfRows1->setMinimumHeight(display->height()*1.5);
    listOfRows2 = new QListWidget();
    listOfRows3 = new QListWidget();
    listOfRows4 = new QListWidget();

    fillLists(lcdData);

    QHBoxLayout *listLayout = new QHBoxLayout;

    listLayout->addWidget(listOfRows1);
    listLayout->addWidget(listOfRows2);
    listLayout->addWidget(listOfRows3);
    listLayout->addWidget(listOfRows4);

    layout->addLayout(listLayout);

    layout->addStretch();

    setCentralWidget(new QWidget);
    centralWidget()->setLayout(layout);

    connect(display,SIGNAL(updateString(DisplayData*)),this,SLOT(fillLists(DisplayData*)));
    connect(listOfRows1,SIGNAL(clicked(QModelIndex)),this,SLOT(str1Changed(QModelIndex)));
    connect(listOfRows2,SIGNAL(clicked(QModelIndex)),this,SLOT(str2Changed(QModelIndex)));
    connect(listOfRows3,SIGNAL(clicked(QModelIndex)),this,SLOT(str3Changed(QModelIndex)));
    connect(listOfRows4,SIGNAL(clicked(QModelIndex)),this,SLOT(str4Changed(QModelIndex)));

    QMenu* contextMenu1 = new QMenu(listOfRows1);
    listOfRows1->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore1 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu1);
    QAction* addAfter1 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu1);
    QAction* copy1 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu1);
    QAction* replace1 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu1);
    QAction* delete1 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu1);
    listOfRows1->addAction(addBefore1);
    listOfRows1->addAction(addAfter1);
    listOfRows1->addAction(copy1);
    listOfRows1->addAction(replace1);
    listOfRows1->addAction(delete1);
    connect(addBefore1,SIGNAL(triggered()),this,SLOT(str1AddBefore()));
    connect(addAfter1,SIGNAL(triggered()),this,SLOT(str1AddAfter()));
    connect(copy1,SIGNAL(triggered()),this,SLOT(str1Copy()));
    connect(replace1,SIGNAL(triggered()),this,SLOT(str1Replace()));
    connect(delete1,SIGNAL(triggered()),this,SLOT(str1Delete()));

    QMenu* contextMenu2 = new QMenu(listOfRows2);
    listOfRows2->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore2 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu2);
    QAction* addAfter2 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu2);
    QAction* copy2 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu2);
    QAction* replace2 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu2);
    QAction* delete2 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu2);
    listOfRows2->addAction(addBefore2);
    listOfRows2->addAction(addAfter2);
    listOfRows2->addAction(copy2);
    listOfRows2->addAction(replace2);
    listOfRows2->addAction(delete2);
    connect(addBefore2,SIGNAL(triggered()),this,SLOT(str2AddBefore()));
    connect(addAfter2,SIGNAL(triggered()),this,SLOT(str2AddAfter()));
    connect(copy2,SIGNAL(triggered()),this,SLOT(str2Copy()));
    connect(replace2,SIGNAL(triggered()),this,SLOT(str2Replace()));
    connect(delete2,SIGNAL(triggered()),this,SLOT(str2Delete()));

    QMenu* contextMenu3 = new QMenu(listOfRows3);
    listOfRows3->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore3 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu3);
    QAction* addAfter3 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu3);
    QAction* copy3 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu3);
    QAction* replace3 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu3);
    QAction* delete3 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu3);
    listOfRows3->addAction(addBefore3);
    listOfRows3->addAction(addAfter3);
    listOfRows3->addAction(copy3);
    listOfRows3->addAction(replace3);
    listOfRows3->addAction(delete3);
    connect(addBefore3,SIGNAL(triggered()),this,SLOT(str3AddBefore()));
    connect(addAfter3,SIGNAL(triggered()),this,SLOT(str3AddAfter()));
    connect(copy3,SIGNAL(triggered()),this,SLOT(str3Copy()));
    connect(replace3,SIGNAL(triggered()),this,SLOT(str3Replace()));
    connect(delete3,SIGNAL(triggered()),this,SLOT(str3Delete()));

    QMenu* contextMenu4 = new QMenu(listOfRows4);
    listOfRows4->setContextMenuPolicy(Qt::ActionsContextMenu);
    QAction* addBefore4 = new QAction(QIcon(":/up_32.ico"),"Добавить строку перед",contextMenu4);
    QAction* addAfter4 = new QAction(QIcon(":/down_32.ico"),"Добавить строку после",contextMenu4);
    QAction* copy4 = new QAction(QIcon(":/copy_32.ico"),"Копировать строку в буфер",contextMenu4);
    QAction* replace4 = new QAction(QIcon(":/paste_32.ico"),"Заменить на строку из буфера",contextMenu4);
    QAction* delete4 = new QAction(QIcon(":/trash_32.ico"),"Удалить строку",contextMenu4);
    listOfRows4->addAction(addBefore4);
    listOfRows4->addAction(addAfter4);
    listOfRows4->addAction(copy4);
    listOfRows4->addAction(replace4);
    listOfRows4->addAction(delete4);
    connect(addBefore4,SIGNAL(triggered()),this,SLOT(str4AddBefore()));
    connect(addAfter4,SIGNAL(triggered()),this,SLOT(str4AddAfter()));
    connect(copy4,SIGNAL(triggered()),this,SLOT(str4Copy()));
    connect(replace4,SIGNAL(triggered()),this,SLOT(str4Replace()));
    connect(delete4,SIGNAL(triggered()),this,SLOT(str4Delete()));

    display->setFocus();

}