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