--- quicklook/tracker/flight/macros/FTrkQLook_EXPERT.cxx 2006/06/01 18:44:26 1.3 +++ quicklook/tracker/flight/macros/FTrkQLook_EXPERT.cxx 2006/06/05 08:37:53 1.4 @@ -30,6 +30,7 @@ #include #include // +#define MAXSTORAGE 50000 void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ if ( to == 0 ){ @@ -152,14 +153,13 @@ // printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); } countrun+=(Int_t)nevent/30000; - printf("\ncountrun=%d\n",countrun); + // printf("\ncountrun=%d\n",countrun); // // other variables definitions stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; Int_t ALARM=0; Int_t WARNING[12]; - Float_t hi=0; // // information about the entries for the temperatures @@ -248,7 +248,7 @@ alarm1 << " DSPMask= "<< hex<<(Int_t)al->DSPMask<SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(59.,98.7,isfile.str().c_str()); + t1->DrawLatex(62.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** @@ -333,7 +332,7 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(63.4,98.7,isfile.str().c_str()); + t1->DrawLatex(65.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** @@ -354,7 +353,7 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(60.,98.7,isfile.str().c_str()); + t1->DrawLatex(65.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** @@ -375,7 +374,7 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(60.,98.7,isfile.str().c_str()); + t1->DrawLatex(65.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** @@ -396,7 +395,7 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(60.,98.7,isfile.str().c_str()); + t1->DrawLatex(65.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** @@ -416,7 +415,7 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(65.,98.7,isfile.str().c_str()); + t1->DrawLatex(70.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** @@ -437,7 +436,7 @@ t1->SetTextColor(1); t1->SetTextAlign(12); t1->SetTextSize(0.02); - t1->DrawLatex(75.,98.7,isfile.str().c_str()); + t1->DrawLatex(78.,98.7,isfile.str().c_str()); isfile.str(""); //************************************************************************************* @@ -495,25 +494,19 @@ /* -----------> HISTOGRAMS */ + tit<<"DSP "<GetXaxis()->SetTitle("max signal"); - landau1[n][ii]->GetXaxis()->CenterTitle(); - landau2[n][ii]=new TH1F(oss2.str().c_str(),oss1.str().c_str(),401,-0.5,1200.5); - landau2[n][ii]->GetXaxis()->SetTitle("max signal"); - landau2[n][ii]->GetXaxis()->CenterTitle(); - landau3[n][ii]=new TH1F(oss3.str().c_str(),oss1.str().c_str(),401,-0.5,1200.5); - landau3[n][ii]->GetXaxis()->SetTitle("max signal"); - landau3[n][ii]->GetXaxis()->CenterTitle(); - - illuminazione[n][ii]=new TH1F(oss4.str().c_str(),oss1.str().c_str(),3073,-0.5,3072.5); - illuminazione[n][ii]->GetXaxis()->SetTitle("strip with max signal"); - illuminazione[n][ii]->GetXaxis()->CenterTitle(); + landau1[n][ii]= new TH1F(oss1.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); + landau2[n][ii]= new TH1F(oss2.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); + landau3[n][ii]= new TH1F(oss3.str().c_str(),tit.str().c_str(),401,-0.5,1200.5); + illuminazione[n][ii]= new TH1F(oss4.str().c_str(),tit.str().c_str(),3073,-0.5,3072.5); + + tit.str(""); oss1.str(""); oss2.str(""); oss3.str(""); @@ -531,19 +524,19 @@ // // information about the tracker data Int_t warning_dspnumber=0; - Float_t x[30000]; - Float_t yc[30000][12]; - Float_t eventint[30000]; - + Float_t x[MAXSTORAGE]; + Float_t yc[MAXSTORAGE][12]; + Float_t eventint[MAXSTORAGE]; + for (Int_t ev=minev; evGetEntry(ev); ph = eh->GetPscuHeader(); if(ev==maxevent-1) maxev=maxevent-1; - if((ph->GetOrbitalTime()GetOrbitalTime()signcluster[i][j]!=0){ - hi=(j*1024)+te->addrcluster[i][j]; - if((hi>505 && hi<519) ||(hi>1017 && hi<1031) ||(hi>1529 && hi<1543) || (hi>2041 && hi<2055) ||(hi>2553 && hi<2567)) - continue; - else illuminazione[dsp][ii]->Fill(hi); - - if(!(dsp%2)){ - landau1[dsp][ii]->Fill(1024-(te->signcluster[i][j])); - landau2[dsp][ii]->Fill(1024-(te->signcluster[i][j])); - landau3[dsp][ii]->Fill(1024-(te->signcluster[i][j])); - } - else{ - landau1[dsp][ii]->Fill(te->signcluster[i][j]); - landau2[dsp][ii]->Fill(te->signcluster[i][j]); - landau3[dsp][ii]->Fill(te->signcluster[i][j]); + 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)) +// continue; +// else + illuminazione[dsp][ii]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); } } } + 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])); + } + 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]); + } 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){ @@ -613,14 +607,14 @@ //******************************************************************************************** // file ALARM //******************************************************************************************** - - alarm <GetCounter() ; - alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<GetCounter() ; + alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"< NO ALARM!!! <-------"< NO ALARM!!! <-------"<cd(); pad1[i]->SetFillColor(10); pad1[i]->SetFrameFillColor(10); pad1[i]->Draw(); pad1[i]->cd(); + landau1[i][ii]->SetLineColor(1); + 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]->SetLineColor(1); + landau2[i][ii]->SetFillColor(1); + 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(); - printf("prova4\n"); + // printf("prova4\n"); IlluminaCanv[ii]->cd(); pad2[i]->SetFillColor(10); pad2[i]->SetFrameFillColor(10); + pad2[i]->SetLogy(); pad2[i]->Draw(); pad2[i]->cd(); - pad2[i]->SetLogy(); // illuminazione[i][ii]->SetStats(KFALSE); + illuminazione[i][ii]->GetXaxis()->SetTitle("strip with max signal"); + illuminazione[i][ii]->GetXaxis()->CenterTitle(); + illuminazione[i][ii]->Draw(""); if(i==1){ - illuminazione[i][ii]->Draw("ah"); maxhist= illuminazione[i][ii]->GetMaximum(); b.DrawBox(2816.,0.,3060.,maxhist); - illuminazione[i][ii]->Draw("axis same"); - illuminazione[i][ii]->Draw("same ]["); } else if(i==6){ - illuminazione[i][ii]->Draw("ah"); maxhist= illuminazione[i][ii]->GetMaximum(); b.DrawBox(2560.,0.,2816.,maxhist); b.DrawBox(512.,0.,768.,maxhist); b.DrawBox(1024.,0.,1792.,maxhist); - illuminazione[i][ii]->Draw("axis same"); - illuminazione[i][ii]->Draw("same]["); } else if(i==11){ - illuminazione[i][ii]->Draw("ah"); maxhist= illuminazione[i][ii]->GetMaximum(); b.DrawBox(768.,0.,1024.,maxhist); - illuminazione[i][ii]->Draw("axis same"); - illuminazione[i][ii]->Draw("same]["); } - else illuminazione[i][ii]->Draw(""); + IlluminaCanv[ii]->Update(); - printf("prova5\n"); + // printf("prova5\n"); CompTimeCanv[ii]->cd(); @@ -739,15 +741,10 @@ comprtime[i][ii]->GetYaxis()->SetRangeUser(0,2); comprtime[i][ii]->Draw("ap"); oss1.str(""); - CompTimeCanv[ii]->Update(); - LandauCanv1[ii]->Update(); - LandauCanv2[ii]->Update(); - LandauCanv3[ii]->Update(); - IlluminaCanv[ii]->Update(); }; - printf("prova6\n"); + // printf("prova6\n"); EventNumCanv[ii]->cd(); pt0=new TPad("pt0"," ",0.704,0.004,0.996,0.98); pt1 = new TPaveText(0.004,0.004,0.986,0.996); @@ -785,7 +782,7 @@ eventnumb[ii]->Draw("ap"); EventNumCanv[ii]->Update(); - printf("prova7\n"); + // printf("prova7\n"); obt=0; for(Int_t i=0; i<5; i++){ @@ -828,23 +825,21 @@ TempCanv[ii]->Update(); } - printf("prova8\n"); + // printf("prova8\n"); minev=maxev; - printf("\ncountrun=%d\n",ii); + // printf("\ncountrun=%d\n",ii); if(maxev==maxevent-1) { countrun=ii+1; break; } warning.close(); - } //***************************************** //close all files //***************************************** alarm.close(); - datafile->Close(); printf("... end of packets. \n"); //************************************************************************* @@ -882,18 +877,6 @@ if(fl!=countrun-1) TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); else TempCanv[fl]->Print(out+out3.str().c_str(),"Portrait"); } - - if(!strcmp(outfile.Data(),"pdf")){ - stringstream com; - com<<"ps2pdf13 "< ps file converted in pdf format!\n"); - com.str(""); - com<<"rm -f "< ps file removed!\n\n"); - com.str(""); - } } else{ out1.str(""); @@ -918,11 +901,24 @@ out1<Print(out+out1.str().c_str()); } + } + + if(!strcmp(outfile.Data(),"pdf")){ + stringstream com; + com<<"ps2pdf13 "< ps file converted in pdf format!\n"); + com.str(""); + com<<"rm -f "< ps file removed!\n\n"); + com.str(""); } + command.str(""); command<<"rm -f "<Reset(); + + gROOT->Reset(); return; }