StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
plWjj.C
1 TCanvas *can=0;
2 TString ver='B';
3 
4 //=================================================
5 plWjj( int page=2,int pl=0, char *core0="R10096140", char *iPath="", char *oPath=""){ //1=gif, 2=ps, 3=both
6  iPath="./";
7  //iPath="/star/data05/scratch/balewski/2009-Wana-SL09g-s1/data/";
8  core0="sumRun9_may1";
9  // core0="sumW";
10  core0="rcn10017_10_500evts";// Z->any
11  //core0="rcm10019_65_1000evts";// QCD ^^^10
12  //core0="rcn10020_13_300evts";// QCD ^^^5
13  //core0="rcn10017_35_500evts";// W->any
14 
15  if(page==0) {
16  doAll();
17  return;
18  }
19 
20 
21  char *nameA[]={"WjjStatEve"}; //pg 1
22  char *nameB[]={"Wjj_J1","Wjj_J2","Wjj_K1","Wjj_K6","Wjj_K5","Wjj_K3"};//pg2
23  char *nameC[]={"Wjj_3J","Wjj_K4","Wjj_K2","Wjjphi12"};//pg3
24  char *nameD[]={"Wjj_K1","Wjj_P1","Wjj_P2","Wjj_P4","Wjj_P3"};//pg4
25 
26 
27  //C2??
28 
29 
30  gStyle->SetOptFit(1);
31  TString fullInpName=iPath; fullInpName+=core0;
32  fullInpName+=".wana.hist.root";
33  fd=new TFile(fullInpName);
34  if(! fd->IsOpen()) {
35  printf("EROR: input histo file not found, quit\n",fullInpName.Data());
36  return;
37  } else {
38  printf("Opened: %s\n",fullInpName.Data());
39  }
40  if(page==1){
41  fd->ls();
42  h0=(TH1*)fd->Get(ver+"WjjStatEve"); assert(h0);
43  printf("%s: ",h0->GetName());
44  for(int k=1;k<=h0->GetXaxis()->GetNbins();k++) printf("%.0f, ",h0->GetBinContent(k));
45  printf("\n");
46  }
47  gStyle->SetPalette(1,0);
48  gStyle->SetOptStat(0);
49  char padTit[1000];
50  sprintf(padTit,"%s %s",ver.Data(),core0);
51 
52  switch (page) {
53 
54  case 1:{
55  can=new TCanvas("aa","aa",800,400); TPad *c=makeTitle(can,padTit,page);
56  c->Divide(1,1);gStyle->SetOptStat(0);
57  char **nameX=nameA;
58  for(int i=0;i<1;i++) {
59  printf("->%s<\n",nameX[i]);
60  h=(TH1*)fd->Get(ver+nameX[i]); assert(h);
61  c->cd(i+1); h->Draw(); gPad->SetTopMargin(0.2);
62  if(i==0) h->Draw("h text");
63  }
64  c->GetPad(1)->SetLogy();
65 
66  } break;//--------------------------------------
67 
68  case 2:{
69  can=new TCanvas("aa","aa",900,600); TPad *c=makeTitle(can,padTit,page);
70  c->Divide(3,2);gStyle->SetOptStat(1110);
71  char **nameX=nameB;
72  for(int i=0;i<6;i++) {
73  printf("->%s<\n",nameX[i]);
74  h=(TH1*)fd->Get(ver+nameX[i]); assert(h);
75  c->cd(i+1); h->Draw("colz");
76  if(i==2) h->Draw();
77  if(i==2){ h->SetAxisRange(0,180); h->SetMinimum(0.9);}// h->Fit("gaus","","RH",60,110);}
78  if(i>=4) ((TH2F*)h)->Rebin2D();
79  c->GetPad(i+1)->SetRightMargin(0.15);
80  }
81 
82  if(strstr(core0,"sumR")) c->GetPad(3)->SetLogy();
83 
84  } break;//--------------------------------------
85 
86 
87  case 3:{
88  can=new TCanvas("aa","aa",700,500); TPad *c=makeTitle(can,padTit,page);
89  c->Divide(3,2);gStyle->SetOptStat(1110);
90  char **nameX=nameC;
91  for(int i=0;i<4;i++) {
92  printf("->%s<\n",nameX[i]);
93  h=(TH1*)fd->Get(ver+nameX[i]); assert(h);
94  c->cd(i+1);
95  h->Draw("colz");
96  if(i==3) h->Draw();
97  }
98  } break;//--------------------------------------
99 
100  case 4:{
101  can=new TCanvas("aa","aa",700,500); TPad *c=makeTitle(can,padTit,page);
102  c->Divide(3,2);gStyle->SetOptStat(1110);
103  char **nameX=nameD;
104  for(int i=0;i<5;i++) {
105  printf("->%s<\n",nameX[i]);
106  h=(TH1*)fd->Get(ver+nameX[i]); assert(h);
107  c->cd(i+1);
108  h->Draw();
109  if(i==3) h->Draw("colz");
110  }
111  } break;//--------------------------------------
112 
113 
114 
115 
116  default:
117  printf("page=%d NOT defined\n",page);
118 
119  }
120 
121  char text[100];
122  sprintf(text,"%s%s_page%03d_%s",oPath,core0,page,ver.Data());
123  TString tit=text;
124  can->SetTitle(tit);
125  can->SetName(tit);
126 
127 
128  if(pl&1) can->Print(tit+".gif");
129  if(pl&2) can->Print(tit+".ps");
130 
131 }
132 
133 //------------------------
134 TPad *makeTitle(TCanvas *c,char *core, int page) {
135  c->Range(0,0,1,1);
136  TPad *pad0 = new TPad("pad0", "apd0",0.0,0.95,1.,1.);
137  pad0->Draw();
138  pad0->cd();
139 
140  TPaveText *pt = new TPaveText(0,0.,1,1,"br");
141  pt->Draw();
142  TDatime dt;
143  TString txt2=core;
144  txt2+=", page=";
145  txt2+=page;
146  txt2+=", ";
147  txt2+=dt.AsString();
148  pt->AddText(txt2);
149  txt2="--";
150  pt->AddText(txt2);
151 
152  c->cd();
153  pad = new TPad("pad1", "apd1",0.0,0.0,1,.95);
154  pad->Draw();
155  return pad;
156 }
157 
158 //============================
159 void doAll(){
160  for(int i=1;i<=4;i++) {
161  plZana(i,2);
162  }
163 }
164 
165 
166 
167 
168 // $Log: plWjj.C,v $
169 // Revision 1.2 2010/06/25 15:42:22 balewski
170 // *** empty log message ***
171 //
172 // Revision 1.1 2010/04/16 01:20:18 balewski
173 // start
174 //
175 // Revision 1.8 2010/03/14 22:50:34 balewski
176 // *** empty log message ***
177 //
178 // Revision 1.7 2010/02/04 03:48:25 balewski
179 // add ET for lumi monitor
180 //
181 // Revision 1.6 2010/01/10 03:01:39 balewski
182 // cleanup & nicer histos
183 //
184 // Revision 1.5 2010/01/06 14:11:17 balewski
185 // one Z-plot added
186 //
187 // Revision 1.4 2010/01/06 05:21:59 balewski
188 // cleanup
189 //
190 // Revision 1.3 2010/01/06 04:22:18 balewski
191 // added Q/PT plot for Zs, more cleanup
192 //
193 // Revision 1.2 2010/01/05 03:23:02 balewski
194 // change logic for filling btow status tables, added printout to Z-code
195 //
196 // Revision 1.1 2010/01/04 05:12:02 balewski
197 // added 4x4 cut to Z-algo, cleanup
198 //
199 // Revision 1.3 2009/12/30 18:37:08 balewski
200 // code tagged in the form close to that used for the Fall 2009 DNP preliminary Jacobian peak
201 //
202 // Revision 1.2 2009/12/08 16:53:01 balewski
203 // *** empty log message ***
204 //
205 // Revision 1.1 2009/11/23 23:00:20 balewski
206 // code moved spin-pool
207 //