BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
draw_hadron_check_plots.cxx
Go to the documentation of this file.
1#include <iostream>
2#include <fstream>
3#include <iomanip>
4#include <cstring>
5#include <string>
6#include <vector>
7#include <TFile.h>
8#include <TTree.h>
9#include <TString.h>
10#include <stdlib.h>
11#include <stdio.h>
12#include <TH2F.h>
13#include <TCanvas.h>
14#include <TColor.h>
15
16using namespace std;
17
18int main(int argc, char* argv[]){
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}
44
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
int main()
Definition: test_IFile.cxx:11