CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  // scattering simulation
85  constexpr float X0 =
86  9.370; // cm, from http://pdg.lbl.gov/2014/AtomicNuclearProperties/HTML/silicon_Si.html // Pb = 0.5612 cm
87  constexpr float xr =
88  0.1; // -assumes radial impact. This is bigger than what we have in main --> shouldn't it be the parameter below??? if radial impact??
89  //const float xr = std::sqrt(Config::beamspotX*Config::beamspotX + Config::beamspotY*Config::beamspotY);
90 
91  // Config for seeding
92  constexpr int nlayers_per_seed_max = 4; // Needed for allocation of arrays on stack.
93  constexpr float chi2seedcut = 9.0;
94  constexpr float lay01angdiff =
95  0.0634888; // analytically derived... depends on geometry of detector --> from mathematica ... d0 set to one sigma of getHypot(bsX,bsY)
96  constexpr float lay02angdiff = 0.11537;
97  constexpr float dEtaSeedTrip =
98  0.06; // for almost max efficiency --> empirically derived... depends on geometry of detector
99  constexpr float dPhiSeedTrip =
100  0.0458712; // numerically+semianalytically derived... depends on geometry of detector
101  // Recalculated in seedTest as it depends on nlayers_per_seed
102  // static const float seed_z2cut= (nlayers_per_seed * fRadialSpacing) / std::tan(2.0f*std::atan(std::exp(-1.0f*dEtaSeedTrip)));
103  constexpr float seed_z0cut = beamspotZ * 3.0f; // 3cm
104  constexpr float seed_z1cut = hitposerrZ * 3.6f; // 3.6 mm --> to match efficiency from chi2cut
105  constexpr float seed_d0cut = 0.5f; // 5mm
106  extern bool cf_seeding;
107 
108  // config for seeding as well... needed bfield
109  constexpr float maxCurvR = (100 * minSimPt) / (Const::sol * Bfield); // in cm
110 
111  // Config for Conformal fitter --> these change depending on inward/outward, which tracks used (MC vs reco), geometry, layers used, track params generated...
112  // parameters for layers 0,4,9
113  constexpr float blowupfit = 10.0;
114  constexpr float ptinverr049 =
115  0.0078; // 0.0075; // errors used for MC only fit, straight from sim tracks, outward with simple geometry
116  constexpr float phierr049 = 0.0017; // 0.0017;
117  constexpr float thetaerr049 = 0.0033; // 0.0031;
118  // parameters for layers 0,1,2 // --> ENDTOEND with "real seeding", fit is outward by definition, with poly geo
119  constexpr float ptinverr012 = 0.12007; // 0.1789; -->old values from only MC seeds
120  constexpr float phierr012 = 1.0; // found empirically 0.00646; // 0.0071
121  constexpr float thetaerr012 = 0.2; // also found empirically 0.01366; // 0.0130;
122 
123  // config on fitting
124  extern bool cf_fitting;
125 
126  extern bool mtvLikeValidation;
127  extern bool mtvRequireSeeds;
128  // Selection of simtracks from CMSSW. Used in Event::clean_cms_simtracks() and MkBuilder::prep_cmsswtracks()
129  extern int cmsSelMinLayers;
130 
131  // config on validation
132  extern int nMinFoundHits;
133  constexpr float minCMSSWMatchChi2[6] = {100, 100, 50, 50, 30, 20};
134  constexpr float minCMSSWMatchdPhi[6] = {0.2, 0.2, 0.1, 0.05, 0.01, 0.005};
135  extern bool quality_val;
136  extern bool sim_val_for_cmssw;
137  extern bool sim_val;
138  extern bool cmssw_val;
139  extern bool fit_val;
140  extern bool readSimTrackStates; // need this to fill pulls
141  extern bool inclusiveShorts;
142  extern bool keepHitInfo;
143  extern bool tryToSaveSimInfo;
144  extern matchOpts cmsswMatchingFW;
145  extern matchOpts cmsswMatchingBK;
146 
147  // config on dead modules
148  extern bool useDeadModules;
149 
150  // number of layer1 hits for finding seeds per task
151  extern int numHitsPerTask;
152 
153  // seed options
154  extern seedOpts seedInput;
155  extern cleanOpts seedCleaning;
156  extern bool readCmsswTracks;
157 
158  extern bool dumpForPlots;
159 
160  extern bool kludgeCmsHitErrors;
161  extern bool backwardFit;
162  extern bool backwardSearch;
163 
164  extern int numThreadsSimulation;
165  extern int finderReportBestOutOfN;
166 
167  extern bool includePCA;
168 
169  // ================================================================
170 
171  extern bool silent;
172  extern bool json_verbose;
173  extern bool json_dump_before;
174  extern bool json_dump_after;
175  extern std::vector<std::string> json_patch_filenames;
176  extern std::vector<std::string> json_load_filenames;
179 
180  // ================================================================
181 
183 
184  } // end namespace Config
185 
186 } // end namespace mkfit
187 
188 #endif
tuple base
Main Program
Definition: newFWLiteAna.py:92
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
int ii
Definition: cuy.py:589
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
constexpr float X0
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:42
constexpr float varR
constexpr float minDEta
constexpr float minSimEta
constexpr float Bfield
Definition: Config.h:88
TrackerInfo TrkInfo
constexpr float ptinverr049
constexpr float beamspotX
constexpr float hitposerrR
constexpr int FileVersion
IterationsInfo ItrInfo
constexpr float chi2seedcut
constexpr float hitposerrZ
constexpr float thetaerr012
constexpr float beamspotY
constexpr float maxSimEta
constexpr float sol
Definition: Config.h:48
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
constexpr float phierr049
constexpr float xr
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
tuple Config
Definition: helper.py:10