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