#include <algorithm>
#include <cstdio>
#include <iostream>
#include <memory>
#include <vector>
#include "TFile.h"
#include "TH1I.h"
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 14 of file makeHIRunIndex.cxx.
14 {
15 if (argc != 2) {
16 std::cout <<
"Syntax: " <<
argv[0] <<
" GoodRunList.xml" << std::endl;
17 return -1;
18 }
19
20
21 FILE *runList =
22 popen(Form("grep '<Metadata Name=\"RunList\">' %s | sed -e 's/<Metadata "
23 "Name=\"RunList\">//' -e 's/<\\/Metadata>//' | sed 's/,/ /g' ",
24 argv[1]),
25 "r");
26
27 if (!runList) {
28 return -1;
29 }
30
32 std::vector<int>
runs;
33 while (fscanf(runList,
"%d", &
run) != EOF) {
35 }
36 pclose(runList);
37
39 unsigned int size =
runs.size();
40
41 std::unique_ptr<TFile>
f(TFile::Open(
"cluster.geo.RUNINDEX.root",
"recreate"));
42 auto h=std::make_unique<TH1I>(
"h1_run_index",
"h1_run_index", size, 0, size);
43 for (
unsigned int i = 0;
i < size;
i++) {
44 h->SetBinContent(i + 1,
runs.at(i));
45 }
47
48 std::cout << "Created output file cluster.geo.RUNINDEX.root" << std::endl;
49 return 0;
50}
Header file for AthHistogramAlgorithm.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.