4 plPubJS(
int page=1,
int pl=0,
char *core0=
"R10103042",
char *iPath=
"",
char *oPath=
""){
8 char *iPath=
"/star/u/stevens4/wAnalysis/out/verB4.3/enhanceQCD/";
28 char *nameA[]={
"JSetowEneZ1",
"JSetowEneZ2",
"JSetowEneZ3",
"JSetowEneZ4"};
29 char *nameB[]={
"JSetowHighPostTr",
"JSetowTotPostTr",
"JSetowHighPreNear",
"JSetowTotPreNear"};
30 char *nameC[]={
"JSetowHighPreAway",
"JSetowTotPreAway"};
31 char *nameD[]={
"JSawayNTow",
"JSawayNTr"};
33 char *nameE[]={
"JSawayCond1",
"JSawayCond2"};
36 TString fullInpName=iPath; fullInpName+=core0;
37 fullInpName+=
".wana.hist.root";
38 fd=
new TFile(fullInpName);
40 printf(
"EROR: input histo file not found, quit\n",fullInpName.Data());
43 printf(
"Opened: %s\n",fullInpName.Data());
48 gStyle->SetPalette(1,0);
51 sprintf(padTit,
"%s",core0);
55 case 1:{ sprintf(padTit,
"ETOW Gain Study I, %s",core0);
56 can=
new TCanvas(
"aa",
"aa",800,600); TPad *c=makeTitle(can,padTit,page);
57 c->Divide(2,2);gStyle->SetOptStat(1);
59 for(
int i=0;i<4;i++) {
60 char txt[100];
int xInt=0;
61 printf(
"->%s<\n",nameX[i]);
62 h=(TH1*)fd->Get(nameX[i]); assert(h);
63 TAxis* axX=h->GetXaxis();
int nbX=axX->GetNbins();
64 float entries= h->GetEntries();
65 for(
int j=nbX; j>0; j--){
66 xInt += h->GetBinContent(j);
68 if(xInt > 0.0005*entries)
71 cout<<i+1<<
" 0.01% of counts in energy = "<<bin/10<<
" bin"<<endl;
72 Lx=h->GetListOfFunctions();
73 ln=
new TLine(bin/10,0,bin/10,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
75 c->cd(i+1); h->Draw();
76 c->GetPad(i+1)->SetLogy();
81 case 2:{ sprintf(padTit,
"ETOW Gain Study II, %s",core0);
82 can=
new TCanvas(
"aa",
"aa",800,600); TPad *c=makeTitle(can,padTit,page);
83 gStyle->SetOptStat(0);
int entries=0;
84 leg =
new TLegend(0.6,0.7,.9,.9);
85 leg->SetHeader(
"Z vertex range (cm)");
87 for(
int i=0;i<4;i++) {
88 char txt[100];
string entry;
89 printf(
"->%s<\n",nameX[i]);
90 h=(TH1*)fd->Get(nameX[i]); assert(h);
92 if(i==0) entry=
"[-100,-50]";
if(i==1) entry=
"[-50,0]";
93 if(i==2) {entry=
"[0,50]"; h->SetLineStyle(2);}
94 if(i==3) {entry=
"[50,100]"; h->SetLineStyle(2);}
96 if(i==0) {h->Draw(); entries=h->GetEntries(); gPad->SetLogy(); h->SetTitle(
"Normalized Endcap Tower E");}
97 else { h->SetLineColor(i+1); h->DrawNormalized(
"same",entries);}
98 leg->AddEntry(h,Form(
"%s",entry),
"l");
103 case 3:{ sprintf(padTit,
"Beam Background I, %s",core0);
104 can=
new TCanvas(
"aa",
"aa",800,600); TPad *c=makeTitle(can,padTit,page);
105 c->Divide(2,2); gStyle->SetOptStat(10);
107 for(
int i=0;i<4;i++) {
109 printf(
"->%s<\n",nameX[i]);
110 h=(TH1*)fd->Get(nameX[i]); assert(h);
111 c->cd(i+1); h->Draw(
"colz");
115 case 4:{ sprintf(padTit,
"Beam Background II, %s",core0);
116 can=
new TCanvas(
"aa",
"aa",800,600); TPad *c=makeTitle(can,padTit,page);
117 c->Divide(2,2); gStyle->SetOptStat(10);
119 for(
int i=0;i<2;i++) {
121 printf(
"->%s<\n",nameX[i]);
122 h=(TH1*)fd->Get(nameX[i]); assert(h);
123 c->cd(i+1); h->Draw(
"colz");
127 case 5:{ sprintf(padTit,
"Away Side Counters, %s",core0);
128 can=
new TCanvas(
"aa",
"aa",800,600); TPad *c=makeTitle(can,padTit,page);
131 for(
int i=0;i<2;i++) {
133 printf(
"->%s<\n",nameX[i]);
134 h=(TH1*)fd->Get(nameX[i]); assert(h);
135 c->cd(i+1); h->Draw();
136 c->GetPad(i+1)->SetLogy();
140 case 6:{ sprintf(padTit,
"Away Side Conditions, %s",core0);
141 can=
new TCanvas(
"aa",
"aa",800,600); TPad *c=makeTitle(can,padTit,page);
144 for(
int i=0;i<2;i++) {
146 printf(
"->%s<\n",nameX[i]);
147 h=(TH1*)fd->Get(nameX[i]); assert(h);
148 c->cd(i+1); h->Draw();
155 printf(
"page=%d NOT defined\n",page);
160 sprintf(text,
"%s%s_page%03d",oPath,core0,page);
166 if(pl&1) can->Print(tit+
".gif");
167 if(pl&2) can->Print(tit+
".ps");
172 TPad *makeTitle(TCanvas *c,
char *core,
int page) {
175 TPad *pad0 =
new TPad(
"pad0",
"apd0",0.0,0.95,1.,1.);
179 TPaveText *pt =
new TPaveText(0,0.,1,1,
"br");
192 pad =
new TPad(
"pad1",
"apd1",0.0,0.0,1,.95);
199 for(
int i=1;i<=4;i++) {