CMS 3D CMS Logo

Setup.cc
Go to the documentation of this file.
6 
7 #include <cmath>
8 #include <algorithm>
9 #include <vector>
10 #include <set>
11 #include <unordered_map>
12 #include <string>
13 #include <sstream>
14 
15 using namespace std;
16 using namespace edm;
17 
18 namespace tt {
19 
20  Setup::Setup(const ParameterSet& iConfig,
22  const TrackerGeometry& trackerGeometry,
23  const TrackerTopology& trackerTopology,
24  const TrackerDetToDTCELinkCablingMap& cablingMap,
25  const StubAlgorithmOfficial& stubAlgorithm,
26  const ParameterSet& pSetStubAlgorithm,
27  const ParameterSet& pSetGeometryConfiguration,
28  const ParameterSetID& pSetIdTTStubAlgorithm,
29  const ParameterSetID& pSetIdGeometryConfiguration)
30  : magneticField_(&magneticField),
31  trackerGeometry_(&trackerGeometry),
32  trackerTopology_(&trackerTopology),
33  cablingMap_(&cablingMap),
34  stubAlgorithm_(&stubAlgorithm),
35  pSetSA_(&pSetStubAlgorithm),
36  pSetGC_(&pSetGeometryConfiguration),
37  pSetIdTTStubAlgorithm_(pSetIdTTStubAlgorithm),
38  pSetIdGeometryConfiguration_(pSetIdGeometryConfiguration),
39  // DD4hep
40  fromDD4hep_(iConfig.getParameter<bool>("fromDD4hep")),
41  // Parameter to check if configured Tracker Geometry is supported
42  pSetSG_(iConfig.getParameter<ParameterSet>("UnSupportedGeometry")),
43  sgXMLLabel_(pSetSG_.getParameter<string>("XMLLabel")),
44  sgXMLPath_(pSetSG_.getParameter<string>("XMLPath")),
45  sgXMLFile_(pSetSG_.getParameter<string>("XMLFile")),
46  sgXMLVersions_(pSetSG_.getParameter<vector<string>>("XMLVersions")),
47  // Parameter to check if Process History is consistent with process configuration
48  pSetPH_(iConfig.getParameter<ParameterSet>("ProcessHistory")),
49  phGeometryConfiguration_(pSetPH_.getParameter<string>("GeometryConfiguration")),
50  phTTStubAlgorithm_(pSetPH_.getParameter<string>("TTStubAlgorithm")),
51  // Common track finding parameter
52  pSetTF_(iConfig.getParameter<ParameterSet>("TrackFinding")),
53  beamWindowZ_(pSetTF_.getParameter<double>("BeamWindowZ")),
54  matchedLayers_(pSetTF_.getParameter<int>("MatchedLayers")),
55  matchedLayersPS_(pSetTF_.getParameter<int>("MatchedLayersPS")),
56  unMatchedStubs_(pSetTF_.getParameter<int>("UnMatchedStubs")),
57  unMatchedStubsPS_(pSetTF_.getParameter<int>("UnMatchedStubsPS")),
58  scattering_(pSetTF_.getParameter<double>("Scattering")),
59  // TMTT specific parameter
60  pSetTMTT_(iConfig.getParameter<ParameterSet>("TMTT")),
61  minPt_(pSetTMTT_.getParameter<double>("MinPt")),
62  maxEta_(pSetTMTT_.getParameter<double>("MaxEta")),
63  chosenRofPhi_(pSetTMTT_.getParameter<double>("ChosenRofPhi")),
64  numLayers_(pSetTMTT_.getParameter<int>("NumLayers")),
65  tmttWidthR_(pSetTMTT_.getParameter<int>("WidthR")),
66  tmttWidthPhi_(pSetTMTT_.getParameter<int>("WidthPhi")),
67  tmttWidthZ_(pSetTMTT_.getParameter<int>("WidthZ")),
68  // Hybrid specific parameter
69  pSetHybrid_(iConfig.getParameter<ParameterSet>("Hybrid")),
70  hybridMinPtStub_(pSetHybrid_.getParameter<double>("MinPtStub")),
71  hybridMinPtCand_(pSetHybrid_.getParameter<double>("MinPtCand")),
72  hybridMaxEta_(pSetHybrid_.getParameter<double>("MaxEta")),
73  hybridChosenRofPhi_(pSetHybrid_.getParameter<double>("ChosenRofPhi")),
74  hybridNumLayers_(pSetHybrid_.getParameter<int>("NumLayers")),
75  hybridNumRingsPS_(pSetHybrid_.getParameter<vector<int>>("NumRingsPS")),
76  hybridWidthsR_(pSetHybrid_.getParameter<vector<int>>("WidthsR")),
77  hybridWidthsZ_(pSetHybrid_.getParameter<vector<int>>("WidthsZ")),
78  hybridWidthsPhi_(pSetHybrid_.getParameter<vector<int>>("WidthsPhi")),
79  hybridWidthsAlpha_(pSetHybrid_.getParameter<vector<int>>("WidthsAlpha")),
80  hybridWidthsBend_(pSetHybrid_.getParameter<vector<int>>("WidthsBend")),
81  hybridRangesR_(pSetHybrid_.getParameter<vector<double>>("RangesR")),
82  hybridRangesZ_(pSetHybrid_.getParameter<vector<double>>("RangesZ")),
83  hybridRangesAlpha_(pSetHybrid_.getParameter<vector<double>>("RangesAlpha")),
84  hybridLayerRs_(pSetHybrid_.getParameter<vector<double>>("LayerRs")),
85  hybridDiskZs_(pSetHybrid_.getParameter<vector<double>>("DiskZs")),
86  hybridDisk2SRsSet_(pSetHybrid_.getParameter<vector<ParameterSet>>("Disk2SRsSet")),
87  tbInnerRadius_(pSetHybrid_.getParameter<double>("InnerRadius")),
88  tbWidthsR_(pSetHybrid_.getParameter<vector<int>>("WidthsRTB")),
89  // Parameter specifying TrackingParticle used for Efficiency measurements
90  pSetTP_(iConfig.getParameter<ParameterSet>("TrackingParticle")),
91  tpMinPt_(pSetTP_.getParameter<double>("MinPt")),
92  tpMaxEta_(pSetTP_.getParameter<double>("MaxEta")),
93  tpMaxVertR_(pSetTP_.getParameter<double>("MaxVertR")),
94  tpMaxVertZ_(pSetTP_.getParameter<double>("MaxVertZ")),
95  tpMaxD0_(pSetTP_.getParameter<double>("MaxD0")),
96  tpMinLayers_(pSetTP_.getParameter<int>("MinLayers")),
97  tpMinLayersPS_(pSetTP_.getParameter<int>("MinLayersPS")),
98  tpMaxBadStubs2S_(pSetTP_.getParameter<int>("MaxBadStubs2S")),
99  tpMaxBadStubsPS_(pSetTP_.getParameter<int>("MaxBadStubsPS")),
100  // Fimrware specific Parameter
101  pSetFW_(iConfig.getParameter<ParameterSet>("Firmware")),
102  widthDSPa_(pSetFW_.getParameter<int>("WidthDSPa")),
103  widthDSPb_(pSetFW_.getParameter<int>("WidthDSPb")),
104  widthDSPc_(pSetFW_.getParameter<int>("WidthDSPc")),
105  widthAddrBRAM36_(pSetFW_.getParameter<int>("WidthAddrBRAM36")),
106  widthAddrBRAM18_(pSetFW_.getParameter<int>("WidthAddrBRAM18")),
107  numFramesInfra_(pSetFW_.getParameter<int>("NumFramesInfra")),
108  freqLHC_(pSetFW_.getParameter<double>("FreqLHC")),
109  freqBE_(pSetFW_.getParameter<double>("FreqBE")),
110  tmpFE_(pSetFW_.getParameter<int>("TMP_FE")),
111  tmpTFP_(pSetFW_.getParameter<int>("TMP_TFP")),
112  speedOfLight_(pSetFW_.getParameter<double>("SpeedOfLight")),
113  bField_(pSetFW_.getParameter<double>("BField")),
114  bFieldError_(pSetFW_.getParameter<double>("BFieldError")),
115  outerRadius_(pSetFW_.getParameter<double>("OuterRadius")),
116  innerRadius_(pSetFW_.getParameter<double>("InnerRadius")),
117  halfLength_(pSetFW_.getParameter<double>("HalfLength")),
118  tiltApproxSlope_(pSetFW_.getParameter<double>("TiltApproxSlope")),
119  tiltApproxIntercept_(pSetFW_.getParameter<double>("TiltApproxIntercept")),
120  tiltUncertaintyR_(pSetFW_.getParameter<double>("TiltUncertaintyR")),
121  mindPhi_(pSetFW_.getParameter<double>("MindPhi")),
122  maxdPhi_(pSetFW_.getParameter<double>("MaxdPhi")),
123  mindZ_(pSetFW_.getParameter<double>("MindZ")),
124  maxdZ_(pSetFW_.getParameter<double>("MaxdZ")),
125  pitch2S_(pSetFW_.getParameter<double>("Pitch2S")),
126  pitchPS_(pSetFW_.getParameter<double>("PitchPS")),
127  length2S_(pSetFW_.getParameter<double>("Length2S")),
128  lengthPS_(pSetFW_.getParameter<double>("LengthPS")),
129  tiltedLayerLimitsZ_(pSetFW_.getParameter<vector<double>>("TiltedLayerLimitsZ")),
130  psDiskLimitsR_(pSetFW_.getParameter<vector<double>>("PSDiskLimitsR")),
131  // Parmeter specifying front-end
132  pSetFE_(iConfig.getParameter<ParameterSet>("FrontEnd")),
133  widthBend_(pSetFE_.getParameter<int>("WidthBend")),
134  widthCol_(pSetFE_.getParameter<int>("WidthCol")),
135  widthRow_(pSetFE_.getParameter<int>("WidthRow")),
136  baseBend_(pSetFE_.getParameter<double>("BaseBend")),
137  baseCol_(pSetFE_.getParameter<double>("BaseCol")),
138  baseRow_(pSetFE_.getParameter<double>("BaseRow")),
139  baseWindowSize_(pSetFE_.getParameter<double>("BaseWindowSize")),
140  bendCut_(pSetFE_.getParameter<double>("BendCut")),
141  // Parmeter specifying DTC
142  pSetDTC_(iConfig.getParameter<ParameterSet>("DTC")),
143  numRegions_(pSetDTC_.getParameter<int>("NumRegions")),
144  numOverlappingRegions_(pSetDTC_.getParameter<int>("NumOverlappingRegions")),
145  numATCASlots_(pSetDTC_.getParameter<int>("NumATCASlots")),
146  numDTCsPerRegion_(pSetDTC_.getParameter<int>("NumDTCsPerRegion")),
147  numModulesPerDTC_(pSetDTC_.getParameter<int>("NumModulesPerDTC")),
148  dtcNumRoutingBlocks_(pSetDTC_.getParameter<int>("NumRoutingBlocks")),
149  dtcDepthMemory_(pSetDTC_.getParameter<int>("DepthMemory")),
150  dtcWidthRowLUT_(pSetDTC_.getParameter<int>("WidthRowLUT")),
151  dtcWidthInv2R_(pSetDTC_.getParameter<int>("WidthInv2R")),
152  offsetDetIdDSV_(pSetDTC_.getParameter<int>("OffsetDetIdDSV")),
153  offsetDetIdTP_(pSetDTC_.getParameter<int>("OffsetDetIdTP")),
154  offsetLayerDisks_(pSetDTC_.getParameter<int>("OffsetLayerDisks")),
155  offsetLayerId_(pSetDTC_.getParameter<int>("OffsetLayerId")),
156  numBarrelLayer_(pSetDTC_.getParameter<int>("NumBarrelLayer")),
157  slotLimitPS_(pSetDTC_.getParameter<int>("SlotLimitPS")),
158  slotLimit10gbps_(pSetDTC_.getParameter<int>("SlotLimit10gbps")),
159  // Parmeter specifying TFP
160  pSetTFP_(iConfig.getParameter<ParameterSet>("TFP")),
161  tfpWidthPhi0_(pSetTFP_.getParameter<int>("WidthPhi0")),
162  tfpWidthInv2R_(pSetTFP_.getParameter<int>("WidthInv2R")),
163  tfpWidthCot_(pSetTFP_.getParameter<int>("WidthCot")),
164  tfpWidthZ0_(pSetTFP_.getParameter<int>("WidthZ0")),
165  tfpNumChannel_(pSetTFP_.getParameter<int>("NumChannel")),
166  // Parmeter specifying GeometricProcessor
167  pSetGP_(iConfig.getParameter<ParameterSet>("GeometricProcessor")),
168  numSectorsPhi_(pSetGP_.getParameter<int>("NumSectorsPhi")),
169  chosenRofZ_(pSetGP_.getParameter<double>("ChosenRofZ")),
170  neededRangeChiZ_(pSetGP_.getParameter<double>("RangeChiZ")),
171  gpDepthMemory_(pSetGP_.getParameter<int>("DepthMemory")),
172  boundariesEta_(pSetGP_.getParameter<vector<double>>("BoundariesEta")),
173  // Parmeter specifying HoughTransform
174  pSetHT_(iConfig.getParameter<ParameterSet>("HoughTransform")),
175  htNumBinsInv2R_(pSetHT_.getParameter<int>("NumBinsInv2R")),
176  htNumBinsPhiT_(pSetHT_.getParameter<int>("NumBinsPhiT")),
177  htMinLayers_(pSetHT_.getParameter<int>("MinLayers")),
178  htDepthMemory_(pSetHT_.getParameter<int>("DepthMemory")),
179  // Parmeter specifying MiniHoughTransform
180  pSetMHT_(iConfig.getParameter<ParameterSet>("MiniHoughTransform")),
181  mhtNumBinsInv2R_(pSetMHT_.getParameter<int>("NumBinsInv2R")),
182  mhtNumBinsPhiT_(pSetMHT_.getParameter<int>("NumBinsPhiT")),
183  mhtNumDLBs_(pSetMHT_.getParameter<int>("NumDLBs")),
184  mhtNumDLBNodes_(pSetMHT_.getParameter<int>("NumDLBNodes")),
185  mhtNumDLBChannel_(pSetMHT_.getParameter<int>("NumDLBChannel")),
186  mhtMinLayers_(pSetMHT_.getParameter<int>("MinLayers")),
187  // Parmeter specifying ZHoughTransform
188  pSetZHT_(iConfig.getParameter<ParameterSet>("ZHoughTransform")),
189  zhtNumBinsZT_(pSetZHT_.getParameter<int>("NumBinsZT")),
190  zhtNumBinsCot_(pSetZHT_.getParameter<int>("NumBinsCot")),
191  zhtNumStages_(pSetZHT_.getParameter<int>("NumStages")),
192  zhtMinLayers_(pSetZHT_.getParameter<int>("MinLayers")),
193  zhtMaxTracks_(pSetZHT_.getParameter<int>("MaxTracks")),
194  zhtMaxStubsPerLayer_(pSetZHT_.getParameter<int>("MaxStubsPerLayer")),
195  // Parameter specifying KalmanFilter Input Formatter
196  pSetKFin_(iConfig.getParameter<ParameterSet>("KalmanFilterIn")),
197  kfinShiftRangePhi_(pSetKFin_.getParameter<int>("ShiftRangePhi")),
198  kfinShiftRangeZ_(pSetKFin_.getParameter<int>("ShiftRangeZ")),
199  // Parmeter specifying KalmanFilter
200  pSetKF_(iConfig.getParameter<ParameterSet>("KalmanFilter")),
201  kfNumWorker_(pSetKF_.getParameter<int>("NumWorker")),
202  kfMinLayers_(pSetKF_.getParameter<int>("MinLayers")),
203  kfMaxLayers_(pSetKF_.getParameter<int>("MaxLayers")),
204  kfRangeFactor_(pSetKF_.getParameter<double>("RangeFactor")),
205  kfShiftInitialC00_(pSetKF_.getParameter<int>("ShiftInitialC00")),
206  kfShiftInitialC11_(pSetKF_.getParameter<int>("ShiftInitialC11")),
207  kfShiftInitialC22_(pSetKF_.getParameter<int>("ShiftInitialC22")),
208  kfShiftInitialC33_(pSetKF_.getParameter<int>("ShiftInitialC33")),
209  // Parmeter specifying KalmanFilter Output Formatter
210  pSetKFOut_(iConfig.getParameter<ParameterSet>("KalmanFilterOut")),
211  kfoutchi2rphiConv_(pSetKFOut_.getParameter<int>("Chi2rphiConv")),
212  kfoutchi2rzConv_(pSetKFOut_.getParameter<int>("Chi2rzConv")),
213  weightBinFraction_(pSetKFOut_.getParameter<int>("WeightBinFraction")),
214  dzTruncation_(pSetKFOut_.getParameter<int>("DzTruncation")),
215  dphiTruncation_(pSetKFOut_.getParameter<int>("DphiTruncation")),
216  // Parmeter specifying DuplicateRemoval
217  pSetDR_(iConfig.getParameter<ParameterSet>("DuplicateRemoval")),
218  drDepthMemory_(pSetDR_.getParameter<int>("DepthMemory")) {
220  // check if bField is supported
222  // check if geometry is supported
223  checkGeometry();
225  return;
226  // derive constants
228  // convert configuration of TTStubAlgorithm
230  // create all possible encodingsBend
231  encodingsBendPS_.reserve(maxWindowSize_ + 1);
232  encodingsBend2S_.reserve(maxWindowSize_ + 1);
235  // create sensor modules
237  // configure TPSelector
239  }
240 
241  // checks current configuration vs input sample configuration
242  void Setup::checkHistory(const ProcessHistory& processHistory) const {
243  const pset::Registry* psetRegistry = pset::Registry::instance();
244  // check used TTStubAlgorithm in input producer
245  checkHistory(processHistory, psetRegistry, phTTStubAlgorithm_, pSetIdTTStubAlgorithm_);
246  // check used GeometryConfiguration in input producer
248  }
249 
250  // checks consitency between history and current configuration for a specific module
252  const pset::Registry* pr,
253  const string& label,
254  const ParameterSetID& pSetId) const {
255  vector<pair<string, ParameterSet>> pSets;
256  pSets.reserve(ph.size());
257  for (const ProcessConfiguration& pc : ph) {
258  const ParameterSet* pSet = pr->getMapped(pc.parameterSetID());
259  if (pSet && pSet->exists(label))
260  pSets.emplace_back(pc.processName(), pSet->getParameterSet(label));
261  }
262  if (pSets.empty()) {
263  cms::Exception exception("BadConfiguration");
264  exception << label << " not found in process history.";
265  exception.addContext("tt::Setup::checkHistory");
266  throw exception;
267  }
268  auto consistent = [&pSetId](const pair<string, ParameterSet>& p) { return p.second.id() == pSetId; };
269  if (!all_of(pSets.begin(), pSets.end(), consistent)) {
270  const ParameterSet& pSetProcess = getParameterSet(pSetId);
271  cms::Exception exception("BadConfiguration");
272  exception.addContext("tt::Setup::checkHistory");
273  exception << label << " inconsistent with History." << endl;
274  exception << "Current Configuration:" << endl << pSetProcess.dump() << endl;
275  for (const pair<string, ParameterSet>& p : pSets)
276  if (!consistent(p))
277  exception << "Process " << p.first << " Configuration:" << endl << dumpDiff(p.second, pSetProcess) << endl;
278  throw exception;
279  }
280  }
281 
282  // dumps pSetHistory where incosistent lines with pSetProcess are highlighted
283  string Setup::dumpDiff(const ParameterSet& pSetHistory, const ParameterSet& pSetProcess) const {
284  stringstream ssHistory, ssProcess, ss;
285  ssHistory << pSetHistory.dump();
286  ssProcess << pSetProcess.dump();
287  string lineHistory, lineProcess;
288  for (; getline(ssHistory, lineHistory) && getline(ssProcess, lineProcess);)
289  ss << (lineHistory != lineProcess ? "\033[1;31m" : "") << lineHistory << "\033[0m" << endl;
290  return ss.str();
291  }
292 
293  // converts tk layout id into dtc id
294  int Setup::dtcId(int tkLayoutId) const {
296  const int tkId = tkLayoutId - 1;
297  const int side = tkId / (numRegions_ * numATCASlots_);
298  const int region = (tkId % (numRegions_ * numATCASlots_)) / numATCASlots_;
299  const int slot = tkId % numATCASlots_;
301  }
302 
303  // converts dtc id into tk layout id
304  int Setup::tkLayoutId(int dtcId) const {
305  checkDTCId(dtcId);
306  const int slot = dtcId % numATCASlots_;
307  const int region = dtcId / numDTCsPerRegion_;
308  const int side = (dtcId % numDTCsPerRegion_) / numATCASlots_;
309  return (side * numRegions_ + region) * numATCASlots_ + slot + 1;
310  }
311 
312  // converts TFP identifier (region[0-8], channel[0-47]) into dtc id
313  int Setup::dtcId(int tfpRegion, int tfpChannel) const {
314  checkTFPIdentifier(tfpRegion, tfpChannel);
315  const int dtcChannel = numOverlappingRegions_ - (tfpChannel / numDTCsPerRegion_) - 1;
316  const int dtcBoard = tfpChannel % numDTCsPerRegion_;
317  const int dtcRegion = tfpRegion - dtcChannel >= 0 ? tfpRegion - dtcChannel : tfpRegion - dtcChannel + numRegions_;
318  return dtcRegion * numDTCsPerRegion_ + dtcBoard;
319  }
320 
321  // checks if given DTC id is connected to PS or 2S sensormodules
322  bool Setup::psModule(int dtcId) const {
323  checkDTCId(dtcId);
324  // from tklayout: first 3 are 10 gbps PS, next 3 are 5 gbps PS and residual 6 are 5 gbps 2S modules
325  return slot(dtcId) < slotLimitPS_;
326  }
327 
328  // return sensor moduel type
329  SensorModule::Type Setup::type(const TTStubRef& ttStubRef) const {
330  const bool barrel = this->barrel(ttStubRef);
331  const bool psModule = this->psModule(ttStubRef);
333  if (barrel && psModule)
335  if (barrel && !psModule)
337  if (!barrel && psModule)
339  if (!barrel && !psModule)
341  return type;
342  }
343 
344  // checks if given dtcId is connected via 10 gbps link
345  bool Setup::gbps10(int dtcId) const {
346  checkDTCId(dtcId);
347  return slot(dtcId) < slotLimit10gbps_;
348  }
349 
350  // checks if given dtcId is connected to -z (false) or +z (true)
351  bool Setup::side(int dtcId) const {
352  checkDTCId(dtcId);
353  const int side = (dtcId % numDTCsPerRegion_) / numATCASlots_;
354  // from tkLayout: first 12 +z, next 12 -z
355  return side == 0;
356  }
357 
358  // ATCA slot number [0-11] of given dtcId
359  int Setup::slot(int dtcId) const {
360  checkDTCId(dtcId);
361  return dtcId % numATCASlots_;
362  }
363 
364  // sensor module for det id
366  const auto it = detIdToSensorModule_.find(detId);
367  if (it == detIdToSensorModule_.end()) {
368  cms::Exception exception("NullPtr");
369  exception << "Unknown DetId used.";
370  exception.addContext("tt::Setup::sensorModule");
371  throw exception;
372  }
373  return it->second;
374  }
375 
376  // index = encoded bend, value = decoded bend for given window size and module type
377  const vector<double>& Setup::encodingBend(int windowSize, bool psModule) const {
378  const vector<vector<double>>& encodingsBend = psModule ? encodingsBendPS_ : encodingsBend2S_;
379  return encodingsBend.at(windowSize);
380  }
381 
382  // check if bField is supported
384  const double bFieldES = magneticField_->inTesla(GlobalPoint(0., 0., 0.)).z();
385  if (abs(bField_ - bFieldES) > bFieldError_) {
386  configurationSupported_ = false;
387  LogWarning("ConfigurationNotSupported")
388  << "Magnetic Field from EventSetup (" << bFieldES << ") differs more then " << bFieldError_
389  << " from supported value (" << bField_ << "). ";
390  }
391  }
392 
393  // check if geometry is supported
395  //FIX ME: Can we assume that geometry used in dd4hep wf supports L1Track?
396  if (!fromDD4hep_) {
397  const vector<string>& geomXMLFiles = pSetGC_->getParameter<vector<string>>(sgXMLLabel_);
398  string version;
399  for (const string& geomXMLFile : geomXMLFiles) {
400  const auto begin = geomXMLFile.find(sgXMLPath_) + sgXMLPath_.size();
401  const auto end = geomXMLFile.find(sgXMLFile_);
402  if (begin != string::npos && end != string::npos)
403  version = geomXMLFile.substr(begin, end - begin - 1);
404  }
405  if (version.empty()) {
406  cms::Exception exception("LogicError");
407  exception << "No " << sgXMLPath_ << "*/" << sgXMLFile_ << " found in GeometryConfiguration";
408  exception.addContext("tt::Setup::checkGeometry");
409  throw exception;
410  }
411  if (find(sgXMLVersions_.begin(), sgXMLVersions_.end(), version) != sgXMLVersions_.end()) {
412  configurationSupported_ = false;
413  LogWarning("ConfigurationNotSupported")
414  << "Geometry Configuration " << sgXMLPath_ << version << "/" << sgXMLFile_ << " is not supported. ";
415  }
416  }
417  }
418 
419  // convert configuration of TTStubAlgorithm
421  numTiltedLayerRings_ = pSetSA_->getParameter<vector<double>>("NTiltedRings");
422  windowSizeBarrelLayers_ = pSetSA_->getParameter<vector<double>>("BarrelCut");
423  const auto& pSetsTiltedLayer = pSetSA_->getParameter<vector<ParameterSet>>("TiltedBarrelCutSet");
424  const auto& pSetsEncapDisks = pSetSA_->getParameter<vector<ParameterSet>>("EndcapCutSet");
425  windowSizeTiltedLayerRings_.reserve(pSetsTiltedLayer.size());
426  for (const auto& pSet : pSetsTiltedLayer)
427  windowSizeTiltedLayerRings_.emplace_back(pSet.getParameter<vector<double>>("TiltedCut"));
428  windowSizeEndcapDisksRings_.reserve(pSetsEncapDisks.size());
429  for (const auto& pSet : pSetsEncapDisks)
430  windowSizeEndcapDisksRings_.emplace_back(pSet.getParameter<vector<double>>("EndcapCut"));
431  maxWindowSize_ = -1;
433  for (const auto& windows : windowss)
434  for (const auto& window : windows)
436  }
437 
438  // create bend encodings
439  void Setup::encodeBend(vector<vector<double>>& encodings, bool ps) const {
440  for (int window = 0; window < maxWindowSize_ + 1; window++) {
441  set<double> encoding;
442  for (int bend = 0; bend < window + 1; bend++)
443  encoding.insert(stubAlgorithm_->degradeBend(ps, window, bend));
444  encodings.emplace_back(encoding.begin(), encoding.end());
445  }
446  }
447 
448  // create sensor modules
450  sensorModules_.reserve(numModules_);
451  dtcModules_ = vector<vector<SensorModule*>>(numDTCs_);
452  for (vector<SensorModule*>& dtcModules : dtcModules_)
453  dtcModules.reserve(numModulesPerDTC_);
454  enum SubDetId { pixelBarrel = 1, pixelDisks = 2 };
455  // loop over all tracker modules
456  for (const DetId& detId : trackerGeometry_->detIds()) {
457  // skip pixel detector
458  if (detId.subdetId() == pixelBarrel || detId.subdetId() == pixelDisks)
459  continue;
460  // skip multiple detIds per module
462  continue;
463  // lowerDetId - 1 = tk layout det id
464  const DetId detIdTkLayout = detId + offsetDetIdTP_;
465  // tk layout dtc id, lowerDetId - 1 = tk lyout det id
466  const int tklId = cablingMap_->detIdToDTCELinkId(detIdTkLayout).first->second.dtc_id();
467  // track trigger dtc id [0-215]
468  const int dtcId = Setup::dtcId(tklId);
469  // collection of so far connected modules to this dtc
470  vector<SensorModule*>& dtcModules = dtcModules_[dtcId];
471  // construct sendor module
472  sensorModules_.emplace_back(this, detId, dtcId, dtcModules.size());
474  // store connection between detId and sensor module
476  // store connection between dtcId and sensor module
477  dtcModules.push_back(sensorModule);
478  }
479  for (vector<SensorModule*>& dtcModules : dtcModules_) {
480  dtcModules.shrink_to_fit();
481  // check configuration
482  if ((int)dtcModules.size() > numModulesPerDTC_) {
483  cms::Exception exception("overflow");
484  exception << "Cabling map connects more than " << numModulesPerDTC_ << " modules to a DTC.";
485  exception.addContext("tt::Setup::Setup");
486  throw exception;
487  }
488  }
489  }
490 
491  // configure TPSelector
493  // configure TrackingParticleSelector
494  const double ptMin = tpMinPt_;
495  constexpr double ptMax = 9.e9;
496  const double etaMax = tpMaxEta_;
497  const double tip = tpMaxVertR_;
498  const double lip = tpMaxVertZ_;
499  constexpr int minHit = 0;
500  constexpr bool signalOnly = true;
501  constexpr bool intimeOnly = true;
502  constexpr bool chargedOnly = true;
503  constexpr bool stableOnly = false;
507  TrackingParticleSelector(ptMin, ptMax, -etaMax, etaMax, tip, lip, minHit, false, false, false, stableOnly);
508  }
509 
510  // stub layer id (barrel: 1 - 6, endcap: 11 - 15)
511  int Setup::layerId(const TTStubRef& ttStubRef) const {
512  const DetId& detId = ttStubRef->getDetId();
513  return detId.subdetId() == StripSubdetector::TOB ? trackerTopology_->layer(detId)
515  }
516 
517  // return tracklet layerId (barrel: [0-5], endcap: [6-10]) for given TTStubRef
518  int Setup::trackletLayerId(const TTStubRef& ttStubRef) const {
519  return this->layerId(ttStubRef) - (this->barrel(ttStubRef) ? offsetLayerId_ : numBarrelLayer_ - offsetLayerId_);
520  }
521 
522  // return index layerId (barrel: [0-5], endcap: [0-6]) for given TTStubRef
523  int Setup::indexLayerId(const TTStubRef& ttStubRef) const {
524  return this->layerId(ttStubRef) - (this->barrel(ttStubRef) ? offsetLayerId_ : offsetLayerId_ + offsetLayerDisks_);
525  }
526 
527  // true if stub from barrel module
528  bool Setup::barrel(const TTStubRef& ttStubRef) const {
529  const DetId& detId = ttStubRef->getDetId();
530  return detId.subdetId() == StripSubdetector::TOB;
531  }
532 
533  // true if stub from barrel module
534  bool Setup::psModule(const TTStubRef& ttStubRef) const {
535  const DetId& detId = ttStubRef->getDetId();
537  }
538 
539  //
540  TTBV Setup::layerMap(const vector<int>& ints) const {
541  TTBV ttBV;
542  for (int layer = numLayers_ - 1; layer >= 0; layer--) {
543  const int i = ints[layer];
544  ttBV += TTBV(i, kfWidthLayerCount_);
545  }
546  return ttBV;
547  }
548 
549  //
550  TTBV Setup::layerMap(const TTBV& hitPattern, const vector<int>& ints) const {
551  TTBV ttBV;
552  for (int layer = numLayers_ - 1; layer >= 0; layer--) {
553  const int i = ints[layer];
554  ttBV += TTBV((hitPattern[layer] ? i - 1 : 0), kfWidthLayerCount_);
555  }
556  return ttBV;
557  }
558 
559  //
560  vector<int> Setup::layerMap(const TTBV& hitPattern, const TTBV& ttBV) const {
561  TTBV bv(ttBV);
562  vector<int> ints(numLayers_, 0);
563  for (int layer = 0; layer < numLayers_; layer++) {
564  const int i = bv.extract(kfWidthLayerCount_);
565  ints[layer] = i + (hitPattern[layer] ? 1 : 0);
566  }
567  return ints;
568  }
569 
570  //
571  vector<int> Setup::layerMap(const TTBV& ttBV) const {
572  TTBV bv(ttBV);
573  vector<int> ints(numLayers_, 0);
574  for (int layer = 0; layer < numLayers_; layer++)
575  ints[layer] = bv.extract(kfWidthLayerCount_);
576  return ints;
577  }
578 
579  // stub projected phi uncertainty
580  double Setup::dPhi(const TTStubRef& ttStubRef, double inv2R) const {
581  const DetId& detId = ttStubRef->getDetId();
583  const double r = stubPos(ttStubRef).perp();
584  const double sigma = sm->pitchRow() / r;
585  const double scat = scattering_ * abs(inv2R);
586  const double extra = sm->barrel() ? 0. : sm->pitchCol() * abs(inv2R);
587  const double digi = tmttBasePhi_;
588  const double dPhi = sigma + scat + extra + digi;
589  if (dPhi >= maxdPhi_ || dPhi < mindPhi_) {
590  cms::Exception exception("out_of_range");
591  exception.addContext("tt::Setup::dPhi");
592  exception << "Stub phi uncertainty " << dPhi << " "
593  << "is out of range " << mindPhi_ << " to " << maxdPhi_ << ".";
594  throw exception;
595  }
596  return dPhi;
597  }
598 
599  // stub projected z uncertainty
600  double Setup::dZ(const TTStubRef& ttStubRef, double cot) const {
601  const DetId& detId = ttStubRef->getDetId();
603  const double sigma = sm->pitchCol() * sm->tiltCorrection(cot);
604  const double digi = tmttBaseZ_;
605  const double dZ = sigma + digi;
606  if (dZ >= maxdZ_ || dZ < mindZ_) {
607  cms::Exception exception("out_of_range");
608  exception.addContext("tt::Setup::dZ");
609  exception << "Stub z uncertainty " << dZ << " "
610  << "is out of range " << mindZ_ << " to " << maxdZ_ << ".";
611  throw exception;
612  }
613  return dZ;
614  }
615 
616  // stub projected chi2phi wheight
617  double Setup::v0(const TTStubRef& ttStubRef, double inv2R) const {
618  const DetId& detId = ttStubRef->getDetId();
620  const double r = stubPos(ttStubRef).perp();
621  const double sigma = pow(sm->pitchRow() / r, 2) / 12.;
622  const double scat = pow(scattering_ * inv2R, 2);
623  const double extra = sm->barrel() ? 0. : pow(sm->pitchCol() * inv2R, 2);
624  const double digi = pow(tmttBasePhi_ / 12., 2);
625  return sigma + scat + extra + digi;
626  }
627 
628  // stub projected chi2z wheight
629  double Setup::v1(const TTStubRef& ttStubRef, double cot) const {
630  const DetId& detId = ttStubRef->getDetId();
632  const double sigma = pow(sm->pitchCol() * sm->tiltCorrection(cot), 2) / 12.;
633  const double digi = pow(tmttBaseZ_ / 12., 2);
634  return sigma + digi;
635  }
636 
637  // checks if stub collection is considered forming a reconstructable track
638  bool Setup::reconstructable(const vector<TTStubRef>& ttStubRefs) const {
639  set<int> hitPattern;
640  for (const TTStubRef& ttStubRef : ttStubRefs)
641  hitPattern.insert(layerId(ttStubRef));
642  return (int)hitPattern.size() >= tpMinLayers_;
643  }
644 
645  // checks if tracking particle is selected for efficiency measurements
647  const bool selected = tpSelector_(tp);
648  const double cot = sinh(tp.eta());
649  const double s = sin(tp.phi());
650  const double c = cos(tp.phi());
651  const TrackingParticle::Point& v = tp.vertex();
652  const double z0 = v.z() - (v.x() * c + v.y() * s) * cot;
653  const double d0 = v.x() * s - v.y() * c;
654  return selected && (abs(d0) < tpMaxD0_) && (abs(z0) < tpMaxVertZ_);
655  }
656 
657  // derive constants
659  // emp
660  const int numFramesPerBX = freqBE_ / freqLHC_;
661  numFrames_ = numFramesPerBX * tmpTFP_ - 1;
662  numFramesIO_ = numFramesPerBX * tmpTFP_ - numFramesInfra_;
663  numFramesFE_ = numFramesPerBX * tmpFE_ - numFramesInfra_;
664  // dsp
665  widthDSPab_ = widthDSPa_ - 1;
666  widthDSPau_ = widthDSPab_ - 1;
667  widthDSPbb_ = widthDSPb_ - 1;
668  widthDSPbu_ = widthDSPbb_ - 1;
669  widthDSPcb_ = widthDSPc_ - 1;
670  widthDSPcu_ = widthDSPcb_ - 1;
671  // firmware
674  // common track finding
675  invPtToDphi_ = speedOfLight_ * bField_ / 2000.;
676  baseRegion_ = 2. * M_PI / numRegions_;
677  // gp
679  maxCot_ = sinh(maxEta_);
681  numSectorsEta_ = boundariesEta_.size() - 1;
683  sectorCots_.reserve(numSectorsEta_);
684  for (int eta = 0; eta < numSectorsEta_; eta++)
685  sectorCots_.emplace_back((sinh(boundariesEta_.at(eta)) + sinh(boundariesEta_.at(eta + 1))) / 2.);
686  // tmtt
687  const double rangeInv2R = 2. * invPtToDphi_ / minPt_;
688  tmttBaseInv2R_ = rangeInv2R / htNumBinsInv2R_;
690  const double baseRgen = tmttBasePhiT_ / tmttBaseInv2R_;
691  const double rangeR = 2. * max(abs(outerRadius_ - chosenRofPhi_), abs(innerRadius_ - chosenRofPhi_));
692  const int baseShiftR = ceil(log2(rangeR / baseRgen / pow(2., tmttWidthR_)));
693  tmttBaseR_ = baseRgen * pow(2., baseShiftR);
694  const double rangeZ = 2. * halfLength_;
695  const int baseShiftZ = ceil(log2(rangeZ / tmttBaseR_ / pow(2., tmttWidthZ_)));
696  tmttBaseZ_ = tmttBaseR_ * pow(2., baseShiftZ);
697  const double rangePhi = baseRegion_ + rangeInv2R * rangeR / 2.;
698  const int baseShiftPhi = ceil(log2(rangePhi / tmttBasePhiT_ / pow(2., tmttWidthPhi_)));
699  tmttBasePhi_ = tmttBasePhiT_ * pow(2., baseShiftPhi);
705  // hybrid
706  const double hybridRangeInv2R = 2. * invPtToDphi_ / hybridMinPtStub_;
707  const double hybridRangeR =
709  hybridRangePhi_ = baseRegion_ + (hybridRangeR * hybridRangeInv2R) / 2.;
712  for (int type = 0; type < SensorModule::NumTypes; type++)
713  hybridBasesZ_.emplace_back(hybridRangesZ_.at(type) / pow(2., hybridWidthsZ_.at(type)));
715  for (int type = 0; type < SensorModule::NumTypes; type++)
716  hybridBasesR_.emplace_back(hybridRangesR_.at(type) / pow(2., hybridWidthsR_.at(type)));
719  for (int type = 0; type < SensorModule::NumTypes; type++)
720  hybridBasesPhi_.emplace_back(hybridRangePhi_ / pow(2., hybridWidthsPhi_.at(type)));
722  for (int type = 0; type < SensorModule::NumTypes; type++)
725  for (int type = 0; type < SensorModule::NumTypes; type++)
730  disk2SRs_.reserve(hybridDisk2SRsSet_.size());
731  for (const auto& pSet : hybridDisk2SRsSet_)
732  disk2SRs_.emplace_back(pSet.getParameter<vector<double>>("Disk2SRs"));
733  // dtc
739  const double maxRangeInv2R = max(rangeInv2R, hybridRangeInv2R);
740  const int baseShiftInv2R = ceil(log2(htNumBinsInv2R_)) - dtcWidthInv2R_ + ceil(log2(maxRangeInv2R / rangeInv2R));
741  dtcBaseInv2R_ = tmttBaseInv2R_ * pow(2., baseShiftInv2R);
742  const int baseDiffM = dtcWidthRowLUT_ - widthRow_;
743  dtcBaseM_ = tmttBasePhi_ * pow(2., baseDiffM);
744  const double x1 = pow(2, widthRow_) * baseRow_ * maxPitch_ / 2.;
745  const double x0 = x1 - pow(2, dtcWidthRowLUT_) * baseRow_ * maxPitch_;
746  const double maxM = atan2(x1, innerRadius_) - atan2(x0, innerRadius_);
747  dtcWidthM_ = ceil(log2(maxM / dtcBaseM_));
749  // mht
751  // zht
753  //
755  }
756 
757  // returns bit accurate hybrid stub radius for given TTStubRef and h/w bit word
758  double Setup::stubR(const TTBV& hw, const TTStubRef& ttStubRef) const {
759  const bool barrel = this->barrel(ttStubRef);
760  const int layerId = this->indexLayerId(ttStubRef);
761  const SensorModule::Type type = this->type(ttStubRef);
762  const int widthR = hybridWidthsR_.at(type);
763  const double baseR = hybridBasesR_.at(type);
764  const TTBV hwR(hw, widthR, 0, barrel);
765  double r = hwR.val(baseR) + (barrel ? hybridLayerRs_.at(layerId) : 0.);
766  if (type == SensorModule::Disk2S)
767  r = disk2SRs_.at(layerId).at((int)r);
768  return r;
769  }
770 
771  // returns bit accurate position of a stub from a given tfp region [0-8]
773  GlobalPoint p;
774  if (frame.first.isNull())
775  return p;
776  TTBV bv(frame.second);
777  if (hybrid) {
778  const bool barrel = this->barrel(frame.first);
779  const int layerId = this->indexLayerId(frame.first);
780  const GlobalPoint gp = this->stubPos(frame.first);
781  const bool side = gp.z() > 0.;
782  const SensorModule::Type type = this->type(frame.first);
783  const int widthBend = hybridWidthsBend_.at(type);
784  const int widthAlpha = hybridWidthsAlpha_.at(type);
785  const int widthPhi = hybridWidthsPhi_.at(type);
786  const int widthZ = hybridWidthsZ_.at(type);
787  const int widthR = hybridWidthsR_.at(type);
788  const double basePhi = hybridBasesPhi_.at(type);
789  const double baseZ = hybridBasesZ_.at(type);
790  const double baseR = hybridBasesR_.at(type);
791  // parse bit vector
792  bv >>= 1 + hybridWidthLayerId_ + widthBend + widthAlpha;
793  double phi = bv.val(basePhi, widthPhi) - hybridRangePhi_ / 2.;
794  bv >>= widthPhi;
795  double z = bv.val(baseZ, widthZ, 0, true);
796  bv >>= widthZ;
797  double r = bv.val(baseR, widthR, 0, barrel);
798  if (barrel)
799  r += hybridLayerRs_.at(layerId);
800  else
801  z += hybridDiskZs_.at(layerId) * (side ? 1. : -1.);
802  phi = deltaPhi(phi + region * baseRegion_);
803  if (type == SensorModule::Disk2S) {
804  r = bv.val(widthR);
805  r = disk2SRs_.at(layerId).at((int)r);
806  }
807  p = GlobalPoint(GlobalPoint::Cylindrical(r, phi, z));
808  } else {
810  double z = (bv.val(tmttWidthZ_, 0, true) + .5) * tmttBaseZ_;
811  bv >>= tmttWidthZ_;
812  double phi = (bv.val(tmttWidthPhi_, 0, true) + .5) * tmttBasePhi_;
813  bv >>= tmttWidthPhi_;
814  double r = (bv.val(tmttWidthR_, 0, true) + .5) * tmttBaseR_;
815  bv >>= tmttWidthR_;
816  r = r + chosenRofPhi_;
817  phi = deltaPhi(phi + region * baseRegion_);
818  p = GlobalPoint(GlobalPoint::Cylindrical(r, phi, z));
819  }
820  return p;
821  }
822 
823  // returns global TTStub position
824  GlobalPoint Setup::stubPos(const TTStubRef& ttStubRef) const {
825  const DetId detId = ttStubRef->getDetId() + offsetDetIdDSV_;
827  const PixelTopology* topol =
828  dynamic_cast<const PixelTopology*>(&(dynamic_cast<const PixelGeomDetUnit*>(det)->specificTopology()));
829  const Plane& plane = dynamic_cast<const PixelGeomDetUnit*>(det)->surface();
830  const MeasurementPoint& mp = ttStubRef->clusterRef(0)->findAverageLocalCoordinatesCentered();
831  return plane.toGlobal(topol->localPosition(mp));
832  }
833 
834  // range check of dtc id
835  void Setup::checkDTCId(int dtcId) const {
836  if (dtcId < 0 || dtcId >= numDTCsPerRegion_ * numRegions_) {
837  cms::Exception exception("out_of_range");
838  exception.addContext("tt::Setup::checkDTCId");
839  exception << "Used DTC Id (" << dtcId << ") "
840  << "is out of range 0 to " << numDTCsPerRegion_ * numRegions_ - 1 << ".";
841  throw exception;
842  }
843  }
844 
845  // range check of tklayout id
846  void Setup::checkTKLayoutId(int tkLayoutId) const {
847  if (tkLayoutId <= 0 || tkLayoutId > numDTCsPerRegion_ * numRegions_) {
848  cms::Exception exception("out_of_range");
849  exception.addContext("tt::Setup::checkTKLayoutId");
850  exception << "Used TKLayout Id (" << tkLayoutId << ") "
851  << "is out of range 1 to " << numDTCsPerRegion_ * numRegions_ << ".";
852  throw exception;
853  }
854  }
855 
856  // range check of tfp identifier
857  void Setup::checkTFPIdentifier(int tfpRegion, int tfpChannel) const {
858  const bool oorRegion = tfpRegion >= numRegions_ || tfpRegion < 0;
859  const bool oorChannel = tfpChannel >= numDTCsPerTFP_ || tfpChannel < 0;
860  if (oorRegion || oorChannel) {
861  cms::Exception exception("out_of_range");
862  exception.addContext("tt::Setup::checkTFPIdentifier");
863  if (oorRegion)
864  exception << "Requested Processing Region "
865  << "(" << tfpRegion << ") "
866  << "is out of range 0 to " << numRegions_ - 1 << ".";
867  if (oorChannel)
868  exception << "Requested TFP Channel "
869  << "(" << tfpChannel << ") "
870  << "is out of range 0 to " << numDTCsPerTFP_ - 1 << ".";
871  throw exception;
872  }
873  }
874 } // namespace tt
Class for "official" algorithm to be used in TTStubBuilder.
const std::vector< SensorModule * > & dtcModules(int dtcId) const
Definition: Setup.h:393
int zhtNumCells_
Definition: Setup.h:1077
int dtcNumRoutingBlocks_
Definition: Setup.h:801
int offsetLayerDisks_
Definition: Setup.h:813
constexpr int32_t ceil(float num)
void checkTKLayoutId(int tkLayoutId) const
Definition: Setup.cc:846
double extract(double base, int size, bool twos=false)
Definition: TTBV.h:276
std::string phTTStubAlgorithm_
Definition: Setup.h:594
double baseRow_
Definition: Setup.h:782
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
double dZ(const TTStubRef &ttStubRef, double cot) const
Definition: Setup.cc:600
int tmttWidthInv2R_
Definition: Setup.h:996
int numFramesIO_
Definition: Setup.h:967
edm::ParameterSetID pSetIdGeometryConfiguration_
Definition: Setup.h:573
int numLayers_
Definition: Setup.h:620
int dtcWidthInv2R_
Definition: Setup.h:807
T perp() const
Definition: PV3DBase.h:69
int numBarrelLayer_
Definition: Setup.h:817
int tmttWidthLayer_
Definition: Setup.h:992
double tpMaxEta_
Definition: Setup.h:676
void calculateConstants()
Definition: Setup.cc:658
int tpMinLayers_
Definition: Setup.h:684
TrackingParticleSelector tpSelector_
Definition: Setup.h:945
double maxZT_
Definition: Setup.h:1059
double lengthPS_
Definition: Setup.h:763
int tmttWidthPhi_
Definition: Setup.h:624
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
double halfLength_
Definition: Setup.h:737
double hybridMaxEta_
Definition: Setup.h:635
int numFrames_
Definition: Setup.h:965
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
Definition: TTBV.h:20
std::pair< TTStubRef, Frame > FrameStub
Definition: TTTypes.h:60
std::vector< double > boundariesEta_
Definition: Setup.h:851
double freqLHC_
Definition: Setup.h:719
static PFTauRenderPlugin instance
T z() const
Definition: PV3DBase.h:61
std::string phGeometryConfiguration_
Definition: Setup.h:592
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
std::vector< double > hybridBasesZ_
Definition: Setup.h:1009
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
double v1(const TTStubRef &ttStubRef, double cot) const
Definition: Setup.cc:629
int widthDSPau_
Definition: Setup.h:699
int offsetLayerId_
Definition: Setup.h:815
unsigned int tidWheel(const DetId &id) const
std::string sgXMLPath_
Definition: Setup.h:583
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool exists(std::string const &parameterName) const
checks if a parameter exists
int tmttWidthSectorEta_
Definition: Setup.h:994
ParameterSet const & getParameterSet(std::string const &) const
constexpr float ptMin
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double mindZ_
Definition: Setup.h:753
const TrackerDetToDTCELinkCablingMap * cablingMap_
Definition: Setup.h:563
int numDTCs_
Definition: Setup.h:1028
int kfWidthLayerCount_
Definition: Setup.h:1081
int numSectors_
Definition: Setup.h:1063
int slotLimit10gbps_
Definition: Setup.h:823
int mhtNumBinsPhiT_
Definition: Setup.h:869
void checkDTCId(int dtcId) const
Definition: Setup.cc:835
double dtcBaseM_
Definition: Setup.h:1042
int tmttWidthZ_
Definition: Setup.h:626
std::vector< double > hybridBasesAlpha_
Definition: Setup.h:1011
std::vector< double > hybridRangesAlpha_
Definition: Setup.h:657
int mhtNumCells_
Definition: Setup.h:1072
int tkLayoutId(int dtcId) const
Definition: Setup.cc:304
TrackingParticleSelector tpSelectorLoose_
Definition: Setup.h:947
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
int htNumBinsPhiT_
Definition: Setup.h:858
void checkGeometry()
Definition: Setup.cc:394
SensorModule::Type type(const TTStubRef &ttStubRef) const
Definition: Setup.cc:329
double tmttBasePhiT_
Definition: Setup.h:988
int numModules_
Definition: Setup.h:1032
bool useForAlgEff(const TrackingParticle &tp) const
Definition: Setup.cc:646
Definition: Plane.h:16
edm::ParameterSetID pSetIdTTStubAlgorithm_
Definition: Setup.h:571
std::vector< int > hybridWidthsR_
Definition: Setup.h:643
double baseSector_
Definition: Setup.h:1057
int htNumBinsInv2R_
Definition: Setup.h:856
void produceSensorModules()
Definition: Setup.cc:449
double bField_
Definition: Setup.h:729
unsigned int layer(const DetId &id) const
const std::vector< double > & encodingBend(int windowSize, bool psModule) const
Definition: Setup.cc:377
double dPhi(const TTStubRef &ttStubRef, double inv2R) const
Definition: Setup.cc:580
double hybridChosenRofPhi_
Definition: Setup.h:637
std::vector< double > hybridRangesR_
Definition: Setup.h:653
std::string dumpDiff(const edm::ParameterSet &pSetHistory, const edm::ParameterSet &pSetProcess) const
Definition: Setup.cc:283
int widthDSPbu_
Definition: Setup.h:705
double tmttBaseR_
Definition: Setup.h:980
std::vector< double > hybridDiskZs_
Definition: Setup.h:661
math::XYZPointD Point
point in the space
std::unordered_map< DetId, SensorModule * > detIdToSensorModule_
Definition: Setup.h:1052
double v0(const TTStubRef &ttStubRef, double inv2R) const
Definition: Setup.cc:617
char const * label
std::vector< double > hybridLayerRs_
Definition: Setup.h:659
const TrackerGeometry * trackerGeometry_
Definition: Setup.h:559
double tpMaxVertZ_
Definition: Setup.h:680
std::string sgXMLLabel_
Definition: Setup.h:581
std::vector< double > hybridBasesPhi_
Definition: Setup.h:1007
Definition: TTTypes.h:54
std::vector< std::vector< double > > encodingsBendPS_
Definition: Setup.h:1044
int numFramesInfra_
Definition: Setup.h:717
std::vector< double > numTiltedLayerRings_
Definition: Setup.h:952
int zhtNumBinsCot_
Definition: Setup.h:884
GlobalPoint stubPos(const TTStubRef &ttStubRef) const
Definition: Setup.cc:824
int slot(int dtcId) const
Definition: Setup.cc:359
std::vector< std::vector< double > > windowSizeTiltedLayerRings_
Definition: Setup.h:956
std::vector< double > hybridRangesZ_
Definition: Setup.h:655
double baseRegion_
Definition: Setup.h:973
int dtcNumStreams_
Definition: Setup.h:819
int widthDSPab_
Definition: Setup.h:697
ModuleType getDetectorType(DetId) const
std::vector< std::string > sgXMLVersions_
Definition: Setup.h:587
int dtcWidthM_
Definition: Setup.h:1038
double bFieldError_
Definition: Setup.h:731
int widthDSPb_
Definition: Setup.h:701
int widthDSPbb_
Definition: Setup.h:703
double maxPitch_
Definition: Setup.h:739
void encodeBend(std::vector< std::vector< double >> &, bool) const
Definition: Setup.cc:439
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< double > hybridBasesR_
Definition: Setup.h:1005
int layerId(const TTStubRef &ttStubRef) const
Definition: Setup.cc:511
int widthDSPcb_
Definition: Setup.h:709
double scattering_
Definition: Setup.h:609
std::vector< int > hybridNumsUnusedBits_
Definition: Setup.h:1021
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool reconstructable(const std::vector< TTStubRef > &ttStubRefs) const
Definition: Setup.cc:638
double maxdPhi_
Definition: Setup.h:751
double stubR(const TTBV &hw, const TTStubRef &ttStubRef) const
Definition: Setup.cc:758
float degradeBend(bool psModule, int window, int bend) const
std::vector< std::vector< double > > encodingsBend2S_
Definition: Setup.h:1046
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
Definition: svgfig.py:643
int numATCASlots_
Definition: Setup.h:795
int offsetDetIdDSV_
Definition: Setup.h:809
std::vector< SensorModule > sensorModules_
Definition: Setup.h:1048
double length2S_
Definition: Setup.h:761
int widthDSPc_
Definition: Setup.h:707
bool fromDD4hep_
Definition: Setup.h:576
double tmttBaseZ_
Definition: Setup.h:982
static constexpr auto TOB
double pitchPS_
Definition: Setup.h:759
double chosenRofZ_
Definition: Setup.h:845
double hybridRangeR() const
Definition: Setup.h:302
std::vector< double > sectorCots_
Definition: Setup.h:1067
bool gbps10(int dtcId) const
Definition: Setup.cc:345
void checkTFPIdentifier(int tfpRegion, int tfpChannel) const
Definition: Setup.cc:857
int numFramesFE_
Definition: Setup.h:969
const edm::ParameterSet * pSetGC_
Definition: Setup.h:569
int slotLimitPS_
Definition: Setup.h:821
void consumeStubAlgorithm()
Definition: Setup.cc:420
double maxEta_
Definition: Setup.h:616
double maxCot_
Definition: Setup.h:1061
int tmpFE_
Definition: Setup.h:723
int tmttWidthR_
Definition: Setup.h:622
double maxLength_
Definition: Setup.h:741
#define M_PI
int dtcNumMergedRows_
Definition: Setup.h:1036
int hybridNumLayers_
Definition: Setup.h:639
int numOverlappingRegions_
Definition: Setup.h:793
std::vector< std::vector< double > > windowSizeEndcapDisksRings_
Definition: Setup.h:958
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
std::vector< int > hybridWidthsAlpha_
Definition: Setup.h:649
int widthDSPcu_
Definition: Setup.h:711
double speedOfLight_
Definition: Setup.h:727
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:242
double maxdZ_
Definition: Setup.h:755
Definition: DetId.h:17
static constexpr float d0
bool isLower(const DetId &id) const
int widthDSPa_
Definition: Setup.h:695
double tmttBaseInv2R_
Definition: Setup.h:986
double outerRadius_
Definition: Setup.h:733
double innerRadius_
Definition: Setup.h:735
bool psModule(int dtcId) const
Definition: Setup.cc:322
std::vector< edm::ParameterSet > hybridDisk2SRsSet_
Definition: Setup.h:663
std::vector< int > hybridWidthsZ_
Definition: Setup.h:645
int val() const
Definition: TTBV.h:259
double dtcBaseInv2R_
Definition: Setup.h:1040
double pitch2S_
Definition: Setup.h:757
std::vector< double > windowSizeBarrelLayers_
Definition: Setup.h:954
int numDTCsPerTFP_
Definition: Setup.h:1030
int dtcWidthRowLUT_
Definition: Setup.h:805
double freqBE_
Definition: Setup.h:721
int dtcNumModulesPerRoutingBlock_
Definition: Setup.h:1034
void checkMagneticField()
Definition: Setup.cc:383
ParameterSet const & getParameterSet(ParameterSetID const &id)
double minPt_
Definition: Setup.h:614
int mhtNumBinsInv2R_
Definition: Setup.h:867
TTBV layerMap(const std::vector< int > &ints) const
Definition: Setup.cc:540
int trackletLayerId(const TTStubRef &ttStubRef) const
Definition: Setup.cc:518
int tmpTFP_
Definition: Setup.h:725
double tpMaxD0_
Definition: Setup.h:682
int widthBend() const
Definition: Setup.h:332
double baseWindowSize_
Definition: Setup.h:784
HLT enums.
int zhtMaxStubsPerLayer_
Definition: Setup.h:892
double chosenRofPhi_
Definition: Setup.h:618
int hybridWidthLayerId_
Definition: Setup.h:1003
int numSectorsPhi_
Definition: Setup.h:841
const StubAlgorithmOfficial * stubAlgorithm_
Definition: Setup.h:565
std::string dump(unsigned int indent=0) const
int tmttNumUnusedBits_
Definition: Setup.h:998
std::pair< std::unordered_multimap< uint32_t, DTCELinkId >::const_iterator, std::unordered_multimap< uint32_t, DTCELinkId >::const_iterator > detIdToDTCELinkId(uint32_t const) const
Resolves one or more DTCELinkId of eLinks which are connected to the detector identified by the given...
bool side(int dtcId) const
Definition: Setup.cc:351
double deltaPhi(double lhs, double rhs=0.)
Definition: Setup.h:37
double tpMaxVertR_
Definition: Setup.h:678
int numRegions_
Definition: Setup.h:791
Monte Carlo truth information used for tracking validation.
std::vector< std::vector< SensorModule * > > dtcModules_
Definition: Setup.h:1050
int maxWindowSize_
Definition: Setup.h:960
int numModulesPerDTC_
Definition: Setup.h:799
int indexLayerId(const TTStubRef &ttStubRef) const
Definition: Setup.cc:523
double hybridRangePhi_
Definition: Setup.h:665
int zhtNumBinsZT_
Definition: Setup.h:882
double invPtToDphi_
Definition: Setup.h:971
Log< level::Warning, false > LogWarning
int numDTCsPerRegion_
Definition: Setup.h:797
int dtcId(int tklId) const
Definition: Setup.cc:294
static constexpr int S_
Definition: TTBV.h:22
double mindPhi_
Definition: Setup.h:749
const MagneticField * magneticField_
Definition: Setup.h:557
SensorModule * sensorModule(const DetId &detId) const
Definition: Setup.cc:365
int numSectorsEta_
Definition: Setup.h:843
SingleObjectSelector< TrackingParticleCollection, ::TrackingParticleSelector > TrackingParticleSelector
double hybridMinPtStub_
Definition: Setup.h:631
int widthRow_
Definition: Setup.h:776
std::vector< int > hybridWidthsPhi_
Definition: Setup.h:647
const edm::ParameterSet * pSetSA_
Definition: Setup.h:567
bool barrel(const TTStubRef &ttStubRef) const
Definition: Setup.cc:528
void configureTPSelector()
Definition: Setup.cc:492
double tpMinPt_
Definition: Setup.h:674
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
int offsetDetIdTP_
Definition: Setup.h:811
ROOT::VecOps::RVec< int > ints
Definition: Resolutions.cc:4
double tmttBasePhi_
Definition: Setup.h:984
const TrackerTopology * trackerTopology_
Definition: Setup.h:561
std::string sgXMLFile_
Definition: Setup.h:585
double hybridMaxCot_
Definition: Setup.h:1019
bool configurationSupported_
Definition: Setup.h:943
std::vector< int > hybridWidthsBend_
Definition: Setup.h:651
std::vector< std::vector< double > > disk2SRs_
Definition: Setup.h:1023