Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • converters/root2lhco.cpp

    rc3547ed r341014c  
    1717 */
    1818
     19#include <fstream>
     20#include <iostream>
     21#include <sstream>
    1922#include <stdexcept>
    20 #include <iostream>
    21 #include <fstream>
    22 #include <sstream>
    2323#include <string>
    2424
    25 #include <stdlib.h>
    2625#include <signal.h>
    2726#include <stdio.h>
    28 
     27#include <stdlib.h>
     28
     29#include "TApplication.h"
    2930#include "TROOT.h"
    30 #include "TApplication.h"
    31 
     31
     32#include "TClonesArray.h"
    3233#include "TFile.h"
    33 #include "TClonesArray.h"
    3434
    3535#include "classes/DelphesClasses.h"
    3636
     37#include "ExRootAnalysis/ExRootProgressBar.h"
    3738#include "ExRootAnalysis/ExRootTreeReader.h"
    38 #include "ExRootAnalysis/ExRootProgressBar.h"
    3939
    4040using namespace std;
     
    6262
    6363private:
    64 
    6564  void Reset();
    6665  void Write();
     
    7675  void AnalyseMissingET();
    7776
    78   enum {kIntParamSize = 2, kDblParamSize = 9};
     77  enum
     78  {
     79    kIntParamSize = 2,
     80    kDblParamSize = 9
     81  };
    7982  Int_t fIntParam[kIntParamSize];
    8083  Double_t fDblParam[kDblParamSize];
     
    132135  fBranchMissingET = fTreeReader->UseBranch("MissingET");
    133136
    134   if(!fBranchEvent || !fBranchTrack || !fBranchTower || !fBranchPhoton ||
    135      !fBranchElectron || !fBranchMuon || !fBranchJet || !fBranchMissingET)
     137  if(!fBranchEvent || !fBranchTrack || !fBranchTower || !fBranchPhoton || !fBranchElectron || !fBranchMuon || !fBranchJet || !fBranchMissingET)
    136138  {
    137139    throw runtime_error("ROOT file doesn't contain all required branches");
     
    202204  Event *element;
    203205
    204   element = static_cast<Event*>(fBranchEvent->At(0));
     206  element = static_cast<Event *>(fBranchEvent->At(0));
    205207
    206208  fprintf(fOutputFile, "%4d %13lld %8d\n", 0, element->Number, 0);
     
    216218
    217219  fItPhoton->Reset();
    218   while((element = static_cast<Photon*>(fItPhoton->Next())))
     220  while((element = static_cast<Photon *>(fItPhoton->Next())))
    219221  {
    220222    Reset();
     
    239241
    240242  fItElectron->Reset();
    241   while((element = static_cast<Electron*>(fItElectron->Next())))
     243  while((element = static_cast<Electron *>(fItElectron->Next())))
    242244  {
    243245    Reset();
     
    270272  muonCounter = 0;
    271273  fItMuon->Reset();
    272   while((element = static_cast<Muon*>(fItMuon->Next())))
     274  while((element = static_cast<Muon *>(fItMuon->Next())))
    273275  {
    274276    Reset();
     
    276278    sumPT = 0.0;
    277279    fItTrack->Reset();
    278     while((track = static_cast<Track*>(fItTrack->Next())))
     280    while((track = static_cast<Track *>(fItTrack->Next())))
    279281    {
    280282      if(element->P4().DeltaR(track->P4()) < 0.5) sumPT += track->PT;
     
    283285    sumET = 0.0;
    284286    fItTower->Reset();
    285     while((tower = static_cast<Tower*>(fItTower->Next())))
     287    while((tower = static_cast<Tower *>(fItTower->Next())))
    286288    {
    287289      if(element->P4().DeltaR(tower->P4()) < 0.5) sumET += tower->ET;
     
    293295    minDR = 1.0E9;
    294296    fItJet->Reset();
    295     while((jet = static_cast<Jet*>(fItJet->Next())))
     297    while((jet = static_cast<Jet *>(fItJet->Next())))
    296298    {
    297299      if(jet->TauTag != 0)
     
    325327    }
    326328
    327     ratET = sumET/element->PT;
     329    ratET = sumET / element->PT;
    328330    fDblParam[6] = Float_t(TMath::Nint(sumPT)) + (ratET < 1.0 ? ratET : 0.99);
    329331
     
    342344
    343345  fItJet->Reset();
    344   while((element = static_cast<Jet*>(fItJet->Next())))
     346  while((element = static_cast<Jet *>(fItJet->Next())))
    345347  {
    346348    if(element->TauTag == 0) continue;
     
    350352    counter = 1;
    351353
    352    /*
     354    /*
    353355    fItTrack->Reset();
    354356    while((track = static_cast<Track*>(fItTrack->Next())))
     
    380382
    381383  fItJet->Reset();
    382   while((element = static_cast<Jet*>(fItJet->Next())))
     384  while((element = static_cast<Jet *>(fItJet->Next())))
    383385  {
    384386    if(element->TauTag != 0) continue;
     
    388390    counter = 0;
    389391    fItTrack->Reset();
    390     while((track = static_cast<Track*>(fItTrack->Next())))
     392    while((track = static_cast<Track *>(fItTrack->Next())))
    391393    {
    392394      if(element->P4().DeltaR(track->P4()) < 0.5) ++counter;
     
    413415  MissingET *element;
    414416
    415   element = static_cast<MissingET*>(fBranchMissingET->At(0));
     417  element = static_cast<MissingET *>(fBranchMissingET->At(0));
    416418
    417419  Reset();
     
    471473  if(argc < 2 || argc > 4)
    472474  {
    473     cerr << " Usage: " << appName << " input_file" << " [output_file] [--jet-branch=Jet]" << endl;
     475    cerr << " Usage: " << appName << " input_file"
     476         << " [output_file] [--jet-branch=Jet]" << endl;
    474477    cerr << " input_file - input file in ROOT format," << endl;
    475478    cerr << " output_file - output file in LHCO format," << endl;
Note: See TracChangeset for help on using the changeset viewer.