{ //------------------------------------------ // 2014.9.4 change to meanMOchTm0(and1)_B3.txt // 2014.11.22 updated for dcsDB //------------------------------------------ #include gROOT->LoadMacro("AtlasUtils.C"); ATLAS->SetPadTickX(1); ATLAS->SetPadRightMargin(0.12); ATLAS->SetPadLeftMargin(0.12); gStyle->SetOptStat(0); c1 = new TCanvas("c1","A Simple Graph",200,100,2100,1500); char cid[99]; char line[200]; int barrel[10]={0,0,0,32,40,48,56,0,0,0}; //---------------------------------------------------- int Nplot=4; c1.Divide(1, Nplot); TPad* canv[Nplot]; double rightM = 0.04, leftM = 0.08, topM = 0.05, bottomM=0.07; double x1 = leftM; double x2 = 1. - rightM; double height = 0.245; double y1 = 1.-topM, y2=1., deltaH = 1.-topM-bottomM; for (int i=0;iFindObject(cid); y2 = 1.- topM - i*deltaH/Nplot ; y1 = y2 - deltaH * height; canv[i]->SetPad(x1,y1,x2,y2); canv[i]->SetFillColor(0); canv[i]->SetFrameFillColor(0); canv[i]->SetTopMargin(0.); canv[i]->SetBottomMargin(0.03); canv[i]->SetLeftMargin(0.); canv[i]->SetRightMargin(0.0); } char stringMonth[13][10]={"test","Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec"}; // //-----------------setup--------------------------------- double ymin, ymax; double Temp[2][3][10][13][56]; //Temp{Tm][bec][layer][eta][phi] for (int i=0;i<3;i++) { for (int j=0;j<10;j++){ for (int k=0;k<13;k++){ for (int l=0;l<56;l++){ Temp[0][i][j][k][l] = -30.; Temp[1][i][j][k][l] = -30.; } } } } double plot_min[4][4], plot_max[4][4]; for (int j=0; j<4; j++) { plot_min[1][j] = 0.; plot_max[1][j] = 180.; //HVchVolt plot_min[2][j] = 0.; plot_min[3][j] = -8; plot_max[3][j] = +12.; // Temperature min max for B3, B4, and B5 if( j !=3 ) continue; plot_min[3][j] = 0; plot_max[3][j] = +20.; // Temperature min max for B6 } plot_max[2][0] = 220.; //HVchCurr plot_max[2][1] = 180.; //HVchCurr plot_max[2][2] = 170.; //HVchCurr plot_max[2][3] = 220.; //HVchCurr //-------------------------------------------------------- int MONTH=11, DAY=19, YEAR=2014; int TYPE = 3; // 1=HVchVolt, 2=HVchCurr, 3=MOch_TmX double RUNintL =999.; //------------------read in HV or HCCurr or TM0----------------------- int bec, layer, phi, eta, ndata, NN=0; double data, sigma,delta; sprintf(cid,"meanMOch_Tm0_B_%02d-%02d-%d.txt",DAY,MONTH,YEAR); if(TYPE==1) sprintf(cid,"meanHVchVolt_B_%02d-%02d-%d.txt",DAY,MONTH,YEAR); if(TYPE==2) sprintf(cid,"meanHVchCurr_B_%02d-%02d-%d.txt",DAY,MONTH,YEAR); ifstream fin(cid); fin.getline(line,sizeof(line)); // skip 1st line while(fin>>bec>>layer>>phi>>eta>>ndata>>data>>sigma>>delta) { if(bec==1) eta += 6; if(TYPE==2) data /= 1000.; Temp[0][bec][layer][eta][phi] = data; NN++; } fin.close(); cout<<"reading in "<>bec>>layer>>phi>>eta>>ndata>>data>>sigma>>delta) { if(bec==1) eta += 6; Temp[1][bec][layer][eta][phi] = data; NN++; } fin.close(); cout<<"reading in "<GetYaxis()->SetTitle("HV [volt]"); if(TYPE==2) h1->GetYaxis()->SetTitle("HV Current [#muA]"); h1->GetYaxis()->SetTitleOffset(0.25); h1->GetYaxis()->SetTitleSize(0.13); h1->GetYaxis()->SetLabelSize(0.13); h1->GetXaxis()->SetLimits(0.,index+1); h1->GetYaxis()->SetNdivisions(505); h1->GetYaxis()->SetTickLength(0.02); h1->Draw("ALP"); if(TYPE==3) { h2 = new TGraph(index1+1,X1,Y1); h2->SetMarkerSize(0.8); h2->SetMarkerColor(4); h2->Draw("SAME LP"); } //---------------------draw eta values at the top--------------- if( Layer==3) { for (i=0; i<12; i++) { sprintf(cid,"Eta %d\0",i-6); if(i>=6) sprintf(cid,"Eta %d\0",i-5); t=new TText(nphi*(i+0.2),ymin+(ymax-ymin)*0.90,cid); t->SetTextSize(0.10); t->Draw(); } } //---------------disk, int/ lum, date-------------------- if( Layer==3 ) { double yy1= (ymax-ymin)*1.04+ ymin; double xx1= index*0.01, xx2; sprintf(cid,"SCT Barrel, %s %d, %d", stringMonth[MONTH],DAY,YEAR); t = new TLatex(xx1, yy1,cid); t->SetTextSize(0.15); t->Draw(); //---------------------ATLAS preliminary--------------------- xx1 = index*0.75, xx2=index*0.85; t=new TLatex(xx1, yy1,"ATLAS"); t->SetTextFont(72); t->SetTextSize(0.15); t->Draw(); t=new TLatex(xx2, yy1,"Internal"); t->SetTextSize(0.15); t->Draw(); } //---------------------draw eta borders--------------- for (int i=0; i<12;i++) { z1 = new TLine(nphi*i-0.5,ymin,nphi*i-0.5,ymax); z1->SetLineStyle(1); if(i!=0)z1->Draw(); for (int j=1; j<4; j++) { double zz = i*nphi + nphi*0.25*j -1.; z1= new TLine(zz,ymin,zz,ymin+(ymax-ymin)*0.03); z1->Draw(); z1 =new TLine(zz,ymin+(ymax-ymin)*0.97,zz,ymax);z1->Draw(); } } //-------------layer number, links--------------- double yleg = 0.87; if( Layer == 3) yleg=0.15; if( TYPE==1) yleg=0.30; sprintf(cid,"Barrel %d",Layer); leg = new TLegend(0.87 ,yleg ,0.87,yleg,cid); leg -> SetFillColor(10); leg->SetBorderSize(0); leg->SetTextSize(0.13); leg->Draw(); //----------------links------------- if(TYPE==3) { leg = new TLegend(0.65 ,yleg ,0.80,yleg); leg -> SetFillColor(10); leg->AddEntry(h1,"link 0","lp"); leg->SetBorderSize(0); leg->SetTextSize(0.15); leg->Draw(); leg = new TLegend(0.75 ,yleg ,0.90,yleg); leg -> SetFillColor(10); leg->AddEntry(h2,"link 1","lp"); leg->SetBorderSize(0); leg->SetTextSize(0.15); leg->Draw(); } } //--------------------x axis -and -draw eta edge--------------- double zcenter[12] = {-67.9, -56.0, -43.2, -31.1, -18.7, -6.4, 6.0, 18.4, 30.6, 43.0, 55.0, 67.9}; for (int i=0; i<12;i++) { z1 = new TLine(nphi*i-0.5,ymin,nphi*i-0.5,ymax); z1->SetLineStyle(2); if(i!=0)z1->Draw(); for (int j=1; j<4; j++) { double zz = i*nphi + nphi*0.25*j -1. ; z1 = new TLine( zz , ymin ,zz , ymin+ (ymax-ymin) * 0.03); z1->Draw(); z1 = new TLine( zz , ymin+(ymax-ymin)*0.97, zz , ymax); z1->Draw(); sprintf(cid,"%d#circ",90*j); tt =new TLatex( zz+nphi*0.057, ymax * 0.05 ,cid ); tt->SetTextAngle(90); tt-> SetTextSize(0.08) ;tt->Draw(); } sprintf(cid,"%6.1f",zcenter[i]); t=new TText(nphi*(i+0.15), - ymax * 0.15 ,cid); t-> SetTextSize(0.13) ;t->Draw(); } t=new TText(4.5*nphi, - ymax * 0.3 ,"Module center in z [cm]"); t-> SetTextSize(0.15) ;t->Draw(); //--------------------------print out -------------------------- if(TYPE==1) sprintf(cid,"Barrel_HVchVolt_%02d-%02d-%d.png",DAY,MONTH,YEAR); if(TYPE==2) sprintf(cid,"Barrel_HVchCurr_%02d-%02d-%d.png",DAY,MONTH,YEAR); if(TYPE==3) sprintf(cid,"Barrel_Tm0and1_%02d-%02d-%d.png",DAY,MONTH,YEAR); cout<Print(cid); //------------------------------------------ }