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