ATLAS Offline Software
Functions
MuonTriggerSFConfGenerator.cxx File Reference
#include <string>
#include <map>
#include <fstream>
#include <set>
#include <TFile.h>
#include <TError.h>
#include <TH2.h>
#include <TKey.h>
Include dependency graph for MuonTriggerSFConfGenerator.cxx:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 17 of file MuonTriggerSFConfGenerator.cxx.

17  {
18 
19  const char* APP_NAME = argv[0];
20 
21  if (argc < 3) {
22  Error(APP_NAME, "No scale factors or configuration file name received!");
23  Error(APP_NAME, " Usage: %s [configuration file name] [scale factors file name]", APP_NAME);
24  return 1;
25  }
26 
27  std::ofstream confFileStream(argv[1], std::ofstream::out);
28 
29  TFile* file = TFile::Open(argv[2]);
30  if (!file) {
31  Error(APP_NAME, " Unable to load scale factors file");
32  return 1;
33  }
34 
35  std::string quality = "Medium"; // HighPt, Tight, Loose, LowPt may also be used here
36  TDirectory* qualityDirectory = file->GetDirectory(quality.c_str());
37  if (!qualityDirectory) {
38  Error("MuonTriggerSFConfGenerator", " Directory for quality %s is missing", quality.c_str());
39  return 1;
40  }
41  TKey* periodKey;
42  TIter nextPeriod(qualityDirectory->GetListOfKeys());
43  while ((periodKey = (TKey*)nextPeriod())) {
44  std::string period = periodKey->GetName();
45  TDirectory* periodDirectory = qualityDirectory->GetDirectory(period.c_str());
46  confFileStream << period << ": ";
47 
48  TKey* triggerKey;
49  TIter nextTrigger(periodDirectory->GetListOfKeys());
50  bool isFirst = true;
51  while ((triggerKey = (TKey*)nextTrigger())) {
52  if (isFirst) isFirst = false;
53  else confFileStream << ", ";
54  std::string trigger = triggerKey->GetName();
55  confFileStream << triggerKey->GetName();
56  }
57  confFileStream << ";\n";
58  }
59  file->Close();
60  delete file;
61  confFileStream.close();
62 
63  return 0;
64 }
python.AtlRunQueryAMI.period
period
Definition: AtlRunQueryAMI.py:225
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
APP_NAME
#define APP_NAME
Definition: BoostedXbbTag.cxx:23
file
TFile * file
Definition: tile_monitor.h:29
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16