#include "CxxUtils/checker_macros.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <unistd.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 20 of file TRTCalib_StrawStatus_merge.cxx.
23 int nfiles =
argc - 2;
24 cout <<
" TRT_StrawStatus_merge. nfiles= " << nfiles << endl;
29 int accumulateHits[32][5482][6];
32 for (
int irun = 0; irun < nfiles; irun++)
35 printf(
"reading file %s \n",
filename.c_str());
43 fscanf(
f,
"%d %d %d %d %d %d %d %d %d\n",
tmp,
tmp + 1,
tmp + 2,
tmp + 3,
tmp + 4,
tmp + 5,
tmp + 6,
tmp + 7,
tmp + 8);
47 printf(
"read %d events from %d files\n",
nevents, nfiles);
52 fprintf(
stderr,
"could not open file %s for writing, EXIT",
argv[1]);
55 printf(
"writing to merged file: %s\n",
argv[1]);
56 for (
int i = 0;
i < 8;
i++)
57 fprintf(
fout,
"%d ", 0);
63 cout <<
" reset status for all straws on side " <<
side * 2 - 1 << endl;
64 for (
int j = 0; j < 32; j++)
65 for (
int k = 0;
k < 5482;
k++)
66 for (
int m = 0;
m < 6;
m++)
67 accumulateHits[j][
k][
m] = 0;
69 for (
int irun = 0; irun < nfiles; irun++)
79 fscanf(
f,
"%d %d %d %d %d %d %d %d %d\n",
tmp,
tmp + 1,
tmp + 2,
tmp + 3,
tmp + 4,
tmp + 5,
tmp + 6,
tmp + 7,
tmp + 8);
81 while (fscanf(
f,
"%d %d %d %d %d %d %d %d %d\n",
tmp,
tmp + 1,
tmp + 2,
tmp + 3,
tmp + 4,
tmp + 5,
tmp + 6,
tmp + 7,
tmp + 8) == 9)
90 for (
int k = 0;
k < 6;
k++)
94 printf(
"read %7d lines from file %s \n",
count,
argv[irun + 2]);
98 for (
int j = 0; j < 32; j++)
99 for (
int k = 0;
k < 5482;
k++)
104 fprintf(
fout,
"%d %d %d",
bec, j,
k);
105 for (
int m = 0;
m < 6;
m++)
106 fprintf(
fout,
" %d", accumulateHits[j][
k][
m]);
112 printf(
"closed merged file: %s\n",
argv[1]);
◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY |