ATLAS Offline Software
|
navigates through the directory structure of identically organised root files adding them all together More...
#include <iostream>
#include <vector>
#include <string>
#include <stdio.h>
#include "TKey.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TProfile.h"
#include "TFile.h"
#include "TClass.h"
#include "simpletimer.h"
#include "dataset.h"
#include <cstdlib>
Go to the source code of this file.
Functions | |
template<class T > | |
bool | add (const std::string &hname, TKey *tobj) |
void | search (TDirectory *td=0, const std::string &s="") |
recursive directory search for TH1 and TH2 More... | |
bool | file_exists (const std::string &s) |
void | cost (const std::string &outputfile) |
int | usage (std::ostream &s, int, char **argv) |
int | main (int argc, char **argv) |
Variables | |
std::vector< std::string > | files |
file names and file pointers More... | |
std::vector< TFile * > | fptr |
struct timeval | global_timer |
glabal timer - how long have I taken so far? More... | |
std::string | depth = "" |
tag string for intendation More... | |
int | ir =0 |
counter of the current depth More... | |
navigates through the directory structure of identically organised root files adding them all together
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Definition in file fastadd.cxx.
bool add | ( | const std::string & | hname, |
TKey * | tobj | ||
) |
Definition at line 55 of file fastadd.cxx.
void cost | ( | const std::string & | outputfile | ) |
no point doing anything if there is only 1 input file because there would be nothing to add to it
don't over write esisting files
copy the first file so we add to this copy
don't bother to open the first file - we've copied it to the output and will update the contents
open the output file
recursively look through the directory structure
close the files
don't need to write the histogram again - writing them as we go along
Definition at line 231 of file fastadd.cxx.
bool file_exists | ( | const std::string & | s | ) |
Definition at line 220 of file fastadd.cxx.
int main | ( | int | argc, |
char ** | argv | ||
) |
if output file is not defined
check som input files
Definition at line 324 of file fastadd.cxx.
void search | ( | TDirectory * | td = 0 , |
const std::string & | s = "" |
||
) |
recursive directory search for TH1 and TH2
don;t go more than 10 directories deep
Definition at line 126 of file fastadd.cxx.
int usage | ( | std::ostream & | s, |
int | , | ||
char ** | argv | ||
) |
std::string depth = "" |
tag string for intendation
Definition at line 46 of file fastadd.cxx.
std::vector<std::string> files |
file names and file pointers
Definition at line 37 of file fastadd.cxx.
std::vector<TFile*> fptr |
Definition at line 38 of file fastadd.cxx.
struct timeval global_timer |
glabal timer - how long have I taken so far?
Definition at line 38 of file fastadd.cxx.
int ir =0 |
counter of the current depth
Definition at line 49 of file fastadd.cxx.