Showing posts with label root. Show all posts
Showing posts with label root. Show all posts

Saturday, April 2, 2016

Modified Hagedorn Function in ROOT

double funModiHagedorn(double * x, double * par) {
    double scale = par[0];
    double a = par[1];
    double b = par[2];
    double p0= par[3];
    double n = par[4];
    double pt = TMath::Sqrt(x[0]*x[0] + par[5]*par[5] - 0.13957018*0.13957018);
    double dndy = scale * TMath::Power(TMath::Exp( (-1) * (a*pt + b*TMath::Power(pt,2)) ) + pt/p0, n*(-1));
    
    return dndy;

}

reference :
http://arxiv.org/abs/hep-ph/0602120
Modified Tsallis function: http://sympnp.org/proceedings/58/E21.pdf

Sunday, August 14, 2011

Modified 간단한 그래프 그리기(root)

// simpleGraph.C
// 2011.08.14 Kunsu OH modified(used function)
// 2009.09.21 Kunsu OH createed
// Original Code : root.cern.ch
// simple x-y plot at ROOT

void simpleGraph(){
    TF1 *func = new TF1("func", fun, 0,10,0);
    func->Draw();
}

void fun(double* x, double* par){
    return 1/(1+x[0]*x[0]);
}







2년전 아래와 같은 방법을 간단한 그래프 그리기라는 글을 예전 블로그에 올렸었네.... 멍청이... 
위의 방법이 훨씬 간단하고(코드가 짧고) 일반적인 그래프를 그릴 수 있다.


// simpleGraph.C
// 2009.09.21 Kunsu OH 
// Original Code : root.cern.ch
// simple x-y plot at ROOT

void simpleGraph(){
  TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);
  const Int_t n = 1000;
  Double_t x[n], y[n];
  for (Int_t i=0;i

    x[i]=i*0.01;
//    y[i]=x[i]*x[i]/(1+x[i]*x[i]);
    y[i]=1/(1+x[i]*x[i]);
    printf(" i %i %f %f \n",i,x[i],y[i]);
  }
  gr = new TGraph(n,x,y); 
  gr->Draw("AP");
  
  c1->Update();
  c1->Modified();
}
http://tandal.tistory.com/39

Friday, May 20, 2011

Pretty 2d histogram in ROOT


http://ultrahigh.org/2007/08/20/making-pretty-root-color-palettes/


const Int_t NRGBs = 5;
const Int_t NCont = 255;
Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
gStyle->SetNumberContours(NCont);

Sunday, May 8, 2011

hadd command

hadd [-f] [-T] targetfile source1 [source2 source3 ...]

hadd -h