CMS 3D CMS Logo

ConfigStandalone.h
Go to the documentation of this file.
1 #ifndef RecoTracker_MkFitCore_standalone_ConfigStandalone_h
2 #define RecoTracker_MkFitCore_standalone_ConfigStandalone_h
3 
6 
7 #include <string>
8 #include <map>
9 #include <vector>
10 
11 namespace mkfit {
12 
13  class TrackerInfo;
14  class IterationsInfo;
15 
16  void execTrackerInfoCreatorPlugin(const std::string& base, TrackerInfo& ti, IterationsInfo& ii, bool verbose = false);
17 
18  //------------------------------------------------------------------------------
19 
20  // Enum for input seed options
22  typedef std::map<std::string, std::pair<seedOpts, std::string> > seedOptsMap;
23 
24  // Enum for seed cleaning options
26  typedef std::map<std::string, std::pair<cleanOpts, std::string> > cleanOptsMap;
27 
28  // Enum for cmssw matching options
30  typedef std::map<std::string, std::pair<matchOpts, std::string> > matchOptsMap;
31 
32  //------------------------------------------------------------------------------
33 
34  namespace Config {
35 
36  extern TrackerInfo TrkInfo;
37  extern IterationsInfo ItrInfo;
38 
39  extern std::string geomPlugin;
40 
41  // default file version
43 
44  // config on main + mkFit
45  extern int nTracks; //defined in Config.cc by default or when reading events from file
46  extern int nEvents;
47  extern int nItersCMSSW;
48  extern bool loopOverFile;
49  // XXXXMT: nTracks should be thrown out ... SMatrix and Event allocate some arrays on this
50  // which can be wrong for real data or in multi-event environment
51 
52  // the following are only used in SMatrix version
53  constexpr float nSigma = 3.;
54  constexpr float minDPhi = 0.01; // default: 0.; cmssw tests: 0.01;
56  constexpr float minDEta = 0.;
57  constexpr float maxDEta = 1.0;
58 
59  // Configuration for simulation info
60  constexpr int NiterSim = 10; // Can make more steps due to near volume misses.
61  // CMS beam spot width 25um in xy and 5cm in z
62  constexpr float beamspotX = 0.1;
63  constexpr float beamspotY = 0.1;
64  constexpr float beamspotZ = 1.0;
65 
66  // XXMT4K minPt was 0.5. Figure out what is the new limit for 90cm or be
67  // more flexible about finding fewer hits. Or postprocess looper candidates.
68  constexpr float minSimPt = 1;
69  constexpr float maxSimPt = 10.;
70 
71  // XXMT Hardhack -- transition region excluded in Simulation::setupTrackByToyMC()
72  constexpr float minSimEta = -2.4;
73  constexpr float maxSimEta = 2.4;
74  // For testing separate EC-/BRL/EC+; -2.3--1.5 / -0.9-0.9 / 1.5-2.3
75  //constexpr float minSimEta = -0.9;
76  //constexpr float maxSimEta = 0.9;
77 
78  constexpr float hitposerrXY = 0.01; // resolution is 100um in xy --> more realistic scenario is 0.003
79  constexpr float hitposerrZ = 0.1; // resolution is 1mm in z
80  constexpr float hitposerrR = Config::hitposerrXY / 10.0f; // XXMT4K ??? I don't get this ...
84 
85  // Config for seeding
86  constexpr int nlayers_per_seed_max = 4; // Needed for allocation of arrays on stack.
87  constexpr float chi2seedcut = 9.0;
89  0.0634888; // analytically derived... depends on geometry of detector --> from mathematica ... d0 set to one sigma of getHypot(bsX,bsY)
90  constexpr float lay02angdiff = 0.11537;
92  0.06; // for almost max efficiency --> empirically derived... depends on geometry of detector
94  0.0458712; // numerically+semianalytically derived... depends on geometry of detector
95  // Recalculated in seedTest as it depends on nlayers_per_seed
96  // static const float seed_z2cut= (nlayers_per_seed * fRadialSpacing) / std::tan(2.0f*std::atan(std::exp(-1.0f*dEtaSeedTrip)));
97  constexpr float seed_z0cut = beamspotZ * 3.0f; // 3cm
98  constexpr float seed_z1cut = hitposerrZ * 3.6f; // 3.6 mm --> to match efficiency from chi2cut
99  constexpr float seed_d0cut = 0.5f; // 5mm
100  extern bool cf_seeding;
101 
102  // config for seeding as well... needed bfield
103  constexpr float maxCurvR = (100 * minSimPt) / (Const::sol * Bfield); // in cm
104 
105  // Config for Conformal fitter --> these change depending on inward/outward, which tracks used (MC vs reco), geometry, layers used, track params generated...
106  // parameters for layers 0,4,9
107  constexpr float blowupfit = 10.0;
109  0.0078; // 0.0075; // errors used for MC only fit, straight from sim tracks, outward with simple geometry
110  constexpr float phierr049 = 0.0017; // 0.0017;
111  constexpr float thetaerr049 = 0.0033; // 0.0031;
112  // parameters for layers 0,1,2 --> with "real seeding", fit is outward by definition, with poly geo
113  constexpr float ptinverr012 = 0.12007; // 0.1789; -->old values from only MC seeds
114  constexpr float phierr012 = 1.0; // found empirically 0.00646; // 0.0071
115  constexpr float thetaerr012 = 0.2; // also found empirically 0.01366; // 0.0130;
116 
117  // config on fitting
118  extern bool cf_fitting;
119 
120  extern bool mtvLikeValidation;
121  extern bool mtvRequireSeeds;
122  // Selection of simtracks from CMSSW. Used in Event::clean_cms_simtracks() and MkBuilder::prep_cmsswtracks()
123  extern int cmsSelMinLayers;
124 
125  // config on validation
126  extern int nMinFoundHits;
127  constexpr float minCMSSWMatchChi2[6] = {100, 100, 50, 50, 30, 20};
128  constexpr float minCMSSWMatchdPhi[6] = {0.2, 0.2, 0.1, 0.05, 0.01, 0.005};
129  extern bool quality_val;
130  extern bool sim_val_for_cmssw;
131  extern bool sim_val;
132  extern bool cmssw_val;
133  extern bool fit_val;
134  extern bool readSimTrackStates; // need this to fill pulls
135  extern bool inclusiveShorts;
136  extern bool keepHitInfo;
137  extern bool tryToSaveSimInfo;
138  extern matchOpts cmsswMatchingFW;
139  extern matchOpts cmsswMatchingBK;
140 
141  // config on dead modules
142  extern bool useDeadModules;
143 
144  // number of layer1 hits for finding seeds per task
145  extern int numHitsPerTask;
146 
147  // seed options
148  extern seedOpts seedInput;
149  extern cleanOpts seedCleaning;
150  extern bool readCmsswTracks;
151 
152  extern bool dumpForPlots;
153 
154  extern bool kludgeCmsHitErrors;
155  extern bool backwardFit;
156  extern bool backwardSearch;
157 
158  extern int numThreadsSimulation;
159  extern int finderReportBestOutOfN;
160 
161  extern bool includePCA;
162 
163  // ================================================================
164 
165  extern bool silent;
166  extern bool json_verbose;
167  extern bool json_dump_before;
168  extern bool json_dump_after;
169  extern std::vector<std::string> json_patch_filenames;
170  extern std::vector<std::string> json_load_filenames;
173 
174  // ================================================================
175 
177 
178  } // end namespace Config
179 
180  namespace internal {
181  extern std::vector<DeadVec> deadvectors;
182  }
183 
184 } // end namespace mkfit
185 
186 #endif
std::vector< DeadVec > deadvectors
constexpr float dEtaSeedTrip
constexpr float blowupfit
constexpr float minCMSSWMatchdPhi[6]
constexpr float lay02angdiff
constexpr float maxDPhi
constexpr float lay01angdiff
constexpr float hitposerrXY
bool verbose
std::map< std::string, std::pair< seedOpts, std::string > > seedOptsMap
constexpr float dPhiSeedTrip
cleanOpts seedCleaning
constexpr float nSigma
constexpr int nlayers_per_seed_max
std::map< std::string, std::pair< matchOpts, std::string > > matchOptsMap
constexpr float phierr012
constexpr float minDPhi
std::vector< std::string > json_patch_filenames
constexpr float thetaerr049
void execTrackerInfoCreatorPlugin(const std::string &base, TrackerInfo &ti, IterationsInfo &ii, bool verbose)
void recalculateDependentConstants()
matchOpts cmsswMatchingFW
matchOpts cmsswMatchingBK
constexpr float varZ
constexpr float seed_d0cut
constexpr float PI
Definition: Config.h:7
constexpr float varR
constexpr float minDEta
constexpr float minSimEta
constexpr float Bfield
Definition: Config.h:60
TrackerInfo TrkInfo
constexpr float ptinverr049
constexpr float beamspotX
constexpr float hitposerrR
constexpr int FileVersion
IterationsInfo ItrInfo
constexpr float chi2seedcut
constexpr float hitposerrZ
ii
Definition: cuy.py:589
constexpr float thetaerr012
constexpr float beamspotY
constexpr float maxSimEta
constexpr float sol
Definition: Config.h:13
constexpr float minCMSSWMatchChi2[6]
constexpr float seed_z1cut
constexpr float minSimPt
std::map< std::string, std::pair< cleanOpts, std::string > > cleanOptsMap
bool json_save_iters_include_iter_info_preamble
std::vector< std::string > json_load_filenames
constexpr int NiterSim
constexpr float varXY
constexpr float seed_z0cut
Definition: Config.py:1
constexpr float phierr049
constexpr float maxCurvR
constexpr float beamspotZ
std::string json_save_iters_fname_fmt
constexpr float ptinverr012
std::string geomPlugin
constexpr float maxDEta
constexpr float maxSimPt