BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
draw_hadron_check_plots.cxx File Reference
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <TFile.h>
#include <TTree.h>
#include <TString.h>
#include <stdlib.h>
#include <stdio.h>
#include <TH2F.h>
#include <TCanvas.h>
#include <TColor.h>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 18 of file draw_hadron_check_plots.cxx.

18 {
19 if(argc<2){
20 cout << "please append the root file name" << endl;
21 cout << "usage: draw_hadron_check_plots.exe filename" << endl;
22 return 1;
23 }
24
25 TString str_filename(argv[1]);
26 TFile *f = new TFile(str_filename);
27 TTree *tree = (TTree*)f->Get("n103");
28 TH2F *h = new TH2F("h", "dE/dx vs momentum", 48, 0.05, 2.45, 160, 0, 2000);
29 TCanvas *c1 = new TCanvas("c1","c1",10,10,800,642);
30 tree->Draw("dEdx_meas:ptrk>>h");
31 const UInt_t Number = 2;
32 Double_t Red[Number] = { 1.0, 0.2};
33 Double_t Green[Number] = { 1.0, 0.0};
34 Double_t Blue[Number] = { 1.0, 0.0};
35 Double_t Length[Number] = { 0.0, 1.0};
36 Int_t nb=200;
37 TColor::CreateGradientColorTable(Number,Length,Red,Green,Blue,nb);
38 h->Draw();
39 c1->SaveAs("temp.eps");
40 f->Close();
41
42 return 0;
43}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")