Fork me on GitHub

Changeset 399 in svn for trunk


Ignore:
Timestamp:
May 19, 2009, 11:19:15 AM (15 years ago)
Author:
Xavier Rouby
Message:
  • some variables for RP/FP were not in the datacard. This is solved
  • time report moved from Delphes.cpp to SmearUtil.cc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SmearUtil.cc

    r392 r399  
    3737#include "SmearUtil.h"
    3838#include "TRandom.h"
     39#include "TStopwatch.h"
    3940
    4041#include <iostream>
     
    192193
    193194  //for very forward detectors
    194   RP_offsetEl_s     = 120;
     195  RP_offsetEl_s     = 120;    // distance of beam separation point, from IP
    195196  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
    199202
    200203  PdgTableFilename  = "data/particle.tbl";
     
    311314  RP_cross_x        = DET.RP_cross_x;
    312315  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;
    314318  RP_IP_name        = DET.RP_IP_name;
    315319
     
    449453  RP_cross_x        = DET.RP_cross_x;
    450454  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;
    452457  RP_IP_name        = DET.RP_IP_name;
    453458
     
    521526    else if(strstr(temp_string.c_str(),"RP_beam2Card"))     {curstring >> varname >> svalue;RP_beam2Card      = svalue;}
    522527    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;}
    523535   
    524536    else if(strstr(temp_string.c_str(),"ELG_Scen"))         {curstring >> varname >> value; ELG_Scen          = value;}
     
    713725          << left << setw(25) <<RP_beam2Card            <<""<< right << setw(10)<<"*"<<"\n";
    714726    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";
    716728    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";
    718730    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";
    720732    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";
    724738    f_out<<"*                                                                    *"<<"\n";
    725739  }
     
    908922         << left << setw(20) <<ISOL_Calo_ET               <<""<< right << setw(10)<<"*"<<"\n";
    909923   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";
    911925  }
    912926
     
    10291043  f_out<<"#....................................................................*"<<"\n";
    10301044  f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n";
    1031  
     1045 
     1046  f_out.close();
    10321047}
    10331048
     
    13971412 
    13981413} // 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)
     1418void 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
     1420TStopwatch 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.