Fork me on GitHub

Changeset 228 in svn


Ignore:
Timestamp:
Feb 2, 2009, 12:44:43 PM (16 years ago)
Author:
Xavier Rouby
Message:

include statements have been cleaned ; no explicit memory-leak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r212 r228  
    1515#include "TApplication.h"
    1616#include "TStopwatch.h"
    17 
    18 #include "Utilities/ExRootAnalysis/interface/ExRootTreeReader.h"
    19 #include "Utilities/ExRootAnalysis/interface/ExRootTreeWriter.h"
    20 #include "Utilities/ExRootAnalysis/interface/ExRootTreeBranch.h"
    21 
    22 #include "interface/DataConverter.h"
    23 #include "interface/HEPEVTConverter.h"
    24 #include "interface/LHEFConverter.h"
    25 #include "interface/STDHEPConverter.h"
    26 
    27 #include "interface/SmearUtil.h"
    28 #include "interface/BFieldProp.h"
    29 #include "interface/TriggerUtil.h"
    30 #include "interface/VeryForward.h"
    31 #include "interface/JetUtils.h"
    32 #include "interface/FrogUtil.h"
     17#include "TFile.h"
     18
     19#include "ExRootTreeReader.h"
     20#include "ExRootTreeWriter.h"
     21#include "ExRootTreeBranch.h"
     22
     23#include "DataConverter.h"
     24#include "HEPEVTConverter.h"
     25#include "LHEFConverter.h"
     26#include "STDHEPConverter.h"
     27
     28#include "SmearUtil.h"
     29#include "BFieldProp.h"
     30#include "TriggerUtil.h"
     31#include "VeryForward.h"
     32#include "JetsUtil.h"
     33#include "FrogUtil.h"
    3334
    3435#include <vector>
     
    5455{
    5556  int appargc = 2;
    56   char *appName = "Delphes";
    57   char *appargv[] = {appName, "-b"};
     57  char *appName= new char[20];
     58  char *appOpt= new char[20];
     59  sprintf(appName,"Delphes");
     60  sprintf(appOpt,"-b");
     61  char *appargv[] = {appName,appOpt};
    5862  TApplication app(appName, &appargc, appargv);
    59  
     63  delete [] appName;
     64  delete [] appOpt;
     65
     66
    6067  if(argc != 4 && argc != 3 && argc != 5) {
    6168    cout << " Usage: " << argv[0] << " input_file output_file [detector_card] [trigger_card] " << endl;
     
    6673    exit(1);
    6774  }
     75
     76
     77 
    6878 
    6979cout << endl << endl;
     
    163173       << right << setw(7) <<"**"<<""<<endl;
    164174  cout <<"**                                                                 **"<< endl;
    165  
     175
    166176  //read the trigger input file
    167177  string TrigDatacard("data/trigger.dat");
     
    182192 
    183193  //Propagation of tracks in the B field
    184   TrackPropagation *TRACP = new TrackPropagation(DetDatacard);
     194  TrackPropagation *TRACP = new TrackPropagation(DET);
     195  //TrackPropagation *TRACP = new TrackPropagation(DetDatacard);
    185196 
    186197  //Jet information
    187   JetsUtil *JETRUN = new JetsUtil(DetDatacard);
     198  JetsUtil *JETRUN = new JetsUtil(DET);
     199  //JetsUtil *JETRUN = new JetsUtil(DetDatacard);
    188200 
    189201  //VFD information
    190   VeryForward * VFD = new VeryForward(DetDatacard);
     202  VeryForward * VFD = new VeryForward(DET);
     203  //VeryForward * VFD = new VeryForward(DetDatacard);
    191204 
    192205  // data converters
    193   DataConverter *converter=0;
     206  DataConverter *converter=NULL;
    194207  cout <<"**                                                                 **"<<endl;
    195208  cout <<"**        ####### Start convertion to TRoot format ########        **"<< endl;
     
    285298      treeReader->ReadEntry(entry);
    286299      treeWriter->Clear();
    287       if((entry % 100) == 0 && entry > 0 ){
     300      if((entry % 100) == 0 && entry > 0 ) {
    288301         cout << left  << setw(52) <<"**              Processing element # "<<""
    289302              << left  << setw(15) << entry <<""
     
    516529      treeWriterT->Write();
    517530      delete treeWriterT;
     531      delete treeReaderT;
    518532    } // trigger
    519533    triggerwatch.Stop();
     
    522536  // 3.2 ************** FROG display
    523537  frogwatch.Start();
    524   if(DET->FLAG_frog == 1)
    525     {
     538  if(DET->FLAG_frog == 1) {
    526539      cout <<"**                                                                 **"<<endl;
    527540      cout <<"**        ################## Start FROG #################          **"<< endl;
    528541
    529       FrogDisplay *FROG = new FrogDisplay();
    530       FROG->BuidEvents(outputfilename,DET->NEvents_Frog);
    531       FROG->BuildGeom(DetDatacard);
    532     }
    533     frogwatch.Stop();
     542      FrogDisplay *FROG = new FrogDisplay(DET);
     543      FROG->BuildEvents(outputfilename);
     544      FROG->BuildGeom();
     545      delete FROG;
     546  }
     547  frogwatch.Stop();
    534548 
    535549
     
    591605  delete JETRUN;
    592606  delete VFD;
    593   if(converter) delete converter;
     607  delete converter;
    594608 
    595609//  todo("TODO");
Note: See TracChangeset for help on using the changeset viewer.