{ //=========================================================================== // Sample ROOT programme for Vd evolution, Taka Kondo (KEK, ATLAS) 2011.10.24 //=========================================================================== gROOT->LoadMacro("AtlasUtils.C"); c1 = new TCanvas("c1","A Simple Graph",500,30,700,500); gPad->SetLogy(); //------NIEL = 1 MeV n-eq fluence [/cm^2] at the sensor for 1 nb^-1 pp collisions ------------ Double_t NIEL= 1.65e5, dNIEL= 0.2 * NIEL; // e.g. ATLAS B3, error=20% is a pure guess //Double_t NIEL= 21.50e5, dNIEL= 0.2 * NIEL; // e.g. ATLAS Pixel B0, error=20% is a pure guess // //---------set start and end days , yminPlot and ymaxPlot for plot --------------- TDatime db(2010,07,02,00,00,00); Int_t t1 = db.Convert(); TDatime db(2011,08,14,23,00,00); Int_t t2 = db.Convert(); Double_t yminPlot = 0.0001, ymaxPlot= 10.0; // min max of plot // //=========================================================================== // //---------------------------------------------------------------- Int_t n = 3000; Double_t time[n], weekL[n], dweekL[n], intL[n], Temp[n], dTemp[n]; Double_t leak[n], dleak[n], leakop[n], dleakop[n], leakP[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<>year2>>month2>>day2>>data[idata]>>ddata[idata]) { TDatime da(year2,month2,day2,12, 0,0); dtime[idata]=da.Convert(); // cout<SetMaximum(ymaxPlot); hu->SetMinimum(yminPlot); hu->SetFillColor(kRed-10); hu->GetXaxis()->SetTitle("DATE"); hu->GetYaxis()->SetTitle("I _{leak}@0#circC (#muA/cm^{3}) "); hu->GetXaxis()->SetLabelSize(0.04); hu->GetYaxis()->SetLabelSize(0.05); hu->GetXaxis()->SetLabelOffset(0.03); hu->GetYaxis()->SetLabelOffset(0.01); hu->GetXaxis()->SetTitleSize(0.045); hu->GetYaxis()->SetTitleSize(0.05); hu->GetXaxis()->SetTitleOffset(1.5); hu->GetYaxis()->SetTitleOffset(1.2); hu->GetXaxis()->SetTimeDisplay(1); hu->GetXaxis()->SetTimeFormat("#splitline{ %Y}{%b %d}"); hu->GetXaxis()->SetLimits(t1,t2); hu->Draw("ALF"); hd->SetFillColor(0); hd->Draw("SAME LF"); //---------plot center values------------- for (Int_t iw=0; iwSetLineColor(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"); //-------draw legend--------------- leg = new TLegend(0.20 ,0.80 ,0.5,0.90); leg->AddEntry(gL,"Integrated Luminosity (fb^{-1})","l"); leg->AddEntry(hc," #pm1#sigma","L"); leg->SetFillColor(10); leg->SetTextSize(0.04);leg->SetBorderSize(0); leg->Draw(); leg = new TLegend(0.33 ,0.80 ,0.45,0.85); leg->AddEntry(hu," prediction","F"); leg->SetFillColor(10); leg->SetTextSize(0.04);leg->SetBorderSize(0); leg->Draw(); //----------draw data points------------------------ for (Int_t j=0; jSetMarkerColor(kRed+2);hd->SetLineColor(kRed+2); g2->SetMarkerSize(1.0); g2->Draw("SAME P"); //--- write tick mark on bottom X axis------------------- for (Int_t month=8; month<13; month++){ TDatime db(2010,month,01,00,00,00); Int_t t4 = db.Convert(); tick = new TLine(t4, yminPlot, t4, yminPlot*1.4);tick->Draw(); } for (Int_t month=1; month<9; month++){ TDatime db(2011,month,2,00,00,00); Int_t t4 = db.Convert(); tick = new TLine(t4, yminPlot, t4, yminPlot*1.4);tick->Draw(); } //-----------x bottom axis, draw once morer------------------------ tick = new TLine(t1, yminPlot, t2, yminPlot); tick->SetLineStyle(1);tick->Draw(); //-----------draw an axis on the right side--------------------- TGaxis *axis = new TGaxis(t2,yminPlot,t2, ymaxPlot,yminPlot,ymaxPlot,505,"+LG"); axis->SetLabelSize(0.0); axis->Draw(); //-----------------------print ------------------------- c1->Print("leak_current_sample.png"); c1->Print("leak_current_sample.pdf"); } :