{ #include #include c1 = new TCanvas("c1","A Simple Graph with error bars",0,0,700,500); c1->SetFillStyle(4100); c1->SetGrid(); c1->GetFrame()->SetBorderSize(12); TStyle *default = new TStyle("Default","Default Style"); //default->SetPadBorderMode(0); default->SetCanvasColor(0); default->cd(); // this becomes now the current style gStyle // create the arrays for the points Int_t n = 409; Double_t x[n], dummy[n]={n*0.}; Double_t y1[n], y2[n],y3[n], y4[n],y5[n], z1[n], z2[n], z3[n], z4[n], z5[n]; ifstream fin("temperature_new.txt"); for (int i=0; i> x[i]>>y1[i]>>y2[i]>>y3[i] >>y4[i] >> y5[i]>>z1[i] >>z2[i]>>z3[i]>>z4[i]>>z5[i]; fin.close(); // g1 = new TGraph(n,x, dummy); // Double_t ymin= -15., ymax=25; Double_t xmin= 0., xmax=12.; g1->SetTitle(); g1->SetMaximum(ymax); g1->SetMinimum(ymin); g1->GetYaxis()->SetTitle("Temperature of sensors (^{o}C) "); g1->GetXaxis()->SetTitle("LHC year"); g1->GetYaxis()->SetTitleSize(0.04); g1->GetYaxis()->SetTitleFont(132); g1->GetYaxis()->SetLabelSize(0.04); g1->GetYaxis()->SetLabelFont(132); g1->GetXaxis()->SetTitleSize(0.04); g1->GetXaxis()->SetTitleFont(132); g1->GetXaxis()->SetLabelSize(0.04); g1->GetXaxis()->SetLabelFont(132); g1->GetYaxis()->SetTitleOffset(1.0); g1->GetXaxis()->SetTitleOffset(1.0); g1->GetYaxis()->SetLabelOffset(0.01); g1->GetXaxis()->SetRangeUser(xmin,xmax); g1->GetXaxis()->SetNdivisions(Int_j=13); g1->Draw("AP"); //--------------------------------------------------- int k = 0; float xlast, ylast1, ylast2, ylast3, ylast4, ylast5; float xnext,ynext1,ynext2,ynext3,ynext4,ynext5; xlast= x[0]; ylast1 = y1[0]; ylast2 = y2[0]; ylast3 = y3[0]; ylast4 = y4[0], ylast5 = y5[0]; for (int i=0; i 0.60) continue; if(k==0) { xnext=x[i]; ynext1 = (y1[i]>ymax)?ymax:y1[i]; ynext2 = (y2[i]>ymax)?ymax:y2[i]; ynext3 =(y3[i]>ymax)?ymax:y3[i];ynext4 = (y4[i]>ymax)?ymax:y4[i];ynext5 = (y5[i]>ymax)?ymax:y5[i]; a=new TLine(xlast,ylast4, xnext,ynext4); a->SetLineColor(4); a->SetLineStyle(3); a->SetLineWidth(2);a->Draw(); a=new TLine(xlast,ylast5, xnext,ynext5); a->SetLineColor(6); a->SetLineStyle(3); a->SetLineWidth(2);a->Draw(); a=new TLine(xlast,ylast2, xnext,ynext2); a->SetLineColor(2); a->SetLineStyle(3); a->SetLineWidth(2);a->Draw(); } k++; if(k<26)continue; xlast= x[i]; ylast1 = y1[i]; ylast2 = y2[i]; ylast3 = y3[i]; ylast4 = y4[i], ylast5 = y5[i]; h0 = new TGraph(26,&x[i-25],&y4[i-25]); h0->SetLineWidth(2);h0->SetMarkerColor(4); h0->SetLineColor(4);h0->Draw("SAME LP"); h0 = new TGraph(26,&x[i-25],&y5[i-25]); h0->SetLineWidth(2);h0->SetMarkerColor(6); h0->SetLineColor(6);h0->Draw("SAME LP"); h0 = new TGraph(26,&x[i-25],&y2[i-25]); h0->SetLineWidth(2);h0->SetMarkerColor(2); h0->SetLineColor(2);h0->Draw("SAME LP"); k=0; } // for (i=0;i<12; i++) { box = new TBox(i+0.14,ymin,i+0.45, ymax); box->SetFillColor(13); box->SetFillStyle(3003); box->Draw(); //---------------------------------------------------- b= new TLine(0,ymin, 0,ymax); b->SetLineWidth(2); b->Draw(); b= new TLine(0,ymin, xmax,ymin); b->SetLineWidth(2); b->Draw(); b= new TLine(0,ymax, xmax,ymax); b->SetLineWidth(2); b->Draw(); b= new TLine(xmax,ymin, xmax,ymax); b->SetLineWidth(2); b->Draw(); b= new TLine(10.,ymin, 10.,ymax); b->SetLineWidth(1); b->Draw(); TLatex *t=new TLatex(10.08, -14.,"optional years");t->SetTextSize(0.035); t->SetTextFont(132); t->SetTextFont(132); t->Draw(); //----------------------------------------------------- // p = new TPave(3.2,12.,9.5,24.0); p->SetFillColor(10); p->SetLineColor(1);p->SetBorderSize(2); p->Draw(); // Float_t h=5.5, dh=0.7, q1=3.5, q2=4.0, q3=4.2, q4=4.6, q5=7.; // h = 22; t=new TLatex(0.5, h,"TDR model"); t->SetTextSize(0.040); t->SetTextFont(132); t->Draw(); t=new TLatex(q4, h,"----first 3 yrs----"); t=new TLatex(q1, h,"T_{cool} "); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q4, h,"----first 3 yrs----"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q5, h,"----next 9 yrs----"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); // h = h-2; t=new TLatex(q4, h,"216 23 126"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q5, h,"216 23 126 days"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); // h = h-2 ; t=new TLatex(q3, h,"B");t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q4, h,"-15 20 -15 ^{o}C"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q5, h,"-22 20 -22 ^{o}C"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); TLine *xx = new TLine(q1,h+dh, q2,h+dh); xx->SetLineColor(2); xx->SetLineWidth(2); xx->Draw(); // h = h-2; t=new TLatex(q3, h,"G");t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q4, h,"-15 20 -15 ^{o}C"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q5, h,"-25 20 -25 ^{o}C"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); TLine *xx = new TLine(q1,h+dh, q2,h+dh); xx->SetLineColor(4); xx->SetLineWidth(2); xx->Draw(); // h = h-2; t=new TLatex(q3+0.05, h,"I");t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q4, h,"-15 20 -15 ^{o}C"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); t=new TLatex(q5, h,"-15 20 -15 ^{o}C"); t->SetTextSize(0.035); t->SetTextFont(132); t->Draw(); TLine *xx = new TLine(q1,h+dh, q2,h+dh); xx->SetLineColor(6); xx->SetLineWidth(2); xx->Draw(); // t=new TLatex(10.05, -22,"optional years");t->SetTextSize(0.035); t->SetTextAngle(0), t->Draw(); }