Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • converters/lhco2root.cpp

    r341014c r1fa50c2  
    1717 */
    1818
     19#include <stdexcept>
    1920#include <iostream>
    2021#include <sstream>
    21 #include <stdexcept>
    22 
     22
     23#include <stdlib.h>
    2324#include <signal.h>
    2425#include <stdio.h>
    25 #include <stdlib.h>
    26 
     26
     27#include "TROOT.h"
    2728#include "TApplication.h"
    28 #include "TROOT.h"
    29 
     29
     30#include "TFile.h"
     31#include "TObjArray.h"
     32#include "TStopwatch.h"
    3033#include "TDatabasePDG.h"
    31 #include "TFile.h"
     34#include "TParticlePDG.h"
    3235#include "TLorentzVector.h"
    33 #include "TObjArray.h"
    34 #include "TParticlePDG.h"
    35 #include "TStopwatch.h"
    36 
     36
     37#include "modules/Delphes.h"
     38#include "classes/DelphesStream.h"
    3739#include "classes/DelphesClasses.h"
    3840#include "classes/DelphesFactory.h"
    39 #include "classes/DelphesStream.h"
    40 #include "modules/Delphes.h"
    41 
     41
     42#include "ExRootAnalysis/ExRootTreeWriter.h"
     43#include "ExRootAnalysis/ExRootTreeBranch.h"
    4244#include "ExRootAnalysis/ExRootProgressBar.h"
    43 #include "ExRootAnalysis/ExRootTreeBranch.h"
    44 #include "ExRootAnalysis/ExRootTreeWriter.h"
    4545
    4646using namespace std;
    4747
    48 static const int kBufferSize = 1024;
     48static const int kBufferSize  = 1024;
    4949
    5050/*
     
    7474
    7575private:
     76
    7677  void AddMissingEvents();
    7778
     
    8586  void AnalyseMissingET(ExRootTreeBranch *branch);
    8687
    87   enum
    88   {
    89     kIntParamSize = 2,
    90     kDblParamSize = 7
    91   };
     88  enum {kIntParamSize = 2, kDblParamSize = 7};
    9289  Int_t fIntParam[kIntParamSize];
    9390  Double_t fDblParam[kDblParamSize];
     
    109106  ExRootTreeBranch *fBranchJet;
    110107  ExRootTreeBranch *fBranchMissingET;
     108
    111109};
    112110
     
    171169    if(!rc)
    172170    {
    173       cerr << "** ERROR: "
    174            << "invalid event format" << endl;
     171      cerr << "** ERROR: " << "invalid event format" << endl;
    175172      return kFALSE;
    176173    }
     
    198195    if(!rc)
    199196    {
    200       cerr << "** ERROR: "
    201            << "invalid object format" << endl;
     197      cerr << "** ERROR: " << "invalid object format" << endl;
    202198      return kFALSE;
    203199    }
     
    205201    switch(fIntParam[1])
    206202    {
    207     case 0: AnalysePhoton(fBranchPhoton); break;
    208     case 1: AnalyseElectron(fBranchElectron); break;
    209     case 2: AnalyseMuon(fBranchMuon); break;
    210     case 3: AnalyseTau(fBranchJet); break;
    211     case 4: AnalyseJet(fBranchJet); break;
    212     case 6: AnalyseMissingET(fBranchMissingET); break;
     203      case 0: AnalysePhoton(fBranchPhoton); break;
     204      case 1: AnalyseElectron(fBranchElectron); break;
     205      case 2: AnalyseMuon(fBranchMuon); break;
     206      case 3: AnalyseTau(fBranchJet); break;
     207      case 4: AnalyseJet(fBranchJet); break;
     208      case 6: AnalyseMissingET(fBranchMissingET); break;
    213209    }
    214210  }
     
    232228  LHCOEvent *element;
    233229
    234   element = static_cast<LHCOEvent *>(branch->NewEntry());
     230  element = static_cast<LHCOEvent*>(branch->NewEntry());
    235231
    236232  element->Number = fEventNumber;
     
    244240  Photon *element;
    245241
    246   element = static_cast<Photon *>(branch->NewEntry());
     242  element = static_cast<Photon*>(branch->NewEntry());
    247243
    248244  element->Eta = fDblParam[0];
     
    258254  Electron *element;
    259255
    260   element = static_cast<Electron *>(branch->NewEntry());
     256  element = static_cast<Electron*>(branch->NewEntry());
    261257
    262258  element->Eta = fDblParam[0];
     
    265261
    266262  element->Charge = fDblParam[4] < 0.0 ? -1 : 1;
    267   /*
     263/*
    268264  element->Ntrk = TMath::Abs(fDblParam[4]);
    269265*/
     
    277273  Muon *element;
    278274
    279   element = static_cast<Muon *>(branch->NewEntry());
     275  element = static_cast<Muon*>(branch->NewEntry());
    280276
    281277  element->Eta = fDblParam[0];
     
    284280
    285281  element->Charge = fDblParam[4] < 0.0 ? -1 : 1;
    286   /*
     282/*
    287283  element->Ntrk = TMath::Abs(fDblParam[4]);
    288284
     
    300296  Jet *element;
    301297
    302   element = static_cast<Jet *>(branch->NewEntry());
     298  element = static_cast<Jet*>(branch->NewEntry());
    303299
    304300  element->Eta = fDblParam[0];
     
    312308
    313309  element->Charge = fDblParam[4] < 0 ? -1 : 1;
    314   /*
     310/*
    315311  element->Ntrk = TMath::Abs(fDblParam[4]);
    316312*/
     
    324320  Jet *element;
    325321
    326   element = static_cast<Jet *>(branch->NewEntry());
     322  element = static_cast<Jet*>(branch->NewEntry());
    327323
    328324  element->Eta = fDblParam[0];
     
    331327
    332328  element->Mass = fDblParam[3];
    333   /*
     329/*
    334330  element->Ntrk = TMath::Abs(Int_t(fDblParam[4]));
    335331*/
     
    340336
    341337  element->EhadOverEem = fDblParam[6];
    342   /*
     338/*
    343339  element->Index = fIntParam[0];
    344340*/
     
    351347  MissingET *element;
    352348
    353   element = static_cast<MissingET *>(branch->NewEntry());
     349  element = static_cast<MissingET*>(branch->NewEntry());
    354350
    355351  element->Phi = fDblParam[1];
     
    380376  if(argc < 2)
    381377  {
    382     cout << " Usage: " << appName << " output_file"
    383          << " [input_file(s)]" << endl;
     378    cout << " Usage: " << appName << " output_file" << " [input_file(s)]" << endl;
    384379    cout << " output_file - output file in ROOT format," << endl;
    385380    cout << " input_file(s) - input file(s) in LHCO format," << endl;
     
    461456
    462457      ++i;
    463     } while(i < argc);
     458    }
     459    while(i < argc);
    464460
    465461    cout << "** Exiting..." << endl;
     
    478474  }
    479475}
     476
     477
Note: See TracChangeset for help on using the changeset viewer.