| 1 |  |  | 
| 2 | /** | /** | 
| 3 | * FTrkQLook_EXPERT.cxx | * FTrkQLook_EXPERT.cxx | 
| 4 | * | * | 
| 5 | * autor: D.Fedele | * autor: D.Fedele | 
| 6 | * version v1r24 | * version v1r27 | 
| 7 | * Parameters: | * Parameters: | 
| 8 | *      file - the data file to analyze | *      file - the data file to analyze | 
| 9 | *      fromevent - first event to analyze | *      fromevent - first event to analyze | 
| 144 |  |  | 
| 145 | // | // | 
| 146 | // information about the RunHeader | // information about the RunHeader | 
| 147 | ULong64_t HOBT[neventH]; | ULong_t HOBT[neventH]; | 
| 148 | Int_t trk_cal_us[neventH]; | Int_t trk_cal_us[neventH]; | 
| 149 | ULong_t acq_info[neventH]; | ULong_t acq_info[neventH]; | 
| 150 | Int_t countnboot=1; | Int_t countnboot=1; | 
| 181 | } | } | 
| 182 | const Int_t tsize=maxsize; | const Int_t tsize=maxsize; | 
| 183 | Int_t tempt[tsize][5]; | Int_t tempt[tsize][5]; | 
| 184 | ULong64_t xt[tsize]; | ULong_t xt[tsize]; | 
| 185 |  |  | 
| 186 | Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; | Int_t cntpgtemp=1,cntpgdat=0,cntpgmag=0; | 
| 187 | // | // | 
| 213 | } | } | 
| 214 | const Int_t bsize=maxsize; | const Int_t bsize=maxsize; | 
| 215 | Int_t magt[bsize][5]; | Int_t magt[bsize][5]; | 
| 216 | ULong64_t xb[bsize]; | ULong_t xb[bsize]; | 
| 217 | siztmp=0; | siztmp=0; | 
| 218 | // | // | 
| 219 | // information about the magnetic field | // information about the magnetic field | 
| 250 | // write the file for the TrkAlarm packet | // write the file for the TrkAlarm packet | 
| 251 | if(alnevent==0) alarm1 <<endl<< "------>  NO ALARM!!! <-------"<< endl; | if(alnevent==0) alarm1 <<endl<< "------>  NO ALARM!!! <-------"<< endl; | 
| 252 | else{ | else{ | 
| 253 | Long64_t obt=0; | ULong_t obt=0; | 
| 254 | for (Int_t ev=0; ev<alnevent; ev++){ | for (Int_t ev=0; ev<alnevent; ev++){ | 
| 255 | altr->GetEntry(ev); | altr->GetEntry(ev); | 
| 256 | ph = aleh->GetPscuHeader(); | ph = aleh->GetPscuHeader(); | 
| 257 |  |  | 
| 258 | if(ph->GetOrbitalTime()<obt && ev>0) | if((ULong_t)ph->GetOrbitalTime()<obt && ev>0) | 
| 259 | alarm1<<endl<<"NEW CPU BOOT"<<endl; | alarm1<<endl<<"NEW CPU BOOT"<<endl; | 
| 260 | obt=ph->GetOrbitalTime(); | obt=ph->GetOrbitalTime(); | 
| 261 |  |  | 
| 262 | alarm1 << "================================================="<< endl; | alarm1 << "================================================="<< endl; | 
| 263 | alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; | alarm1 << "PSCU-Pkt N. "<< ph->GetCounter() ; | 
| 264 | alarm1 << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; | alarm1 << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; | 
| 265 | alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; | alarm1 << "(ROOT-tree entry "<<ev<<")"<<endl; | 
| 266 | alarm1 << "================================================="<< endl<<endl; | alarm1 << "================================================="<< endl<<endl; | 
| 267 |  |  | 
| 621 |  |  | 
| 622 | case 1: | case 1: | 
| 623 | li.DrawLine(min,2055.,max,2055.); | li.DrawLine(min,2055.,max,2055.); | 
| 624 | li.DrawLine(min,2050.,max,2050.); | li.DrawLine(min,2049.,max,2049.); | 
| 625 | t1->DrawLatex(xlat,2055.3,ma.str().c_str()); | t1->DrawLatex(xlat,2055.3,ma.str().c_str()); | 
| 626 | t1->DrawLatex(xlat,2049.7,mi.str().c_str()); | t1->DrawLatex(xlat,2048.7,mi.str().c_str()); | 
| 627 | break; | break; | 
| 628 |  |  | 
| 629 | case 2: | case 2: | 
| 630 | li.DrawLine(min,2056.,max,2056.); | li.DrawLine(min,2056.,max,2056.); | 
| 631 | li.DrawLine(min,2051.,max,2051.); | li.DrawLine(min,2050.,max,2050.); | 
| 632 | t1->DrawLatex(xlat,2056.3,ma.str().c_str()); | t1->DrawLatex(xlat,2056.3,ma.str().c_str()); | 
| 633 | t1->DrawLatex(xlat,2050.7,mi.str().c_str()); | t1->DrawLatex(xlat,2049.7,mi.str().c_str()); | 
| 634 | break; | break; | 
| 635 |  |  | 
| 636 | case 3: | case 3: | 
| 637 | li.DrawLine(min,2057.,max,2057.); | li.DrawLine(min,2057.,max,2057.); | 
| 638 | li.DrawLine(min,2052.,max,2052.); | li.DrawLine(min,2051.,max,2051.); | 
| 639 | t1->DrawLatex(xlat,2057.3,ma.str().c_str()); | t1->DrawLatex(xlat,2057.3,ma.str().c_str()); | 
| 640 | t1->DrawLatex(xlat,2051.7,mi.str().c_str()); | t1->DrawLatex(xlat,2050.7,mi.str().c_str()); | 
| 641 | break; | break; | 
| 642 |  |  | 
| 643 | case 4: | case 4: | 
| 644 | li.DrawLine(min,2066.,max,2066.); | li.DrawLine(min,2066.,max,2066.); | 
| 645 | li.DrawLine(min,2060.,max,2060.); | li.DrawLine(min,2060.,max,2060.); | 
| 646 | t1->DrawLatex(xlat,2066.15,ma.str().c_str()); | t1->DrawLatex(xlat,2066.2,ma.str().c_str()); | 
| 647 | t1->DrawLatex(xlat,2059.85,mi.str().c_str()); | t1->DrawLatex(xlat,2059.8,mi.str().c_str()); | 
| 648 | break; | break; | 
| 649 |  |  | 
| 650 | } | } | 
| 738 | // and fill graphs and histos | // and fill graphs and histos | 
| 739 |  |  | 
| 740 | Int_t al=0; | Int_t al=0; | 
| 741 |  | ULong_t obtx=0; | 
| 742 | Double_t x[MAXSTORAGE]; | Double_t x[MAXSTORAGE]; | 
| 743 | Float_t yc[MAXSTORAGE][12]; | Float_t yc[MAXSTORAGE][12]; | 
| 744 | Double_t eventint[MAXSTORAGE]; | Double_t eventint[MAXSTORAGE]; | 
| 752 |  |  | 
| 753 | if(ev==maxevent-1) maxev=maxevent-1; | if(ev==maxevent-1) maxev=maxevent-1; | 
| 754 |  |  | 
| 755 | if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ | if(((ULong_t)ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ | 
| 756 | maxev=ev; | maxev=ev; | 
| 757 | break; | break; | 
| 758 | } | } | 
| 759 | else{ | else{ | 
| 760 | x[(ev-minev)]= ph->GetOrbitalTime(); | obtx = ph->GetOrbitalTime(); | 
| 761 |  | x[(ev-minev)]=(Double_t)obtx; | 
| 762 | ALARM=0; | ALARM=0; | 
| 763 | Int_t dsp=0; | Int_t dsp=0; | 
| 764 | Int_t noacq=0; | Int_t noacq=0; | 
| 892 | al=1; | al=1; | 
| 893 | alarm <<endl<< "================================================="<< endl; | alarm <<endl<< "================================================="<< endl; | 
| 894 | alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; | alarm << "PSCU-Pkt N. "<< ph->GetCounter() ; | 
| 895 | alarm << " - OBT "<< ph->GetOrbitalTime() << " ms"<<endl; | alarm << " - OBT "<< (ULong_t)ph->GetOrbitalTime() << " ms"<<endl; | 
| 896 | alarm << "Total events "<<nevent<<endl; | alarm << "Total events "<<nevent<<endl; | 
| 897 | alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; | alarm << "(ROOT-tree entry "<<ev<<" in page "<<ii+1<<" )"<<endl; | 
| 898 | alarm << "================================================="<< endl; | alarm << "================================================="<< endl; | 
| 1111 | t1->DrawLatex(70.,98.7,isfile.str().c_str()); | t1->DrawLatex(70.,98.7,isfile.str().c_str()); | 
| 1112 | isfile.str(""); | isfile.str(""); | 
| 1113 |  |  | 
| 1114 |  | isfile<<"Boxes so colored point out chips broken before the launch and never resumed"; | 
| 1115 |  | t->SetTextColor(6); | 
| 1116 |  | t->SetTextSize(0.018); | 
| 1117 |  | //  t->DrawLatex(7.,97.2,isfile.str().c_str()); | 
| 1118 |  | isfile.str(""); | 
| 1119 |  |  | 
| 1120 |  | isfile<<"Boxes so colored point out anomalous chips (not necessarily broken)"; | 
| 1121 |  | t->SetTextColor(107); | 
| 1122 |  | //  t->DrawLatex(7.,95.7,isfile.str().c_str()); | 
| 1123 |  | isfile.str(""); | 
| 1124 |  | t->SetTextColor(1); | 
| 1125 |  |  | 
| 1126 | // | // | 
| 1127 | // Draw the histos | // Draw the histos | 
| 1128 | for (Int_t i=0; i<12 ; i++){ | for (Int_t nn=0; nn<12 ; nn++){ | 
| 1129 |  |  | 
| 1130 | TBox b; | TBox b; | 
| 1131 |  |  | 
| 1132 | Float_t maxhist=0,va1x=0; | Float_t maxhist=0.,va1x=0.,minhist=0.; | 
| 1133 | LandauCanv1->cd(); | LandauCanv1->cd(); | 
| 1134 | pad1[i]->SetFillColor(10); | pad1[nn]->SetFillColor(10); | 
| 1135 | pad1[i]->SetFrameFillColor(10); | pad1[nn]->SetFrameFillColor(10); | 
| 1136 | pad1[i]->Draw(); | pad1[nn]->Draw(); | 
| 1137 | pad1[i]->cd(); | pad1[nn]->cd(); | 
| 1138 | landau1[i]->GetXaxis()->SetTitle("max signal"); | landau1[nn]->GetXaxis()->SetTitle("max signal"); | 
| 1139 | landau1[i]->GetXaxis()->CenterTitle(); | landau1[nn]->GetXaxis()->CenterTitle(); | 
| 1140 | landau1[i]->Draw(""); | landau1[nn]->Draw(""); | 
| 1141 | LandauCanv1->Update(); | LandauCanv1->Update(); | 
| 1142 |  |  | 
| 1143 | LandauCanv2->cd(); | LandauCanv2->cd(); | 
| 1144 | pad4[i]->SetFillColor(10); | pad4[nn]->SetFillColor(10); | 
| 1145 | pad4[i]->SetFrameFillColor(10); | pad4[nn]->SetFrameFillColor(10); | 
| 1146 | pad4[i]->Draw(); | pad4[nn]->Draw(); | 
| 1147 | pad4[i]->cd(); | pad4[nn]->cd(); | 
| 1148 | landau2[i]->GetXaxis()->SetTitle("max signal"); | landau2[nn]->GetXaxis()->SetTitle("max signal"); | 
| 1149 | landau2[i]->GetXaxis()->CenterTitle(); | landau2[nn]->GetXaxis()->CenterTitle(); | 
| 1150 | landau2[i]->Draw(""); | landau2[nn]->Draw(""); | 
| 1151 | LandauCanv2->Update(); | LandauCanv2->Update(); | 
| 1152 |  |  | 
| 1153 | LandauCanv3->cd(); | LandauCanv3->cd(); | 
| 1154 | pad5[i]->SetFillColor(10); | pad5[nn]->SetFillColor(10); | 
| 1155 | pad5[i]->SetFrameFillColor(10); | pad5[nn]->SetFrameFillColor(10); | 
| 1156 | pad5[i]->Draw(); | pad5[nn]->Draw(); | 
| 1157 | pad5[i]->cd(); | pad5[nn]->cd(); | 
| 1158 | landau3[i]->GetXaxis()->SetTitle("max signal"); | landau3[nn]->GetXaxis()->SetTitle("max signal"); | 
| 1159 | landau3[i]->GetXaxis()->CenterTitle(); | landau3[nn]->GetXaxis()->CenterTitle(); | 
| 1160 | landau3[i]->Draw(""); | landau3[nn]->Draw(""); | 
| 1161 | LandauCanv3->Update(); | LandauCanv3->Update(); | 
| 1162 |  |  | 
| 1163 |  |  | 
| 1169 | liva1.SetLineWidth(1); | liva1.SetLineWidth(1); | 
| 1170 |  |  | 
| 1171 | IlluminaCanv->cd(); | IlluminaCanv->cd(); | 
| 1172 | pad2[i]->SetFillColor(10); | pad2[nn]->SetFillColor(10); | 
| 1173 | pad2[i]->SetFrameFillColor(10); | pad2[nn]->SetFrameFillColor(10); | 
| 1174 | pad2[i]->SetLogy(); | pad2[nn]->SetLogy(); | 
| 1175 | pad2[i]->Draw(); | pad2[nn]->Draw(); | 
| 1176 | pad2[i]->cd(); | pad2[nn]->cd(); | 
| 1177 | illuminazione[i]->GetXaxis()->SetTitle("strip with max signal"); | illuminazione[nn]->GetXaxis()->SetTitle("strip with max signal"); | 
| 1178 | illuminazione[i]->GetXaxis()->CenterTitle(); | illuminazione[nn]->GetXaxis()->CenterTitle(); | 
| 1179 | illuminazione[i]->Draw(""); | illuminazione[nn]->Draw(""); | 
| 1180 | maxhist= illuminazione[i]->GetMaximum(); | maxhist= illuminazione[nn]->GetMaximum(); | 
| 1181 | if(i==0){ | minhist=0.; | 
| 1182 | b.SetFillColor(107); | b.SetFillColor(19); | 
| 1183 | b.SetFillStyle(3954); | b.SetFillStyle(3954); | 
| 1184 | b.DrawBox(256.,0.,384.,maxhist); | if(nn==0){ | 
| 1185 | b.DrawBox(768.,0.,2047.,maxhist); | b.DrawBox(0.,minhist,2047.,maxhist); | 
| 1186 | } | } | 
| 1187 | else if(i==1){ | else if(nn==1){ | 
| 1188 | b.SetFillColor(6); | b.DrawBox(128.,minhist,256.,maxhist); | 
| 1189 | b.SetFillStyle(3945); | b.DrawBox(384.,minhist,512.,maxhist); | 
| 1190 | b.DrawBox(2944.,0.,3070.,maxhist); | b.DrawBox(896.,minhist,1024.,maxhist); | 
| 1191 |  | b.DrawBox(2048.,minhist,2432.,maxhist); | 
| 1192 | b.SetFillColor(107); | b.DrawBox(2816.,minhist,2944.,maxhist); | 
| 1193 | b.SetFillStyle(3954); | b.DrawBox(2944.,minhist,3070.,maxhist); | 
| 1194 | b.DrawBox(384.,0.,512.,maxhist); | } | 
| 1195 | b.DrawBox(2048.,0.,2432.,maxhist); | else if(nn==3){ | 
| 1196 | b.DrawBox(2816.,0.,2944.,maxhist); | b.DrawBox(0.,minhist,256.,maxhist); | 
| 1197 | } | b.DrawBox(2816.,minhist,3070.,maxhist); | 
| 1198 | else if(i==3){ | } | 
| 1199 | b.SetFillColor(107); | else if(nn==4){ | 
| 1200 | b.SetFillStyle(3954); | b.DrawBox(256.,minhist,512.,maxhist); | 
| 1201 | b.DrawBox(2816.,0.,3070.,maxhist); | b.DrawBox(1792.,minhist,1920.,maxhist); | 
| 1202 | } | b.DrawBox(2816.,minhist,3070.,maxhist); | 
| 1203 | else if(i==4){ | } | 
| 1204 | b.SetFillColor(107); | else if(nn==5){ | 
| 1205 | b.SetFillStyle(3954); | b.DrawBox(0.,minhist,256.,maxhist); | 
| 1206 | b.DrawBox(256.,0.,512.,maxhist); | b.DrawBox(896.,minhist,1024.,maxhist); | 
| 1207 | b.DrawBox(2816.,0.,3070.,maxhist); | b.DrawBox(1664.,minhist,1792.,maxhist); | 
| 1208 | } | } | 
| 1209 | else if(i==5){ | else if(nn==6){ | 
| 1210 | b.SetFillColor(107); | b.DrawBox(512.,minhist,768.,maxhist); | 
| 1211 | b.SetFillStyle(3954); | b.DrawBox(1024.,minhist,1280.,maxhist); | 
| 1212 | b.DrawBox(896.,0.,1024.,maxhist); | b.DrawBox(1280.,minhist,1792.,maxhist); | 
| 1213 | } | b.DrawBox(2560.,minhist,2816.,maxhist); | 
|  | else if(i==6){ |  | 
|  | b.SetFillColor(6); |  | 
|  | b.SetFillStyle(3945); |  | 
|  | b.DrawBox(1024.,0.,1280.,maxhist); |  | 
|  |  |  | 
|  | b.SetFillColor(107); |  | 
|  | b.SetFillStyle(3954); |  | 
|  | b.DrawBox(512.,0.,768.,maxhist); |  | 
|  | b.DrawBox(1280.,0.,1792.,maxhist); |  | 
|  | b.DrawBox(2560.,0.,2816.,maxhist); |  | 
| 1214 | } | } | 
| 1215 | else if(i==7){ | else if(nn==7){ | 
| 1216 | b.SetFillColor(107); | b.DrawBox(0.,minhist,1535.,maxhist); | 
| 1217 | b.SetFillStyle(3954); | b.DrawBox(2024.,minhist,2280.,maxhist); | 
| 1218 | b.DrawBox(512.,0.,768.,maxhist); | } | 
| 1219 | b.DrawBox(896.,0.,1535.,maxhist); | else if(nn==8){ | 
| 1220 | } | b.DrawBox(512.,minhist,768.,maxhist); | 
| 1221 | else if(i==8){ | } | 
| 1222 | b.SetFillColor(107); | else if(nn==9){ | 
| 1223 | b.SetFillStyle(3954); | b.DrawBox(0.,minhist,128.,maxhist); | 
| 1224 | b.DrawBox(512.,0.,768.,maxhist); | b.DrawBox(256.,minhist,384.,maxhist); | 
| 1225 | } | b.DrawBox(512.,minhist,640.,maxhist); | 
| 1226 | else if(i==9){ | b.DrawBox(896.,minhist,1152.,maxhist); | 
| 1227 | b.SetFillColor(107); | b.DrawBox(1280.,minhist,1535.,maxhist); | 
| 1228 | b.SetFillStyle(3954); | b.DrawBox(1664.,minhist,1920.,maxhist); | 
| 1229 | b.DrawBox(256.,0.,384.,maxhist); | b.DrawBox(2048.,minhist,2304.,maxhist); | 
| 1230 | b.DrawBox(1280.,0.,1535.,maxhist); | } | 
| 1231 | b.DrawBox(1792.,0.,1920.,maxhist); | else if(nn==10){ | 
| 1232 | } | b.DrawBox(0.,minhist,512.,maxhist); | 
| 1233 | else if(i==10){ | b.DrawBox(1024.,minhist,3070.,maxhist); | 
| 1234 | b.SetFillColor(107); | } | 
| 1235 | b.SetFillStyle(3954); | else if(nn==11){ | 
| 1236 | b.DrawBox(1024.,0.,1152.,maxhist); | b.DrawBox(0.,minhist,512.,maxhist); | 
| 1237 | b.DrawBox(2048.,0.,3070.,maxhist); | b.DrawBox(768.,minhist,1024.,maxhist); | 
| 1238 | } | b.DrawBox(1536.,minhist,1664.,maxhist); | 
| 1239 | else if(i==11){ | b.DrawBox(1920.,minhist,2560.,maxhist); | 
| 1240 | b.SetFillColor(6); | b.DrawBox(2816.,minhist,3070.,maxhist); | 
| 1241 | 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.,2560.,maxhist); |  | 
|  | } |  | 
| 1242 | for(int va=1; va<24; va++){ | for(int va=1; va<24; va++){ | 
| 1243 | va1x=128*va; | va1x=128*va; | 
| 1244 | liva1.DrawLine(va1x,0.,va1x,maxhist); | liva1.DrawLine(va1x,minhist,va1x,maxhist); | 
| 1245 | } | } | 
| 1246 | li.DrawLine(1024.5,0,1024.5,maxhist); | li.DrawLine(1024.5,minhist,1024.5,maxhist); | 
| 1247 | li.DrawLine(2048.5,0,2048.5,maxhist); | li.DrawLine(2048.5,minhist,2048.5,maxhist); | 
| 1248 | IlluminaCanv->Update(); | IlluminaCanv->Update(); | 
| 1249 | } | } | 
| 1250 |  |  |