Changeset 399 in svn
- Timestamp:
- May 19, 2009, 11:19:15 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SmearUtil.cc
r392 r399 37 37 #include "SmearUtil.h" 38 38 #include "TRandom.h" 39 #include "TStopwatch.h" 39 40 40 41 #include <iostream> … … 192 193 193 194 //for very forward detectors 194 RP_offsetEl_s = 120; 195 RP_offsetEl_s = 120; // distance of beam separation point, from IP 195 196 RP_offsetEl_x = 0.097; 196 RP_cross_x = -500; 197 RP_cross_y = 0.0; 198 RP_cross_ang = 142.5; 197 RP_cross_x = -500; // IP offset in horizontal plane, in micrometers 198 RP_cross_y = 0.0; // IP offset in vertical plane, in micrometers 199 RP_cross_ang_x = 142.5; // half-crossing angle in horizontal plane, in microrad 200 RP_cross_ang_y = 0.0; // half-crossing angle in vertical plane, in microrad 201 199 202 200 203 PdgTableFilename = "data/particle.tbl"; … … 311 314 RP_cross_x = DET.RP_cross_x; 312 315 RP_cross_y = DET.RP_cross_y; 313 RP_cross_ang = DET.RP_cross_ang; 316 RP_cross_ang_x = DET.RP_cross_ang_x; 317 RP_cross_ang_y = DET.RP_cross_ang_y; 314 318 RP_IP_name = DET.RP_IP_name; 315 319 … … 449 453 RP_cross_x = DET.RP_cross_x; 450 454 RP_cross_y = DET.RP_cross_y; 451 RP_cross_ang = DET.RP_cross_ang; 455 RP_cross_ang_x = DET.RP_cross_ang_x; 456 RP_cross_ang_y = DET.RP_cross_ang_y; 452 457 RP_IP_name = DET.RP_IP_name; 453 458 … … 521 526 else if(strstr(temp_string.c_str(),"RP_beam2Card")) {curstring >> varname >> svalue;RP_beam2Card = svalue;} 522 527 else if(strstr(temp_string.c_str(),"RP_IP_name")) {curstring >> varname >> svalue;RP_IP_name = svalue;} 528 529 else if(strstr(temp_string.c_str(),"RP_offsetEl_s")) {curstring >> varname >> value; RP_offsetEl_s = value;} 530 else if(strstr(temp_string.c_str(),"RP_offsetEl_x")) {curstring >> varname >> value; RP_offsetEl_x = value;} 531 else if(strstr(temp_string.c_str(),"RP_cross_x")) {curstring >> varname >> value; RP_cross_x = value;} 532 else if(strstr(temp_string.c_str(),"RP_cross_y")) {curstring >> varname >> value; RP_cross_y = value;} 533 else if(strstr(temp_string.c_str(),"RP_cross_ang_x")) {curstring >> varname >> value; RP_cross_ang_x = value;} 534 else if(strstr(temp_string.c_str(),"RP_cross_ang_y")) {curstring >> varname >> value; RP_cross_ang_y = value;} 523 535 524 536 else if(strstr(temp_string.c_str(),"ELG_Scen")) {curstring >> varname >> value; ELG_Scen = value;} … … 713 725 << left << setw(25) <<RP_beam2Card <<""<< right << setw(10)<<"*"<<"\n"; 714 726 f_out << left << setw(44) <<"* Beam separation, in meters: "<<"" 715 << left << setw(6) << RP_offsetEl_x <<""<< right << setw( 20)<<"! not in datacard*"<<"\n";727 << left << setw(6) << RP_offsetEl_x <<""<< right << setw(10)<<"*"<<"\n"; 716 728 f_out << left << setw(44) <<"* Distance from IP for Beam separation (m):"<<"" 717 << left << setw(6) <<RP_offsetEl_s <<""<< right << setw( 20)<<"! not in datacard*"<<"\n";729 << left << setw(6) <<RP_offsetEl_s <<""<< right << setw(10)<<"*"<<"\n"; 718 730 f_out << left << setw(44) <<"* X offset of beam crossing in micrometers:"<<"" 719 << left << setw(6) <<RP_cross_x <<""<< right << setw( 20)<<"! not in datacard*"<<"\n";731 << left << setw(6) <<RP_cross_x <<""<< right << setw(10)<<"*"<<"\n"; 720 732 f_out << left << setw(44) <<"* Y offset of beam crossing in micrometers:"<<"" 721 << left << setw(6) <<RP_cross_y <<""<< right << setw(20)<<"! not in datacard *"<<"\n"; 722 f_out << left << setw(44) <<"* Angle of beam crossing:"<<"" 723 << left << setw(6) <<RP_cross_ang <<""<< right << setw(20)<<"! not in datacard *"<<"\n"; 733 << left << setw(6) <<RP_cross_y <<""<< right << setw(10)<<"*"<<"\n"; 734 f_out << left << setw(44) <<"* X Angle of beam crossing:"<<"" 735 << left << setw(6) <<RP_cross_ang_x <<""<< right << setw(10)<<"*"<<"\n"; 736 f_out << left << setw(44) <<"* Y Angle of beam crossing:"<<"" 737 << left << setw(6) <<RP_cross_ang_y <<""<< right << setw(10)<<"*"<<"\n"; 724 738 f_out<<"* *"<<"\n"; 725 739 } … … 908 922 << left << setw(20) <<ISOL_Calo_ET <<""<< right << setw(10)<<"*"<<"\n"; 909 923 f_out << left << setw(40) <<"* Grid size (NxN) for calorimetric isolation: "<<"" 910 << left << setw(20) <<ISOL_Calo_Grid <<""<< right << setw( 10)<<"*"<<"\n";924 << left << setw(20) <<ISOL_Calo_Grid <<""<< right << setw(4)<<"*"<<"\n"; 911 925 } 912 926 … … 1029 1043 f_out<<"#....................................................................*"<<"\n"; 1030 1044 f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n"; 1031 1045 1046 f_out.close(); 1032 1047 } 1033 1048 … … 1397 1412 1398 1413 } // ReadParticleDataGroupTable 1414 1415 1416 // to be improved in order to avoid code repetition 1417 // sorry, no time to do it right now (XR, 19/05/2009) 1418 void time_report(const TStopwatch& global,const TStopwatch& loop,const TStopwatch& trigger,const TStopwatch& frog,const TStopwatch& lhco, const int flag_frog, const int flag_trigger, const int flag_lhco, const string& LogName, const Long64_t allEntries) { 1419 1420 TStopwatch globalwatch(global), loopwatch(loop), triggerwatch(trigger), frogwatch(frog), lhcowatch(lhco); 1421 1422 cout <<"** **"<< endl; 1423 cout <<"** ################## Time report ################# **"<< endl; 1424 cout << left << setw(32) <<"** Time report for "<<"" 1425 << left << setw(15) << allEntries <<"" 1426 << right << setw(22) <<"events **"<<endl; 1427 cout <<"** **"<< endl; 1428 cout << left << setw(10) <<"**"<<"" 1429 << left << setw(15) <<"Time (s):"<<"" 1430 << right << setw(15) <<"CPU"<<"" 1431 << right << setw(15) <<"Real"<<"" 1432 << right << setw(14) <<"**"<<endl; 1433 cout << left << setw(10) <<"**"<<"" 1434 << left << setw(15) <<" + Global:"<<"" 1435 << right << setw(15) <<globalwatch.CpuTime()<<"" 1436 << right << setw(15) <<globalwatch.RealTime()<<"" 1437 << right << setw(14) <<"**"<<endl; 1438 cout << left << setw(10) <<"**"<<"" 1439 << left << setw(15) <<" + Events:"<<"" 1440 << right << setw(15) <<loopwatch.CpuTime()<<"" 1441 << right << setw(15) <<loopwatch.RealTime()<<"" 1442 << right << setw(14) <<"**"<<endl; 1443 if(flag_trigger == 1) 1444 { 1445 cout << left << setw(10) <<"**"<<"" 1446 << left << setw(15) <<" + Trigger:"<<"" 1447 << right << setw(15) <<triggerwatch.CpuTime()<<"" 1448 << right << setw(15) <<triggerwatch.RealTime()<<"" 1449 << right << setw(14) <<"**"<<endl; 1450 } 1451 if(flag_frog == 1) 1452 { 1453 cout << left << setw(10) <<"**"<<"" 1454 << left << setw(15) <<" + Frog:"<<"" 1455 << right << setw(15) <<frogwatch.CpuTime()<<"" 1456 << right << setw(15) <<frogwatch.RealTime()<<"" 1457 << right << setw(14) <<"**"<<endl; 1458 } 1459 if(flag_lhco == 1) 1460 { 1461 cout << left << setw(10) <<"**"<<"" 1462 << left << setw(15) <<" + LHCO:"<<"" 1463 << right << setw(15) <<lhcowatch.CpuTime()<<"" 1464 << right << setw(15) <<lhcowatch.RealTime()<<"" 1465 << right << setw(14) <<"**"<<endl; 1466 } 1467 1468 1469 ofstream f_out(LogName.c_str(),ios_base::app); 1470 1471 f_out <<"** *"<< endl; 1472 f_out <<"** ################## Time report ################# *"<< endl; 1473 f_out << left << setw(32) <<"** Time report for "<<"" 1474 << left << setw(15) << allEntries <<"" 1475 << right << setw(22) <<"events *"<<endl; 1476 f_out <<"** *"<< endl; 1477 f_out << left << setw(10) <<"**"<<"" 1478 << left << setw(15) <<"Time (s):"<<"" 1479 << right << setw(15) <<"CPU"<<"" 1480 << right << setw(15) <<"Real"<<"" 1481 << right << setw(15) <<" *"<<endl; 1482 f_out << left << setw(10) <<"**"<<"" 1483 << left << setw(15) <<" + Global:"<<"" 1484 << right << setw(15) <<globalwatch.CpuTime()<<"" 1485 << right << setw(15) <<globalwatch.RealTime()<<"" 1486 << right << setw(15) <<" *"<<endl; 1487 f_out << left << setw(10) <<"**"<<"" 1488 << left << setw(15) <<" + Events:"<<"" 1489 << right << setw(15) <<loopwatch.CpuTime()<<"" 1490 << right << setw(15) <<loopwatch.RealTime()<<"" 1491 << right << setw(15) <<" *"<<endl; 1492 if(flag_trigger == 1) 1493 { 1494 f_out << left << setw(10) <<"**"<<"" 1495 << left << setw(15) <<" + Trigger:"<<"" 1496 << right << setw(15) <<triggerwatch.CpuTime()<<"" 1497 << right << setw(15) <<triggerwatch.RealTime()<<"" 1498 << right << setw(15) <<" *"<<endl; 1499 } 1500 if(flag_frog == 1) 1501 { 1502 f_out << left << setw(10) <<"**"<<"" 1503 << left << setw(15) <<" + Frog:"<<"" 1504 << right << setw(15) <<frogwatch.CpuTime()<<"" 1505 << right << setw(15) <<frogwatch.RealTime()<<"" 1506 << right << setw(15) <<" *"<<endl; 1507 } 1508 if(flag_lhco == 1) 1509 { 1510 f_out << left << setw(10) <<"**"<<"" 1511 << left << setw(15) <<" + LHCO:"<<"" 1512 << right << setw(15) <<lhcowatch.CpuTime()<<"" 1513 << right << setw(15) <<lhcowatch.RealTime()<<"" 1514 << right << setw(15) <<" *"<<endl; 1515 } 1516 f_out<<"* *"<<"\n"; 1517 f_out<<"* *"<<"\n"; 1518 f_out<<"#....................................................................*"<<"\n"; 1519 f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n"; 1520 1521 f_out.close(); 1522 1523 }
Note:
See TracChangeset
for help on using the changeset viewer.