Esempio n. 1
0
		VAULTFUNCTION ID Create(ID itemlist, const String& notify_, Function<ID, char*> format) noexcept {
			char function_name[16];

			std::snprintf(function_name, sizeof(function_name), "%p", reinterpret_cast<void*>(format));
			String format_(function_name);
			MakePublic(format, format_);

			return static_cast<ID>(CallPublic("IlView::Create", itemlist, notify_.c_str(), format_.c_str()));
		}
Esempio n. 2
0
void print_errors () {
  type_error *err;
  type_cell *errs;

  err = errors();
  if (err != NULL) {
    while (err != NULL) {
      errs = cons (err->message, cons (err->location, NULL));
      format_ ("Error: ~A at ~A~%", errs);
      err = err->next;
    }
  } 
}
Esempio n. 3
0
void LEPStyle::draw()
{
  if( _canv==0 )
    {
      setCanvas();
      setHist();
      _canv->Draw();
      if( _ymin==0 ) _ymin = 0.2;
      //  _ymax = _n*1.5; 
      if( _ymax==0 ) _ymax = _n+_upDy;
      _hist->SetMinimum( _ymin  );
      _hist->SetMaximum( _ymax );
      
      _hist->Draw();

      if( _cmsPrelim ) cmsPrelim( _intLumi );
    }

  //  size_t n_ = _entry.size();
  _n = _entry.size();
  
  if( _extraBand )
    {
      drawExtraBand();
    }
 
  if( _band )
    {
      Double_t xx_[5] = { _bxmin, _bxmax, _bxmax, _bxmin, _bxmin };
      float eps1_ = _eps1*(_ymax-_ymin);
      float eps2_ = _eps2*(_ymax-_ymin);
      Double_t yy_[5] = { _ymin+eps1_, _ymin+eps1_, _ymax-eps2_, _ymax-eps2_, _ymin+eps1_ };
      TPolyLine* pl_ = new TPolyLine( 5, xx_, yy_ );
      pl_->SetFillStyle(_bandFillStyle);
      pl_->SetFillColor(_bandFillColor);
      pl_->SetLineWidth(3);
      pl_->SetLineColor( kOrange );
      pl_->DrawClone("FSame");
      TLine* l_ = new TLine( _bx0, _ymin+eps1_, _bx0, _ymax-eps2_  );
      l_->SetLineWidth(4);
      l_->SetLineColor( kOrange );
      l_->DrawClone();


      if( _hasLegend )
	{

	  cout << "HELLO!!!!" << endl;
	  //      _y0 = 4.0;
	  if( _y0==0 ) _y0 = _n+2*_upDy/3.;
	  if( _dy==0 ) _dy = 0.06;
	  _x0 = _xmax - 0.05*(_xmax-_xmin);
	  
	  TLatex leg1_;
	  leg1_.SetTextSize(_scale*0.05);      
	  leg1_.SetTextAlign(31); 
	  leg1_.DrawLatex( _x0, _y0+_dy, _legend );
	  
	  
	  TLatex leg2_;
	  leg2_.SetTextSize(_scale*0.05);      
	  leg2_.SetTextAlign(23); 
	  leg2_.DrawLatex( _bx0, _y0-_dy, _theory );

	}

//       TLegend* legend=new TLegend(_x0,_y0, _x0+_dx, _y0+_dy );
//       legend->SetLineColor(0);
//       legend->SetFillColor(0);
      
//       //      legend->AddEntry(pl_,_legend,"lf");
//       legend->AddEntry(pl_,_legend,"");

//       legend->Draw("same");
      

    }

  for( size_t ii=0; ii<_entry.size(); ii++ )
    {
      if( _entry[ii]==("SPACE") ) continue;
      Float_t  xval_[1];
      Float_t  yval_[1];
      Float_t    ey_[1];
      Float_t estatup_[1];
      Float_t ecombup_[1];
      Float_t etotup_[1];
      Float_t estatlo_[1];
      Float_t ecomblo_[1];
      Float_t etotlo_[1];

      float yy_ = _n-(Float_t)ii;
      xval_[0] = _val[ii];
      yval_[0] = yy_;
      ey_[0] = 0;

      estatup_[0] = _statup[ii];
      ecombup_[0] = sqrt( pow( _statup[ii],2 ) + pow( _systup[ii],2 ) );
      etotup_[0] = ecombup_[0] + _lumi[ii];

      estatlo_[0] = _statlo[ii];
      ecomblo_[0] = sqrt( pow( _statlo[ii],2 ) + pow( _systlo[ii],2 ) );      
      etotlo_[0] = ecomblo_[0] + _lumi[ii];

      TGraphAsymmErrors* gtot_  = new TGraphAsymmErrors( 1, xval_, yval_, etotlo_, etotup_, ey_, ey_ );
      gtot_->SetLineColor( kGreen );
      TGraphAsymmErrors* gcomb_ = new TGraphAsymmErrors( 1, xval_, yval_, ecomblo_, ecombup_, ey_, ey_ );
      gcomb_->SetLineColor( kRed );
      TGraphAsymmErrors* gstat_ = new TGraphAsymmErrors( 1, xval_, yval_, estatlo_, estatup_, ey_, ey_ );
      gstat_->SetLineColor( kBlack );
      gstat_->SetLineWidth( 2 );
      gstat_->SetMarkerStyle( _marker[ii] );
      gstat_->SetMarkerSize( _size[ii] );
      gstat_->SetMarkerColor( _color[ii] );

      gcomb_->SetLineWidth( 2 );

      gtot_->SetLineWidth( 2 );

      if( _lumi[ii]>0 )
	gtot_->Draw();

      gcomb_->DrawClone();
      gstat_->DrawClone("P");



      if( !_writeText ) continue;

      //   align = 10*HorizontalAlign + VerticalAlign
      // For Horizontal alignment the following convention applies:
      //   1=left adjusted, 2=centered, 3=right adjusted
      // For Vertical alignment the following convention applies:
      //   1=bottom adjusted, 2=centered, 3=top adjusted
      float xtxt_ = _xmin + 0.05*(_xmax-_xmin);
      TLatex ltx1_;

      ltx1_.SetTextSize(_scale*_size1);      
      ltx1_.SetTextAlign(_align1);
      if( _specifyPlacement )
	ltx1_.DrawLatex( _xx1, yy_+_e1, _entry[ii] );
      else
	ltx1_.DrawLatex( xtxt_, yy_+E_+e_, _entry[ii] );

      TLatex ltx2_;

      char line_[512];

      TString str_;
      TString pmstr_(" #pm ");
      TString format_("%-4.");
      format_ += _ndigit[ii];
      format_ += "f";
      TString valstr_;
      TString statstr_;
      TString syststr_;
      TString lumistr_;

      sprintf( line_, format_.Data(), _val[ii] );
      // sprintf( line_,  "%-4.3f", _val[ii] );
      valstr_ = line_;

      if( fabs( _statup[ii]-_statlo[ii] )<0.01 )
	{
	  sprintf( line_, format_.Data(), _statlo[ii] );
	}
      else
	{
	  sprintf( line_, "#scale[0.7]{#splitline{+%-4.3f}{-%-4.3f}}_{ stat.}", _statup[ii], _statlo[ii] );
	}

      statstr_ = line_;
      str_ = valstr_ + pmstr_ + statstr_;
      str_ += "_{ ";
      str_ += _firstError;
      str_ += "}";

      if( _systup[ii]>0 )
	{
	  if( fabs( _systup[ii]-_systlo[ii] )<0.01 )
	    {
	      sprintf( line_, format_.Data(), _systlo[ii] );
	    }
	  else 
	    {
	      sprintf( line_, "#scale[0.7]{#splitline{+%-4.3f}{- %-4.3f}}_", _systup[ii], _systlo[ii] );
	    }
	  syststr_ = line_;
	  str_ += pmstr_;
	  str_ += syststr_;
	  str_ += "_{ ";
	  str_ += _secondError;
	  str_ += "}";
	}
  
      if( _lumi[ii]>0 )
	{
	  sprintf( line_, format_.Data(), _lumi[ii] );
	  lumistr_ = line_;
	  lumistr_ += "_{lumi.}";
	  str_ += pmstr_ + lumistr_;
	}

      //      TString str_(line_);
      
      str_ += _unit;
      cout << str_ << endl;
 
      ltx2_.SetTextSize(_scale*_size2);      
      ltx2_.SetTextAlign(_align2);
      if( _specifyPlacement )
	ltx2_.DrawLatex( _xx2, yy_+_e2, str_ );
      else
	ltx2_.DrawLatex( xtxt_+0.02*(_xmax-_xmin), yy_+E_-e_, str_ );
    }


  _hist->Draw("Same");

  _canv->RedrawAxis();
}
Esempio n. 4
0
GLWidget::GLWidget(QWidget *parent, bool isOnly2D) :

    QGLWidget(format_(), parent),

    isOnly2D_(isOnly2D),
    
    cameraDollyIsEnabled_(true),
    cameraTravellingIsEnabled_(true),
    cameraZoomIsEnabled_(true),

    settings_(0),
    
    mouse_LeftButton_(false),
    mouse_MidButton_(false),
    mouse_RightButton_(false),
    mouse_AltWasDown_(false),
    mouse_ControlWasDown_(false),
    mouse_ShiftWasDown_(false),
    mouse_PressEvent_X_(0),
    mouse_PressEvent_Y_(0),
    mouse_ClicAction_(0),
    mouse_PMRAction_(0),
    mouse_isTablet_(false),
    mouse_tabletPressure_(0),
    mouse_tabletPressJustReceived_(false),
    mouse_tabletReleaseJustReceived_(false),
    mouse_HideCursor_(false),

    viewportWidth_(0),
    viewportHeight_(0),

    autoCenterScene_(true),

    isOrtho_(false),
    camera_(),
    camera_beforeMousePress_(),
    camera2D_(),
    camera2D_beforeMousePress_(),

    lights_(),
    material_(),

    fpstimer_(),
    fpstimerCount_(0),

    mouse_tabletEventToMouseEvent_(QEvent::MouseButtonPress, QPoint(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier)
{
    // To grab keyboard focus when user clicks
    setFocusPolicy(Qt::ClickFocus);

    setMinimumSize(200, 200);
    //setAutoFillBackground(false);

    // Making  mouse  move events  occur  even  without any  buttons
    // pressed. Useful for picking points
    setMouseTracking(true);

    // lighting initialisation
    GL_LIGHT_[0] = GL_LIGHT0;
    GL_LIGHT_[1] = GL_LIGHT1;
    GL_LIGHT_[2] = GL_LIGHT2;
    GL_LIGHT_[3] = GL_LIGHT3;
    GL_LIGHT_[4] = GL_LIGHT4;
    GL_LIGHT_[5] = GL_LIGHT5;
    GL_LIGHT_[6] = GL_LIGHT6;
    GL_LIGHT_[7] = GL_LIGHT7;

    // Display settings
    settings_ = new GLWidget_Settings();
    connect(settings_, SIGNAL(changed()),
            this, SLOT(updateGL()));
}