/** * FTrkQLook_EXPERT.cxx * * autor: D.Fedele * version v1r08 * Parameters: * file - the data file to analyze * fromevent - first event to analyze * toevent - last event to analyze * outdir - total path of output file * outfile - extension of output file (pdf,ps,gif,jpg) * * */ // #include // #include #include #include #include #include #include #include // #include #include #include #include #include #include #include #include #include #include #include // #define MAXSTORAGE 50000 void FTrkQLook_EXPERT(TString file,Int_t fromevent,Int_t toevent, TString outdir, TString outfile) { // // obtain information about the data file and select the output dir Int_t dwpos = file.Last('/'); Int_t dwpos1 = file.Last('.'); TString base,ffile ; ffile=file(dwpos+1,dwpos1-(dwpos+1)); if(dwpos>0) base=file(0,dwpos); TString out; if(outdir.Length()==0){ out = base; }else{ out = outdir; } if(out.Last('/')+1Get("TsbT"); tree->SetBranchAddress("TsbT",&event); tree->SetBranchAddress("Header",&eT); TTree *Btree = (TTree*)datafile->Get("TsbB"); Btree->SetBranchAddress("TsbB",&Bevent); Btree->SetBranchAddress("Header",&eB); TTree *altr = (TTree*)datafile->Get("TrkAlarm"); altr->SetBranchAddress("TrkAlarm",&al); altr->SetBranchAddress("Header",&aleh); TTree *tr = (TTree*)datafile->Get("Physics"); tr->SetBranchAddress("Tracker",&te); tr->SetBranchAddress("Header",&eh); TTree *otr = (TTree*)datafile->Get("RunHeader"); otr->SetBranchAddress("Header",&eH); otr->SetBranchAddress("RunHeader",&reh); Long64_t nevent = tr->GetEntries(); Long64_t neventH = otr->GetEntries(); Long64_t tnevent = tree->GetEntries(); Long64_t bnevent = Btree->GetEntries(); Long64_t alnevent = altr->GetEntries(); Int_t minevent=0; Int_t maxevent=0; printf("Number of total events: %lld\n",nevent); printf("Number of header events: %lld\n",neventH); printf("Number of TsbT events: %lld\n",tnevent); printf("Number of TsbB events: %lld\n",bnevent); printf("Number of TrkAlarm packet events: %lld\n",alnevent); if (nevent<=0){ datafile->Close(); return; } if ( fromevent > toevent && toevent>0 ){ printf("It must be fromevent < toevent \n"); return; } if ( fromevent > nevent || fromevent < 0 ) { printf("You can choose fromevent between 0 (all) and %lld \n",nevent); return; } if ( toevent > nevent || toevent < 0 ) { printf("You can choose toevent between 0 (all) and %lld \n",nevent); return; } if ( fromevent == 0 ) { minevent = 0; maxevent = nevent; } else { minevent = fromevent; if ( toevent > 0 ){ maxevent = toevent+1; } else if (toevent > nevent) { maxevent = nevent; } else { maxevent = toevent+1; } nevent=maxevent-minevent ; } // // information about the RunHeader ULong64_t HOBT[neventH]; Int_t trk_cal_us[neventH]; Int_t countnboot=1; for (Int_t vi=0; viGetEntry(ev); pH = eH->GetPscuHeader(); HOBT[ev]= pH->GetOrbitalTime(); trk_cal_us[ev]=reh->TRK_CALIB_USED; if((HOBT[ev]0) countnboot+=1; } countnboot+=2*(Int_t)nevent/MAXSTORAGE; // printf("\ncountnboot=%d\n",countnboot); // // other variables definitions stringstream oss1,oss2,oss3,oss4,fromfile,isfile,tit; Int_t ALARM=0; Int_t WARNING[12]; // // information about the entries for the temperatures Int_t tmpSize=0,siztmp=0,maxsize=0; for (Int_t ev=0; evGetEntry(ev); tmpSize = event->Records->GetEntries(); maxsize+=tmpSize; } const Int_t tsize=maxsize; Int_t tempt[tsize][5]; ULong64_t xt[tsize]; Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; // // information about the temperatures for (Int_t ev=0; evGetEntry(ev); tmpSize = event->Records->GetEntries(); for (Int_t j = 0; j < tmpSize; j++){ record = (pamela::TsbTRecord*)event->Records->At(j); xt[siztmp]=record->RECORD_OBT; if((xt[siztmp]0) cntpgtemp+=1; for (Int_t z = 0; z < 5; z++){ tempt[siztmp][z] = record->TEMPERATURES[z+1]; } siztmp++; } } // // information about the entries for the magnetic field if(bnevent>0) cntpgmag=1; maxsize=0; for (Int_t ev=0; evGetEntry(ev); tmpSize = Bevent->Records->GetEntries(); maxsize+=tmpSize; } const Int_t bsize=maxsize; Int_t magt[bsize][5]; ULong64_t xb[bsize]; siztmp=0; // // information about the magnetic field for (Int_t ev=0; evGetEntry(ev); tmpSize = Bevent->Records->GetEntries(); for (Int_t j = 0; j < tmpSize; j++){ Brecord = (pamela::TsbBRecord*)Bevent->Records->At(j); xb[siztmp]=Brecord->RECORD_OBT; if((xb[siztmp]0) cntpgmag+=1; for (Int_t z = 0; z < 5; z++){ magt[siztmp][z] = Brecord->B_FIELD[z+1]; } siztmp++; } } // // open the output text files for the alarms TString fname1 = out+ffile; TString fname = out+ffile; int slen=fname.Length(); int last=fname.Last('_'); if(last<(slen-1))fname.Append('_'); fname.Append("FTrk-DSP-report.txt"); ofstream alarm(fname,ios::out); alarm << "TRACKER DSP REPORT - Downlink " << ffile<< endl; fname1.Append("_FTrkAlarm-pkt-report.txt"); ofstream alarm1(fname1,ios::out); alarm1 << "TrkAlarm pkt REPORT - Downlink " << ffile<< endl; // // write the file for the TrkAlarm packet if(alnevent==0) alarm1 < NO ALARM!!! <-------"<< endl; else{ Long64_t obt=0; for (Int_t ev=0; evGetEntry(ev); ph = aleh->GetPscuHeader(); if(ph->GetOrbitalTime()0) alarm1<GetOrbitalTime(); alarm1 << "================================================="<< endl; alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; alarm1 << " - OBT "<< ph->GetOrbitalTime() << " ms"<ALARM[1]<ALARM[2]<CmdDuringTrig<FinalCheck<FlashData<FlashShutdown<FlashUpset<InterCheck<UnknownCmd<CmdIDMA<DSPSoft<TrigIDMA<DSPBusy<DSPMask<FlashOn<TrigMask<Aswr<BID[0]<BID[1]<BID[2]<BID[3]<BID[4]<BID[5]<BID[6]<CmdNum<PNum<< dec <SetLabelSize(0.05,"x"); gStyle->SetLabelSize(0.06,"y"); gStyle->SetStatFontSize(0.075); gStyle->SetOptStat(1110); gStyle->SetFillColor(10); gStyle->SetStatColor(10); gStyle->SetTitleFillColor(10); gStyle->SetTitleFontSize(0.1); gStyle->SetTitleOffset(0.8,"y"); gStyle->SetTitleOffset(0.9,"x"); gStyle->SetTitleSize(0.06,"y"); gStyle->SetTitleSize(0.055,"x"); // // Define output canvas, histos and graphs TCanvas *CompTimeCanv[countnboot],*EventNumCanv[countnboot],*TempCanv[cntpgtemp],*BfieldCanv[cntpgmag]; TCanvas *IlluminaCanv,*LandauCanv1,*LandauCanv2,*LandauCanv3; TH1F *landau1[12],*landau2[12],*landau3[12],*illuminazione[12]; TGraph *comprtime[12][countnboot],*temp[5][cntpgtemp],*tempw[5][cntpgtemp],*eventnumb[countnboot],*mag[5][cntpgmag]; TPad *pad1[12],*pad2[12],*pad3[12],*pad4[12],*pad5[12],*pad6[5],*pad7[5]; for(Int_t n = 0; n<12; n++) { /* -----------> HISTOGRAMS */ tit<<"DSP "<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(""); t1->SetTextSize(0.025); t1->SetTextColor(196); isfile<<"--> Values at 28.5^{o}C (if presents) correspond"; t1->DrawLatex(50.,22.,isfile.str().c_str()); isfile.str(""); isfile<<" to wrong readings ( > 100^{o}C) of the Tsb"; t1->DrawLatex(50.,19.,isfile.str().c_str()); isfile.str(""); isfile<<"--> Values at 25.5^{o}C (if presents) correspond"; t1->DrawLatex(50.,12.,isfile.str().c_str()); isfile.str(""); isfile<<" to wrong readings ( < 0^{o}C) of the Tsb"; t1->DrawLatex(50.,9.,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); Int_t v=0,vv=0; Double_t xt_tmp[tsize], tempt_tmp[tsize]; Double_t xt_tmpw[tsize], tempt_tmpw[tsize]; for (Int_t ev=countTEMP; evcountTEMP){ if(i==4) countTEMP=ev; break; } else{ tempt_tmp[v]=(Double_t)((Int_t)(((3.3*tempt[ev][i]/4096)-0.586)/0.0231)); if(tempt_tmp[v]>100) { tempt_tmp[v]=28.5; tempt_tmpw[vv]=28.5; xt_tmpw[vv++]=(Double_t)xt[ev]; } else if(tempt_tmp[v]<0){ tempt_tmp[v]=25.5; tempt_tmpw[vv]=25.5; xt_tmpw[vv++]=(Double_t)xt[ev]; } xt_tmp[v++]=(Double_t)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(""); if(vv>0){ tempw[i][ii]= new TGraph(vv,xt_tmpw,tempt_tmpw); tempw[i][ii]->SetMarkerStyle(21); tempw[i][ii]->SetMarkerSize(0.2); tempw[i][ii]->SetMarkerColor(196); tempw[i][ii]->Draw("samep"); } TempCanv[ii]->Update(); } if(countTEMP==tsize-1){ break; } } // // Fill magnetic field graphs for(Int_t ii=0; iiSetFillColor(10); BfieldCanv[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(""); TLine li; li.SetLineStyle(1); li.SetLineWidth(1); li.SetLineColor(190); t1->SetTextColor(190); t1->SetTextSize(0.04); 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 */ pad7[i] = new TPad("pad7"," ",tposx1,tposy-thpad,tposx0,tposy,18,0,0); Int_t v=0; Double_t xb_tmp[bsize], magt_tmp[bsize]; for (Int_t ev=countMAG; evcountMAG){ if(i==4) countMAG=ev; break; } else{ magt_tmp[v]=(Double_t)magt[ev][i]; xb_tmp[v++]=(Double_t)xb[ev]; } } BfieldCanv[ii]->cd(); tit<<"B"<SetFillColor(10); pad7[i]->Draw(); pad7[i]->cd(); mag[i][ii]= new TGraph(v,xb_tmp,magt_tmp); mag[i][ii]->SetTitle(tit.str().c_str()); mag[i][ii]->GetXaxis()->SetNdivisions(502,kTRUE); mag[i][ii]->GetXaxis()->SetLabelSize(0.04); mag[i][ii]->GetXaxis()->SetTitleSize(0.04); mag[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); mag[i][ii]->GetXaxis()->CenterTitle(); mag[i][ii]->GetXaxis()->SetTitleOffset(0.85); if(i!=4) mag[i][ii]->GetYaxis()->SetRangeUser(2047,2058); else mag[i][ii]->GetYaxis()->SetRangeUser(2061,2066); mag[i][ii]->GetYaxis()->SetTitleOffset(1.2); mag[i][ii]->GetYaxis()->SetLabelOffset(0.001); mag[i][ii]->GetYaxis()->SetLabelSize(0.03); mag[i][ii]->GetYaxis()->SetTitleSize(0.04); mag[i][ii]->GetYaxis()->SetTitle("Magnetic Field (au)"); mag[i][ii]->GetYaxis()->CenterTitle(); mag[i][ii]->SetMarkerStyle(21); mag[i][ii]->SetMarkerSize(0.4); mag[i][ii]->Draw("ap"); Double_t min=0.,max=0,xlat=0.; min=mag[i][ii]->GetXaxis()->GetXmin(); max=mag[i][ii]->GetXaxis()->GetXmax(); xlat=min+(max-min)/2; stringstream mi,ma; mi<<"minimum recorded value"; ma<<"maximum recorded value"; t->SetTextSize(0.1); switch(i){ case 0: li.DrawLine(min,2054.,max,2054.); li.DrawLine(min,2048.,max,2048.); t1->DrawLatex(xlat,2054.3,ma.str().c_str()); t1->DrawLatex(xlat,2047.7,mi.str().c_str()); break; case 1: li.DrawLine(min,2055.,max,2055.); li.DrawLine(min,2051.,max,2051.); t1->DrawLatex(xlat,2055.3,ma.str().c_str()); t1->DrawLatex(xlat,2050.7,mi.str().c_str()); break; case 2: li.DrawLine(min,2056.,max,2056.); li.DrawLine(min,2052.,max,2052.); t1->DrawLatex(xlat,2056.3,ma.str().c_str()); t1->DrawLatex(xlat,2051.7,mi.str().c_str()); break; case 3: li.DrawLine(min,2057.,max,2057.); li.DrawLine(min,2053.,max,2053.); t1->DrawLatex(xlat,2057.3,ma.str().c_str()); t1->DrawLatex(xlat,2052.7,mi.str().c_str()); break; case 4: li.DrawLine(min,2065.,max,2065.); li.DrawLine(min,2062.,max,2062.); t1->DrawLatex(xlat,2065.15,ma.str().c_str()); t1->DrawLatex(xlat,2061.85,mi.str().c_str()); break; } BfieldCanv[ii]->Update(); tit.str(""); } if(countMAG==bsize-1){ break; } } // // Fill compressiontime and eventnumber graphs and DSP warnings for(Int_t ii=0; iiSetFillColor(10); CompTimeCanv[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(62.,98.7,isfile.str().c_str()); isfile.str(""); //**************************************************************************************** //DSP EVENT NUMBER Output Pages //**************************************************************************************** isfile<<"DSP EVENT NUMBER vs. OBT pag"<SetFillColor(10); EventNumCanv[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(62.,98.7,isfile.str().c_str()); isfile.str(""); 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 hpad = (posy-marg*11)/6; wrel = (1-marg*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; posx0 = posx1 + wrel; } else { posx1 = posx0 + 2*marg; posx0 = posx1 + wrel; } /* -----------> 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); } // // Obtain information about the tracker data // and fill graphs and histos Int_t al=0; Double_t x[MAXSTORAGE]; Float_t yc[MAXSTORAGE][12]; Double_t eventint[MAXSTORAGE]; Int_t eventn[12]; for (Int_t ev=minev; evGetEntry(ev); ph = eh->GetPscuHeader(); cod = eh->GetCounter(); if(ev==maxevent-1) maxev=maxevent-1; if((ph->GetOrbitalTime()GetOrbitalTime(); ALARM=0; Int_t dsp=0; for(Int_t i=0; i<12; i++){ if(te->DSPnumber[i]<1 || te->DSPnumber[i]>12) { ALARM=1; break; } dsp=te->DSPnumber[i]-1; yc[(ev-minev)][dsp]= 0.051*te->compressiontime[i]; // // Fill Cluster Signal and Lighting of the view histos for(Int_t j=0;j<3;j++){ if(te->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)){ illuminazione[dsp]->Fill((Float_t)((j*1024.)+te->addrcluster[i][j])); } } } if(trk_cal_us[cod->Get(pctp->RunHeader)]!=104){ if(!(dsp%2)){ if(te->signcluster[i][0]!=0) landau1[dsp]->Fill((Float_t)(1024.-te->signcluster[i][0])); if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)(1024.-te->signcluster[i][1])); 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]->Fill((Float_t)te->signcluster[i][0]); if(te->signcluster[i][1]!=0) landau2[dsp]->Fill((Float_t)te->signcluster[i][1]); 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 WARNING[i] = 1; // DSP warning }; if(te->alarm[i]!=0){ // hardware alarm ALARM = 1; }; //************************************************************************************** // warning for internal number //************************************************************************************** if(i<=10 && te->eventn[i]!=te->eventn[i+1]) ALARM=1; if((ev-minev)>=1 && eventn[i]+1!=te->eventn[i] && te->eventn[i]!=1) ALARM=1; } eventint[(ev-minev)]=te->eventn[0]; //******************************************************************************************** // file DSP warning //******************************************************************************************** if(ALARM==1) { al=1; alarm <GetCounter() ; alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<DSPnumber[i]; alarm.width(8); alarm << te->eventn[i]; alarm.width(8); alarm << eventn[i]; alarm.width(6); alarm << te->DATAlength[i]; alarm.width(4); alarm << te->crc[i]; alarm.width(4); alarm << te->fc[i]; alarm.width(4); alarm << te->fl1[i]; alarm.width(4); alarm << te->fl2[i]; alarm.width(4); alarm << te->fl3[i]; alarm.width(4); alarm << te->fl4[i]; alarm.width(4); alarm << te->fl5[i]; alarm.width(4); alarm << te->fl6[i]; if(te->alarm[i]!=0)alarm<<" >> ALARM "; if(WARNING[i]!=0)alarm<<" (DSP warning) "; alarm << endl; } } for(Int_t i=0; i<12 ; i++) eventn[i]=te->eventn[i]; } } if(al==0) alarm << endl<< "Page "< NO ALARM!!! <-------"<cd(); pad3[i]->SetFillColor(10); pad3[i]->SetFrameFillColor(10); pad3[i]->Draw(); pad3[i]->cd(); comprtime[i][ii]= new TGraph(maxev-minev,x,yyc); oss1<<"DSP "<SetTitle(oss1.str().c_str()); comprtime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); comprtime[i][ii]->GetXaxis()->CenterTitle(); comprtime[i][ii]->GetYaxis()->SetTitle("compressiontime (ms)"); comprtime[i][ii]->GetYaxis()->CenterTitle(); // comprtime[i][ii]->GetYaxis()->SetRangeUser(0,3); comprtime[i][ii]->Draw("ap"); oss1.str(""); CompTimeCanv[ii]->Update(); } EventNumCanv[ii]->cd(); pt = new TPad("pt"," ",0.02,0.01,1.,0.98,18,0,0); pt->SetFillColor(10); pt->SetFrameFillColor(10); pt->Draw(); pt->cd(); eventnumb[ii]=new TGraph(maxev-minev,x,eventint); eventnumb[ii]->SetTitle(""); eventnumb[ii]->GetXaxis()->SetLabelSize(0.02); eventnumb[ii]->GetXaxis()->SetTitleSize(0.03); eventnumb[ii]->GetXaxis()->SetTitle("OBT (ms)"); eventnumb[ii]->GetXaxis()->CenterTitle(); eventnumb[ii]->GetXaxis()->SetTickLength(0.01); eventnumb[ii]->GetXaxis()->SetTitleOffset(1.1); eventnumb[ii]->GetYaxis()->SetLabelSize(0.02); eventnumb[ii]->GetYaxis()->SetTitleSize(0.03); eventnumb[ii]->GetYaxis()->SetTitle("DSP event-number"); eventnumb[ii]->GetYaxis()->CenterTitle(); eventnumb[ii]->GetYaxis()->SetTitleOffset(2.); eventnumb[ii]->SetMarkerStyle(21); eventnumb[ii]->SetMarkerColor(kBlue); eventnumb[ii]->SetMarkerSize(0.2); eventnumb[ii]->Draw("ap"); EventNumCanv[ii]->Update(); minev=maxev; if(maxev==maxevent-1) { cntpgdat=ii+1; break; } } alarm.close(); //**************************************************************************************** //Cluster Signal ladder1 Output Pages //**************************************************************************************** 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(""); //**************************************************************************************** //Cluster Signal ladder2 Output Pages //**************************************************************************************** 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(""); //**************************************************************************************** //Cluster Signal ladder3 Output Pages //**************************************************************************************** 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(""); //**************************************************************************************** //Lighting of the views Output Pages //**************************************************************************************** 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(""); // // Draw the histos for (Int_t i=0; i<12 ; i++){ TBox b; 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.SetFillColor(6); b.SetFillStyle(3945); b.DrawBox(2944.,0.,3060.,maxhist); b.SetFillColor(107); b.SetFillStyle(3954); b.DrawBox(2816.,0.,2944.,maxhist); b.DrawBox(2048.,0.,2176.,maxhist); } else if(i==6){ maxhist= illuminazione[i]->GetMaximum(); b.SetFillColor(6); b.SetFillStyle(3945); b.DrawBox(2560.,0.,2816.,maxhist); b.DrawBox(1024.,0.,1792.,maxhist); b.SetFillColor(107); b.SetFillStyle(3954); b.DrawBox(512.,0.,768.,maxhist); } else if(i==7){ maxhist= illuminazione[i]->GetMaximum(); b.SetFillColor(107); b.SetFillStyle(3954); b.DrawBox(512.,0.,768.,maxhist); } else if(i==11){ maxhist= illuminazione[i]->GetMaximum(); b.SetFillColor(6); b.SetFillStyle(3945); b.DrawBox(768.,0.,1024.,maxhist); b.SetFillColor(107); b.SetFillStyle(3954); b.DrawBox(0.,0.,512.,maxhist); b.DrawBox(1920.,0.,2048.,maxhist); } IlluminaCanv->Update(); } printf("... end of packets. \n"); //************************************************************************* // Save output Files //************************************************************************* stringstream out1,out2,out3,command; Int_t totpg=0; if(cntpgtemp>cntpgdat) 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"); TempCanv[fl]->Print(out+out2.str().c_str(),"Portrait"); BfieldCanv[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(totpg>1){ if(fl==0) CompTimeCanv[fl]->Print(out+out1.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(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()); 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(fl==totpg-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()); } } } // // Convert ps to pdf if required 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(""); } gROOT->Reset(); return; }