Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • converters/root2lhco.cpp

    r341014c rc3547ed  
    1717 */
    1818
     19#include <stdexcept>
     20#include <iostream>
    1921#include <fstream>
    20 #include <iostream>
    2122#include <sstream>
    22 #include <stdexcept>
    2323#include <string>
    2424
     25#include <stdlib.h>
    2526#include <signal.h>
    2627#include <stdio.h>
    27 #include <stdlib.h>
    28 
     28
     29#include "TROOT.h"
    2930#include "TApplication.h"
    30 #include "TROOT.h"
    31 
     31
     32#include "TFile.h"
    3233#include "TClonesArray.h"
    33 #include "TFile.h"
    3434
    3535#include "classes/DelphesClasses.h"
    3636
     37#include "ExRootAnalysis/ExRootTreeReader.h"
    3738#include "ExRootAnalysis/ExRootProgressBar.h"
    38 #include "ExRootAnalysis/ExRootTreeReader.h"
    3939
    4040using namespace std;
     
    6262
    6363private:
     64
    6465  void Reset();
    6566  void Write();
     
    7576  void AnalyseMissingET();
    7677
    77   enum
    78   {
    79     kIntParamSize = 2,
    80     kDblParamSize = 9
    81   };
     78  enum {kIntParamSize = 2, kDblParamSize = 9};
    8279  Int_t fIntParam[kIntParamSize];
    8380  Double_t fDblParam[kDblParamSize];
     
    135132  fBranchMissingET = fTreeReader->UseBranch("MissingET");
    136133
    137   if(!fBranchEvent || !fBranchTrack || !fBranchTower || !fBranchPhoton || !fBranchElectron || !fBranchMuon || !fBranchJet || !fBranchMissingET)
     134  if(!fBranchEvent || !fBranchTrack || !fBranchTower || !fBranchPhoton ||
     135     !fBranchElectron || !fBranchMuon || !fBranchJet || !fBranchMissingET)
    138136  {
    139137    throw runtime_error("ROOT file doesn't contain all required branches");
     
    204202  Event *element;
    205203
    206   element = static_cast<Event *>(fBranchEvent->At(0));
     204  element = static_cast<Event*>(fBranchEvent->At(0));
    207205
    208206  fprintf(fOutputFile, "%4d %13lld %8d\n", 0, element->Number, 0);
     
    218216
    219217  fItPhoton->Reset();
    220   while((element = static_cast<Photon *>(fItPhoton->Next())))
     218  while((element = static_cast<Photon*>(fItPhoton->Next())))
    221219  {
    222220    Reset();
     
    241239
    242240  fItElectron->Reset();
    243   while((element = static_cast<Electron *>(fItElectron->Next())))
     241  while((element = static_cast<Electron*>(fItElectron->Next())))
    244242  {
    245243    Reset();
     
    272270  muonCounter = 0;
    273271  fItMuon->Reset();
    274   while((element = static_cast<Muon *>(fItMuon->Next())))
     272  while((element = static_cast<Muon*>(fItMuon->Next())))
    275273  {
    276274    Reset();
     
    278276    sumPT = 0.0;
    279277    fItTrack->Reset();
    280     while((track = static_cast<Track *>(fItTrack->Next())))
     278    while((track = static_cast<Track*>(fItTrack->Next())))
    281279    {
    282280      if(element->P4().DeltaR(track->P4()) < 0.5) sumPT += track->PT;
     
    285283    sumET = 0.0;
    286284    fItTower->Reset();
    287     while((tower = static_cast<Tower *>(fItTower->Next())))
     285    while((tower = static_cast<Tower*>(fItTower->Next())))
    288286    {
    289287      if(element->P4().DeltaR(tower->P4()) < 0.5) sumET += tower->ET;
     
    295293    minDR = 1.0E9;
    296294    fItJet->Reset();
    297     while((jet = static_cast<Jet *>(fItJet->Next())))
     295    while((jet = static_cast<Jet*>(fItJet->Next())))
    298296    {
    299297      if(jet->TauTag != 0)
     
    327325    }
    328326
    329     ratET = sumET / element->PT;
     327    ratET = sumET/element->PT;
    330328    fDblParam[6] = Float_t(TMath::Nint(sumPT)) + (ratET < 1.0 ? ratET : 0.99);
    331329
     
    344342
    345343  fItJet->Reset();
    346   while((element = static_cast<Jet *>(fItJet->Next())))
     344  while((element = static_cast<Jet*>(fItJet->Next())))
    347345  {
    348346    if(element->TauTag == 0) continue;
     
    352350    counter = 1;
    353351
    354     /*
     352   /*
    355353    fItTrack->Reset();
    356354    while((track = static_cast<Track*>(fItTrack->Next())))
     
    382380
    383381  fItJet->Reset();
    384   while((element = static_cast<Jet *>(fItJet->Next())))
     382  while((element = static_cast<Jet*>(fItJet->Next())))
    385383  {
    386384    if(element->TauTag != 0) continue;
     
    390388    counter = 0;
    391389    fItTrack->Reset();
    392     while((track = static_cast<Track *>(fItTrack->Next())))
     390    while((track = static_cast<Track*>(fItTrack->Next())))
    393391    {
    394392      if(element->P4().DeltaR(track->P4()) < 0.5) ++counter;
     
    415413  MissingET *element;
    416414
    417   element = static_cast<MissingET *>(fBranchMissingET->At(0));
     415  element = static_cast<MissingET*>(fBranchMissingET->At(0));
    418416
    419417  Reset();
     
    473471  if(argc < 2 || argc > 4)
    474472  {
    475     cerr << " Usage: " << appName << " input_file"
    476          << " [output_file] [--jet-branch=Jet]" << endl;
     473    cerr << " Usage: " << appName << " input_file" << " [output_file] [--jet-branch=Jet]" << endl;
    477474    cerr << " input_file - input file in ROOT format," << endl;
    478475    cerr << " output_file - output file in LHCO format," << endl;
Note: See TracChangeset for help on using the changeset viewer.