CMS 3D CMS Logo

ConfigStandalone.cc
Go to the documentation of this file.
4 
5 // For plugin loader
6 #include <dlfcn.h>
7 #include <sys/stat.h>
8 #include <cstdlib>
9 
10 namespace mkfit {
11 
12  namespace Config {
13 
16 
17  std::string geomPlugin = "CylCowWLids";
18 
19  int nTracks = 10000;
20  int nEvents = 20;
21  int nItersCMSSW = 0;
22  bool loopOverFile = false;
23 
26 
27  bool readCmsswTracks = false;
28 
29  bool dumpForPlots = false;
30 
31  bool cf_seeding = false;
32  bool cf_fitting = false;
33 
34  bool quality_val = false;
35  bool sim_val_for_cmssw = false;
36  bool sim_val = false;
37  bool cmssw_val = false;
38  bool fit_val = false;
39  bool readSimTrackStates = false;
40  bool inclusiveShorts = false;
41  bool keepHitInfo = false;
42  bool tryToSaveSimInfo = false;
45 
46  bool useDeadModules = false;
47 
48  // number of hits per task for finding seeds
49  int numHitsPerTask = 32;
50 
51  bool mtvLikeValidation = false;
52  bool mtvRequireSeeds = false;
53  int cmsSelMinLayers = 12;
54  int nMinFoundHits = 10;
55 
56  bool kludgeCmsHitErrors = false;
57  bool backwardFit = false;
58  bool backwardSearch = true;
59 
61 
63 
64  bool includePCA = false;
65 
66  // ================================================================
67 
68  bool silent = false;
69  bool json_verbose = false;
70  bool json_dump_before = false;
71  bool json_dump_after = false;
72  std::vector<std::string> json_patch_filenames;
73  std::vector<std::string> json_load_filenames;
76 
77  // ================================================================
78 
80 
81  } // namespace Config
82 
83  //==============================================================================
84  // Geometry / Configuration Plugin Loader
85  //==============================================================================
86 
87  namespace {
88  const char *search_path[] = {"", "../Geoms/", "Geoms/", "../", nullptr};
89  typedef void (*TrackerInfoCreator_foo)(TrackerInfo &, IterationsInfo &, bool verbose);
90  } // namespace
91 
93  const std::string soname = base + ".so";
94  const std::string binname = base + ".bin";
95  struct stat st;
96 
97  int si = 0;
98  while (search_path[si]) {
100  const char *envpath = std::getenv("MKFIT_BASE");
101  if (envpath != nullptr) {
102  path += envpath;
103  path += "/";
104  }
105  path += search_path[si];
106  std::string sopath = path + soname;
107  if (stat(sopath.c_str(), &st) == 0) {
108  printf("execTrackerInfoCreatorPlugin processing '%s'\n", sopath.c_str());
109 
110  void *h = dlopen(sopath.c_str(), RTLD_LAZY);
111  if (!h) {
112  perror("dlopen failed");
113  exit(2);
114  }
115 
116  long long *p2f = (long long *)dlsym(h, "TrackerInfoCreator_ptr");
117  if (!p2f) {
118  perror("dlsym failed");
119  exit(2);
120  }
121 
122  std::string binpath = path + binname;
123  int binsr = stat(binpath.c_str(), &st);
124  printf("execTrackerInfoCreatorPlugin has%s found TrackerInfo binary file '%s'\n",
125  binsr ? " NOT" : "",
126  binpath.c_str());
127  if (binsr == 0)
128  ti.read_bin_file(binpath);
129 
130  TrackerInfoCreator_foo foo = (TrackerInfoCreator_foo)(*p2f);
131  foo(ti, ii, verbose);
132 
133  return;
134  }
135 
136  ++si;
137  }
138 
139  fprintf(stderr, "TrackerInfo plugin '%s' not found in search path.\n", soname.c_str());
140  exit(2);
141  }
142 
143 } // namespace mkfit
void read_bin_file(const std::string &fname)
Definition: TrackerInfo.cc:202
bool verbose
cleanOpts seedCleaning
std::vector< std::string > json_patch_filenames
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
void execTrackerInfoCreatorPlugin(const std::string &base, TrackerInfo &ti, IterationsInfo &ii, bool verbose)
void recalculateDependentConstants()
matchOpts cmsswMatchingFW
matchOpts cmsswMatchingBK
TrackerInfo TrkInfo
IterationsInfo ItrInfo
ii
Definition: cuy.py:589
bool json_save_iters_include_iter_info_preamble
std::vector< std::string > json_load_filenames
Definition: Config.py:1
std::string json_save_iters_fname_fmt
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::string geomPlugin
def exit(msg="")