{ #include gROOT->LoadMacro("AtlasUtils.C"); ATLAS->SetPadTickX(1); ATLAS->SetPadTickY(0); ATLAS->SetPadRightMargin(0.12); ATLAS->SetPadLeftMargin(0.12); c1 = new TCanvas("c1","A Simple Graph",500,10,700,500); c1->SetGrid(); //TDatime db(2010,06,01,00,00,00); TDatime db(2010,01,01,00,00,00); int t1 = db.Convert(); //TDatime db(2021,12,31,00,00,00); TDatime db(2021,12,31,00,00,00); int t2 = db.Convert(); gStyle->SetOptStat(0); gPad->SetLogy(); //c1->SetGrid(); // create the arrays for the points Double_t ymax= 10000., ymin=0.1; double Tscale=ymax*0.1/10., Toffset = ymax*0.2; //double Tscale=0.01/10., Toffset = 0.02; Int_t n = 3000; double intL[n],Temp[4][n],Temp_plot[4][n], Tbias=3.6; double Tplot0[4]={1.35,1.12,1.83,8.75}; //double Tplot0[4]={-7.4,-7.4,-7.4,-7.4}; double time[n], Ttime[n]; double weekL[n], energy[n]; double leak[4][n],dleak[4][n],leakop[4][n],dleakop[4][n], leak3[5][n],dleak3[5][n]; int week,year1,month1,day1,year2,month2,day2; //--------readin luminosity data------------------- int iweek=1, iT=0; ifstream fin("lhcall_7_temperature_plan1.txt"); while(fin>>year1>>month1>>day1>>year2>>month2>>day2>>energy[iweek]>> weekL[iweek]>>intL[iweek]>>Temp[0][iweek]>>Temp[1][iweek]>>Temp[2][iweek]>>Temp[3][iweek] ) { cout<=10.) Tsensor += 2.0; double Arrhenius = exp(EI/kB*(1/TR-1/(Tsensor+T0))); isum[ierror] = 0.; //------calculate each component of leak current----------------- for (int k=0; k<5; k++) { double leak_week = alpha*Vsensor*A[k]*tau[k]/Arrhenius/days *(1-exp(-Arrhenius*days/tau[k]))*fluence; ileak[layer][iw][k][ierror] = ileak[layer][iw-1][k][ierror] * exp(-Arrhenius*days/tau[k]) + leak_week; isum[ierror] += ileak[layer][iw][k][ierror]; // cout<<"iw,layer,k,ierror="<>bec>>layer>>year2>>month2>>day2>>tempdata>>error) { //cout<3) continue; int m = idata[L]; TDatime da(year2,month2,day2,12, 0,0); dtime[L][m]=da.Convert(); // shift data(-10C) to Tplot---- double Tplot = Tplot0[L] - Tbias; double W=pow((Tplot+T0)/(T0-10.),2)*exp(Eg/2./kB*(1./(T0-10.)-1./ (Tplot+T0))); data[L][m]=tempdata * W; cout<-1; layer--){ for (int iw=0; iwSetMaximum(ymax); hc->SetMinimum(ymin); // hc->GetYaxis()->SetTitle("I _{leak} [#muA] @-10#circC"); hc->GetYaxis()->SetTitle("I _{leak} (#muA) @ operation"); //hc->GetXaxis()->SetTitle("DATE"); for (int j=0; jGetXaxis()->SetTitleOffset(1.4); hc->GetXaxis()->SetLabelOffset(0.05); hc->GetXaxis()->SetLabelSize(0.04); hc->GetYaxis()->SetTitleSize(0.05); hc->GetYaxis()->SetTitleOffset(1.0); hc->GetYaxis()->SetLabelOffset(0.01); // hc->GetXaxis()->SetRangeUser(13,45); hc->GetXaxis()->SetTimeDisplay(1); hc->GetXaxis()->SetTimeFormat("#splitline{ %Y}{%b %d}"); hc->GetXaxis()->SetLimits(t1,t2); // hc->GetXaxis()->SetNdivisions(206); hc->GetXaxis()->SetNdivisions(206); g2->SetMarkerSize(0.9); hc->SetMarkerSize(0.9); hc->SetLineColor(layer+2); hc->SetMarkerColor(layer+2);g2->SetMarkerColor(layer+2); if(layer==3) { hc->SetLineColor(1); hc->SetMarkerColor(1); g2->SetMarkerColor(1);} // hu->SetFillStyle(3001); if(layer==3)hc->Draw("AL"); if(layer!=3)hc->Draw("SAME L"); // hd->SetFillColor(0); // hd->Draw("SAME LF"); g2->Draw("SAME P"); if(layer==0)leg0->AddEntry(hc," B3","LP"); if(layer==1)leg0->AddEntry(hc," B4","LP"); if(layer==2)leg0->AddEntry(hc," B5","LP"); if(layer==3)leg0->AddEntry(hc," B6","LP"); } gT3 = new TGraph(iT,Ttime,Temp_plot[0]); gT4 = new TGraph(iT,Ttime,Temp_plot[1]); gT5 = new TGraph(iT,Ttime,Temp_plot[2]); gT6 = new TGraph(iT,Ttime,Temp_plot[3]); gT6->SetLineStyle(2); gT6->SetLineColor(1);gT6->Draw("SAME L"); gT5->SetLineStyle(2); gT5->SetLineColor(4);gT5->Draw("SAME L"); gT4->SetLineStyle(2); gT4->SetLineColor(3);gT4->Draw("SAME L"); gT3->SetLineStyle(2); gT3->SetLineColor(2);gT3->Draw("SAME L"); // p = new TPave(0.2,225,7.2,345); //------------------integrated luminosity-------------------- gL = new TGraph(iweek,time,intL); gL->SetLineStyle(2); gL->SetLineColor(46);gL->Draw("SAME L"); leg0->AddEntry(gL,"int-Lumi","l"); // leg0->SetFillColor(10); leg0->SetBorderSize(0); leg0->SetTextSize(0.04); leg0->Draw(); //draw an axis on the right side TGaxis *axis = new TGaxis(t2,1000.,t2, ymax,-10.,30.,404,"+L"); axis->SetTitle("T_{sensor} (#circC)"); axis->SetLabelOffset(0.01); axis->SetTitleOffset(1.2); axis->SetTitleSize(0.040); axis->SetLabelSize(0.04); axis->SetLabelFont(42); axis->SetTitleFont(42); axis->Draw(); // //draw an axis on the right side TGaxis *axis = new TGaxis(t2,0.1,t2, 1000.,0.1,1000.,505,"+LG"); axis->SetLabelOffset(0.01); axis->SetTitleOffset(1.0); axis->SetTitleSize(0.040); axis->SetLabelSize(0.0); axis->SetLabelFont(42); axis->SetTitleFont(42); axis->Draw(); //-- write last and first days TDatime db(2021,09,01,00,00,00);int t4 = db.Convert(); legA = new TText(t4 ,0.04 ,"2022"); legA->SetTextSize(0.040);legA->Draw(); TDatime db(2021,08,01,00,00,00);int t4 = db.Convert(); legB = new TText(t4 ,0.0225 ,"Jan 01"); legB->SetTextSize(0.040);legB->Draw(); // TDatime db(2009,09,01,00,00,00);int t4 = db.Convert(); legA = new TText(t4 ,0.04 ,"2010"); legA->SetTextSize(0.040);legA->Draw(); TDatime db(2009,08,01,00,00,00);int t4 = db.Convert(); legB = new TText(t4 ,0.0225 ,"Jan 01"); legB->SetTextSize(0.040);legB->Draw(); // TDatime db(2015,01,01,00,00,00);int t4 = db.Convert(); legA = new TLatex(t4 ,6000 ,"sensor temperature"); legA->SetTextSize(0.040);legA->Draw(); // TDatime db(2018,06,01,00,00,00);int t4 = db.Convert(); legA = new TLatex(t4 ,5 ,"Cooling plan 1"); legA->SetTextSize(0.050);legA->Draw(); // c1->Print("leak_current_10years_plan1.png"); //c1->Print("leak_current_new.eps"); //c1->Print("leak_current_new.pdf"); } :