{ //=========================================================================== // Sample ROOT programme for Vd evolution, Taka Kondo (KEK, ATLAS) 2011.10.24 //=========================================================================== //------------------set up for plot -------------------------------------- gROOT->LoadMacro("AtlasUtils.C"); ATLAS->SetPadTickY(0); ATLAS->SetPadRightMargin(0.12); ATLAS->SetPadLeftMargin(0.12); c1 = new TCanvas("c1","A Simple Graph",500,30,700,500); gStyle->SetOptStat(0); //--------1 MeV n-eq fluence [/cm^2] at 1 nb^-1 7 TeV pp collision------------ // Double_t NIEL0 = 1.65e5, dNIEL0 = 0.20 * NIEL0; // e.g. ATLAS B3, error=20% is a pure guess //Double_t NIEL0 = 21.50e5, dNIEL0 = 0.20 * NIEL0; //e.g. ATLAS Pixel B0, error=20% pure guess Double_t d = 0.0285; // sensor thickness [cm] Double_t Vd0 = 70., dVd0 = 0.; // initial voltage and its spread [V] //---------set start and end days for plot --------------- TDatime db(2010,01,01,00,00,00); Int_t t1 = db.Convert(); TDatime db(2022,01,02,00,00,00); Int_t t2 = db.Convert(); Double_t yminPlot = 0., ymaxPlot= 200; // min max of plot Double_t Tscale=ymaxPlot*0.025/10., Toffset = ymaxPlot*0.9; // just for temperature plot //=========================================================================== Int_t n = 3000; Double_t intL[n],Temp[n],dTemp[n], Temp_plot[n]; Double_t time[n], Ttime[n]; Double_t weekL[n], dweekL[n]; // //--------readin days_luminosity_temperature.txt------------------ // Int_t year1,month1,day1,hour1,min1,year2,month2,day2,hour2,min2; Int_t iweek=1; ifstream fin("days_lumi_temp_Plan1.txt"); char line[255]; fin.getline(line,sizeof(line)); //------read 1st line--------- while(fin>>year1>>month1>>day1>>hour1>>min1>>year2>>month2>>day2>>hour2>>min2 >>weekL[iweek]>>dweekL[iweek]>>intL[iweek]>>Temp[iweek]>>dTemp[iweek]) { if(iweek<10) cout< V2) { Vdu[iw] = V1; Vdd[iw] = V2; } else { Vdu[iw] = V2; Vdd[iw] = V1; } if((Neff[0][iw]+SigmaNeff[iw])* (Neff[0][iw]-SigmaNeff[iw])<0) Vdd[iw]=0.; } // //-----------------add one more null data for color-area plotting-------------- // iweek++; TDatime dextra(2022,12,31,00,00,00); time[iweek-1]=dextra.Convert(); Vdu[iweek-1] = 0.; Vdd[iweek-1] = 0.; // Vdc[0] = Vdc[1]; Vdu[0] = 0.; Vdd[0] = 0.; //----------------------------------------------------- // hc = new TGraph(iweek,time,Vdc); hu = new TGraph(iweek,time,Vdu); hd = new TGraph(iweek,time,Vdd); hu->SetMaximum(ymaxPlot); hu->SetMinimum(yminPlot); hu->SetFillColor(kRed-10); hu->GetYaxis()->SetTitle("V_{d} [V]"); hu->GetXaxis()->SetTitle("DATE"); hu->GetXaxis()->SetTitleOffset(1.4); hu->GetXaxis()->SetLabelOffset(0.03); hu->GetXaxis()->SetLabelSize(0.04); hu->GetYaxis()->SetTitleSize(0.05); hu->GetYaxis()->SetTitleOffset(1.2); hu->GetYaxis()->SetLabelOffset(0.01); hu->GetXaxis()->SetTimeDisplay(1); hu->GetXaxis()->SetTimeFormat("#splitline{ %Y}{%b %d}"); hu->GetXaxis()->SetLimits(t1,t2); hc->SetLineColor(2); hu->SetLineColor(1); hd->SetLineColor(4); hu->GetXaxis()->SetNdivisions(207); hu->GetYaxis()->SetNdivisions(505); hu->Draw("ALF"); hd->SetFillColor(0); hd->Draw("SAME LF"); hc->SetLineColor(kRed+2); hc->Draw("SAME L"); //-------- overlay integrated luminosity-------------- gL = new TGraph(iweek,time,intL); gL->SetLineStyle(3); gL->SetLineColor(1);gL->Draw("SAME L"); //-------------------------plot temperature-------------------------- Temp_plot[0] = Temp_plot[1]; gT = new TGraph(iweek-1,time,Temp_plot); gT->SetLineColor(1);gT->Draw("SAME L"); //-------------draw an axis on the right side for temperature-------- TGaxis *axis = new TGaxis(t2,ymaxPlot*0.8,t2, ymaxPlot,-40.,40.,202,"+L"); axis->SetTitle("T_{sensor} [#circC]"); axis->SetLabelOffset(0.01); axis->SetTitleOffset(1.0); axis->SetTitleSize(0.05); axis->SetLabelSize(0.05); axis->SetLabelFont(42); axis->SetTitleFont(42); axis->Draw(); //--- write tick mark on bottom X axis------------------- for (Int_t year=2011; year<2022; year++){ TDatime db(year,01,01,00,00,00); Int_t t4 = db.Convert(); tick = new TLine(t4, 0, t4, ymaxPlot*0.03);tick->Draw(); } //draw an axis on the left side TGaxis *axis = new TGaxis(t1,yminPlot,t1, ymaxPlot,yminPlot,ymaxPlot,505,"L"); axis->SetLabelSize(0.0); axis->Draw(); //-------draw legend--------------- leg = new TLegend(0.20 ,0.80 ,0.5,0.92); leg->AddEntry(gL,"Integrated Luminosity (fb^{-1})","l"); leg->SetFillColor(10); leg->SetTextSize(0.04);leg->SetBorderSize(0); //leg->Draw(); // c1->Print("Vd_sample_Plan1.pdf"); c1->Print("Vd_sample_Plan1.png"); }