All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
concat_cafs.cc
Go to the documentation of this file.
2 using namespace ana;
3 
4 #include <iostream>
5 #include <string>
6 #include <vector>
7 
8 int main(int argc, char** argv)
9 {
10  if(argc < 3){
11  std::cout << "usage: concat_cafs INFILES OUTFILE\n"
12  << " concat_cafs INFILES... OUTFILE\n"
13  << " concat_cafs 'WILDCARD' OUTFILE\n"
14  << " concat_cafs SAMDEF OUTFILE\n"
15  << "Warning: this argument order is different to hadd"
16  << std::endl;
17  exit(1);
18  }
19 
20  std::vector<std::string> infiles;
21  for(int i = 1; i < argc-1; ++i) infiles.push_back(argv[i]);
22  const std::string outfile = argv[argc-1];
23 
24  FileReducer* reducer = 0;
25  if(infiles.size() == 1){
26  // Could be an (escaped) wildcard, or SAM definition
27  reducer = new FileReducer(infiles[0], outfile);
28  }
29  else{
30  reducer = new FileReducer(infiles, outfile);
31  }
32 
33  reducer->SetMetadata("data_tier", "concat_caf");
34  reducer->SetMetadata("file_format", "concat_caf");
35 
36  reducer->Go();
37 
38  delete reducer;
39 
40  std::cout << "Created " << outfile << std::endl;
41 }
void SetMetadata(const std::string &key, const std::string &val)
Override any metadata key in the output file.
Definition: FileReducer.h:45
process_name opflashCryoW ana
virtual void Go() override
Load all the registered spectra.
Definition: FileReducer.cxx:95
Create smaller CAFs.
Definition: FileReducer.h:19
int main(int argc, char **argv)
BEGIN_PROLOG could also be cout