--- quicklook/tracker/flight/macros/FTrkQLook_EXPERT.cxx 2006/06/05 14:23:29 1.5 +++ quicklook/tracker/flight/macros/FTrkQLook_EXPERT.cxx 2006/06/08 10:33:53 1.6 @@ -29,6 +29,8 @@ #include #include #include +#include +#include // #define MAXSTORAGE 50000 @@ -73,6 +75,9 @@ pamela::PscuHeader *ph=0,*pH=0; pamela::TrkAlarmEvent *al=0; pamela::RunHeaderEvent *reh=0; + pamela::EventCounter *cod=0; + + pamela::PacketType *pctp=0; TFile *datafile = new TFile(file); @@ -148,12 +153,10 @@ pH = eH->GetPscuHeader(); HOBT[ev]= pH->GetOrbitalTime(); trk_cal_us[ev]=reh->TRK_CALIB_USED; - if((HOBT[ev]0) - countrun+=1; +// if((HOBT[ev]0) +// countrun+=1; // printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); } - countrun+=(Int_t)nevent/30000; - // printf("\ncountrun=%d\n",countrun); // // other variables definitions @@ -178,13 +181,18 @@ tmpSize = event->Records->GetEntries(); for (Int_t j = 0; j < tmpSize; j++){ record = (pamela::TsbTRecord*)event->Records->At(j); - xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; + xt[siztmp]=record->RECORD_OBT; //0.051*record->RECORD_OBT; + if((xt[siztmp]0) + countrun+=1; + for (Int_t z = 0; z < 5; z++){ tempt[siztmp][z] = record->TEMPERATURES[z+1]; } siztmp++; } } +// printf("\ncountrun=%d\n",countrun); + countrun+=(Int_t)nevent/30000; // // open the output text files for the alarms @@ -275,6 +283,40 @@ gStyle->SetTitleSize(0.06,"y"); gStyle->SetTitleSize(0.055,"x"); + //************************************************************************************* + //book pads and histos + //*************************************************************************************** + + TCanvas *CompTimeCanv[countrun],*EventNumCanv[countrun],*TempCanv[countrun]; + TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; + + TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; + TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5]; + + for(Int_t n = 0; n<12; n++) { + + /* -----------> HISTOGRAMS */ + + tit<<"DSP "<SetFillColor(10); - CompTimeCanv[ii]->Range(0,0,100,100); - TLatex *t=new TLatex(); - t->SetTextFont(32); - t->SetTextColor(1); - t->SetTextAlign(12); - t->SetTextSize(0.02); - t->DrawLatex(2.,98.7,fromfile.str().c_str()); - TLatex *t1=new TLatex(); - t1->SetTextFont(32); - t1->SetTextColor(1); - t1->SetTextAlign(12); - t1->SetTextSize(0.02); - t1->DrawLatex(62.,98.7,isfile.str().c_str()); - isfile.str(""); - - //**************************************************************************************** - //Output figures --- Second sheet: - //**************************************************************************************** + isfile<<"Temperatures vs OBT pag"<SetFillColor(10); + TempCanv[ii]->Range(0,0,100,100); - isfile<<"WARNINGS on DSP EVENT NUMBER pag"<SetFillColor(10); - EventNumCanv[ii]->Range(0,0,100,100); t->SetTextFont(32); t->SetTextColor(1); t->SetTextAlign(12); @@ -340,39 +354,95 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(65.,98.7,isfile.str().c_str()); + t1->DrawLatex(78.,98.7,isfile.str().c_str()); isfile.str(""); + + Float_t tposy = 0.95; // up y-coord - top pads + Float_t thpad = 0; // pad height + Float_t tposx1=0; // left x-coord - pad column + Float_t tposx0=0; // x-coord - column division + Float_t twrel = 0; // relative x size of first sub-column + Float_t tmarg = 0.004; // margin among pads + + thpad = (tposy-tmarg*5)/3; + twrel = (1-tmarg*4)/2; + + for(Int_t i=0; i<5; i++){ + if ( (i+1)%2==1 ) { + if(i>1) tposy = tposy-(tmarg*2+thpad); + tposx1 = tmarg; + tposx0 = tposx1 + twrel; + } + else { + tposx1 = tposx0 + 2*tmarg; + tposx0 = tposx1 + twrel; + } + + /* -----------> pad for histograms */ + pad6[i] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); - //**************************************************************************************** - //Output figures --- Third sheet: - //**************************************************************************************** + Int_t v=0,xt_tmp[tsize]; + for (Int_t ev=countTEMP; evcountTEMP){ + if(i==4) countTEMP=ev; + break; + } + else{ + if(tempt[ev][i]!=65535){ + tempt_tmp[v]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); + if(tempt_tmp[v]>0) xt_tmp[v++]=xt[ev]; + } + } + } + TempCanv[ii]->cd(); + tit<<"T"<SetFillColor(10); + pad6[i]->Draw(); + pad6[i]->cd(); + temp[i][ii]= new TGraph(v,xt_tmp,tempt_tmp); + temp[i][ii]->SetTitle(tit.str().c_str()); + temp[i][ii]->GetXaxis()->SetLabelSize(0.04); + temp[i][ii]->GetXaxis()->SetTitleSize(0.04); + temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); + temp[i][ii]->GetXaxis()->CenterTitle(); + temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); + temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); + temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); + temp[i][ii]->GetYaxis()->SetLabelSize(0.04); + temp[i][ii]->GetYaxis()->SetTitleSize(0.04); + temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); + temp[i][ii]->GetYaxis()->CenterTitle(); + temp[i][ii]->SetMarkerStyle(21); + temp[i][ii]->SetMarkerSize(0.2); + temp[i][ii]->Draw("ap"); + tit.str(""); + TempCanv[ii]->Update(); + + } + if(countTEMP==tsize-1){ + cntpgtemp=ii+1; + break; + } + } - isfile<<"Cluster Signal ladder1 pag"<SetFillColor(10); - LandauCanv1[ii]->Range(0,0,100,100); - t->SetTextFont(32); - t->SetTextColor(1); - t->SetTextAlign(12); - t->SetTextSize(0.02); - t->DrawLatex(2.,98.7,fromfile.str().c_str()); - t1->SetTextFont(32); - t1->SetTextColor(1); - t1->SetTextAlign(12); - t1->SetTextSize(0.02); - t1->DrawLatex(65.,98.7,isfile.str().c_str()); - isfile.str(""); + for(Int_t ii=0; iiSetFillColor(10); - LandauCanv2[ii]->Range(0,0,100,100); - + fromfile.str(""); + fromfile<<"FTrkQLook_EXPERT File: "<SetFillColor(10); + CompTimeCanv[ii]->Range(0,0,100,100); t->SetTextFont(32); t->SetTextColor(1); t->SetTextAlign(12); @@ -382,18 +452,17 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(65.,98.7,isfile.str().c_str()); + t1->DrawLatex(62.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** - //Output figures --- Third sheet: + //Output figures --- Second sheet: //**************************************************************************************** - isfile<<"Cluster Signal ladder3 pag"<SetFillColor(10); - LandauCanv3[ii]->Range(0,0,100,100); - + isfile<<"WARNINGS on DSP EVENT NUMBER pag"<SetFillColor(10); + EventNumCanv[ii]->Range(0,0,100,100); t->SetTextFont(32); t->SetTextColor(1); t->SetTextAlign(12); @@ -405,71 +474,19 @@ t1->SetTextSize(0.02); t1->DrawLatex(65.,98.7,isfile.str().c_str()); isfile.str(""); - - //**************************************************************************************** - //Output figures --- Fourth sheet: - //**************************************************************************************** - isfile<<"lighting of the views pag"<SetFillColor(10); - IlluminaCanv[ii]->Range(0,0,100,100); - t->SetTextFont(32); - t->SetTextColor(1); - t->SetTextAlign(12); - t->SetTextSize(0.02); - t->DrawLatex(2.,98.7,fromfile.str().c_str()); - t1->SetTextFont(32); - t1->SetTextColor(1); - t1->SetTextAlign(12); - t1->SetTextSize(0.02); - t1->DrawLatex(70.,98.7,isfile.str().c_str()); - isfile.str(""); - - //**************************************************************************************** - //Output figures --- Fifth sheet: - //**************************************************************************************** - - isfile<<"Temperatures vs OBT pag"<SetFillColor(10); - TempCanv[ii]->Range(0,0,100,100); - - t->SetTextFont(32); - t->SetTextColor(1); - t->SetTextAlign(12); - t->SetTextSize(0.02); - t->DrawLatex(2.,98.7,fromfile.str().c_str()); - t1->SetTextFont(32); - t1->SetTextColor(1); - t1->SetTextAlign(12); - t1->SetTextSize(0.02); - t1->DrawLatex(78.,98.7,isfile.str().c_str()); - isfile.str(""); - - //************************************************************************************* - //book pads and histos - //*************************************************************************************** Float_t posy = 0.95; // up y-coord - top pads Float_t hpad = 0; // pad height Float_t posx1=0; // left x-coord - pad column Float_t posx0=0; // x-coord - column division Float_t wrel = 0; // relative x size of first sub-column Float_t marg = 0.004; // margin among pads - Float_t tposy = 0.95; // up y-coord - top pads - Float_t thpad = 0; // pad height - Float_t tposx1=0; // left x-coord - pad column - Float_t tposx0=0; // x-coord - column division - Float_t twrel = 0; // relative x size of first sub-column - Float_t tmarg = 0.004; // margin among pads - + hpad = (posy-marg*11)/6; wrel = (1-marg*4)/2; - thpad = (tposy-tmarg*5)/3; - twrel = (1-tmarg*4)/2; - + for(Int_t n = 0; n<12; n++) { - + if ( (n+1)%2==1 ) { if(n>1) posy = posy-(marg*2+hpad); posx1 = marg; @@ -478,53 +495,15 @@ else { posx1 = posx0 + 2*marg; posx0 = posx1 + wrel; - } - - if ( (n+1)%2==1 ) { - if(n>1) tposy = tposy-(tmarg*2+thpad); - tposx1 = tmarg; - tposx0 = tposx1 + twrel; - } - else { - tposx1 = tposx0 + 2*tmarg; - tposx0 = tposx1 + twrel; - } - - + } + /* -----------> pad for histograms */ pad1[n] = new TPad("pad1"," ",posx1,posy-hpad,posx0,posy,18,0,0); pad2[n] = new TPad("pad2"," ",posx1,posy-hpad,posx0,posy,18,0,0); pad3[n] = new TPad("pad3"," ",posx1,posy-hpad,posx0,posy,18,0,0); pad4[n] = new TPad("pad4"," ",posx1,posy-hpad,posx0,posy,18,0,0); pad5[n] = new TPad("pad5"," ",posx1,posy-hpad,posx0,posy,18,0,0); - if(n<5) pad6[n] = new TPad("pad6"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); - - - /* -----------> HISTOGRAMS */ - - tit<<"DSP "<GetEntry(ev); ph = eh->GetPscuHeader(); - + cod = eh->GetCounter(); + if(ev==maxevent-1) maxev=maxevent-1; if((ph->GetOrbitalTime()signcluster[i][j]!=0){ if((te->addrcluster[i][j]>6 && te->addrcluster[i][j]<505) ||(te->addrcluster[i][j]>518 && te->addrcluster[i][j]<1018)){ - // if((dsp==1 && te->addrcluster[i][2]>767 && te->addrcluster[i][2]<1024) || (dsp==6 && te->addrcluster[i][0]>511 && te->addrcluster[i][0]<769) ||(dsp==6 && te->addrcluster[i][1]>0 && te->addrcluster[i][1]<769) ||(dsp==6 && te->addrcluster[i][2]>511 && te->addrcluster[i][2]<769) ||(dsp==11 && te->addrcluster[i][0]>767 && te->addrcluster[i][0]<1024)); -// else - illuminazione[dsp][ii]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); + illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); } } } - if(x[ev-minev]>HOBT[countHOBT+1]) - countHOBT+=1; - if(trk_cal_us[countHOBT]!=104){ + if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ if(!(dsp%2)){ - if(te->signcluster[i][0]!=0) landau1[dsp][ii]->Fill((Float_t)(1024.-te->signcluster[i][0])); - if(te->signcluster[i][1]!=0) landau2[dsp][ii]->Fill((Float_t)(1024.-te->signcluster[i][1])); - if(te->signcluster[i][2]!=0) landau3[dsp][ii]->Fill((Float_t)(1024.-te->signcluster[i][2])); + // if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018)) + if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); + // if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018)) + if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); + // if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018)) + if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)(1024.-te->signcluster[i][2])); } else{ - if(te->signcluster[i][0]!=0) landau1[dsp][ii]->Fill((Float_t)te->signcluster[i][0]); - if(te->signcluster[i][1]!=0) landau2[dsp][ii]->Fill((Float_t)te->signcluster[i][1]); - if(te->signcluster[i][2]!=0) landau3[dsp][ii]->Fill((Float_t)te->signcluster[i][2]); + // if((te->addrcluster[i][0]>6 && te->addrcluster[i][0]<505) ||(te->addrcluster[i][0]>518 && te->addrcluster[i][0]<1018)) + if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)te->signcluster[i][0]); + // if((te->addrcluster[i][1]>6 && te->addrcluster[i][1]<505) ||(te->addrcluster[i][1]>518 && te->addrcluster[i][1]<1018)) + if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); + // if((te->addrcluster[i][2]>6 && te->addrcluster[i][2]<505) ||(te->addrcluster[i][2]>518 && te->addrcluster[i][2]<1018)) + if(te->signcluster[i][2]!=0) landau3[dsp]->Fill((Float_t)te->signcluster[i][2]); } } - + WARNING[i]=0; if(te->fc[i]!=0 || te->fl1[i]!=0 || te->fl2[i]!=0 || te->fl3[i]!=0 || te->fl4[i]!=0 || te->fl5[i]!=0 || te->fl6[i]!=0){ ALARM = 1; //general alarm @@ -658,73 +640,11 @@ if(ALARM==0) alarm << endl<< "------> NO ALARM!!! <-------"<cd(); - pad1[i]->SetFillColor(10); - pad1[i]->SetFrameFillColor(10); - pad1[i]->Draw(); - pad1[i]->cd(); - landau1[i][ii]->GetXaxis()->SetTitle("max signal"); - landau1[i][ii]->GetXaxis()->CenterTitle(); - landau1[i][ii]->Draw(""); - LandauCanv1[ii]->Update(); - - LandauCanv2[ii]->cd(); - pad4[i]->SetFillColor(10); - pad4[i]->SetFrameFillColor(10); - pad4[i]->Draw(); - pad4[i]->cd(); - landau2[i][ii]->GetXaxis()->SetTitle("max signal"); - landau2[i][ii]->GetXaxis()->CenterTitle(); - landau2[i][ii]->Draw(""); - LandauCanv2[ii]->Update(); - - LandauCanv3[ii]->cd(); - pad5[i]->SetFillColor(10); - pad5[i]->SetFrameFillColor(10); - pad5[i]->Draw(); - pad5[i]->cd(); - landau3[i][ii]->GetXaxis()->SetTitle("max signal"); - landau3[i][ii]->GetXaxis()->CenterTitle(); - landau3[i][ii]->Draw(""); - LandauCanv3[ii]->Update(); - - IlluminaCanv[ii]->cd(); - pad2[i]->SetFillColor(10); - pad2[i]->SetFrameFillColor(10); - pad2[i]->SetLogy(); - pad2[i]->Draw(); - pad2[i]->cd(); - illuminazione[i][ii]->GetXaxis()->SetTitle("strip with max signal"); - illuminazione[i][ii]->GetXaxis()->CenterTitle(); - illuminazione[i][ii]->Draw(""); - if(i==1){ - maxhist= illuminazione[i][ii]->GetMaximum(); - b.DrawBox(2816.,0.,3060.,maxhist); - } - else if(i==6){ - maxhist= illuminazione[i][ii]->GetMaximum(); - b.DrawBox(2560.,0.,2816.,maxhist); - b.DrawBox(512.,0.,768.,maxhist); - b.DrawBox(1024.,0.,1792.,maxhist); - } - else if(i==11){ - maxhist= illuminazione[i][ii]->GetMaximum(); - b.DrawBox(768.,0.,1024.,maxhist); - } - IlluminaCanv[ii]->Update(); - CompTimeCanv[ii]->cd(); pad3[i]->SetFillColor(10); @@ -742,7 +662,7 @@ comprtime[i][ii]->Draw("ap"); oss1.str(""); CompTimeCanv[ii]->Update(); - }; + } EventNumCanv[ii]->cd(); pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); @@ -780,69 +700,176 @@ eventnumb[ii]->SetMarkerSize(0.3); eventnumb[ii]->Draw("ap"); EventNumCanv[ii]->Update(); - - obt=0; - for(Int_t i=0; i<5; i++){ - Int_t v=0; - for (Int_t ev=countTEMP; evGetEntry(ev); - ph=eT->GetPscuHeader(); - - if(ph->GetOrbitalTime()countTEMP){ - countTEMP=ev; - break; - } - else{ - obt=ph->GetOrbitalTime(); - tempt_tmp[v++]=(Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231); - } - } - TempCanv[ii]->cd(); - tit<<"T"<SetFillColor(10); - pad6[i]->Draw(); - pad6[i]->cd(); - temp[i][ii]= new TGraph(v,xt,tempt_tmp); - temp[i][ii]->SetTitle(tit.str().c_str()); - temp[i][ii]->GetXaxis()->SetLabelSize(0.04); - temp[i][ii]->GetXaxis()->SetTitleSize(0.04); - temp[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); - temp[i][ii]->GetXaxis()->CenterTitle(); - temp[i][ii]->GetXaxis()->SetTitleOffset(0.85); - temp[i][ii]->GetYaxis()->SetTitleOffset(1.2); - temp[i][ii]->GetYaxis()->SetLabelOffset(0.001); - temp[i][ii]->GetYaxis()->SetLabelSize(0.04); - temp[i][ii]->GetYaxis()->SetTitleSize(0.04); - temp[i][ii]->GetYaxis()->SetTitle("Temperatures ( ^{o}C)"); - temp[i][ii]->GetYaxis()->CenterTitle(); - temp[i][ii]->SetMarkerStyle(21); - temp[i][ii]->SetMarkerSize(0.2); - temp[i][ii]->Draw("ap"); - tit.str(""); - TempCanv[ii]->Update(); - } + + warning.close(); minev=maxev; if(maxev==maxevent-1) { - countrun=ii+1; + cntpgdat=ii+1; break; } - - warning.close(); } - //***************************************** - //close all files - //***************************************** alarm.close(); + //**************************************************************************************** + //Output figures --- Third sheet: + //**************************************************************************************** + + fromfile.str(""); + fromfile<<"FTrkQLook_EXPERT File: "<SetFillColor(10); + LandauCanv1->Range(0,0,100,100); + + t->SetTextFont(32); + t->SetTextColor(1); + t->SetTextAlign(12); + t->SetTextSize(0.02); + t->DrawLatex(2.,98.7,fromfile.str().c_str()); + t1->SetTextFont(32); + t1->SetTextColor(1); + t1->SetTextAlign(12); + t1->SetTextSize(0.02); + t1->DrawLatex(70.,98.7,isfile.str().c_str()); + isfile.str(""); + + //**************************************************************************************** + //Output figures --- Third sheet: + //**************************************************************************************** + + isfile<<"Cluster Signal ladder2"; + LandauCanv2=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); + LandauCanv2->SetFillColor(10); + LandauCanv2->Range(0,0,100,100); + + t->SetTextFont(32); + t->SetTextColor(1); + t->SetTextAlign(12); + t->SetTextSize(0.02); + t->DrawLatex(2.,98.7,fromfile.str().c_str()); + t1->SetTextFont(32); + t1->SetTextColor(1); + t1->SetTextAlign(12); + t1->SetTextSize(0.02); + t1->DrawLatex(70.,98.7,isfile.str().c_str()); + isfile.str(""); + + //**************************************************************************************** + //Output figures --- Third sheet: + //**************************************************************************************** + + isfile<<"Cluster Signal ladder3"; + LandauCanv3=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); + LandauCanv3->SetFillColor(10); + LandauCanv3->Range(0,0,100,100); + + t->SetTextFont(32); + t->SetTextColor(1); + t->SetTextAlign(12); + t->SetTextSize(0.02); + t->DrawLatex(2.,98.7,fromfile.str().c_str()); + t1->SetTextFont(32); + t1->SetTextColor(1); + t1->SetTextAlign(12); + t1->SetTextSize(0.02); + t1->DrawLatex(70.,98.7,isfile.str().c_str()); + isfile.str(""); + + //**************************************************************************************** + //Output figures --- Fourth sheet: + //**************************************************************************************** + + isfile<<"lighting of the views"; + IlluminaCanv=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); + IlluminaCanv->SetFillColor(10); + IlluminaCanv->Range(0,0,100,100); + t->SetTextFont(32); + t->SetTextColor(1); + t->SetTextAlign(12); + t->SetTextSize(0.02); + t->DrawLatex(2.,98.7,fromfile.str().c_str()); + t1->SetTextFont(32); + t1->SetTextColor(1); + t1->SetTextAlign(12); + t1->SetTextSize(0.02); + t1->DrawLatex(70.,98.7,isfile.str().c_str()); + isfile.str(""); + + for (Int_t i=0; i<12 ; i++){ + + TBox b; + b.SetFillColor(6); + b.SetFillStyle(3945); + + Float_t maxhist=0; + LandauCanv1->cd(); + pad1[i]->SetFillColor(10); + pad1[i]->SetFrameFillColor(10); + pad1[i]->Draw(); + pad1[i]->cd(); + landau1[i]->GetXaxis()->SetTitle("max signal"); + landau1[i]->GetXaxis()->CenterTitle(); + landau1[i]->Draw(""); + LandauCanv1->Update(); + + LandauCanv2->cd(); + pad4[i]->SetFillColor(10); + pad4[i]->SetFrameFillColor(10); + pad4[i]->Draw(); + pad4[i]->cd(); + landau2[i]->GetXaxis()->SetTitle("max signal"); + landau2[i]->GetXaxis()->CenterTitle(); + landau2[i]->Draw(""); + LandauCanv2->Update(); + + LandauCanv3->cd(); + pad5[i]->SetFillColor(10); + pad5[i]->SetFrameFillColor(10); + pad5[i]->Draw(); + pad5[i]->cd(); + landau3[i]->GetXaxis()->SetTitle("max signal"); + landau3[i]->GetXaxis()->CenterTitle(); + landau3[i]->Draw(""); + LandauCanv3->Update(); + + IlluminaCanv->cd(); + pad2[i]->SetFillColor(10); + pad2[i]->SetFrameFillColor(10); + pad2[i]->SetLogy(); + pad2[i]->Draw(); + pad2[i]->cd(); + illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); + illuminazione[i]->GetXaxis()->CenterTitle(); + illuminazione[i]->Draw(""); + if(i==1){ + maxhist= illuminazione[i]->GetMaximum(); + b.DrawBox(2816.,0.,3060.,maxhist); + } + else if(i==6){ + maxhist= illuminazione[i]->GetMaximum(); + b.DrawBox(2560.,0.,2816.,maxhist); + b.DrawBox(512.,0.,768.,maxhist); + b.DrawBox(1024.,0.,1792.,maxhist); + } + else if(i==11){ + maxhist= illuminazione[i]->GetMaximum(); + b.DrawBox(768.,0.,1024.,maxhist); + } + IlluminaCanv->Update(); + } + printf("... end of packets. \n"); //************************************************************************* // Save output Files //************************************************************************* stringstream out1,out2,out3,command; - - for(Int_t fl=0;flcntpgdat) totpg=cntpgtemp; + else if(cntpgtemp<=cntpgdat) totpg=cntpgdat; + + for(Int_t fl=0;flPrint(out+out1.str().c_str(),"Portrait"); EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); - LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); - LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); - LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); - IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); - TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); + TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); + LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); + LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); + LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); + IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); } - else if(countrun>=1){ + else if(totpg>1){ if(fl==0) CompTimeCanv[fl]->Print(out+out1.str().c_str(),"Portrait"); - else CompTimeCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); - EventNumCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); - LandauCanv1[fl]->Print(out+out2.str().c_str(),"Portrait"); - LandauCanv2[fl]->Print(out+out2.str().c_str(),"Portrait"); - LandauCanv3[fl]->Print(out+out2.str().c_str(),"Portrait"); - IlluminaCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); - if(fl!=countrun-1) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); - else TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); + if(fl>0 && flPrint(out+out2.str().c_str(),"Portrait"); + if(flPrint(out+out2.str().c_str(),"Portrait"); + if(flPrint(out+out2.str().c_str(),"Portrait"); + if(fl==totpg-1){ + LandauCanv1->Print(out+out2.str().c_str(),"Portrait"); + LandauCanv2->Print(out+out2.str().c_str(),"Portrait"); + LandauCanv3->Print(out+out2.str().c_str(),"Portrait"); + IlluminaCanv->Print(out+out3.str().c_str(),"Portrait"); + } } } else{ out1.str(""); out1<Print(out+out1.str().c_str()); + if(flPrint(out+out1.str().c_str()); out1.str(""); out1<Print(out+out1.str().c_str()); + if(flPrint(out+out1.str().c_str()); out1.str(""); out1<Print(out+out1.str().c_str()); - out1.str(""); - out1<Print(out+out1.str().c_str()); - out1.str(""); - out1<Print(out+out1.str().c_str()); - out1.str(""); - out1<Print(out+out1.str().c_str()); - out1.str(""); - out1<Print(out+out1.str().c_str()); + if(flPrint(out+out1.str().c_str()); + if(fl==countrun-1){ + out1.str(""); + out1<Print(out+out1.str().c_str()); + out1.str(""); + out1<Print(out+out1.str().c_str()); + out1.str(""); + out1<Print(out+out1.str().c_str()); + out1.str(""); + out1<Print(out+out1.str().c_str()); + } } }