{ //-----plot_Dortmund_with_noError_1.C------------------------ // 2012.1.26 change log term correctly // 2012.1.30 bug fixed // 2012.1.31 add hour and minutes in input // 2012.2.22 added both polarity in error, 4.5%->3.7% in fluence error // 2012.3.1 data and model with 1.21 // 2012.3.3. Atlas Perliminary // 2012.3.15 int. lum deliv. -> right axis // 2012.3.17 Y axis title: leak-> vol // 2012.3.22 change to sigma band and cleanup // 2012.12.19 change for 2012 and beam data // 2013.1.16 use fitted values from Temperature/Days/LCfit_selected.txt //----------------------------------------------- //----------------------------------------------- #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,30,1400,1000); //c1->SetGrid(); //TDatime db(2010,06,01,00,00,00); TDatime db(2010,07,01,00,00,00); int t1 = db.Convert(); //TDatime db(2011,04,01,00,00,00); TDatime db(2013,1,01,23,59,59); int t2 = db.Convert(); gStyle->SetOptStat(0); gPad->SetLogy(); int isGrid = 1; int isOldincluded = 0; //c1->SetGrid(); //------------------create the arrays for the points------------------------- char cid[40]; double Tplot = 0.; Double_t ymax= 1000.0; Double_t ymin= 0.0001; double Tscale=ymax*0.1/10., Toffset = ymax*0.2; //double Tscale=0.01/10., Toffset = 0.02; Int_t n = 3000; // number of weeks double intL[n],Temp[4][n],Temp_plot[4][n], Tbias=3.6; 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]; for (int i=0; i>year1>>month1>>day1>>hour1>>min1>>year2>>month2>>day2>>hour2>>min2>>energy[iweek]>> weekL[iweek]>>intL[iweek]>>Temp[0][iweek]>>Temp[1][iweek]>>Temp[2][iweek]>>Temp[3][iweek] ) { if(iweek<10) cout< t2) continue; if(iweek==1) time[0] = time1; TDatime d2(year2,month2,day2,hour2,min2,60); time[iweek]=d2.Convert(); Ttime[iT]=time1; for(int layer=0; layer<4; layer++){ Temp[layer][iweek] = Temp[layer][iweek] - Tbias; // Temp_plot[layer][iT] = Temp[layer][iweek]*Tscale+Toffset; Temp_plot[layer][iT] = pow(10., 2.+(Temp[layer][iweek]+10.)/40.); } iT++; Ttime[iT]=time[iweek]; for(int layer=0; layer<4; layer++) //Temp_plot[layer][iT] = Temp[layer][iweek]*Tscale+Toffset; Temp_plot[layer][iT] = pow(10., 2.+(Temp[layer][iweek]+10)/40.); iT++; iweek++; } fin.close(); cout<<"number of time intervals= "<< iweek << endl; cout<<"last week: from "<7. && energy[iw] < 9.) fluence0 *= factor8TeV; if(energy[iw]>13.) fluence0 *= factor14TeV; double Tsensor0 = Temp[layer][iw] ; // cout<<"Temp="< 0.) ierror = jerror + nError; //--------------------------------------------------- double alphaI = alphaI0; double k0I = k0I0; double EI = EI0; double alpha0star = alpha0star0; double beta = beta0; double EIstar = EIstar0; Tsensor = Tsensor0; double fluence_thisweek = fluence0; double Eg = Eg0; // if( jerror==1 ) alphaI += pol*dalphaI; if( jerror==2 && pol>0.) k0I += dk0I_plus; if( jerror==2 && pol<0.) k0I -= dk0I_minus; if( jerror==3 ) EI += pol*dEI; if( jerror==4 ) alpha0star += pol*dalpha0star; if( jerror==5 ) beta += pol * dbeta; if( jerror==6 ) EIstar += pol * dEIstar; if( jerror==7 && pol<0.) Eg -= dEg_minus; if( jerror==7 && pol>0.) Eg += dEg_plus; if( jerror==8 && Tsensor0 < 10.) Tsensor += pol * 1.0; if( jerror==8 && Tsensor0 >=10.) Tsensor += pol * 2.0; if( jerror==9 ) fluence_thisweek *= (1. + pol*dfluence) ; fluences[layer][iw][ierror] = fluence_thisweek; //-----leak_week = new leakcurrent due to new flux during this week ----------- double Arrhenius = exp(-EIstar/kB*(1/(Tsensor+T0)-1/Tref)); double W=pow((Tplot+T0)/Tref,2)*exp(-Eg/2./kB*(1./(Tplot+T0)-1./Tref)); double tauI = 1./ (k0I * exp(-EI/kB/(Tsensor+T0))); double leak_week_exp = W * fluence_thisweek * alphaI *exp(-0.5*days/tauI); double leak_week_log = W * fluence_thisweek * (alpha0star - beta * log(0.368*days/t0)); ileak_exp[layer][iw][ierror] = leak_week_exp + ileak_exp[layer][iw-1][ierror] * exp(-days/tauI); days_eff[layer][iw][ierror] = days * Arrhenius; double sum_fluence = 0.; double beta_term = 0.; if( iw != 1) { for (int jw = 1; jw"<>year2>>month2>>day2>>FSIon>>nfit[0]>>fitv[0]>>nfit[1]>>fitv[1]>>nfit[2]>>fitv[2]>>nfit[3]>>fitv[3]){ TDatime da(year2,month2,day2,12.,0.,0); //-------just plot all if(FSIon==0 || FSIon!=0) { for (int L=0; L<4; L++) { int m = idata[0][L]; dtime[0][L][m]=da.Convert(); data[0][L][m]=(fitv[L]-pedestal[L])/Vsensor; idata[0][L]++; } } else { for (int L=0; L<4; L++) { int m = idata[1][L]; dtime[1][L][m]=da.Convert(); data[1][L][m]=(fitv[L]-pedestal[L])/Vsensor; idata[1][L]++; } } } fin.close(); cout<<"data points(ALL):"<SetMaximum(ymax); hu->SetMinimum(ymin); hu->GetXaxis()->SetTitle("Date"); hu->GetXaxis()->SetTitleOffset(2.0); hu->GetXaxis()->SetTitleSize(0.03); hu->GetXaxis()->SetLabelOffset(0.05); hu->GetXaxis()->SetLabelSize(0.0); sprintf(cid,"I_{vol} @ %d^{o}C (#muA/cm^{3})\0",(int)Tplot); hu->GetYaxis()->SetTitle(cid); hu->GetYaxis()->SetTitleSize(0.035); hu->GetYaxis()->SetLabelSize(0.035); hu->GetYaxis()->SetTitleOffset(1.3); hu->GetYaxis()->SetLabelOffset(0.01); hu->GetXaxis()->SetTimeDisplay(1); hu->GetXaxis()->SetTimeFormat("#splitline{ %Y}{%b %d}"); hu->GetXaxis()->SetLimits(t1,t2); hu->GetXaxis()->SetNdivisions(207); int kColor=kRed; if(layer==1) kColor = kGreen; if(layer==2) kColor = kCyan+2; if(layer==3) kColor = kBlue; hu->SetFillColor(kColor-10); //hu->SetFillStyle(3001); hu->GetXaxis()->SetNdivisions(0); if(layer==0)hu->Draw("ALF"); if(layer!=0)hu->Draw("SAME LF"); leg4->AddEntry(hu," ","f"); if(layer==0)leg0->AddEntry(hu,"B3",""); if(layer==1)leg0->AddEntry(hu,"B4",""); if(layer==2)leg0->AddEntry(hu,"B5",""); if(layer==3)leg0->AddEntry(hu,"B6",""); } //----------draw central values and data points ------------------------- for (int layer=0; layer<4; layer++){ double yplot[iweek]; for (int iw=0; iwSetLineColor(kColor+2); g2->SetMarkerColor(kColor+2); if(layer==2) g2->SetMarkerColor(kColor); hc->Draw("SAME L"); g2->SetMarkerSize(0.8); g2->Draw("SAME P"); //g3->SetMarkerColor(1); //g3->SetMarkerSize(1.5); // special for FSI OFF points //g3->SetMarkerStyle(20); //if(isOldincluded == 1) g3->Draw("SAME P"); leg1->AddEntry(hc," #pm1#sigma","L"); leg2->AddEntry(g2," ","P"); } //-------------------------plot temperature-------------------------- 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]); gT3->SetLineStyle(1); gT3->SetLineColor(kRed);gT3->Draw("SAME L"); gT4->SetLineStyle(1); gT4->SetLineColor(kGreen);gT4->Draw("SAME L"); gT5->SetLineStyle(1); gT5->SetLineColor(kCyan+2);gT5->Draw("SAME L"); gT6->SetLineStyle(1); gT6->SetLineColor(kBlue);gT6->Draw("SAME L"); //-------------------plot integrated luminosity--------------- for (int i=0; iDraw("SAME L"); TDatime db(2010,10,1,0,0,0); int t4 = db.Convert(); lum = new TLatex(t4 ,0.60 ,"int. lum. deliv."); lum->SetTextSize(0.035); lum->Draw(); //-------------------- write years and days on X label-------------- int day1=10; double ylabel1= ymin*0.5, ylabel2=ymin*0.3; for (int iy=2010; iy<2014; iy++) { for (int m=1; m<13; m+=3){ TDatime db(iy,m-1,day1,00,00,00);int t4 = db.Convert(); if(t4 t2+3000000) continue; sprintf(cid,"%d/01\0",m); legA = new TText(t4 ,ylabel1 ,cid); legA->SetTextSize(0.030); legA->Draw(); sprintf(cid,"%d\0",iy); legA = new TText(t4 ,ylabel2 ,cid); legA->SetTextSize(0.030);legA->Draw(); } //--- tick marks------ for (int i=1;i<13;i++) { TDatime db(iy,i,01,00,00,00); int t4 = db.Convert(); if(t4<=t1 || t4>=t2) continue; tick = new TLine(t4, ymin, t4, ymin*1.3); tick->SetLineStyle(1);tick->Draw(); tick = new TLine(t4, ymax*0.8, t4, ymax); tick->SetLineStyle(1);tick->Draw(); if(isGrid != 0 && i%3 == 1) { tick = new TLine(t4, 0, t4, ymax); tick->SetLineStyle(3); tick->Draw(); } } } //-----------horizontal bar------------------------ if(isGrid !=0) { for (double y=ymin; ySetLineStyle(3);tick->Draw(); } } //----------Legend----------------- legd->SetFillColor(10); legd->SetBorderSize(1); leg0->SetFillColor(10); leg0->SetBorderSize(0); leg0->SetTextSize(0.03); leg1->SetFillColor(10); leg1->SetBorderSize(0); leg1->SetTextSize(0.03); leg2->SetFillColor(10); leg2->SetBorderSize(0); leg2->SetTextSize(0.03); leg4->SetFillColor(10); leg4->SetBorderSize(0); leg4->SetTextSize(0.01); legd->Draw(); leg0->Draw(); leg2->Draw(); leg1->Draw(); leg4->Draw(); //---------------draw Temperature axis on the right side----------------- TGaxis *axis = new TGaxis(t2,ymax/10.*pow(10.,0.25),t2, ymax,0.,30.,404,"+L"); axis->SetTitle("T (#circC)"); axis->SetLabelOffset(0.01); axis->SetTitleOffset(1.0); axis->SetTitleSize(0.03); axis->SetLabelSize(0.03); axis->SetLabelFont(42); axis->SetTitleFont(42); axis->Draw(); //-----------------------draw an axis on the right side---------------- TGaxis *axis = new TGaxis(t2,ymin,t2, ymax/10.,ymin/10.,ymax/100.,505,"+LG"); axis->SetTitle("Int. Lum. Deliv. (fb^{-1}) "); axis->SetLabelOffset(0.0); axis->SetTitleOffset(1.0); axis->SetTitleSize(0.03); axis->SetLabelSize(0.03); axis->SetLabelFont(42); axis->SetTitleFont(42); axis->Draw(); //-------------------write sensor temperature --------------- TDatime db(2011,2,10,00,00,00); int t4 = db.Convert(); TDatime db(2011,7,25,00,00,00); int t5 = db.Convert(); p = new TPave(t4, ymax*0.6,t5, ymax*0.95); p->SetFillColor(10); p->SetBorderSize(0), p->Draw(); TDatime db(2011,2,15,00,00,00); int t4 = db.Convert(); lum = new TLatex(t4 ,600 ,"sensor temperature"); lum->SetTextSize(0.035); lum->Draw(); //-----------------------OLD point description------------------ if( isOldincluded!=0) { TDatime db(2012,01,15,00,00,00); int t5 = db.Convert(); t=new TLatex(t5,0.1 ,"old method with FSI OFF"); t->SetTextSize(0.035); t->Draw(); TDatime db(2012,01,0,00,00,00); t5 = db.Convert(); TMarker *mm=new TMarker(t5,0.13,20); mm->SetMarkerSize(1.5); mm->Draw(); } //----------------- write ATLAS preliminary-------------------------- TDatime db(2010,07,15,00,00,00); int t5 = db.Convert(); t=new TLatex(t5,ymax*0.05,"ATLAS preliminary"); //t=new TLatex(t5,ymax*0.05,"preliminary"); t->SetTextSize(0.04); t->Draw(); //-----------------------print ------------------------- if(isOldincluded==1) c1->Print("Barrel_log_2012end_OLDincluded_fit.png"); else { c1->Print("Barrel_log_2012end_fit.png"); //c1->Print("Barrel_log_2012end_fit.pdf"); //c1->Print("Barrel_log_2012end_fit.eps"); } }