Beispiel #1
0
        QWidget *ActionProxyWidget::CreateNewOpenSimWorld()
        {
            QWidget *new_os_world_widget;
            current_grid_info_map_.clear();

            QUiLoader loader;
            QFile uiFile("./data/ui/ether/world-edit-opensim.ui");
            new_os_world_widget = loader.load(&uiFile, 0);
            uiFile.close();

            QPushButton *button;
            button = new_os_world_widget->findChild<QPushButton*>("pushButtonGetGridInfo");
            connect(button, SIGNAL( clicked() ), SLOT( GridInfoRequested() ));

            button = new_os_world_widget->findChild<QPushButton*>("pushButtonSave");
            connect(button, SIGNAL( clicked() ), SLOT( SaveInformation() ));

            QPixmap pic = CretatePicture(QSize(150,150), "./data/ui/images/ether/world.png");
            QLabel *pic_label = new_os_world_widget->findChild<QLabel*>("pictureLabel");
            pic_label->setPixmap(pic);

            current_type_ = "new-world-opensim";
            current_os_world_data_ = 0;

            return new_os_world_widget;
        }
Beispiel #2
0
        QWidget *ActionProxyWidget::OpenSimAvatarEditWidget(Data::OpenSimAvatar *data)
        {
            QWidget *os_edit_widget;

            QUiLoader loader;
            QFile uiFile("./data/ui/ether/avatar-edit-opensim.ui");
            os_edit_widget = loader.load(&uiFile, 0);
            uiFile.close();

            QLineEdit *line_edit;
            line_edit = os_edit_widget->findChild<QLineEdit*>("firstNameLineEdit");
            line_edit->setText(data->firstName());
            line_edit = os_edit_widget->findChild<QLineEdit*>("lastNameLineEdit");
            line_edit->setText(data->lastName());
            line_edit = os_edit_widget->findChild<QLineEdit*>("passwordLineEdit");
            line_edit->setText(data->password());

            QPixmap pic = CretatePicture(QSize(150,150), data->pixmapPath());
            QLabel *pic_label = os_edit_widget->findChild<QLabel*>("pictureLabel");
            pic_label->setPixmap(pic);

            QPushButton *button = os_edit_widget->findChild<QPushButton*>("pushButtonSave");
            connect(button, SIGNAL( clicked() ), SLOT( SaveInformation() ));

            // Store data pointer and define types for save function
            current_type_ = "avatar-opensim";
            current_os_avatar_data_ = data;

            return os_edit_widget;
        }
Beispiel #3
0
        QWidget *ActionProxyWidget::OpenSimWorldEditWidget(Data::OpenSimWorld *data)
        {
            QWidget *os_world_edit_widget;
            current_grid_info_map_.clear();

            QUiLoader loader;
            QFile uiFile("./data/ui/ether/world-edit-opensim.ui");
            os_world_edit_widget = loader.load(&uiFile, 0);
            uiFile.close();

            QLineEdit *line_edit;
            line_edit = os_world_edit_widget->findChild<QLineEdit*>("loginURLLineEdit");
            line_edit->setText(data->loginUrl().toString());
            line_edit = os_world_edit_widget->findChild<QLineEdit*>("startLocationLineEdit");
            line_edit->setText(data->startLocation());

            QPushButton *button;
            button = os_world_edit_widget->findChild<QPushButton*>("pushButtonGetGridInfo");
            connect(button, SIGNAL( clicked() ), SLOT( GridInfoRequested() ));

            button = os_world_edit_widget->findChild<QPushButton*>("pushButtonSave");
            connect(button, SIGNAL( clicked() ), SLOT( SaveInformation() ));

            QPixmap pic = CretatePicture(QSize(150,150), data->pixmapPath());
            QLabel *pic_label = os_world_edit_widget->findChild<QLabel*>("pictureLabel");
            pic_label->setPixmap(pic);

            // Grid info from file if it is there
            if (data->gridInfo().count() > 0)
            {
                SetGridInfoToWorldWidget(os_world_edit_widget, data->gridInfo());
                QLabel *status = os_world_edit_widget->findChild<QLabel*>("gridInfoStatusLabel");
                if (status)
                    status->setText("Grid info from local storage");
            }

            // Store data pointer and define types for save function
            current_type_ = "world-opensim";
            current_os_world_data_ = data;
            current_grid_info_map_ = data->gridInfo();

            return os_world_edit_widget;
        }
Beispiel #4
0
        QWidget *ActionProxyWidget::CreateNewOpenSimAvatar()
        {
            QWidget *new_os_avatar;

            QUiLoader loader;
            QFile uiFile("./data/ui/ether/avatar-edit-opensim.ui");
            new_os_avatar = loader.load(&uiFile, 0);
            uiFile.close();

            QPushButton *button = new_os_avatar->findChild<QPushButton*>("pushButtonSave");
            connect(button, SIGNAL( clicked() ), SLOT( SaveInformation() ));

            QPixmap pic = CretatePicture(QSize(150,150), "./data/ui/images/ether/naali.png");
            QLabel *pic_label = new_os_avatar->findChild<QLabel*>("pictureLabel");
            pic_label->setPixmap(pic);

            // Store data pointer and define types for save function
            current_type_ = "new-avatar-opensim";
            current_os_avatar_data_ = 0;

            return new_os_avatar;
        }
Beispiel #5
0
  /** 
   * Run the unfolding and correction task. 
   *
   * The @a measuredFile is assumed to have the structure 
   *
   * @verbatim
   *     /- ForwardMultSums         (TCollection)
   *          |- [type]             (TCollection)
   *          |    |- [bin]         (TCollection) 
   *          |    |    `- rawDist  (TH1)
   *          |    |- [bin]
   *          |    ...
   *          |- [type]
   *          ...
   * @endverbatim 
   * 
   * and @a corrFile is assumed to have the structure 
   *
   * @verbatim
   *     /- ForwardMultResults            (TCollection)
   *          |- [type]                   (TCollection)
   *          |    |- [bin]               (TCollection) 
   *          |    |    |- truth          (TH1)
   *          |    |    |- truthAccepted  (TH1)
   *          |    |    |- triggerVertex  (TH1)
   *          |    |    `- response       (TH2)
   *          |    |- [bin]
   *          |    ...
   *          |- [type]
   *          ...
   * @endverbatim 
   *
   * where @c [type] is one of <i>symmetric</i>, <i>positive</i>,
   * <i>negative</i>, or <i>other</i>, and [bin] is the @f$ \eta@f$
   * bin named like
   *
   * @verbatim
   *   [bin]          := [eta_spec] _ [eta_spec]
   *   [eta_spec]     := [sign_char] [integer_part] d [decimal_part]
   *   [sign_part]    := p          positive eta 
   *                  |  m          negative eta 
   *   [integer_part] := [number]
   *   [decimal_part] := [number] [number]
   *   [number]       := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 
   * @endverbatim
   *
   * That is, the bin @f$ -3\le\eta\ge3@f$ is labeled
   * <b>m3d00_p3d00</b>, @f$ 0\le\eta\ge2.5@f$ is <b>p0d00_p2d50</b> 
   *
   * @a measuredFile and @a corrFile can point to the same file.  If
   * @a corrFile is not specified, it is assumed that @a measuredFile
   * has the expected @a corrFile @e in @e addition to the
   * expected content of that file.
   * 
   * @param measuredFile Name of file containing measured data
   * @param corrFile     Name of file containing correction data
   * @param method       Unfolding method to use 
   * @param regParam     Regularization parameter 
   */  
  void Run(const TString& measuredFile, const TString& corrFile,
	   const TString& method="Bayes", Double_t regParam=4)
  {
    // Get the input collections 
    if (measuredFile.IsNull()) {
      Error("Run", "No measurements given");
      return;
    }
    TCollection* mTop = GetTop(measuredFile, false);
    TCollection* cTop = GetTop(corrFile.IsNull() ? measuredFile : corrFile, 
			       true);
    if (!mTop || !cTop) return;

    // Get some info from the input collection 
    UShort_t sys;
    UShort_t sNN; 
    ULong_t  trig; 
    Double_t minZ; 
    Double_t maxZ;
    GetParameter(mTop, "sys",     sys);	  
    GetParameter(mTop, "sNN",     sNN);	  
    GetParameter(mTop, "trigger", trig);
    GetParameter(mTop, "minIpZ",  minZ); 
    GetParameter(mTop, "maxIpZ",  maxZ); 
    if (sys == 0 || sNN == 0) 
      Warning("Run", "System (%d) and/or collision energy (%d) unknown", 
	      sys, sNN);
    
    // Open the output file 
    TFile* out = TFile::Open("forward_unfolded.root", "RECREATE");
    if (!out) { 
      Error("Run", "Failed to open output file");
      return;
    }

    // Decode method option and store in file 
    TString meth(method);
    UInt_t  mId = MethodId(meth);
    if (mId == 0xDeadBeef) return;

    // Store information 
    SaveInformation(out,meth,mId,regParam,sys,sNN,trig,minZ,maxZ,
		    corrFile.IsNull());

    // Load other data 
    TString savPath(gROOT->GetMacroPath());
    gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2/scripts",
                             gROOT->GetMacroPath()));
    // Always recompile 
    if (!gROOT->GetClass("OtherPNch"))
      gROOT->LoadMacro("OtherPNchData.C++");
    gROOT->SetMacroPath(savPath);

    // Loop over the input 
    const char*  inputs[] = { "symmetric", "positive", "negative", 0 };
    const char** pinput   = inputs;
    while (*pinput) { 
      TCollection* mInput = GetCollection(mTop, *pinput, false);
      TCollection* cInput = GetCollection(cTop, *pinput, false);
      if (mInput && cInput)
	ProcessType(mInput, cInput, mId, regParam, out,
		    sys, sNN);
      pinput++;
    }      

    out->Write();
    // out->ls();
    out->Close();

    SaveSummarize();
  }