Fork me on GitHub

Changeset 212 in svn for trunk/Delphes.cpp


Ignore:
Timestamp:
Jan 30, 2009, 12:25:28 AM (16 years ago)
Author:
severine ovyn
Message:

my improvement of output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r191 r212  
    6666    exit(1);
    6767  }
    68  
     68 
     69cout << endl << endl;
     70
     71cout <<"*********************************************************************"<< endl;
     72cout <<"*********************************************************************"<< endl;
     73cout <<"**                                                                 **"<< endl;
     74cout <<"**                            Welcome to                           **"<< endl;
     75cout <<"**                                                                 **"<< endl;
     76cout <<"**                                                                 **"<< endl;
     77cout <<"**     .ddddddd-            lL             hH                      **"<< endl;
     78cout <<"**     -Dd` `dD:           Ll             hH`                      **"<< endl;
     79cout <<"**     dDd   dDd    eeee.  lL  .pp+pp    Hh+hhh`   -eeee- `sssss   **"<< endl;
     80cout <<"**    -Dd   `DD   ee. ee  Ll   .Pp. PP   Hh. HH.  ee. ee  sSs      **"<< endl;
     81cout <<"**    dD`   dDd  eEeee:   lL.  pP.  pP  hH   hH` eEeee:` -sSSSs.   **"<< endl;
     82cout <<"**   .Dd  :dd    eE.     LlL   PpppPP   Hh  Hh   eE         sSS    **"<< endl;
     83cout <<"**   dddddd:.     eee+:  lL.  pp.      hh.  hh    eee+  sssssS     **"<< endl;
     84cout <<"**                            Pp                                   **"<< endl;
     85cout <<"**                                                                 **"<< endl;
     86cout <<"**           Delphes, a framework for the fast simulation          **"<< endl;
     87cout <<"**                 of a  generic collider experiment               **"<< endl;
     88cout <<"**                                                                 **"<< endl;
     89cout <<"**                --- Version 1.3beta of Delphes ---               **"<< endl;
     90cout <<"**               Last date of change: 29 January 2009              **"<< endl;
     91cout <<"**                                                                 **"<< endl;
     92cout <<"**                                                                 **"<< endl;
     93cout <<"**     This package uses:                                          **"<< endl;
     94cout <<"**     ------------------                                          **"<< endl;
     95cout <<"**     FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **"<< endl;
     96cout <<"**     Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]  **"<< endl;
     97cout <<"**     FROG:                                                       **"<< endl;
     98cout <<"**                                                                 **"<< endl;
     99cout <<"**-----------------------------------------------------------------**"<< endl;
     100cout <<"**                                                                 **"<< endl;
     101cout <<"**   Main authors:                                                 **"<< endl;
     102cout <<"**   -------------                                                 **"<< endl;
     103cout <<"**                                                                 **"<< endl;
     104cout <<"**              Séverine Ovyn               Xavier Rouby           **"<< endl;
     105cout <<"**       severine.ovyn@uclouvain.be      xavier.rouby@cern         **"<< endl;
     106cout <<"**       Center for Particle Physics and Phenomenology (CP3)       **"<< endl;
     107cout <<"**       Universite Catholique de Louvain (UCL)                    **"<< endl;
     108cout <<"**       Louvain-la-Neuve, Belgium                                 **"<< endl;
     109cout <<"**                                                                 **"<< endl;
     110cout <<"**-----------------------------------------------------------------**"<< endl;
     111cout <<"**                                                                 **"<< endl;
     112cout <<"**   Former Delphes versions and documentation can be found on :   **"<< endl;
     113cout <<"**               http://www.fynu.ucl.ac.be/delphes.html            **"<< endl;
     114cout <<"**                                                                 **"<< endl;
     115cout <<"**                                                                 **"<< endl;
     116cout <<"**   Disclaimer: this program is a beta version of Delphes and     **"<< endl;
     117cout <<"** therefore comes without guarantees. Beware of errors and please **"<< endl;
     118cout <<"**        give us your feedbacks about potential bugs              **"<< endl;
     119cout <<"**                                                                 **"<< endl;
     120cout <<"*********************************************************************"<< endl;
     121cout <<"*********************************************************************"<< endl;
     122 
    69123// 1. ********** initialisation ***********
    70124
     
    94148  //read the datacard input file
    95149  string DetDatacard("");
    96   if(argc>=4)  DetDatacard =argv[3];
     150  if(argc>=4)DetDatacard =argv[3];
    97151 
    98152  //Smearing information
    99153  RESOLution *DET = new RESOLution();
     154  cout <<"**                                                                 **"<< endl;
     155  cout <<"**        ####### Start reading DETECTOR parameters #######        **"<< endl;
     156  cout << left  << setw(40) <<"**        Opening configuration card: "<<""
     157       << left  << setw(20) << DetDatacard                            <<""
     158       << right << setw(9) <<" **"<<""<<endl;
    100159  DET->ReadDataCard(DetDatacard);
    101160  DET->Logfile(LogName);
     161  cout << left  << setw(42) <<"**        Parameters summarised in file: "<<""
     162       << left  << setw(20) << LogName                            <<""
     163       << right << setw(7) <<"**"<<""<<endl;
     164  cout <<"**                                                                 **"<< endl;
    102165 
    103166  //read the trigger input file
     
    109172  TRIGT->TriggerCardReader(TrigDatacard.c_str());
    110173  TRIGT->PrintTriggerTable(LogName);
     174  if(DET->FLAG_trigger == 1)
     175    {
     176      cout <<"**        ########### Start reading TRIGGER card ##########        **"<< endl;
     177      cout << left  << setw(40) <<"**        Opening configuration card: "<<""
     178           << left  << setw(20) << TrigDatacard                            <<""
     179           << right << setw(9) <<" **"<<""<<endl;
     180      cout <<"**                                                                 **"<< endl;
     181    }
    111182 
    112183  //Propagation of tracks in the B field
     
    121192  // data converters
    122193  DataConverter *converter=0;
    123  
     194  cout <<"**                                                                 **"<<endl;
     195  cout <<"**        ####### Start convertion to TRoot format ########        **"<< endl;
     196
    124197  if(strstr(line.c_str(),".hep"))
    125198    {                           
    126       cout<<"#**********************************************************************"<<endl;
    127       cout<<"#**********         StdHEP file format detected           *************"<<endl;
    128       cout<<"#***********     Starting convertion to TRoot format     **************"<<endl;
    129       cout<<"#**********************************************************************"<<endl;
     199      cout <<"**                 StdHEP file format detected                     **"<<endl;
     200      cout <<"**                This can take several minutes                    **"<< endl;
    130201      converter = new STDHEPConverter(inputFileList,outputfilename);//case ntpl file in input list
    131202    }
    132203  else if(strstr(line.c_str(),".lhe"))
    133204    {
    134       cout<<"#**********************************************************************"<<endl;
    135       cout<<"#***********          LHEF file format detected            ************"<<endl;
    136       cout<<"#***********     Starting convertion to TRoot format       ************"<<endl;
    137       cout<<"#**********************************************************************"<<endl;
     205      cout <<"**                   LHEF file format detected                     **"<<endl;
     206      cout <<"**                 This can take several minutes                   **"<< endl;
    138207      converter = new LHEFConverter(inputFileList,outputfilename);//case ntpl file in input list
    139208    }
    140209  else if(strstr(line.c_str(),".root"))
    141210    {
    142       cout<<"#**********************************************************************"<<endl;
    143       cout<<"#**********         h2root file format detected           *************"<<endl;
    144       cout<<"#**********     Starting convertion to TRoot format       *************"<<endl;
    145       cout<<"#**********************************************************************"<<endl;
     211      cout <<"**                   h2root file format detected                   **"<<endl;
     212      cout <<"**                  This can take several minutes                  **"<< endl;
    146213      converter = new HEPEVTConverter(inputFileList,outputfilename);//case ntpl file in input list
    147214    }
    148   else { cout << "***  " << line.c_str() << "\n***  file format not identified\n***  Exiting\n"; return -1;};
    149  
     215  else {
     216      cout << left  << setw(4) <<"**  "<<""
     217           << left  << setw(63) << line.c_str() <<""
     218           << right << setw(2) <<"**"<<endl;
     219      cout <<"**             File format not identified --  Exiting...           **"<< endl;
     220      cout <<"**                                                                 **"<< endl;
     221      cout <<"*********************************************************************"<< endl;
     222      return -1;};
     223  cout <<"**                       Exiting conversion...                     **"<< endl;
     224
    150225  TChain chain("GEN");
    151226  chain.Add(outputfilename.c_str());
     
    196271// 2. ********** Loop over all events ***********
    197272  Long64_t entry, allEntries = treeReader->GetEntries();
    198   cout << "** The input list contains " << allEntries << " events" << endl;
     273  cout <<"**                                                                 **"<<endl;
     274  cout <<"**        ####### Start fast detector simulation ########          **"<< endl;
     275  cout << left  << setw(52) <<"**              Total number of events to run: "<<""
     276       << left  << setw(15) << allEntries <<""
     277       << right << setw(2) <<"**"<<endl;
     278
    199279  loopwatch.Start();
    200280
     
    205285      treeReader->ReadEntry(entry);
    206286      treeWriter->Clear();
    207       if((entry % 100) == 0 && entry > 0 )  cout << "** Processing element # " << entry << endl;
     287      if((entry % 100) == 0 && entry > 0 ){
     288         cout << left  << setw(52) <<"**              Processing element # "<<""
     289              << left  << setw(15) << entry <<""
     290              << right << setw(2) <<"**"<<endl;
     291      }
    208292     
    209293      electron.clear();
     
    384468      treeWriter->Fill();
    385469    } // 2. Loop over all events ('for' loop)
    386  
     470 
     471  cout <<"**                                                                 **"<< endl;
     472  cout <<"**                 Exiting detector simulation...                  **"<< endl;
     473
     474 
    387475  treeWriter->Write();
    388476  delete treeWriter;
     
    391479
    392480 
    393 // 3. ********** Trigger  & Frog ***********
     481  // 3. ********** Trigger  & Frog ***********
    394482  // 3.1 ************ running the trigger in case the FLAG trigger is put to 1 in the datacard
    395483  triggerwatch.Start();
    396484  if(DET->FLAG_trigger == 1)
    397485    {
     486       cout <<"**                                                                 **"<<endl;
     487       cout <<"**        ########### Start Trigger selection ###########          **"<< endl;
     488
    398489      // input
    399490      TChain chainT("Analysis");
     
    414505 
    415506      Long64_t entryT, allEntriesT = treeReaderT->GetEntries();
    416       cout << "** Trigger: the 'Analysis' tree contains " << allEntriesT << " events" << endl;
    417507      // loop on all entries
    418508      for(entryT = 0; entryT < allEntriesT; ++entryT) {
     
    422512          treeWriterT->Fill();
    423513      } // loop on all entries
     514      cout <<"**                 Exiting trigger simulation...                   **"<< endl;
    424515     
    425516      treeWriterT->Write();
     
    433524  if(DET->FLAG_frog == 1)
    434525    {
     526      cout <<"**                                                                 **"<<endl;
     527      cout <<"**        ################## Start FROG #################          **"<< endl;
     528
    435529      FrogDisplay *FROG = new FrogDisplay();
    436530      FROG->BuidEvents(outputfilename,DET->NEvents_Frog);
     
    443537
    444538// 4. ********** End & Exit ***********
    445   cout << "** Exiting..." << endl;
     539
    446540  globalwatch.Stop();
    447   cout << "** Time report for " << allEntries << " events.\n";
    448   cout << " +  Time (s): \tCPU \t real"<< endl;
    449   cout << " +  Global:  \t" << globalwatch.CpuTime() << " \t " << globalwatch.RealTime() << endl;
    450   cout << " +  Events:  \t" << loopwatch.CpuTime() << " \t " << loopwatch.RealTime() << endl;
     541  cout <<"**                                                                 **"<< endl;
     542  cout <<"**        ################## Time report #################         **"<< endl;
     543  cout << left  << setw(32) <<"**              Time report for "<<""
     544              << left  << setw(15) << allEntries <<""
     545              << right << setw(22) <<"events         **"<<endl;
     546  cout <<"**                                                                 **"<< endl;
     547  cout << left  << setw(10) <<"**"<<""
     548       << left  << setw(15) <<"Time (s):"<<""
     549       << right << setw(15) <<"CPU"<<""
     550       << right << setw(15) <<"Real"<<""
     551       << right << setw(14)  <<"**"<<endl;
     552  cout << left  << setw(10) <<"**"<<""
     553       << left  << setw(15) <<" +  Global:"<<""
     554       << right << setw(15) <<globalwatch.CpuTime()<<""
     555       << right << setw(15) <<globalwatch.RealTime()<<""
     556       << right << setw(14)  <<"**"<<endl;
     557  cout << left  << setw(10) <<"**"<<""
     558       << left  << setw(15) <<" +  Events:"<<""
     559       << right << setw(15) <<loopwatch.CpuTime()<<""
     560       << right << setw(15) <<loopwatch.RealTime()<<""
     561       << right << setw(14)  <<"**"<<endl;
    451562  if(DET->FLAG_trigger == 1)
    452   cout << " +  Trigger: \t" << triggerwatch.CpuTime() << " \t " << triggerwatch.RealTime() << endl;
     563    {
     564     cout << left  << setw(10) <<"**"<<""
     565          << left  << setw(15) <<" +  Trigger:"<<""
     566          << right << setw(15) <<triggerwatch.CpuTime()<<""
     567          << right << setw(15) <<triggerwatch.RealTime()<<""
     568          << right << setw(14)  <<"**"<<endl;
     569    }
    453570  if(DET->FLAG_frog == 1)
    454   cout << " +  Frog:    \t" << frogwatch.CpuTime() << " \t " << frogwatch.RealTime() << endl;
    455 
    456  
     571    {
     572     cout << left  << setw(10) <<"**"<<""
     573          << left  << setw(15) <<" +  Frog:"<<""
     574          << right << setw(15) <<frogwatch.CpuTime()<<""
     575          << right << setw(15) <<frogwatch.RealTime()<<""
     576          << right << setw(14)  <<"**"<<endl;
     577
     578    }
     579 
     580   cout <<"**                                                                 **"<< endl;
     581   cout <<"**                        Exiting Delphes ...                      **"<< endl;
     582   cout <<"**                                                                 **"<< endl;
     583   cout <<"*********************************************************************"<< endl;
     584   cout <<"*********************************************************************"<< endl;
     585
     586
    457587  delete treeReader;
    458588  delete DET;
Note: See TracChangeset for help on using the changeset viewer.