Fork me on GitHub

Changeset 191 in svn


Ignore:
Timestamp:
Jan 26, 2009, 3:38:14 PM (16 years ago)
Author:
Xavier Rouby
Message:

Performance of timing included

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r184 r191  
    1414#include "TChain.h"
    1515#include "TApplication.h"
     16#include "TStopwatch.h"
    1617
    1718#include "Utilities/ExRootAnalysis/interface/ExRootTreeReader.h"
     
    6970
    7071  srand (time (NULL));         /* Initialisation du générateur */
     72  TStopwatch globalwatch, loopwatch, triggerwatch, frogwatch;
     73  globalwatch.Start();
     74
    7175 
    7276  //read the input TROOT file
     
    193197  Long64_t entry, allEntries = treeReader->GetEntries();
    194198  cout << "** The input list contains " << allEntries << " events" << endl;
     199  loopwatch.Start();
    195200
    196201  // loop on all events
     
    382387  treeWriter->Write();
    383388  delete treeWriter;
     389  loopwatch.Stop();
    384390 
    385391
     
    387393// 3. ********** Trigger  & Frog ***********
    388394  // 3.1 ************ running the trigger in case the FLAG trigger is put to 1 in the datacard
     395  triggerwatch.Start();
    389396  if(DET->FLAG_trigger == 1)
    390397    {
     
    419426      delete treeWriterT;
    420427    } // trigger
     428    triggerwatch.Stop();
    421429 
    422430 
    423431  // 3.2 ************** FROG display
     432  frogwatch.Start();
    424433  if(DET->FLAG_frog == 1)
    425434    {
     
    428437      FROG->BuildGeom(DetDatacard);
    429438    }
     439    frogwatch.Stop();
    430440 
    431441
     
    434444// 4. ********** End & Exit ***********
    435445  cout << "** Exiting..." << endl;
     446  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;
     451  if(DET->FLAG_trigger == 1)
     452  cout << " +  Trigger: \t" << triggerwatch.CpuTime() << " \t " << triggerwatch.RealTime() << endl;
     453  if(DET->FLAG_frog == 1)
     454  cout << " +  Frog:    \t" << frogwatch.CpuTime() << " \t " << frogwatch.RealTime() << endl;
     455
    436456 
    437457  delete treeReader;
     
    443463  if(converter) delete converter;
    444464 
    445   todo("TODO");
     465//  todo("TODO");
    446466}
Note: See TracChangeset for help on using the changeset viewer.