Skip to content

Instantly share code, notes, and snippets.

View petrstepanov's full-sized avatar
Working from home

Petr Stepanov petrstepanov

Working from home
View GitHub Profile
/// \file
/// \ingroup tutorial_roofit
/// \notebook -js
/// 'DATA AND CATEGORIES' RooFit tutorial macro #403
/// Using weights in unbinned datasets
/// \macro_image
/// \macro_output
/// \macro_code
#include "Riostream.h"
// Custom two exponential pdf
class TwoExpPdf : public RooAbsPdf {
TwoExpPdf() {};
TwoExpPdf(const char *name, const char *title,
RooAbsReal& _t,
RooAbsReal& _tau1,
RooAbsReal& _tau2,
petrstepanov / conv_linearity_test.c
Last active March 19, 2019 23:24
RooFFTConvPdf linearity test
#include "Riostream.h"
// Custom exponential PDF
class ExpPdf : public RooAbsPdf {
ExpPdf() {};
ExpPdf(const char *name, const char *title, RooAbsReal& _t, RooAbsReal& _tau);
ExpPdf(const ExpPdf& other, const char* name = 0);
virtual TObject* clone(const char* newname) const { return new ExpPdf(*this, newname); }
inline virtual ~ExpPdf() { }
petrstepanov / canvasResize.c
Created April 19, 2019 07:58
TGListBox inside TGCanvas container not shrinks down
#include <TGClient.h>
#include <TGCanvas.h>
#include <TGListBox.h>
#include <TGFrame.h>
class MyMainFrame : public TGMainFrame {
MyMainFrame(const TGWindow *p, UInt_t w, UInt_t h);
virtual ~MyMainFrame();
petrstepanov / presenter.h
Created April 23, 2019 22:53
CERN ROOT MVP Presenter header
#include "./../AbstractPresenter.h"
#include "../../model/Model.h"
class __View;
class __Presenter : public AbstractPresenter<Model, __View> {
__Presenter(__View* view);
virtual ~__Presenter();
petrstepanov / view.h
Last active April 26, 2019 23:01
CERN ROOT MVP View header
#include "./../AbstractView.h"
#include "__Presenter.h"
class __Presenter;
class __View : public AbstractView<__Presenter> {
void initUI();
void connectSignalsToPresenter();
petrstepanov / emittest.c
Created April 27, 2019 00:53
ROOT Signal with two parameters
#include <TQObject.h>
#include <RQ_OBJECT.h>
class A {
Int_t fValue1;
Int_t fValue2;
petrstepanov / presenter.cpp
Last active July 16, 2019 03:46
CERN ROOT MVP Presenter source
#include "__Presenter.h"
#include "__View.h"
#include "../AbstractPresenter.h"
#include "../../model/Model.h"
#include <TGFileDialog.h>
__Presenter::__Presenter(__View* view) : AbstractPresenter<Model, __View>(view) {
model = instantinateModel();
petrstepanov / view.cpp
Last active July 22, 2019 22:53
CERN ROOT MVP View souce
#include "__View.h"
#include "__Presenter.h"
__View::__View(const TGWindow *w) : AbstractView<__Presenter>(w){
// Build UI
// Instantinate presenter and connect slots
presenter = instantinatePresenter();
// All Linkdef.h files start with this preamble
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ nestedclasses;
// List all your classes that require Dictionary generation:
#pragma link C++ class MyClassWithClassImpMarco1
#pragma link C++ class MyClassWithClassImpMarco2