Fork me on GitHub

Changeset d870fc5 in git for converters/root2lhco.cpp


Ignore:
Timestamp:
Dec 21, 2014, 4:03:35 PM (10 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
d77b51d
Parents:
7f12612 (diff), e5767b57 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'upstream/master'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • converters/root2lhco.cpp

    r7f12612 rd870fc5  
    22 *  Delphes: a framework for fast simulation of a generic collider experiment
    33 *  Copyright (C) 2012-2014  Universite catholique de Louvain (UCL), Belgium
    4  * 
     4 *
    55 *  This program is free software: you can redistribute it and/or modify
    66 *  it under the terms of the GNU General Public License as published by
    77 *  the Free Software Foundation, either version 3 of the License, or
    88 *  (at your option) any later version.
    9  * 
     9 *
    1010 *  This program is distributed in the hope that it will be useful,
    1111 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1212 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1313 *  GNU General Public License for more details.
    14  * 
     14 *
    1515 *  You should have received a copy of the GNU General Public License
    1616 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    108108
    109109LHCOWriter::LHCOWriter(ExRootTreeReader *treeReader, FILE *outputFile) :
    110   fTriggerWord(0), fEventNumber(1), fTreeReader(0), fOutputFile(0)
     110  fTriggerWord(0), fEventNumber(1), fTreeReader(0), fOutputFile(0),
     111  fBranchEvent(0), fBranchTrack(0), fBranchTower(0), fBranchPhoton(0),
     112  fBranchElectron(0), fBranchMuon(0), fBranchJet(0), fBranchMissingET(0)
    111113{
    112114  fTreeReader = treeReader;
     
    117119  // reconstructed tracks
    118120  fBranchTrack = fTreeReader->UseBranch("Track");
    119   fItTrack = fBranchTrack->MakeIterator();
    120121  // calorimeter towers
    121122  fBranchTower = fTreeReader->UseBranch("Tower");
    122   fItTower = fBranchTower->MakeIterator();
    123123  // reconstructed photons
    124124  fBranchPhoton = fTreeReader->UseBranch("Photon");
    125   fItPhoton = fBranchPhoton->MakeIterator();
    126125  // reconstructed electrons
    127126  fBranchElectron = fTreeReader->UseBranch("Electron");
    128   fItElectron = fBranchElectron->MakeIterator();
    129127  // reconstructed muons
    130128  fBranchMuon = fTreeReader->UseBranch("Muon");
    131   fItMuon = fBranchMuon->MakeIterator();
    132129  // reconstructed jets
    133130  fBranchJet = fTreeReader->UseBranch("Jet");
    134   fItJet = fBranchJet->MakeIterator();
    135131  // missing transverse energy
    136132  fBranchMissingET = fTreeReader->UseBranch("MissingET");
     133
     134  if(!fBranchEvent || !fBranchTrack || !fBranchTower || !fBranchPhoton ||
     135     !fBranchElectron || !fBranchMuon || !fBranchJet || !fBranchMissingET)
     136  {
     137    throw runtime_error("ROOT file doesn't contain all required branches");
     138  }
     139
     140  fItTrack = fBranchTrack->MakeIterator();
     141  fItTower = fBranchTower->MakeIterator();
     142  fItPhoton = fBranchPhoton->MakeIterator();
     143  fItElectron = fBranchElectron->MakeIterator();
     144  fItMuon = fBranchMuon->MakeIterator();
     145  fItJet = fBranchJet->MakeIterator();
    137146}
    138147
Note: See TracChangeset for help on using the changeset viewer.