117 |
var.INFOS = 0; |
var.INFOS = 0; |
118 |
var.VINFOS = 0; |
var.VINFOS = 0; |
119 |
var.PALETTE = 0; |
var.PALETTE = 0; |
120 |
|
var.PATTRIG = 1; |
121 |
if ( *ctrlword & (1<<0) ) { |
if ( *ctrlword & (1<<0) ) { |
122 |
var.PALETTE = 1; |
var.PALETTE = 1; |
123 |
}; |
}; |
145 |
if ( *ctrlword & (1<<8) ) { |
if ( *ctrlword & (1<<8) ) { |
146 |
var.TOF = 1; |
var.TOF = 1; |
147 |
}; |
}; |
148 |
|
if ( *ctrlword & (1<<9) ) { |
149 |
|
var.PATTRIG = 1; |
150 |
|
}; |
151 |
} |
} |
152 |
|
|
153 |
void FEVdetector::SetDDEC(TString de){ |
void FEVdetector::SetDDEC(TString de){ |
1264 |
// |
// |
1265 |
} |
} |
1266 |
|
|
1267 |
|
bool bit(int decimal, char pos) |
1268 |
|
{ |
1269 |
|
return( (decimal>>pos)%2 ); |
1270 |
|
} |
1271 |
|
// |
1272 |
|
// THE PATTERN TRIGGER |
1273 |
|
// |
1274 |
|
void FEVdetector::ShowTRG(){ |
1275 |
|
// |
1276 |
|
// |
1277 |
|
if ( !var.TRG ) return; |
1278 |
|
// |
1279 |
|
int S11[8]; |
1280 |
|
S11[0] = 0; |
1281 |
|
S11[1] = 0; |
1282 |
|
S11[2] = 0; |
1283 |
|
S11[3] = 0; |
1284 |
|
S11[4] = 0; |
1285 |
|
S11[5] = 0; |
1286 |
|
S11[6] = 0; |
1287 |
|
S11[7] = 0; |
1288 |
|
|
1289 |
|
int S12[6]; |
1290 |
|
S12[0] = 0; |
1291 |
|
S12[1] = 0; |
1292 |
|
S12[2] = 0; |
1293 |
|
S12[3] = 0; |
1294 |
|
S12[4] = 0; |
1295 |
|
S12[5] = 0; |
1296 |
|
|
1297 |
|
int S21[2]; |
1298 |
|
S21[0] = 0; |
1299 |
|
S21[1] = 0; |
1300 |
|
|
1301 |
|
int S22[2]; |
1302 |
|
S22[0] = 0; |
1303 |
|
S22[1] = 0; |
1304 |
|
|
1305 |
|
int S31[3]; |
1306 |
|
S31[0] = 0; |
1307 |
|
S31[1] = 0; |
1308 |
|
S31[2] = 0; |
1309 |
|
|
1310 |
|
int S32[3]; |
1311 |
|
S32[0] = 0; |
1312 |
|
S32[1] = 0; |
1313 |
|
S32[2] = 0; |
1314 |
|
|
1315 |
|
//S3 |
1316 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],0) ) S31[0]++; |
1317 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],1) ) S31[1]++; |
1318 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],2) ) S31[2]++; |
1319 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],3) ) S31[0]++; |
1320 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],4) ) S31[1]++; |
1321 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],5) ) S31[2]++; |
1322 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],6) ) S32[0]++; |
1323 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],7) ) S32[1]++; |
1324 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],8) ) S32[2]++; |
1325 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],9) ) S32[0]++; |
1326 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],10) ) S32[1]++; |
1327 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[2],11) ) S32[2]++; |
1328 |
|
//S2 |
1329 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],0) ) S21[0]++; |
1330 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],1) ) S21[1]++; |
1331 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],2) ) S21[0]++; |
1332 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],3) ) S21[1]++; |
1333 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],4) ) S22[0]++; |
1334 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],5) ) S22[1]++; |
1335 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],6) ) S22[0]++; |
1336 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[3],7) ) S22[1]++; |
1337 |
|
//S12 |
1338 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],0) ) S12[0]++; |
1339 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],1) ) S12[1]++; |
1340 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],2) ) S12[2]++; |
1341 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],3) ) S12[3]++; |
1342 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],4) ) S12[4]++; |
1343 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],5) ) S12[5]++; |
1344 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],6) ) S12[0]++; |
1345 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],7) ) S12[1]++; |
1346 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],8) ) S12[2]++; |
1347 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],9) ) S12[3]++; |
1348 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],10) ) S12[4]++; |
1349 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[4],11) ) S12[5]++; |
1350 |
|
//S11 |
1351 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],0) ) S11[0]++; |
1352 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],1) ) S11[1]++; |
1353 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],2) ) S11[2]++; |
1354 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],3) ) S11[3]++; |
1355 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],4) ) S11[4]++; |
1356 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],5) ) S11[5]++; |
1357 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],6) ) S11[6]++; |
1358 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],7) ) S11[7]++; |
1359 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],8) ) S11[0]++; |
1360 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],9) ) S11[1]++; |
1361 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],10) ) S11[2]++; |
1362 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],11) ) S11[3]++; |
1363 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],12) ) S11[4]++; |
1364 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],13) ) S11[5]++; |
1365 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],14) ) S11[6]++; |
1366 |
|
if ( bit(L2->GetTrigLevel2()->patterntrig[5],15) ) S11[7]++; |
1367 |
|
|
1368 |
|
|
1369 |
|
// |
1370 |
|
Int_t rj = 0; |
1371 |
|
Float_t xs2x = var.xxvc; |
1372 |
|
Float_t ys2x = var.yxvc + 0.36*var.sfy; |
1373 |
|
Float_t xs2y = var.xyvc; |
1374 |
|
Float_t ys2y = var.yyvc + 0.36*var.sfy; |
1375 |
|
Float_t ws2 = 0.005; |
1376 |
|
Float_t ws13 = 0.007; |
1377 |
|
Int_t noadc; |
1378 |
|
if ( var.bw ){ |
1379 |
|
noadc=12; |
1380 |
|
} else { |
1381 |
|
noadc=kRed; |
1382 |
|
}; |
1383 |
|
// |
1384 |
|
// S11 X-view |
1385 |
|
// |
1386 |
|
Float_t s11p = 0.051; |
1387 |
|
TPolyLine *ftrg11x[8]; |
1388 |
|
for ( Int_t j=0; j<8; j++){ |
1389 |
|
Float_t nxc1[5]={ (s11p*j), (s11p*j), s11p*(j+1), s11p*(j+1), (s11p*j)}; |
1390 |
|
Float_t nyc1[5]={ 0., ws13, ws13, 0., 0.}; |
1391 |
|
Float_t nxc[5]; |
1392 |
|
Float_t nyc[5]; |
1393 |
|
for (Int_t i = 0; i<5 ; i++) { |
1394 |
|
nxc[i]= xs2x + (-0.204+nxc1[i])*var.sfx; |
1395 |
|
nyc[i] = ys2x + (0.295+nyc1[i])*var.sfy; |
1396 |
|
}; |
1397 |
|
ftrg11x[j] = new TPolyLine(5,nxc,nyc); |
1398 |
|
ftrg11x[j]->SetLineColor(noadc); |
1399 |
|
ftrg11x[j]->SetLineWidth(S11[j]); |
1400 |
|
if ( S11[j] ) ftrg11x[j]->Draw(); |
1401 |
|
}; |
1402 |
|
// |
1403 |
|
// S12 Y-view |
1404 |
|
// |
1405 |
|
Float_t s12p = 0.055; |
1406 |
|
TPolyLine *ftrg12y[6]; |
1407 |
|
rj = 6; |
1408 |
|
for ( Int_t j=0; j<6; j++){ |
1409 |
|
rj--; |
1410 |
|
Float_t nxc1[5]={ (s12p*j), (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; |
1411 |
|
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
1412 |
|
Float_t nxc[5]; |
1413 |
|
Float_t nyc[5]; |
1414 |
|
for (Int_t i = 0; i<5 ; i++) { |
1415 |
|
nxc[i]= xs2y + (-0.165+nxc1[i])*var.sfx; |
1416 |
|
nyc[i] = ys2y + (0.295+nyc1[i])*var.sfy; |
1417 |
|
}; |
1418 |
|
ftrg12y[j] = new TPolyLine(5,nxc,nyc); |
1419 |
|
ftrg12y[j]->SetLineColor(noadc); |
1420 |
|
ftrg12y[j]->SetLineWidth(S12[rj]); |
1421 |
|
if ( S12[rj] ) ftrg12y[j]->Draw(); |
1422 |
|
}; |
1423 |
|
|
1424 |
|
|
1425 |
|
// |
1426 |
|
// S21 Y-view |
1427 |
|
// |
1428 |
|
Float_t s21p = 0.075; |
1429 |
|
TPolyLine *ftrg21y[2]; |
1430 |
|
rj=2; |
1431 |
|
for ( Int_t j=0; j<2; j++){ |
1432 |
|
rj--; |
1433 |
|
Float_t nxc1[5]={ s21p*(j-1), s21p*(j-1), s21p*j,s21p*j, s21p*(j-1)}; |
1434 |
|
Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; |
1435 |
|
Float_t nxc[5]; |
1436 |
|
Float_t nyc[5]; |
1437 |
|
for (Int_t i = 0; i<5 ; i++) { |
1438 |
|
nxc[i]= xs2y + nxc1[i]*var.sfx; |
1439 |
|
nyc[i] = ys2y + nyc1[i]*var.sfy; |
1440 |
|
// printf(" TRG i %i x %f y %f \n",i,nxc[i],nyc[i]); |
1441 |
|
}; |
1442 |
|
ftrg21y[j] = new TPolyLine(5,nxc,nyc); |
1443 |
|
ftrg21y[j]->SetLineColor(noadc); |
1444 |
|
ftrg21y[j]->SetLineWidth(S21[j]); |
1445 |
|
if ( S21[j]) ftrg21y[j]->Draw(); |
1446 |
|
}; |
1447 |
|
|
1448 |
|
// |
1449 |
|
// S22 X-view |
1450 |
|
// |
1451 |
|
Float_t s22p = 0.090; |
1452 |
|
TPolyLine *ftrg22x[2]; |
1453 |
|
for ( Int_t j=0; j<2; j++){ |
1454 |
|
Float_t nxc1[5]={ s22p*(j-1), s22p*(j-1), s22p*j, s22p*j, s22p*(j-1)}; |
1455 |
|
Float_t nyc1[5]={ -ws2, 0., 0., -ws2, -ws2}; |
1456 |
|
Float_t nxc[5]; |
1457 |
|
Float_t nyc[5]; |
1458 |
|
for (Int_t i = 0; i<5 ; i++) { |
1459 |
|
nxc[i]= xs2x + nxc1[i]*var.sfx; |
1460 |
|
nyc[i] = ys2x + nyc1[i]*var.sfy; |
1461 |
|
}; |
1462 |
|
ftrg22x[j] = new TPolyLine(5,nxc,nyc); |
1463 |
|
ftrg22x[j]->SetLineColor(noadc); |
1464 |
|
ftrg22x[j]->SetLineWidth(S22[j]); |
1465 |
|
if ( S22[j] ) ftrg22x[j]->Draw(); |
1466 |
|
}; |
1467 |
|
// |
1468 |
|
// S31 X-view |
1469 |
|
// |
1470 |
|
Float_t s31p = 0.060; |
1471 |
|
TPolyLine *ftrg31x[3]; |
1472 |
|
for ( Int_t j=0; j<3; j++){ |
1473 |
|
Float_t nxc1[5]={ (s31p*j), (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; |
1474 |
|
Float_t nyc1[5]={ 0., ws13, ws13, 0., 0.}; |
1475 |
|
Float_t nxc[5]; |
1476 |
|
Float_t nyc[5]; |
1477 |
|
for (Int_t i = 0; i<5 ; i++) { |
1478 |
|
nxc[i]= xs2x + (-0.090+nxc1[i])*var.sfx; |
1479 |
|
nyc[i] = ys2x + (-0.488+nyc1[i])*var.sfy; |
1480 |
|
}; |
1481 |
|
ftrg31x[j] = new TPolyLine(5,nxc,nyc); |
1482 |
|
ftrg31x[j]->SetLineColor(noadc); |
1483 |
|
ftrg31x[j]->SetLineWidth(S31[j]); |
1484 |
|
if ( S31[j] ) ftrg31x[j]->Draw(); |
1485 |
|
}; |
1486 |
|
|
1487 |
|
// |
1488 |
|
// S32 Y-view |
1489 |
|
// |
1490 |
|
Float_t s32p = 0.050; |
1491 |
|
TPolyLine *ftrg32y[3]; |
1492 |
|
rj = 3; |
1493 |
|
for ( Int_t j=0; j<3; j++){ |
1494 |
|
rj--; |
1495 |
|
Float_t nxc1[5]={ (s32p*j), (s32p*j), s32p*(j+1),s32p*(j+1), (s32p*j)}; |
1496 |
|
Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; |
1497 |
|
Float_t nxc[5]; |
1498 |
|
Float_t nyc[5]; |
1499 |
|
for (Int_t i = 0; i<5 ; i++) { |
1500 |
|
nxc[i]= xs2y + (-0.075+nxc1[i])*var.sfx; |
1501 |
|
nyc[i] = ys2y + (-0.488+nyc1[i])*var.sfy; |
1502 |
|
}; |
1503 |
|
ftrg32y[j] = new TPolyLine(5,nxc,nyc); |
1504 |
|
ftrg32y[j]->SetLineColor(noadc); |
1505 |
|
ftrg32y[j]->SetLineWidth(S32[rj]); |
1506 |
|
if ( S32[rj] ) ftrg32y[j]->Draw(); |
1507 |
|
} |
1508 |
|
} |
1509 |
|
|
1510 |
void FEVdetector::DisplayEvent(){ |
void FEVdetector::DisplayEvent(){ |
1511 |
TLatex *text=new TLatex(); |
TLatex *text=new TLatex(); |
1512 |
stringstream testo; |
stringstream testo; |
1522 |
thefigure->cd(); |
thefigure->cd(); |
1523 |
ShowTOF(); |
ShowTOF(); |
1524 |
// |
// |
1525 |
|
// show pattern trigger if the case |
1526 |
|
// |
1527 |
|
thefigure->cd(); |
1528 |
|
if ( var.PATTRIG ){ |
1529 |
|
ShowTRG(); |
1530 |
|
thefigure->Modified(); |
1531 |
|
thefigure->Update(); |
1532 |
|
} |
1533 |
|
// |
1534 |
// show anticounters |
// show anticounters |
1535 |
// |
// |
1536 |
thefigure->cd(); |
thefigure->cd(); |
3396 |
for (Int_t i = 0; i<5 ; i++) { |
for (Int_t i = 0; i<5 ; i++) { |
3397 |
nxc[i]= xs2y + nxc1[i]*var.sfx; |
nxc[i]= xs2y + nxc1[i]*var.sfx; |
3398 |
nyc[i] = ys2y + nyc1[i]*var.sfy; |
nyc[i] = ys2y + nyc1[i]*var.sfy; |
3399 |
|
// printf(" TOF i %i x %f y %f \n",i,nxc[i],nyc[i]); |
3400 |
}; |
}; |
3401 |
ftof21y[j] = new TPolyLine(5,nxc,nyc); |
ftof21y[j] = new TPolyLine(5,nxc,nyc); |
3402 |
ftof21y[j]->SetLineColor(1); |
ftof21y[j]->SetLineColor(1); |