CMS 3D CMS Logo

Settings.cc
Go to the documentation of this file.
3 #include <set>
4 #include <cmath>
5 
6 using namespace std;
7 
8 namespace tmtt {
9 
12 
13  Settings::Settings()
14  : //--------------------------------------------------------------------------------------------------
15  // TMTT related configuration parameters, including Kalman Filter.
16  // Meaning of these parameters explained in TrackFindingTMTT/python/TMTrackProducer_Defaults_cfi.py
17  //--------------------------------------------------------------------------------------------------
18 
19  // General cfg params
20  enableDigitize_(false),
21  useApproxB_(true),
22  bApprox_gradient_(0.886454),
23  bApprox_intercept_(0.504148),
24  numPhiNonants_(9),
25  numPhiSectors_(9),
26  chosenRofPhi_(55.), // Hourglass radius in r-phi (tracklet)
27  etaRegions_(
28  {-2.4, -2.08, -1.68, -1.26, -0.90, -0.62, -0.41, -0.20, 0.0, 0.20, 0.41, 0.62, 0.90, 1.26, 1.68, 2.08, 2.4}),
29  chosenRofZ_(50.0), // Hourglass radius in r-z (this must be tmtt)
30  houghMinPt_(2.0), // L1 track pt cut
31  minStubLayers_(4),
32  minPtToReduceLayers_(99999.),
33  reduceLayerID_(true),
34  minFracMatchStubsOnReco_(-99),
35  minFracMatchStubsOnTP_(-99),
36  minNumMatchLayers_(4),
37  minNumMatchPSLayers_(0),
38  stubMatchStrict_(false),
39 
40  // Kalman filter track fit cfg
41  kalmanDebugLevel_(0),
42  //kalmanDebugLevel_(2), // Good for debugging
43  kalmanMinNumStubs_(4),
44  kalmanMaxNumStubs_(6),
45  kalmanRemove2PScut_(true),
46  kalmanMaxSkipLayersHard_(1), // On "hard" input tracks
47  kalmanMaxSkipLayersEasy_(2), // On "easy" input tracks
48  kalmanMaxStubsEasy_(10), // Max. #stubs an input track can have to be defined "easy"
49  kfUseMaybeLayers_(true),
50  kfLayerVsPtToler_({999., 999., 0.1, 0.1, 0.05, 0.05, 0.05}),
51  kfLayerVsD0Cut5_({999., 999., 999., 10., 10., 10., 10.}),
52  kfLayerVsZ0Cut5_({999., 999., 25.5, 25.5, 25.5, 25.5, 25.5}),
53  kfLayerVsZ0Cut4_({999., 999., 15., 15., 15., 15., 15.}),
54  kfLayerVsChiSq5_({999., 999., 10., 30., 80., 120., 160.}),
55  kfLayerVsChiSq4_({999., 999., 10., 30., 80., 120., 160.}),
56  kalmanMaxStubsPerLayer_(4), // To save resources, consider at most this many stubs per layer per track.
57  kalmanMultiScattTerm_(0.00075),
58  kalmanChi2RphiScale_(8),
59  kalmanHOtilted_(true),
60  kalmanHOhelixExp_(true),
61  kalmanHOalpha_(1),
62  kalmanHOprojZcorr_(1),
63  kalmanHOfw_(false) {
64  hybrid_ = true;
65  magneticField_ = 0.; // Value set later
66  killScenario_ = 0; // Emulation of dead modules
67 
68  if (hybrid_) {
69  if (not useApproxB_) {
70  throw cms::Exception("BadConfig")
71  << "TMTT Settings Error: module tilt angle unknown, so must set useApproxB = true";
72  }
73  }
74  }
75 
78 
80  :
81 
82  // See either Analyze_Defaults_cfi.py or Settings.h for description of these parameters.
83 
84  //=== Tags for Input ES & ED data.
85  magneticFieldInputTag_(iConfig.getParameter<edm::ESInputTag>("magneticFieldInputTag")),
86  trackerGeometryInputTag_(iConfig.getParameter<edm::ESInputTag>("trackerGeometryInputTag")),
87  trackerTopologyInputTag_(iConfig.getParameter<edm::ESInputTag>("trackerTopologyInputTag")),
88  ttStubAlgoInputTag_(iConfig.getParameter<edm::ESInputTag>("ttStubAlgoInputTag")),
89 
90  stubInputTag_(iConfig.getParameter<edm::InputTag>("stubInputTag")),
91  tpInputTag_(iConfig.getParameter<edm::InputTag>("tpInputTag")),
92  stubTruthInputTag_(iConfig.getParameter<edm::InputTag>("stubTruthInputTag")),
93  clusterTruthInputTag_(iConfig.getParameter<edm::InputTag>("clusterTruthInputTag")),
94  genJetInputTag_(iConfig.getParameter<edm::InputTag>("genJetInputTag")),
95 
96  //=== Parameter sets for differents types of configuration parameter.
97  genCuts_(iConfig.getParameter<edm::ParameterSet>("GenCuts")),
98  stubCuts_(iConfig.getParameter<edm::ParameterSet>("StubCuts")),
99  stubDigitize_(iConfig.getParameter<edm::ParameterSet>("StubDigitize")),
100  trackerModuleType_(iConfig.getParameter<edm::ParameterSet>("TrackerModuleType")),
101  geometricProc_(iConfig.getParameter<edm::ParameterSet>("GeometricProc")),
102  phiSectors_(iConfig.getParameter<edm::ParameterSet>("PhiSectors")),
103  etaSectors_(iConfig.getParameter<edm::ParameterSet>("EtaSectors")),
104  htArraySpecRphi_(iConfig.getParameter<edm::ParameterSet>("HTArraySpecRphi")),
105  htFillingRphi_(iConfig.getParameter<edm::ParameterSet>("HTFillingRphi")),
106  rzFilterOpts_(iConfig.getParameter<edm::ParameterSet>("RZfilterOpts")),
107  l1TrackDef_(iConfig.getParameter<edm::ParameterSet>("L1TrackDef")),
108  dupTrkRemoval_(iConfig.getParameter<edm::ParameterSet>("DupTrkRemoval")),
109  trackMatchDef_(iConfig.getParameter<edm::ParameterSet>("TrackMatchDef")),
110  trackFitSettings_(iConfig.getParameter<edm::ParameterSet>("TrackFitSettings")),
111  deadModuleOpts_(iConfig.getParameter<edm::ParameterSet>("DeadModuleOpts")),
112  trackDigi_(iConfig.getParameter<edm::ParameterSet>("TrackDigi")),
113 
114  //=== General settings
115 
116  enableMCtruth_(iConfig.getParameter<bool>("EnableMCtruth")),
117  enableHistos_(iConfig.getParameter<bool>("EnableHistos")),
118  enableOutputIntermediateTTTracks_(iConfig.getParameter<bool>("EnableOutputIntermediateTTTracks")),
119 
120  //=== Cuts on MC truth tracks used for tracking efficiency measurements.
121 
122  genMinPt_(genCuts_.getParameter<double>("GenMinPt")),
123  genMaxAbsEta_(genCuts_.getParameter<double>("GenMaxAbsEta")),
124  genMaxVertR_(genCuts_.getParameter<double>("GenMaxVertR")),
125  genMaxVertZ_(genCuts_.getParameter<double>("GenMaxVertZ")),
126  genMaxD0_(genCuts_.getParameter<double>("GenMaxD0")),
127  genMaxZ0_(genCuts_.getParameter<double>("GenMaxZ0")),
128  genMinStubLayers_(genCuts_.getParameter<unsigned int>("GenMinStubLayers")),
129 
130  //=== Cuts applied to stubs before arriving in L1 track finding board.
131 
132  degradeBendRes_(stubCuts_.getParameter<unsigned int>("DegradeBendRes")),
133  maxStubEta_(stubCuts_.getParameter<double>("MaxStubEta")),
134  killLowPtStubs_(stubCuts_.getParameter<bool>("KillLowPtStubs")),
135  printStubWindows_(stubCuts_.getParameter<bool>("PrintStubWindows")),
136  bendCut_(stubCuts_.getParameter<double>("BendCut")),
137  bendCutExtra_(stubCuts_.getParameter<double>("BendCutExtra")),
138  orderStubsByBend_(stubCuts_.getParameter<bool>("OrderStubsByBend")),
139 
140  //=== Optional stub digitization.
141 
142  enableDigitize_(stubDigitize_.getParameter<bool>("EnableDigitize")),
143 
144  //--- Parameters available in MP board.
145  phiSectorBits_(stubDigitize_.getParameter<unsigned int>("PhiSectorBits")),
146  phiSBits_(stubDigitize_.getParameter<unsigned int>("PhiSBits")),
147  phiSRange_(stubDigitize_.getParameter<double>("PhiSRange")),
148  rtBits_(stubDigitize_.getParameter<unsigned int>("RtBits")),
149  rtRange_(stubDigitize_.getParameter<double>("RtRange")),
150  zBits_(stubDigitize_.getParameter<unsigned int>("ZBits")),
151  zRange_(stubDigitize_.getParameter<double>("ZRange")),
152  //--- Parameters available in GP board (excluding any in common with MP specified above).
153  phiNBits_(stubDigitize_.getParameter<unsigned int>("PhiNBits")),
154  phiNRange_(stubDigitize_.getParameter<double>("PhiNRange")),
155  bendBits_(stubDigitize_.getParameter<unsigned int>("BendBits")),
156 
157  //=== Tracker Module Type for FW.
158  pitchVsType_(trackerModuleType_.getParameter<vector<double>>("PitchVsType")),
159  spaceVsType_(trackerModuleType_.getParameter<vector<double>>("SpaceVsType")),
160  barrelVsTypeTmp_(trackerModuleType_.getParameter<vector<unsigned int>>("BarrelVsType")),
161  psVsTypeTmp_(trackerModuleType_.getParameter<vector<unsigned int>>("PSVsType")),
162  tiltedVsTypeTmp_(trackerModuleType_.getParameter<vector<unsigned int>>("TiltedVsType")),
163 
164  //=== Configuration of Geometric Processor.
165  useApproxB_(geometricProc_.getParameter<bool>("UseApproxB")),
166  bApprox_gradient_(geometricProc_.getParameter<double>("BApprox_gradient")),
167  bApprox_intercept_(geometricProc_.getParameter<double>("BApprox_intercept")),
168 
169  //=== Division of Tracker into phi sectors.
170  numPhiNonants_(phiSectors_.getParameter<unsigned int>("NumPhiNonants")),
171  numPhiSectors_(phiSectors_.getParameter<unsigned int>("NumPhiSectors")),
172  chosenRofPhi_(phiSectors_.getParameter<double>("ChosenRofPhi")),
173  useStubPhi_(phiSectors_.getParameter<bool>("UseStubPhi")),
174  useStubPhiTrk_(phiSectors_.getParameter<bool>("UseStubPhiTrk")),
175  assumedPhiTrkRes_(phiSectors_.getParameter<double>("AssumedPhiTrkRes")),
176  calcPhiTrkRes_(phiSectors_.getParameter<bool>("CalcPhiTrkRes")),
177 
178  //=== Division of Tracker into eta sectors.
179  etaRegions_(etaSectors_.getParameter<vector<double>>("EtaRegions")),
180  chosenRofZ_(etaSectors_.getParameter<double>("ChosenRofZ")),
181  beamWindowZ_(etaSectors_.getParameter<double>("BeamWindowZ")),
182  allowOver2EtaSecs_(etaSectors_.getParameter<bool>("AllowOver2EtaSecs")),
183 
184  //=== r-phi Hough transform array specifications.
185  houghMinPt_(htArraySpecRphi_.getParameter<double>("HoughMinPt")),
186  houghNbinsPt_(htArraySpecRphi_.getParameter<unsigned int>("HoughNbinsPt")),
187  houghNbinsPhi_(htArraySpecRphi_.getParameter<unsigned int>("HoughNbinsPhi")),
188  enableMerge2x2_(htArraySpecRphi_.getParameter<bool>("EnableMerge2x2")),
189  maxPtToMerge2x2_(htArraySpecRphi_.getParameter<double>("MaxPtToMerge2x2")),
190  numSubSecsEta_(htArraySpecRphi_.getParameter<unsigned int>("NumSubSecsEta")),
191  shape_(htArraySpecRphi_.getParameter<unsigned int>("Shape")),
192  miniHTstage_(htArraySpecRphi_.getParameter<bool>("MiniHTstage")),
193  miniHoughNbinsPt_(htArraySpecRphi_.getParameter<unsigned int>("MiniHoughNbinsPt")),
194  miniHoughNbinsPhi_(htArraySpecRphi_.getParameter<unsigned int>("MiniHoughNbinsPhi")),
195  miniHoughMinPt_(htArraySpecRphi_.getParameter<double>("MiniHoughMinPt")),
196  miniHoughDontKill_(htArraySpecRphi_.getParameter<bool>("MiniHoughDontKill")),
197  miniHoughDontKillMinPt_(htArraySpecRphi_.getParameter<double>("MiniHoughDontKillMinPt")),
198  miniHoughLoadBalance_(htArraySpecRphi_.getParameter<unsigned int>("MiniHoughLoadBalance")),
199 
200  //=== Rules governing how stubs are filled into the r-phi Hough Transform array.
201  killSomeHTCellsRphi_(htFillingRphi_.getParameter<unsigned int>("KillSomeHTCellsRphi")),
202  useBendFilter_(htFillingRphi_.getParameter<bool>("UseBendFilter")),
203  maxStubsInCell_(htFillingRphi_.getParameter<unsigned int>("MaxStubsInCell")),
204  maxStubsInCellMiniHough_(htFillingRphi_.getParameter<unsigned int>("MaxStubsInCellMiniHough")),
205  busySectorKill_(htFillingRphi_.getParameter<bool>("BusySectorKill")),
206  busySectorNumStubs_(htFillingRphi_.getParameter<unsigned int>("BusySectorNumStubs")),
207  busySectorMbinRanges_(htFillingRphi_.getParameter<vector<unsigned int>>("BusySectorMbinRanges")),
208  busySectorMbinOrder_(htFillingRphi_.getParameter<vector<unsigned int>>("BusySectorMbinOrder")),
209  busyInputSectorKill_(htFillingRphi_.getParameter<bool>("BusyInputSectorKill")),
210  busyInputSectorNumStubs_(htFillingRphi_.getParameter<unsigned int>("BusyInputSectorNumStubs")),
211  muxOutputsHT_(htFillingRphi_.getParameter<unsigned int>("MuxOutputsHT")),
212  etaRegWhitelist_(htFillingRphi_.getParameter<vector<unsigned int>>("EtaRegWhitelist")),
213 
214  //=== Options controlling r-z track filters (or any other track filters run after the Hough transform, as opposed to inside it).
215 
216  rzFilterName_(rzFilterOpts_.getParameter<string>("RZFilterName")),
217  seedResCut_(rzFilterOpts_.getParameter<double>("SeedResCut")),
218  keepAllSeed_(rzFilterOpts_.getParameter<bool>("KeepAllSeed")),
219  maxSeedCombinations_(rzFilterOpts_.getParameter<unsigned int>("MaxSeedCombinations")),
220  maxGoodSeedCombinations_(rzFilterOpts_.getParameter<unsigned int>("MaxGoodSeedCombinations")),
221  maxSeedsPerStub_(rzFilterOpts_.getParameter<unsigned int>("MaxSeedsPerStub")),
222  zTrkSectorCheck_(rzFilterOpts_.getParameter<bool>("zTrkSectorCheck")),
223  minFilterLayers_(rzFilterOpts_.getParameter<unsigned int>("MinFilterLayers")),
224 
225  //=== Rules for deciding when the track finding has found an L1 track candidate
226 
227  minStubLayers_(l1TrackDef_.getParameter<unsigned int>("MinStubLayers")),
228  minPtToReduceLayers_(l1TrackDef_.getParameter<double>("MinPtToReduceLayers")),
229  etaSecsReduceLayers_(l1TrackDef_.getParameter<vector<unsigned int>>("EtaSecsReduceLayers")),
230  reduceLayerID_(l1TrackDef_.getParameter<bool>("ReducedLayerID")),
231 
232  //=== Specification of algorithm to eliminate duplicate tracks.
233 
234  dupTrkAlgFit_(dupTrkRemoval_.getParameter<unsigned int>("DupTrkAlgFit")),
235 
236  //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle).
237 
238  minFracMatchStubsOnReco_(trackMatchDef_.getParameter<double>("MinFracMatchStubsOnReco")),
239  minFracMatchStubsOnTP_(trackMatchDef_.getParameter<double>("MinFracMatchStubsOnTP")),
240  minNumMatchLayers_(trackMatchDef_.getParameter<unsigned int>("MinNumMatchLayers")),
241  minNumMatchPSLayers_(trackMatchDef_.getParameter<unsigned int>("MinNumMatchPSLayers")),
242  stubMatchStrict_(trackMatchDef_.getParameter<bool>("StubMatchStrict")),
243 
244  //=== Track Fitting Settings
245 
246  trackFitters_(trackFitSettings_.getParameter<vector<std::string>>("TrackFitters")),
247  useRZfilter_(trackFitSettings_.getParameter<vector<std::string>>("UseRZfilter")),
248  detailedFitOutput_(trackFitSettings_.getParameter<bool>("DetailedFitOutput")),
249  trackFitCheat_(trackFitSettings_.getParameter<bool>("TrackFitCheat")),
250  //
251  numTrackFitIterations_(trackFitSettings_.getParameter<unsigned int>("NumTrackFitIterations")),
252  killTrackFitWorstHit_(trackFitSettings_.getParameter<bool>("KillTrackFitWorstHit")),
253  generalResidualCut_(trackFitSettings_.getParameter<double>("GeneralResidualCut")),
254  killingResidualCut_(trackFitSettings_.getParameter<double>("KillingResidualCut")),
255  //
256  digitizeSLR_(trackFitSettings_.getParameter<bool>("DigitizeSLR")),
257  dividerBitsHelix_(trackFitSettings_.getParameter<unsigned int>("DividerBitsHelix")),
258  dividerBitsHelixZ_(trackFitSettings_.getParameter<unsigned int>("DividerBitsHelixZ")),
259  ShiftingBitsDenRPhi_(trackFitSettings_.getParameter<unsigned int>("ShiftingBitsDenRPhi")),
260  ShiftingBitsDenRZ_(trackFitSettings_.getParameter<unsigned int>("ShiftingBitsDenRZ")),
261  ShiftingBitsPt_(trackFitSettings_.getParameter<unsigned int>("ShiftingBitsPt")),
262  ShiftingBitsPhi_(trackFitSettings_.getParameter<unsigned int>("ShiftingBitsPhi")),
263 
264  ShiftingBitsLambda_(trackFitSettings_.getParameter<unsigned int>("ShiftingBitsLambda")),
265  ShiftingBitsZ0_(trackFitSettings_.getParameter<unsigned int>("ShiftingBitsZ0")),
266  slr_chi2cut_(trackFitSettings_.getParameter<double>("SLR_chi2cut")),
267  residualCut_(trackFitSettings_.getParameter<double>("ResidualCut")),
268  //
269  kalmanDebugLevel_(trackFitSettings_.getParameter<unsigned int>("KalmanDebugLevel")),
270  kalmanMinNumStubs_(trackFitSettings_.getParameter<unsigned int>("KalmanMinNumStubs")),
271  kalmanMaxNumStubs_(trackFitSettings_.getParameter<unsigned int>("KalmanMaxNumStubs")),
272  kalmanAddBeamConstr_(trackFitSettings_.getParameter<bool>("KalmanAddBeamConstr")),
273  kalmanRemove2PScut_(trackFitSettings_.getParameter<bool>("KalmanRemove2PScut")),
274  kalmanMaxSkipLayersHard_(trackFitSettings_.getParameter<unsigned>("KalmanMaxSkipLayersHard")),
275  kalmanMaxSkipLayersEasy_(trackFitSettings_.getParameter<unsigned>("KalmanMaxSkipLayersEasy")),
276  kalmanMaxStubsEasy_(trackFitSettings_.getParameter<unsigned>("KalmanMaxStubsEasy")),
277  kfUseMaybeLayers_(trackFitSettings_.getParameter<bool>("KFUseMaybeLayers")),
278 
279  kfLayerVsPtToler_(trackFitSettings_.getParameter<vector<double>>("KFLayerVsPtToler")),
280  kfLayerVsD0Cut5_(trackFitSettings_.getParameter<vector<double>>("KFLayerVsD0Cut5")),
281  kfLayerVsZ0Cut5_(trackFitSettings_.getParameter<vector<double>>("KFLayerVsZ0Cut5")),
282  kfLayerVsZ0Cut4_(trackFitSettings_.getParameter<vector<double>>("KFLayerVsZ0Cut4")),
283  kfLayerVsChiSq5_(trackFitSettings_.getParameter<vector<double>>("KFLayerVsChiSq5")),
284  kfLayerVsChiSq4_(trackFitSettings_.getParameter<vector<double>>("KFLayerVsChiSq4")),
285 
286  kalmanMaxStubsPerLayer_(trackFitSettings_.getParameter<unsigned>("KalmanMaxStubsPerLayer")),
287  kalmanMultiScattTerm_(trackFitSettings_.getParameter<double>("KalmanMultiScattTerm")),
288  kalmanChi2RphiScale_(trackFitSettings_.getParameter<unsigned>("KalmanChi2RphiScale")),
289  kalmanHOtilted_(trackFitSettings_.getParameter<bool>("KalmanHOtilted")),
290  kalmanHOhelixExp_(trackFitSettings_.getParameter<bool>("KalmanHOhelixExp")),
291  kalmanHOalpha_(trackFitSettings_.getParameter<unsigned int>("KalmanHOalpha")),
292  kalmanHOprojZcorr_(trackFitSettings_.getParameter<unsigned int>("KalmanHOprojZcorr")),
293  kalmanHOfw_(trackFitSettings_.getParameter<bool>("KalmanHOfw")),
294 
295  //=== Treatment of dead modules.
296 
297  killScenario_(deadModuleOpts_.getParameter<unsigned int>("KillScenario")),
298  killRecover_(deadModuleOpts_.getParameter<bool>("KillRecover")),
299 
300  //=== Track digitisation configuration for various track fitters
301 
302  slr_skipTrackDigi_(trackDigi_.getParameter<bool>("SLR_skipTrackDigi")),
303  slr_oneOver2rBits_(trackDigi_.getParameter<unsigned int>("SLR_oneOver2rBits")),
304  slr_oneOver2rRange_(trackDigi_.getParameter<double>("SLR_oneOver2rRange")),
305  slr_d0Bits_(trackDigi_.getParameter<unsigned int>("SLR_d0Bits")),
306  slr_d0Range_(trackDigi_.getParameter<double>("SLR_d0Range")),
307  slr_phi0Bits_(trackDigi_.getParameter<unsigned int>("SLR_phi0Bits")),
308  slr_phi0Range_(trackDigi_.getParameter<double>("SLR_phi0Range")),
309  slr_z0Bits_(trackDigi_.getParameter<unsigned int>("SLR_z0Bits")),
310  slr_z0Range_(trackDigi_.getParameter<double>("SLR_z0Range")),
311  slr_tanlambdaBits_(trackDigi_.getParameter<unsigned int>("SLR_tanlambdaBits")),
312  slr_tanlambdaRange_(trackDigi_.getParameter<double>("SLR_tanlambdaRange")),
313  slr_chisquaredBits_(trackDigi_.getParameter<unsigned int>("SLR_chisquaredBits")),
314  slr_chisquaredRange_(trackDigi_.getParameter<double>("SLR_chisquaredRange")),
315  //
316  kf_skipTrackDigi_(trackDigi_.getParameter<bool>("KF_skipTrackDigi")),
317  kf_oneOver2rBits_(trackDigi_.getParameter<unsigned int>("KF_oneOver2rBits")),
318  kf_oneOver2rRange_(trackDigi_.getParameter<double>("KF_oneOver2rRange")),
319  kf_d0Bits_(trackDigi_.getParameter<unsigned int>("KF_d0Bits")),
320  kf_d0Range_(trackDigi_.getParameter<double>("KF_d0Range")),
321  kf_phi0Bits_(trackDigi_.getParameter<unsigned int>("KF_phi0Bits")),
322  kf_phi0Range_(trackDigi_.getParameter<double>("KF_phi0Range")),
323  kf_z0Bits_(trackDigi_.getParameter<unsigned int>("KF_z0Bits")),
324  kf_z0Range_(trackDigi_.getParameter<double>("KF_z0Range")),
325  kf_tanlambdaBits_(trackDigi_.getParameter<unsigned int>("KF_tanlambdaBits")),
326  kf_tanlambdaRange_(trackDigi_.getParameter<double>("KF_tanlambdaRange")),
327  kf_chisquaredBits_(trackDigi_.getParameter<unsigned int>("KF_chisquaredBits")),
328  kf_chisquaredRange_(trackDigi_.getParameter<double>("KF_chisquaredRange")),
329  kf_chisquaredBinEdges_(trackDigi_.getParameter<vector<double>>("KF_chisquaredBinEdges")),
330  //
331  other_skipTrackDigi_(trackDigi_.getParameter<bool>("Other_skipTrackDigi")),
332 
333  // Plot options
334  resPlotOpt_(iConfig.getParameter<bool>("ResPlotOpt")),
335 
336  // Name of output EDM file if any.
337  // N.B. This parameter does not appear inside TMTrackProducer_Defaults_cfi.py . It is created inside
338  // tmtt_tf_analysis_cfg.py .
339  writeOutEdmFile_(iConfig.getUntrackedParameter<bool>("WriteOutEdmFile", true)),
340 
341  // Bfield in Tesla. (Unknown at job initiation. Set to true value for each event
342  magneticField_(0.),
343 
344  // Hybrid tracking
345  hybrid_(iConfig.getParameter<bool>("Hybrid")) {
346  // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-.
347  vector<unsigned int> genPdgIdsUnsigned(genCuts_.getParameter<vector<unsigned int>>("GenPdgIds"));
348  if (genPdgIdsUnsigned.empty()) {
349  genPdgIdsUnsigned = {11, 13, 211, 321, 2212};
350  }
351 
352  // For simplicity, user need not distinguish particles from antiparticles in configuration file.
353  // But here we must store both explicitely in Settings, since TrackingParticleSelector expects them.
354  for (unsigned int i = 0; i < genPdgIdsUnsigned.size(); i++) {
355  genPdgIds_.push_back(genPdgIdsUnsigned[i]);
356  genPdgIds_.push_back(-genPdgIdsUnsigned[i]);
357  }
358 
359  // Clean up list of fitters that require the r-z track filter to be run before them,
360  // by removing those fitters that are not to be run.
361  vector<string> useRZfilterTmp;
362  for (const string& name : useRZfilter_) {
363  if (std::count(trackFitters_.begin(), trackFitters_.end(), name) > 0)
364  useRZfilterTmp.push_back(name);
365  }
366  useRZfilter_ = useRZfilterTmp;
367 
368  // As python cfg doesn't know type "vbool", fix it here.
369  for (unsigned int i = 0; i < barrelVsTypeTmp_.size(); i++) {
370  barrelVsType_.push_back(bool(barrelVsTypeTmp_[i]));
371  psVsType_.push_back(bool(psVsTypeTmp_[i]));
372  tiltedVsType_.push_back(bool(tiltedVsTypeTmp_[i]));
373  }
374 
375  //--- Sanity checks
376 
377  if (!(useStubPhi_ || useStubPhiTrk_))
378  throw cms::Exception("BadConfig")
379  << "Settings: Invalid cfg parameters - You cant set both UseStubPhi & useStubPhiTrk to false.";
380 
382  throw cms::Exception("BadConfig")
383  << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type A.";
385  throw cms::Exception("BadConfig")
386  << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type B.";
388  throw cms::Exception("BadConfig")
389  << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C.";
390 
391  // If reducing number of required layers for high Pt tracks, then above checks must be redone.
392  bool doReduceLayers = (minPtToReduceLayers_ < 10000. || not etaSecsReduceLayers_.empty());
393  if (doReduceLayers && minStubLayers_ > 4) {
395  throw cms::Exception("BadConfig")
396  << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type D.";
398  throw cms::Exception("BadConfig")
399  << "Settings: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type E.";
400  }
401 
402  constexpr float verySmall = 0.1;
403  if (houghMinPt_ < verySmall)
404  throw cms::Exception("BadConfig") << "Settings: Invalid cfg parameters -- HoughMinPt must be positive.";
406 
407  for (const unsigned int& iEtaReg : etaSecsReduceLayers_) {
408  if (iEtaReg >= etaRegions_.size())
409  throw cms::Exception("BadConfig") << "Settings: You specified an eta sector number in EtaSecsReduceLayers "
410  "which exceeds the total number of eta sectors! "
411  << iEtaReg << " " << etaRegions_.size();
412  }
413 
414  // Chains of m bin ranges for output of HT.
415  if (!busySectorMbinOrder_.empty()) {
416  // User has specified an order in which the m bins should be chained together. Check if it makes sense.
417  if (busySectorMbinOrder_.size() != houghNbinsPt_)
418  throw cms::Exception("BadConfig")
419  << "Settings: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains wrong number of "
420  "elements. Unless you are optimising the MUX, suggest you configure it to an empty vector.";
421  set<unsigned int> mOrderCheck;
422  for (const unsigned int& m : busySectorMbinOrder_) {
423  mOrderCheck.insert(m);
424  }
425  if (mOrderCheck.size() != houghNbinsPt_)
426  throw cms::Exception("BadConfig")
427  << "Settings: Invalid cfg parameters - BusySectorMbinOrder used by HT MUX contains duplicate elements.";
428  unsigned int sum_nr = 0;
429  for (unsigned int nr : busySectorMbinRanges_) {
430  sum_nr += nr;
431  }
432  if (sum_nr != houghNbinsPt_)
433  throw cms::Exception("BadConfig")
434  << "Settings: Invalid cfg parameters - Sum of entries in BusySectorMbinRanges is incorrect.";
435  }
436 
437  if (miniHTstage_) {
438  if (enableMerge2x2_)
439  throw cms::Exception("BadConfig")
440  << "Settings: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options.";
441  // Options for 2nd stage mini HT
442  if (shape_ != 0)
443  throw cms::Exception("BadConfig")
444  << "Settings: Invalid cfg parameters - 2nd stage mini HT only allowed for square-shaped cells.";
445  if (miniHoughNbinsPt_ != 2 || miniHoughNbinsPhi_ != 2)
446  throw cms::Exception("BadConfig") << "Settings: 2nd mini HT has so dar only been implemented in C++ for 2x2.";
447  }
448 
449  if (enableMerge2x2_) {
450  if (miniHTstage_)
451  throw cms::Exception("BadConfig")
452  << "Settings: it is not allowed to enable both MiniHTstage & EnableMerge2x2 options.";
453  // Merging of HT cells has not yet been implemented for diamond or hexagonal HT cell shape.
454  if (enableMerge2x2_ && shape_ != 0)
455  throw cms::Exception("BadConfig")
456  << "Settings: Invalid cfg parameters - merging only allowed for square-shaped cells.";
457  }
458 
459  // Check Kalman fit params.
461  throw cms::Exception("BadConfig")
462  << "Settings: Invalid cfg parameters - KalmanMaxNumStubs is less than KalmanMaxNumStubs.";
463  }
464 
465  bool Settings::isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const {
466  bool whitelisted = true;
467 
468  bool const whitelist_enabled = (!etaRegWhitelist_.empty());
469  if (whitelist_enabled) {
470  whitelisted = (std::count(etaRegWhitelist_.begin(), etaRegWhitelist_.end(), iEtaReg) > 0);
471  }
472 
473  return whitelisted;
474  }
475 
476 } // namespace tmtt
tmtt::Settings::genMinStubLayers_
unsigned int genMinStubLayers_
Definition: Settings.h:455
tmtt::Settings::shape_
unsigned int shape_
Definition: Settings.h:516
tmtt::Settings::miniHoughMinPt_
double miniHoughMinPt_
Definition: Settings.h:520
electrons_cff.bool
bool
Definition: electrons_cff.py:366
mps_fire.i
i
Definition: mps_fire.py:428
funct::false
false
Definition: Factorize.h:29
tmtt::Settings::minPtToReduceLayers_
double minPtToReduceLayers_
Definition: Settings.h:551
tmtt::Settings::miniHoughNbinsPt_
unsigned int miniHoughNbinsPt_
Definition: Settings.h:518
ESInputTag
edm
HLT enums.
Definition: AlignableModifier.h:19
tmtt::Settings::etaRegions_
std::vector< double > etaRegions_
Definition: Settings.h:504
tmtt::Settings::useRZfilter_
std::vector< std::string > useRZfilter_
Definition: Settings.h:567
tmtt::Settings::Settings
Settings()
Definition: Settings.cc:13
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
tmtt::Settings::genPdgIds_
std::vector< int > genPdgIds_
Definition: Settings.h:454
tmtt::Settings::miniHoughNbinsPhi_
unsigned int miniHoughNbinsPhi_
Definition: Settings.h:519
tmtt::Settings::miniHTstage_
bool miniHTstage_
Definition: Settings.h:517
tmtt::Settings::genCuts_
edm::ParameterSet genCuts_
Definition: Settings.h:425
tmtt::Settings::psVsType_
std::vector< bool > psVsType_
Definition: Settings.h:483
tmtt::Settings::trackFitters_
std::vector< std::string > trackFitters_
Definition: Settings.h:566
tmtt::Settings::etaSecsReduceLayers_
std::vector< unsigned int > etaSecsReduceLayers_
Definition: Settings.h:552
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
tmtt::Settings::psVsTypeTmp_
std::vector< unsigned int > psVsTypeTmp_
Definition: Settings.h:486
tmtt::Settings::minNumMatchLayers_
unsigned int minNumMatchLayers_
Definition: Settings.h:561
tmtt::Settings::enableMerge2x2_
bool enableMerge2x2_
Definition: Settings.h:513
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
tmtt::Settings::tiltedVsType_
std::vector< bool > tiltedVsType_
Definition: Settings.h:484
funct::true
true
Definition: Factorize.h:173
tmtt::Settings::kalmanMinNumStubs_
unsigned int kalmanMinNumStubs_
Definition: Settings.h:591
tmtt::Settings::houghNbinsPt_
unsigned int houghNbinsPt_
Definition: Settings.h:511
edm::ParameterSet
Definition: ParameterSet.h:47
EgHLTOffHistBins_cfi.nr
nr
Definition: EgHLTOffHistBins_cfi.py:4
ParameterSet
Definition: Functions.h:16
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
tmtt::Settings::houghMinPt_
double houghMinPt_
Definition: Settings.h:510
tmtt::Settings::useStubPhiTrk_
bool useStubPhiTrk_
Definition: Settings.h:499
createfilelist.int
int
Definition: createfilelist.py:10
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
tmtt::Settings::kalmanMaxNumStubs_
unsigned int kalmanMaxNumStubs_
Definition: Settings.h:592
std
Definition: JetResolutionObject.h:76
Settings.h
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
tmtt::Settings::barrelVsType_
std::vector< bool > barrelVsType_
Definition: Settings.h:482
Exception.h
tmtt::Settings::useStubPhi_
bool useStubPhi_
Definition: Settings.h:498
tmtt::Settings::barrelVsTypeTmp_
std::vector< unsigned int > barrelVsTypeTmp_
Definition: Settings.h:485
cms::Exception
Definition: Exception.h:70
tmtt::Settings::etaRegWhitelist_
std::vector< unsigned int > etaRegWhitelist_
Definition: Settings.h:537
tmtt::Settings::minStubLayers_
unsigned int minStubLayers_
Definition: Settings.h:550
tmtt::Settings::busySectorMbinRanges_
std::vector< unsigned int > busySectorMbinRanges_
Definition: Settings.h:532
tmtt::Settings::tiltedVsTypeTmp_
std::vector< unsigned int > tiltedVsTypeTmp_
Definition: Settings.h:487
tmtt
=== This is the base class for the linearised chi-squared track fit algorithms.
Definition: Array2D.h:16
tmtt::Settings::busySectorMbinOrder_
std::vector< unsigned int > busySectorMbinOrder_
Definition: Settings.h:533
tmtt::Settings::isHTRPhiEtaRegWhitelisted
bool isHTRPhiEtaRegWhitelisted(unsigned const iEtaReg) const
Definition: Settings.cc:465