flavour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
scriptplots.cpp
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <fstream>
4 
5 #include "TF2.h"
6 #include "TProfile3D.h"
7 #include "THStack.h"
8 #include "TColor.h"
9 #include "TROOT.h"
10 #include "TStyle.h"
11 #include "TGraph.h"
12 #include "TLatex.h"
13 #include "TFile.h"
14 #include "TVector.h"
15 
16 using namespace std;
17 
18 int main(){
19 
20 string g[3]={"0","1","2"};
21 string u[3]={"0","1"};
22 
23 string sg[3]={"1st","2nd","3rd"};
24 string su[3]={"Down","Up"};
25 
26 ofstream f[2];
27 
28 f[0].open("draft/large_fig1.tex");
29 f[1].open("draft/large_fig2.tex");
30 
31 for(uint qup=0;qup<2;qup++){
32 
33 for(uint gL=0;gL<3;gL++)
34 for(uint lup=0;lup<2;lup++){
35 f[qup]<<"\\begin{tikzpicture}[every node/.style={anchor=south west,inner sep=0pt},"<<endl;
36 f[qup]<<"x=0.307692307692\\textwidth,y=0.230769230769\\textwidth,]"<<endl;
37 
38 for(uint gQ=0;gQ<3;gQ++)
39 {
40  char name[5]="0000";
41  name[0]+=gL;
42  name[1]+=gQ;
43  name[2]+=lup;
44  name[3]+=qup;
45  char name_[8]="0 0 0 0";
46  name_[0]+=gL;
47  name_[2]+=gQ;
48  name_[4]+=lup;
49  name_[6]+=qup;
50 
51  //system((string("./update pdfs/T_BD4/h")+string(name)+string(".root pdfs/T_BD3/h")+string(name)+string(".root pdfs/T_BD/h")+string(name)+string(".root")).c_str());
52 
53  system((string("cd pdfs/T_BD; ../../draw ./h")+string(name)+string(".root ")+string(name_)).c_str());
54  ifstream ff((string("pdfs/T_BD/maxs_")+string(name)+string(".out")).c_str());
55  if(!ff.is_open()){
56  cout<<"ERROR: maxs_*.out not found"<<endl;
57  return 1;
58  }
59  int tx=0, ty=0;
60  double xi=0,xxi=0.26,xw=0.384615384615,yi=0.25;
61  yi=0.25;
62  if(gQ>0) {xi=0.24+gQ; xxi+=gQ; tx=192; xw=0.307692307692;}
63  if(gL<2 || lup<1) {ty=144; yi=0.01;}
64 
65  double McH=0,MR=0,MI=0,llmax=-1000,tbmax=0,McHmax=1000,MRmax=1000,MImax=1000;
66  double eK__=0,sm__=0,charged__=0,neutral__=0,neutralR__=0,neutralI__=0,all__=0;
67  ff>>McH>>MR>>MI;
68  if(gQ>0 && qup) {
69  ff>>McH>>MR>>MI;
70  ff>>McH>>MR>>MI;
71  }else{ ff>>llmax>>llmax>>llmax;
72  ff>>llmax>>llmax>>llmax;
73  }
74  ff>>llmax>>tbmax>>McHmax>>MRmax>>MImax;
75  ff>>eK__;
76  ff>>sm__>>charged__>>neutral__>>neutralR__>>neutralI__>>all__;
77  ff.close();
78  int eK_(eK__*100+0.5);
79  int sm_(sm__*100+0.5);
80  int charged_(charged__*100+0.5);
81  int neutral_(neutral__*100+0.5);
82  int neutralR_(neutralR__*100+0.5);
83  int neutralI_(neutralI__*100+0.5);
84  int all_(all__*100+0.5);
85  int mcH(McH+0.5),mR(MR+0.5),mI(MI+0.5);
86  double tmax(int(tbmax*100+0.5)/100.0);
87  int mcHmax(McHmax+0.5),mRmax(MRmax+0.5),mImax(MImax+0.5);
88  f[qup]<<"\\node at ("<<xi<<",0) {\\includegraphics[trim="<<tx<<" "<<ty<<" 0 0,clip,"<<endl;
89  f[qup]<<"width="<<xw<<"\\textwidth]{../pdfs/T_BD/pdf_"<<name<<".png}};"<<endl;
90  f[qup]<<"\\node at ("<<xxi<<","<<yi<<") {\\begin{minipage}{0.1\\textwidth}{"<<endl;
91  f[qup]<<"\\scriptsize \\begin{align*}"<<endl;
92  //f[qup]<<tmax<<" & \\ "<<mcHmax<<"\\ "<<mRmax<<"\\ "<<mImax<<"\\\\[-4pt]"<<endl;
93  //f[qup]<<sm_<<" & \\ "<<charged_<<"\\ "<<neutral_<<"\\ "<<neutralR_<<"\\ "<<neutralI_<<"\\ "<<all_<<"\\\\[-4pt]"<<endl;
94  //f[qup]<<" & \\ "<<eK_<<"\\\\[-4pt]"<<endl;
95  f[qup]<<mcH<<"&<M_{H^+}/\\GeV\\\\[-4pt]"<<endl;
96  f[qup]<<mR<<"&<M_{R^0}/\\GeV\\\\[-4pt]"<<endl;
97  f[qup]<<mI<<"&<M_{I^0}/\\GeV\\end{align*}}\\end{minipage}};"<<endl;
98 
99 
100 }
101 f[qup]<<"\\end{tikzpicture}\\\\"<<endl;
102 }
103 f[qup].close();
104 }
105 
106 return 0;
107 }
Definition: multivector.h:4
unsigned int uint
Definition: script.cpp:4
int main()
Definition: scriptplots.cpp:18