Locked History Actions

attachment:PlotKTUY.C of 核図表

Attachment 'PlotKTUY.C'

Download

#include "TFile.h"
#include "TTree.h"
#include "TH2F.h"

Int_t PlotKTUY() {
  TFile *f1 = new TFile("KTUY05_m246.root","READ");
  TTree *tree1 = (TTree*)f1->Get("KTUY05_m246");
  TH2F  *hist = new TH2F("hist", "KTUY05 Mass Excess (MeV);Nutrom number N; Atomic number Z;",201,-0.5,200.5,131,-0.5,130.5);
  TH2F  *hist2= new TH2F("hist2","",201,-0.5,200.5,131,-0.5,130.5);
  tree1->Draw("ZZ:NN>>hist","Mcal*(bBound ==1)");
  tree1->Draw("ZZ:NN>>hist2","bBound == 1");
  
  BGSub(hist,hist2);
  hist->GetXaxis()->CenterTitle();
  hist->GetYaxis()->CenterTitle();
  hist->Draw("COLZ");
  
  //  delete hist;
  //  delete f;
  return 0;
}

Int_t BGSub(TH2F *hist,TH2F *hist2) {
  Double_t zmin;
  TH2F* hist3 = hist->Clone("hist3");
  Fill_1(hist3);
  hist3->Add(hist3,hist2,1.0,-1.0);
  zmin = hist->GetMinimum();
  hist->Add(hist,hist3,1.0,zmin*1.1);
  hist->SetMinimum(zmin);
  return 0;
}

Int_t Fill_1(TH2F *hist) {
  Int_t xbins,ybins;
  Double_t xcnt,ycnt;

  xbins = hist->GetNbinsX();
  ybins = hist->GetNbinsY();

  hist->Reset();
  for (Int_t i=1; i <= xbins; i++) {
    for (Int_t j=1; j <= ybins; j++) {
      xcnt = hist->GetXaxis()->GetBinCenter(i);
      ycnt = hist->GetYaxis()->GetBinCenter(j);
      hist->Fill(xcnt,ycnt);
    }
  }
  return 0;
}

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2011-08-15 12:31:59, 11.7 KB) [[attachment:DrawKTUY05DripLine.C]]
  • [get | view] (2011-08-15 12:30:05, 4.2 KB) [[attachment:DrawStableNuclei.C]]
  • [get | view] (2011-08-15 10:52:12, 0.4 KB) [[attachment:Ini.C]]
  • [get | view] (2011-08-15 11:22:39, 423.9 KB) [[attachment:KTUY05_m246.dat]]
  • [get | view] (2011-08-15 11:21:45, 13.3 KB) [[attachment:KTUY05_m246.png]]
  • [get | view] (2011-08-15 11:19:56, 325.8 KB) [[attachment:KTUY05_m246.root]]
  • [get | view] (2011-08-15 12:44:15, 14.4 KB) [[attachment:KTUY_stable.png]]
  • [get | view] (2011-08-15 12:44:47, 9.9 KB) [[attachment:KTUYdl_stable.png]]
  • [get | view] (2011-08-15 11:40:48, 37.7 KB) [[attachment:LiseMassExcess.png]]
  • [get | view] (2011-08-15 11:55:08, 14.6 KB) [[attachment:LiseMassExcessType.png]]
  • [get | view] (2011-08-15 11:19:33, 3.1 KB) [[attachment:MakeKTUY05RootFile.C]]
  • [get | view] (2011-08-15 10:53:14, 1.2 KB) [[attachment:MakeStableNucleiRootFile.C]]
  • [get | view] (2011-08-11 17:37:50, 25.6 KB) [[attachment:NuclearWalletCardsSearch_GetStableNuclei.png]]
  • [get | view] (2011-09-03 04:16:45, 1.2 KB) [[attachment:PlotKTUY.C]]
  • [get | view] (2011-08-15 10:53:26, 0.5 KB) [[attachment:PlotStable.C]]
  • [get | view] (2011-08-15 10:49:44, 8.6 KB) [[attachment:StableNuclei.png]]
  • [get | view] (2011-08-15 10:53:40, 6.0 KB) [[attachment:StableNuclei.root]]
  • [get | view] (2011-08-11 17:50:57, 36.5 KB) [[attachment:StableNuclei.txt]]
  • [get | view] (2013-11-01 17:25:58, 15.2 KB) [[attachment:evenz_oddn_jpi.dat]]
  • [get | view] (2013-11-01 08:50:14, 12.0 KB) [[attachment:first2plus.dat]]
  • [get | view] (2013-11-01 09:06:27, 43.2 KB) [[attachment:first2plus_ss.png]]
  • [get | view] (2013-11-01 17:25:07, 14.7 KB) [[attachment:oddz_evenn_jpi.dat]]
  • [get | view] (2013-11-01 17:26:05, 2.0 KB) [[attachment:plot_evenz_oddn_jpi.C]]
  • [get | view] (2013-11-01 17:26:10, 11.9 KB) [[attachment:plot_evenz_oddn_jpi.png]]
  • [get | view] (2013-11-01 08:49:50, 1.5 KB) [[attachment:plot_first2plus.C]]
  • [get | view] (2013-11-01 08:50:03, 11.5 KB) [[attachment:plot_first2plus.png]]
  • [get | view] (2013-11-01 17:25:18, 2.0 KB) [[attachment:plot_oddz_evenn_jpi.C]]
  • [get | view] (2013-11-01 17:25:23, 11.8 KB) [[attachment:plot_oddz_evenn_jpi.png]]

You are not allowed to attach a file to this page.