Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-06-03 00:12:28

0001 #ifndef L1Trigger_TrackTrigger_Setup_h
0002 #define L1Trigger_TrackTrigger_Setup_h
0003 
0004 #include "FWCore/Framework/interface/data_default_record_trait.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/ParameterSet/interface/Registry.h"
0007 #include "DataFormats/DetId/interface/DetId.h"
0008 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0009 #include "DataFormats/Math/interface/deltaPhi.h"
0010 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0011 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0012 #include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h"
0013 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0014 #include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h"
0015 #include "CondFormats/SiPhase2TrackerObjects/interface/TrackerDetToDTCELinkCablingMap.h"
0016 #include "SimTracker/Common/interface/TrackingParticleSelector.h"
0017 
0018 #include "SimDataFormats/Associations/interface/TTTypes.h"
0019 #include "DataFormats/L1TrackTrigger/interface/TTDTC.h"
0020 #include "L1Trigger/TrackTrigger/interface/SensorModule.h"
0021 #include "L1Trigger/TrackTrigger/interface/SetupRcd.h"
0022 
0023 #include <vector>
0024 #include <set>
0025 #include <unordered_map>
0026 
0027 namespace tt {
0028 
0029   typedef TTStubAlgorithm<Ref_Phase2TrackerDigi_> StubAlgorithm;
0030   typedef TTStubAlgorithm_official<Ref_Phase2TrackerDigi_> StubAlgorithmOfficial;
0031   // handles 2 pi overflow
0032   inline double deltaPhi(double lhs, double rhs = 0.) { return reco::deltaPhi(lhs, rhs); }
0033 
0034   /*! \class  tt::Setup
0035    *  \brief  Class to process and provide run-time constants used by Track Trigger emulators
0036    *  \author Thomas Schuh
0037    *  \date   2020, Apr
0038    */
0039   class Setup {
0040   public:
0041     // Configuration
0042     struct Config {
0043       double beamWindowZ_;
0044       double minPt_;
0045       double minPtCand_;
0046       double maxEta_;
0047       double maxD0_;
0048       double chosenRofPhi_;
0049       int numLayers_;
0050       int minLayers_;
0051       int tmttWidthR_;
0052       int tmttWidthPhi_;
0053       int tmttWidthZ_;
0054       int hybridNumLayers_;
0055       std::vector<int> hybridNumRingsPS_;
0056       std::vector<int> hybridWidthsR_;
0057       std::vector<int> hybridWidthsZ_;
0058       std::vector<int> hybridWidthsPhi_;
0059       std::vector<int> hybridWidthsAlpha_;
0060       std::vector<int> hybridWidthsBend_;
0061       std::vector<double> hybridRangesR_;
0062       std::vector<double> hybridRangesZ_;
0063       std::vector<double> hybridRangesAlpha_;
0064       std::vector<double> hybridLayerRs_;
0065       std::vector<double> hybridDiskZs_;
0066       std::vector<edm::ParameterSet> hybridDisk2SRsSet_;
0067       double hybridRangePhi_;
0068       double tbBarrelHalfLength_;
0069       double tbInnerRadius_;
0070       std::vector<int> tbWidthsR_;
0071       int enableTruncation_;
0072       bool useHybrid_;
0073       int widthDSPa_;
0074       int widthDSPab_;
0075       int widthDSPau_;
0076       int widthDSPb_;
0077       int widthDSPbb_;
0078       int widthDSPbu_;
0079       int widthDSPc_;
0080       int widthDSPcb_;
0081       int widthDSPcu_;
0082       int widthAddrBRAM36_;
0083       int widthAddrBRAM18_;
0084       int numFramesInfra_;
0085       double freqLHC_;
0086       double freqBEHigh_;
0087       double freqBELow_;
0088       int tmpFE_;
0089       int tmpTFP_;
0090       double speedOfLight_;
0091       double bField_;
0092       double bFieldError_;
0093       double outerRadius_;
0094       double innerRadius_;
0095       double halfLength_;
0096       double maxPitchRow_;
0097       double maxPitchCol_;
0098       double tiltApproxSlope_;
0099       double tiltApproxIntercept_;
0100       double tiltUncertaintyR_;
0101       double scattering_;
0102       double pitchRow2S_;
0103       double pitchRowPS_;
0104       double pitchCol2S_;
0105       double pitchColPS_;
0106       double limitPSBarrel_;
0107       std::vector<double> limitsTiltedR_;
0108       std::vector<double> limitsTiltedZ_;
0109       std::vector<double> limitsPSDiksZ_;
0110       std::vector<double> limitsPSDiksR_;
0111       std::vector<double> tiltedLayerLimitsZ_;
0112       std::vector<double> psDiskLimitsR_;
0113       int widthBend_;
0114       int widthCol_;
0115       int widthRow_;
0116       double baseBend_;
0117       double baseCol_;
0118       double baseRow_;
0119       double baseWindowSize_;
0120       double bendCut_;
0121       int numRegions_;
0122       int numOverlappingRegions_;
0123       int numATCASlots_;
0124       int numDTCsPerRegion_;
0125       int numModulesPerDTC_;
0126       int dtcNumRoutingBlocks_;
0127       int dtcDepthMemory_;
0128       int dtcWidthRowLUT_;
0129       int dtcWidthInv2R_;
0130       int offsetDetIdDSV_;
0131       int offsetDetIdTP_;
0132       int offsetLayerDisks_;
0133       int offsetLayerId_;
0134       int numBarrelLayer_;
0135       int numBarrelLayerPS_;
0136       int dtcNumStreams_;
0137       int slotLimitPS_;
0138       int slotLimit10gbps_;
0139       int tfpWidthPhi0_;
0140       int tfpWidthInvR_;
0141       int tfpWidthCot_;
0142       int tfpWidthZ0_;
0143       int tfpNumChannel_;
0144       int gpNumBinsPhiT_;
0145       int gpNumBinsZT_;
0146       double chosenRofZ_;
0147       int gpDepthMemory_;
0148       int gpWidthModule_;
0149       int gpPosPS_;
0150       int gpPosBarrel_;
0151       int gpPosTilted_;
0152       int htNumBinsInv2R_;
0153       int htNumBinsPhiT_;
0154       int htMinLayers_;
0155       int htDepthMemory_;
0156       int ctbNumBinsInv2R_;
0157       int ctbNumBinsPhiT_;
0158       int ctbNumBinsCot_;
0159       int ctbNumBinsZT_;
0160       int ctbMinLayers_;
0161       int ctbMaxTracks_;
0162       int ctbMaxStubs_;
0163       int ctbDepthMemory_;
0164       bool kfUse5ParameterFit_;
0165       bool kfUseSimmulation_;
0166       bool kfUseTTStubResiduals_;
0167       bool kfUseTTStubParameters_;
0168       bool kfApplyNonLinearCorrection_;
0169       int kfNumWorker_;
0170       int kfMaxTracks_;
0171       int kfMinLayers_;
0172       int kfMinLayersPS_;
0173       int kfMaxLayers_;
0174       int kfMaxGaps_;
0175       int kfMaxSeedingLayer_;
0176       int kfNumSeedStubs_;
0177       double kfMinSeedDeltaR_;
0178       double kfRangeFactor_;
0179       int kfShiftInitialC00_;
0180       int kfShiftInitialC11_;
0181       int kfShiftInitialC22_;
0182       int kfShiftInitialC33_;
0183       int kfShiftChi20_;
0184       int kfShiftChi21_;
0185       double kfCutChi2_;
0186       int kfWidthChi2_;
0187       int drDepthMemory_;
0188       int tqNumChannel_;
0189     };
0190     Setup() {}
0191     Setup(const Config& iConfig,
0192           const TrackerGeometry& trackerGeometry,
0193           const TrackerTopology& trackerTopology,
0194           const TrackerDetToDTCELinkCablingMap& cablingMap,
0195           const StubAlgorithmOfficial& stubAlgorithm,
0196           const edm::ParameterSet& pSetStubAlgorithm);
0197     ~Setup() = default;
0198 
0199     // converts tk layout id into dtc id
0200     int dtcId(int tklId) const;
0201     // converts dtci id into tk layout id
0202     int tkLayoutId(int dtcId) const;
0203     // converts TFP identifier (region[0-8], channel[0-47]) into dtcId [0-215]
0204     int dtcId(int tfpRegion, int tfpChannel) const;
0205     // checks if given dtcId is connected to PS or 2S sensormodules
0206     bool psModule(int dtcId) const;
0207     // checks if given dtcId is connected via 10 gbps link
0208     bool gbps10(int dtcId) const;
0209     // checks if given dtcId is connected to -z (false) or +z (true)
0210     bool side(int dtcId) const;
0211     // ATCA slot number [0-11] of given dtcId
0212     int slot(int dtcId) const;
0213     // sensor module for det id
0214     SensorModule* sensorModule(const DetId& detId) const;
0215     // sensor module for ttStubRef
0216     SensorModule* sensorModule(const TTStubRef& ttStubRef) const;
0217     // TrackerGeometry
0218     const TrackerGeometry* trackerGeometry() const { return trackerGeometry_; }
0219     // TrackerTopology
0220     const TrackerTopology* trackerTopology() const { return trackerTopology_; }
0221     // returns global TTStub position
0222     GlobalPoint stubPos(const TTStubRef& ttStubRef) const;
0223     // returns bit accurate hybrid stub radius for given TTStubRef and h/w bit word
0224     double stubR(const TTBV& hw, const TTStubRef& ttStubRef) const;
0225     // returns bit accurate position of a stub from a given tfp region [0-8]
0226     GlobalPoint stubPos(const tt::FrameStub& frame, int region) const;
0227     // empty trackerDTC EDProduct
0228     TTDTC ttDTC() const { return TTDTC(numRegions_, numOverlappingRegions_, numDTCsPerRegion_); }
0229     // stub layer id (barrel: 1 - 6, endcap: 11 - 15)
0230     int layerId(const TTStubRef& ttStubRef) const;
0231     // return tracklet layerId (barrel: [0-5], endcap: [6-10]) for given TTStubRef
0232     int trackletLayerId(const TTStubRef& ttStubRef) const;
0233     // return index layerId (barrel: [0-5], endcap: [0-6]) for given TTStubRef
0234     int indexLayerId(const TTStubRef& ttStubRef) const;
0235     // true if stub from barrel module
0236     bool barrel(const TTStubRef& ttStubRef) const;
0237     // true if stub from barrel module
0238     bool psModule(const TTStubRef& ttStubRef) const;
0239     // return sensor moduel type
0240     SensorModule::Type type(const TTStubRef& ttStubRef) const;
0241     // checks if stub collection is considered forming a reconstructable track
0242     bool reconstructable(const std::vector<TTStubRef>& ttStubRefs) const;
0243     //
0244     TTBV layerMap(const std::vector<int>& ints) const;
0245     //
0246     TTBV layerMap(const TTBV& hitPattern, const std::vector<int>& ints) const;
0247     //
0248     std::vector<int> layerMap(const TTBV& hitPattern, const TTBV& ttBV) const;
0249     //
0250     std::vector<int> layerMap(const TTBV& ttBV) const;
0251     // stub projected phi uncertainty
0252     double dPhi(const TTStubRef& ttStubRef, double inv2R) const;
0253     // stub projected z uncertainty
0254     double dZ(const TTStubRef& ttStubRef) const;
0255     // stub projected chi2phi wheight
0256     double v0(const TTStubRef& ttStubRef, double inv2R) const;
0257     // stub projected chi2z wheight
0258     double v1(const TTStubRef& ttStubRef, double cot) const;
0259     //
0260     const std::vector<SensorModule>& sensorModules() const { return sensorModules_; }
0261     //
0262     TTBV module(double r, double z) const;
0263     //
0264     bool ps(const TTBV& module) const { return module[gpPosPS_]; }
0265     //
0266     bool barrel(const TTBV& module) const { return module[gpPosBarrel_]; }
0267     //
0268     bool tilted(const TTBV& module) const { return module[gpPosTilted_]; }
0269     // stub projected phi uncertainty for given module type, stub radius and track curvature
0270     double dPhi(const TTBV& module, double r, double inv2R) const;
0271 
0272     // Firmware specific Parameter
0273 
0274     // enable emulation of truncation for TM, DR, KF, TQ and TFP
0275     int enableTruncation() const { return enableTruncation_; }
0276     // use Hybrid or TMTT as TT algorithm
0277     bool useHybrid() const { return useHybrid_; }
0278     // width of the 'A' port of an DSP slice
0279     int widthDSPa() const { return widthDSPa_; }
0280     // width of the 'A' port of an DSP slice using biased twos complement
0281     int widthDSPab() const { return widthDSPab_; }
0282     // width of the 'A' port of an DSP slice using biased binary
0283     int widthDSPau() const { return widthDSPau_; }
0284     // width of the 'B' port of an DSP slice
0285     int widthDSPb() const { return widthDSPb_; }
0286     // width of the 'B' port of an DSP slice using biased twos complement
0287     int widthDSPbb() const { return widthDSPbb_; }
0288     // width of the 'B' port of an DSP slice using biased binary
0289     int widthDSPbu() const { return widthDSPbu_; }
0290     // width of the 'C' port of an DSP slice
0291     int widthDSPc() const { return widthDSPc_; }
0292     // width of the 'C' port of an DSP slice using biased twos complement
0293     int widthDSPcb() const { return widthDSPcb_; }
0294     // width of the 'C' port of an DSP slice using biased binary
0295     int widthDSPcu() const { return widthDSPcu_; }
0296     // smallest address width of an BRAM36 configured as broadest simple dual port memory
0297     int widthAddrBRAM36() const { return widthAddrBRAM36_; }
0298     // smallest address width of an BRAM18 configured as broadest simple dual port memory
0299     int widthAddrBRAM18() const { return widthAddrBRAM18_; }
0300     // number of frames betwen 2 resets of 18 BX packets
0301     int numFramesHigh() const { return numFramesHigh_; }
0302     // number of frames betwen 2 resets of 18 BX packets
0303     int numFramesLow() const { return numFramesLow_; }
0304     // number of frames needed per reset
0305     int numFramesInfra() const { return numFramesInfra_; }
0306     // number of valid frames per 18 BX packet
0307     int numFramesIOHigh() const { return numFramesIOHigh_; }
0308     // number of valid frames per 18 BX packet
0309     int numFramesIOLow() const { return numFramesIOLow_; }
0310     // number of valid frames per 8 BX packet
0311     int numFramesFE() const { return numFramesFE_; }
0312 
0313     // Tracker specific Parameter
0314 
0315     // strip pitch of outer tracker sensors in cm
0316     double pitchRow2S() const { return pitchRow2S_; }
0317     // pixel pitch of outer tracker sensors in cm
0318     double pitchRowPS() const { return pitchRowPS_; }
0319     // strip length of outer tracker sensors in cm
0320     double pitchCol2S() const { return pitchCol2S_; }
0321     // pixel length of outer tracker sensors in cm
0322     double pitchColPS() const { return pitchColPS_; }
0323     // BField used in fw in T
0324     double bField() const { return bField_; }
0325     // outer radius of outer tracker in cm
0326     double outerRadius() const { return outerRadius_; }
0327     // inner radius of outer tracker in cm
0328     double innerRadius() const { return innerRadius_; }
0329     // half length of outer tracker in cm
0330     double halfLength() const { return halfLength_; }
0331     // max strip/pixel length of outer tracker sensors in cm
0332     double maxPitchCol() const { return maxPitchCol_; }
0333     // In tilted barrel, grad*|z|/r + int approximates |cosTilt| + |sinTilt * cotTheta|
0334     double tiltApproxSlope() const { return tiltApproxSlope_; }
0335     // In tilted barrel, grad*|z|/r + int approximates |cosTilt| + |sinTilt * cotTheta|
0336     double tiltApproxIntercept() const { return tiltApproxIntercept_; }
0337     // In tilted barrel, constant assumed stub radial uncertainty * sqrt(12) in cm
0338     double tiltUncertaintyR() const { return tiltUncertaintyR_; }
0339     // scattering term used to add stub phi uncertainty depending on assumed track inv2R
0340     double scattering() const { return scattering_; }
0341     // barrel layer limit z value to partition into tilted and untilted region
0342     double tiltedLayerLimitZ(int layer) const { return tiltedLayerLimitsZ_.at(layer); }
0343     // endcap disk limit r value to partition into PS and 2S region
0344     double psDiskLimitR(int layer) const { return psDiskLimitsR_.at(layer); }
0345 
0346     // Common track finding parameter
0347 
0348     // half lumi region size in cm
0349     double beamWindowZ() const { return beamWindowZ_; }
0350     // converts GeV in 1/cm
0351     double invPtToDphi() const { return invPtToDphi_; }
0352     // region size in rad
0353     double baseRegion() const { return baseRegion_; }
0354     // max cot(theta) of found tracks
0355     double maxCot() const { return maxCot_; }
0356     // cut on stub and TP pt, also defines region overlap shape in GeV
0357     double minPt() const { return minPt_; }
0358     // cut on candidate pt
0359     double minPtCand() const { return minPtCand_; }
0360     // cut on stub eta
0361     double maxEta() const { return maxEta_; }
0362     // constraints track reconstruction phase space
0363     double maxD0() const { return maxD0_; }
0364     // critical radius defining region overlap shape in cm
0365     double chosenRofPhi() const { return chosenRofPhi_; }
0366     // TMTT: number of detector layers a reconstructbale particle may cross; Hybrid: max number of layers connected to one DTC
0367     int numLayers() const { return numLayers_; }
0368 
0369     // TMTT specific parameter
0370 
0371     // number of bits used for stub r - ChosenRofPhi
0372     int tmttWidthR() const { return tmttWidthR_; }
0373     // number of bits used for stub phi w.r.t. phi sector centre
0374     int tmttWidthPhi() const { return tmttWidthPhi_; }
0375     // number of bits used for stub z
0376     int tmttWidthZ() const { return tmttWidthZ_; }
0377     // number of bits used for stub layer id
0378     int tmttWidthLayer() const { return tmttWidthLayer_; }
0379     // number of bits used for stub eta sector
0380     int tmttWidthSectorEta() const { return tmttWidthSectorEta_; }
0381     // number of bits used for stub inv2R
0382     int tmttWidthInv2R() const { return tmttWidthInv2R_; }
0383     // internal stub r precision in cm
0384     double tmttBaseR() const { return tmttBaseR_; }
0385     // internal stub z precision in cm
0386     double tmttBaseZ() const { return tmttBaseZ_; }
0387     // internal stub phi precision in rad
0388     double tmttBasePhi() const { return tmttBasePhi_; }
0389     // internal stub inv2R precision in 1/cm
0390     double tmttBaseInv2R() const { return tmttBaseInv2R_; }
0391     // internal stub phiT precision in rad
0392     double tmttBasePhiT() const { return tmttBasePhiT_; }
0393     // number of padded 0s in output data format
0394     int tmttNumUnusedBits() const { return tmttNumUnusedBits_; }
0395 
0396     // Hybrid specific parameter
0397 
0398     // max number of layer connected to one DTC
0399     double hybridNumLayers() const { return hybridNumLayers_; }
0400     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0401     int hybridWidthR(SensorModule::Type type) const { return hybridWidthsR_.at(type); }
0402     // number of bits used for stub z w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0403     int hybridWidthZ(SensorModule::Type type) const { return hybridWidthsZ_.at(type); }
0404     // number of bits used for stub phi w.r.t. region centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0405     int hybridWidthPhi(SensorModule::Type type) const { return hybridWidthsPhi_.at(type); }
0406     // number of bits used for stub row number for module types (barrelPS, barrel2S, diskPS, disk2S)
0407     int hybridWidthAlpha(SensorModule::Type type) const { return hybridWidthsAlpha_.at(type); }
0408     // number of bits used for stub bend number for module types (barrelPS, barrel2S, diskPS, disk2S)
0409     int hybridWidthBend(SensorModule::Type type) const { return hybridWidthsBend_.at(type); }
0410     // number of bits used for stub layer id
0411     int hybridWidthLayerId() const { return hybridWidthLayerId_; }
0412     // precision or r in cm for (barrelPS, barrel2S, diskPS, disk2S)
0413     double hybridBaseR(SensorModule::Type type) const { return hybridBasesR_.at(type); }
0414     double hybridBaseR() const { return hybridBaseR_; }
0415     // precision or phi in rad for (barrelPS, barrel2S, diskPS, disk2S)
0416     double hybridBasePhi(SensorModule::Type type) const { return hybridBasesPhi_.at(type); }
0417     double hybridBasePhi() const { return hybridBasePhi_; }
0418     // precision or z in cm for (barrelPS, barrel2S, diskPS, disk2S)
0419     double hybridBaseZ(SensorModule::Type type) const { return hybridBasesZ_.at(type); }
0420     double hybridBaseZ() const { return hybridBaseZ_; }
0421     // precision or alpha in pitch units for (barrelPS, barrel2S, diskPS, disk2S)
0422     double hybridBaseAlpha(SensorModule::Type type) const { return hybridBasesAlpha_.at(type); }
0423     // number of padded 0s in output data format for (barrelPS, barrel2S, diskPS, disk2S)
0424     int hybridNumUnusedBits(SensorModule::Type type) const { return hybridNumsUnusedBits_.at(type); }
0425     // stub cut on cot(theta) = tan(lambda) = sinh(eta)
0426     double hybridMaxCot() const { return hybridMaxCot_; }
0427     // number of outer PS rings for disk 1, 2, 3, 4, 5
0428     int hybridNumRingsPS(int layerId) const { return hybridNumRingsPS_.at(layerId); }
0429     // mean radius of outer tracker barrel layer
0430     double hybridLayerR(int layerId) const { return hybridLayerRs_.at(layerId); }
0431     // mean z of outer tracker endcap disks
0432     double hybridDiskZ(int layerId) const { return hybridDiskZs_.at(layerId); }
0433     // range of stub phi in rad
0434     double hybridRangePhi() const { return hybridRangePhi_; }
0435     // range of stub r in cm
0436     double hybridRangeR() const { return hybridRangesR_[SensorModule::DiskPS]; }
0437     // biggest barrel stub z position after TrackBuilder in cm
0438     double tbBarrelHalfLength() const { return tbBarrelHalfLength_; }
0439     // smallest stub radius after TrackBuilder in cm
0440     double tbInnerRadius() const { return tbInnerRadius_; }
0441     // center radius of outer tracker endcap 2S diks strips
0442     double disk2SR(int layerId, int r) const { return disk2SRs_.at(layerId).at(r); }
0443     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S) after TrackBuilder
0444     int tbWidthR(SensorModule::Type type) const { return tbWidthsR_.at(type); }
0445 
0446     // Parameter specifying TTStub algorithm
0447 
0448     // number of tilted layer rings per barrel layer
0449     double numTiltedLayerRing(int layerId) const { return numTiltedLayerRings_.at(layerId); };
0450     // stub bend window sizes for flat barrel layer in full pitch units
0451     double windowSizeBarrelLayer(int layerId) const { return windowSizeBarrelLayers_.at(layerId); };
0452     // stub bend window sizes for tilted barrel layer rings in full pitch units
0453     double windowSizeTiltedLayerRing(int layerId, int ring) const {
0454       return windowSizeTiltedLayerRings_.at(layerId).at(ring);
0455     };
0456     // stub bend window sizes for endcap disks rings in full pitch units
0457     double windowSizeEndcapDisksRing(int layerId, int ring) const {
0458       return windowSizeEndcapDisksRings_.at(layerId).at(ring);
0459     };
0460     // precision of window sizes in pitch units
0461     double baseWindowSize() const { return baseWindowSize_; }
0462     // index = encoded bend, value = decoded bend for given window size and module type
0463     const std::vector<double>& encodingBend(int windowSize, bool psModule) const;
0464     //getBendCut
0465     const StubAlgorithmOfficial* stubAlgorithm() const { return stubAlgorithm_; }
0466 
0467     // Parameter specifying front-end
0468 
0469     // number of bits used for internal stub bend
0470     int widthBend() const { return widthBend_; }
0471     // number of bits used for internal stub column
0472     int widthCol() const { return widthCol_; }
0473     // number of bits used for internal stub row
0474     int widthRow() const { return widthRow_; }
0475     // precision of internal stub bend in pitch units
0476     double baseBend() const { return baseBend_; }
0477     // precision of internal stub column in pitch units
0478     double baseCol() const { return baseCol_; }
0479     // precision of internal stub row in pitch units
0480     double baseRow() const { return baseRow_; }
0481     // used stub bend uncertainty in pitch units
0482     double bendCut() const { return bendCut_; }
0483 
0484     // Parameter specifying DTC
0485 
0486     // number of phi slices the outer tracker readout is organized in
0487     int numRegions() const { return numRegions_; }
0488     // number of regions a reconstructable particles may cross
0489     int numOverlappingRegions() const { return numOverlappingRegions_; }
0490     // number of Tracker boards per ATCA crate.
0491     int numATCASlots() const { return numATCASlots_; }
0492     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0493     int numDTCsPerRegion() const { return numDTCsPerRegion_; }
0494     // max number of sensor modules connected to one DTC board
0495     int numModulesPerDTC() const { return numModulesPerDTC_; }
0496     // number of systiloic arrays in stub router firmware
0497     int dtcNumRoutingBlocks() const { return dtcNumRoutingBlocks_; }
0498     // fifo depth in stub router firmware
0499     int dtcDepthMemory() const { return dtcDepthMemory_; }
0500     // number of row bits used in look up table
0501     int dtcWidthRowLUT() const { return dtcWidthRowLUT_; }
0502     // number of bits used for stub inv2R. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0503     int dtcWidthInv2R() const { return dtcWidthInv2R_; }
0504     // tk layout det id minus DetSetVec->detId
0505     int offsetDetIdDSV() const { return offsetDetIdDSV_; }
0506     // tk layout det id minus TrackerTopology lower det id
0507     int offsetDetIdTP() const { return offsetDetIdTP_; }
0508     // offset in layer ids between barrel layer and endcap disks
0509     int offsetLayerDisks() const { return offsetLayerDisks_; }
0510     // offset between 0 and smallest layer id (barrel layer 1)
0511     int offsetLayerId() const { return offsetLayerId_; }
0512     // number of barrel layer
0513     int numBarrelLayer() const { return numBarrelLayer_; }
0514     // number of barrel PS layer
0515     int numBarrelLayerPS() const { return numBarrelLayerPS_; }
0516     // total number of outer tracker DTCs
0517     int numDTCs() const { return numDTCs_; }
0518     // number of DTCs connected to one TFP (48)
0519     int numDTCsPerTFP() const { return numDTCsPerTFP_; }
0520     // total number of max possible outer tracker modules (72 per DTC)
0521     int numModules() const { return numModules_; }
0522     // max number of moudles connected to a systiloic array in stub router firmware
0523     int dtcNumModulesPerRoutingBlock() const { return dtcNumModulesPerRoutingBlock_; }
0524     // number of merged rows for look up
0525     int dtcNumMergedRows() const { return dtcNumMergedRows_; }
0526     // number of bits used for phi of row slope
0527     int dtcWidthM() const { return dtcWidthM_; }
0528     // internal stub inv2R precision in 1 /cm
0529     double dtcBaseInv2R() const { return dtcBaseInv2R_; }
0530     // phi of row slope precision in rad / pitch unit
0531     double dtcBaseM() const { return dtcBaseM_; }
0532     // sensor modules connected to given dtc id
0533     const std::vector<SensorModule*>& dtcModules(int dtcId) const { return dtcModules_.at(dtcId); }
0534     // total number of output channel
0535     int dtcNumStreams() const { return dtcNumStreams_; }
0536 
0537     // Parameter specifying TFP
0538 
0539     // number of bist used for phi0
0540     int tfpWidthPhi0() const { return tfpWidthPhi0_; }
0541     // umber of bist used for invR
0542     int tfpWidthInvR() const { return tfpWidthInvR_; }
0543     // number of bist used for cot(theta)
0544     int tfpWidthCot() const { return tfpWidthCot_; }
0545     // number of bist used for z0
0546     int tfpWidthZ0() const { return tfpWidthZ0_; }
0547     // number of output links
0548     int tfpNumChannel() const { return tfpNumChannel_; }
0549 
0550     // Parameter specifying GeometricProcessor
0551 
0552     // number of phi sectors in a processing nonant used in hough transform
0553     int gpNumBinsPhiT() const { return gpNumBinsPhiT_; }
0554     // number of eta sectors used in hough transform
0555     int gpNumBinsZT() const { return gpNumBinsZT_; }
0556     // # critical radius defining r-z sector shape in cm
0557     double chosenRofZ() const { return chosenRofZ_; }
0558     // fifo depth in stub router firmware
0559     int gpDepthMemory() const { return gpDepthMemory_; }
0560     //
0561     int gpWidthModule() const { return gpWidthModule_; }
0562     // phi sector size in rad
0563     double baseSector() const { return baseSector_; }
0564     // total number of sectors
0565     int numSectors() const { return numSectors_; }
0566     //
0567     double maxRphi() const { return maxRphi_; }
0568     //
0569     double maxRz() const { return maxRz_; }
0570 
0571     // Parameter specifying HoughTransform
0572 
0573     // number of inv2R bins used in hough transform
0574     int htNumBinsInv2R() const { return htNumBinsInv2R_; }
0575     // number of phiT bins used in hough transform
0576     int htNumBinsPhiT() const { return htNumBinsPhiT_; }
0577     // required number of stub layers to form a candidate
0578     int htMinLayers() const { return htMinLayers_; }
0579     // internal fifo depth
0580     int htDepthMemory() const { return htDepthMemory_; }
0581 
0582     // Parameter specifying Track Builder
0583 
0584     // number of finer inv2R bins inside HT bin
0585     int ctbNumBinsInv2R() const { return ctbNumBinsInv2R_; }
0586     // number of finer phiT bins inside HT bin
0587     int ctbNumBinsPhiT() const { return ctbNumBinsPhiT_; }
0588     // number of used z0 bins inside GP ZT bin
0589     int ctbNumBinsCot() const { return ctbNumBinsCot_; }
0590     //number of used zT bins inside GP ZT bin
0591     int ctbNumBinsZT() const { return ctbNumBinsZT_; }
0592     // required number of stub layers to form a candidate
0593     int ctbMinLayers() const { return ctbMinLayers_; }
0594     // max number of output tracks per node
0595     int ctbMaxTracks() const { return ctbMaxTracks_; }
0596     // cut on number of stub per layer for input candidates
0597     int ctbMaxStubs() const { return ctbMaxStubs_; }
0598     // internal memory depth
0599     int ctbDepthMemory() const { return ctbDepthMemory_; }
0600 
0601     // Parameter specifying KalmanFilter
0602 
0603     // double precision simulation of 5 parameter fit instead of bit accurate emulation of 4 parameter fit
0604     bool kfUse5ParameterFit() const { return kfUse5ParameterFit_; }
0605     // simulate KF instead of emulate
0606     bool kfUseSimmulation() const { return kfUseSimmulation_; }
0607     // stub residuals and radius are recalculated from seed parameter and TTStub position
0608     bool kfUseTTStubResiduals() const { return kfUseTTStubResiduals_; }
0609     // track parameter are recalculated from seed TTStub positions
0610     bool kfUseTTStubParameters() const { return kfUseTTStubParameters_; }
0611     //
0612     bool kfApplyNonLinearCorrection() const { return kfApplyNonLinearCorrection_; }
0613     // number of kf worker
0614     int kfNumWorker() const { return kfNumWorker_; }
0615     // max number of tracks a kf worker can process
0616     int kfMaxTracks() const { return kfMaxTracks_; }
0617     // required number of stub layers to form a track
0618     int kfMinLayers() const { return kfMinLayers_; }
0619     // required number of ps stub layers to form a track
0620     int kfMinLayersPS() const { return kfMinLayersPS_; }
0621     // maximum number of  layers added to a track
0622     int kfMaxLayers() const { return kfMaxLayers_; }
0623     //
0624     int kfMaxGaps() const { return kfMaxGaps_; }
0625     //
0626     int kfMaxSeedingLayer() const { return kfMaxSeedingLayer_; }
0627     //
0628     int kfNumSeedStubs() const { return kfNumSeedStubs_; }
0629     //
0630     double kfMinSeedDeltaR() const { return kfMinSeedDeltaR_; }
0631     // search window of each track parameter in initial uncertainties
0632     double kfRangeFactor() const { return kfRangeFactor_; }
0633     // initial C00 is given by inv2R uncertainty squared times this power of 2
0634     int kfShiftInitialC00() const { return kfShiftInitialC00_; }
0635     // initial C11 is given by phiT uncertainty squared times this power of 2
0636     int kfShiftInitialC11() const { return kfShiftInitialC11_; }
0637     // initial C22 is given by cot uncertainty squared times this power of 2
0638     int kfShiftInitialC22() const { return kfShiftInitialC22_; }
0639     // initial C33 is given by zT uncertainty squared times this power of 2
0640     int kfShiftInitialC33() const { return kfShiftInitialC33_; }
0641     //
0642     int kfShiftChi20() const { return kfShiftChi20_; }
0643     //
0644     int kfShiftChi21() const { return kfShiftChi21_; }
0645     //
0646     double kfCutChi2() const { return kfCutChi2_; }
0647     //
0648     int kfWidthChi2() const { return kfWidthChi2_; }
0649 
0650     // Parameter specifying DuplicateRemoval
0651 
0652     // internal memory depth
0653     int drDepthMemory() const { return drDepthMemory_; }
0654 
0655     // Parameter specifying TrackQuaility
0656 
0657     // number of output channel
0658     int tqNumChannel() const { return tqNumChannel_; }
0659 
0660   private:
0661     // checks consitency between history and current configuration for a specific module
0662     void checkHistory(const edm::ProcessHistory&,
0663                       const edm::pset::Registry*,
0664                       const std::string&,
0665                       const edm::ParameterSetID&) const;
0666     // dumps pSetHistory where incosistent lines with pSetProcess are highlighted
0667     std::string dumpDiff(const edm::ParameterSet& pSetHistory, const edm::ParameterSet& pSetProcess) const;
0668     // derive constants
0669     void calculateConstants();
0670     // convert configuration of TTStubAlgorithm
0671     void consumeStubAlgorithm();
0672     // create bend encodings
0673     void encodeBend(std::vector<std::vector<double>>&, bool) const;
0674     // create sensor modules
0675     void produceSensorModules();
0676     // range check of dtc id
0677     void checkDTCId(int dtcId) const;
0678     // range check of tklayout id
0679     void checkTKLayoutId(int tkLayoutId) const;
0680     // range check of tfp identifier
0681     void checkTFPIdentifier(int tfpRegion, int tfpChannel) const;
0682     // configure TPSelector
0683     void configureTPSelector();
0684 
0685     // TrackerGeometry
0686     const TrackerGeometry* trackerGeometry_;
0687     // TrackerTopology
0688     const TrackerTopology* trackerTopology_;
0689     // CablingMap
0690     const TrackerDetToDTCELinkCablingMap* cablingMap_;
0691     // TTStub algorithm used to create bend encodings
0692     const StubAlgorithmOfficial* stubAlgorithm_;
0693     // pSet of ttStub algorithm, used to identify bend window sizes of sensor modules
0694     const edm::ParameterSet* pSetSA_;
0695 
0696     // half lumi region size in cm
0697     double beamWindowZ_;
0698     // cut on stub and TP pt, also defines region overlap shape in GeV
0699     double minPt_;
0700     // cut on candidate pt
0701     double minPtCand_;
0702     // cut on stub eta
0703     double maxEta_;
0704     // in cm, constraints track reconstruction phase space
0705     double maxD0_;
0706     // critical radius defining region overlap shape in cm
0707     double chosenRofPhi_;
0708     // number of detector layers a reconstructbale particle may cross
0709     int numLayers_;
0710     // required number of stub layers to form a track
0711     int minLayers_;
0712 
0713     // number of bits used for stub r - ChosenRofPhi
0714     int tmttWidthR_;
0715     // number of bits used for stub phi w.r.t. phi sector centre
0716     int tmttWidthPhi_;
0717     // number of bits used for stub z
0718     int tmttWidthZ_;
0719 
0720     // max number of layers connected to one DTC
0721     int hybridNumLayers_;
0722     // number of outer PS rings for disk 1, 2, 3, 4, 5
0723     std::vector<int> hybridNumRingsPS_;
0724     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0725     std::vector<int> hybridWidthsR_;
0726     // number of bits used for stub z w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0727     std::vector<int> hybridWidthsZ_;
0728     // number of bits used for stub phi w.r.t. region centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0729     std::vector<int> hybridWidthsPhi_;
0730     // number of bits used for stub row number for module types (barrelPS, barrel2S, diskPS, disk2S)
0731     std::vector<int> hybridWidthsAlpha_;
0732     // number of bits used for stub bend number for module types (barrelPS, barrel2S, diskPS, disk2S)
0733     std::vector<int> hybridWidthsBend_;
0734     // range in stub r which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0735     std::vector<double> hybridRangesR_;
0736     // range in stub z which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0737     std::vector<double> hybridRangesZ_;
0738     // range in stub row which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0739     std::vector<double> hybridRangesAlpha_;
0740     // mean radius of outer tracker barrel layer
0741     std::vector<double> hybridLayerRs_;
0742     // mean z of outer tracker endcap disks
0743     std::vector<double> hybridDiskZs_;
0744     // center radius of outer tracker endcap 2S diks strips
0745     std::vector<edm::ParameterSet> hybridDisk2SRsSet_;
0746     // range of stub phi in rad
0747     double hybridRangePhi_;
0748     // biggest barrel stub z position after TrackBuilder in cm
0749     double tbBarrelHalfLength_;
0750     // smallest stub radius after TrackBuilder in cm
0751     double tbInnerRadius_;
0752     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S) after TrackBuilder
0753     std::vector<int> tbWidthsR_;
0754 
0755     // enable emulation of truncation for TM, DR, KF, TQ and TFP
0756     int enableTruncation_;
0757     // use Hybrid or TMTT as TT algorithm
0758     bool useHybrid_;
0759     // width of the 'A' port of an DSP slice
0760     int widthDSPa_;
0761     // width of the 'A' port of an DSP slice using biased twos complement
0762     int widthDSPab_;
0763     // width of the 'A' port of an DSP slice using biased binary
0764     int widthDSPau_;
0765     // width of the 'B' port of an DSP slice
0766     int widthDSPb_;
0767     // width of the 'B' port of an DSP slice using biased twos complement
0768     int widthDSPbb_;
0769     // width of the 'B' port of an DSP slice using biased binary
0770     int widthDSPbu_;
0771     // width of the 'C' port of an DSP slice
0772     int widthDSPc_;
0773     // width of the 'C' port of an DSP slice using biased twos complement
0774     int widthDSPcb_;
0775     // width of the 'C' port of an DSP slice using biased binary
0776     int widthDSPcu_;
0777     // smallest address width of an BRAM36 configured as broadest simple dual port memory
0778     int widthAddrBRAM36_;
0779     // smallest address width of an BRAM18 configured as broadest simple dual port memory
0780     int widthAddrBRAM18_;
0781     // needed gap between events of emp-infrastructure firmware
0782     int numFramesInfra_;
0783     // LHC bunch crossing rate in MHz
0784     double freqLHC_;
0785     // processing Frequency of DTC & TFP in MHz, has to be integer multiple of FreqLHC
0786     double freqBEHigh_;
0787     // processing Frequency of DTC & TFP in MHz, has to be integer multiple of FreqLHC
0788     double freqBELow_;
0789     // number of events collected in front-end
0790     int tmpFE_;
0791     // time multiplexed period of track finding processor
0792     int tmpTFP_;
0793     // speed of light used in FW in e8 m/s
0794     double speedOfLight_;
0795 
0796     // BField used in fw in T
0797     double bField_;
0798     // accepted BField difference between FW to EventSetup in T
0799     double bFieldError_;
0800     // outer radius of outer tracker in cm
0801     double outerRadius_;
0802     // inner radius of outer tracker in cm
0803     double innerRadius_;
0804     // half length of outer tracker in cm
0805     double halfLength_;
0806     // max strip/pixel pitch of outer tracker sensors in cm
0807     double maxPitchRow_;
0808     // max strip/pixel length of outer tracker sensors in cm
0809     double maxPitchCol_;
0810     // approximated tilt correction parameter used to project r to z uncertainty
0811     double tiltApproxSlope_;
0812     // approximated tilt correction parameter used to project r to z uncertainty
0813     double tiltApproxIntercept_;
0814     // In tilted barrel, constant assumed stub radial uncertainty * sqrt(12) in cm
0815     double tiltUncertaintyR_;
0816     // scattering term used to add stub phi uncertainty depending on assumed track inv2R
0817     double scattering_;
0818     // strip pitch of outer tracker sensors in cm
0819     double pitchRow2S_;
0820     // pixel pitch of outer tracker sensors in cm
0821     double pitchRowPS_;
0822     // strip length of outer tracker sensors in cm
0823     double pitchCol2S_;
0824     // pixel length of outer tracker sensors in cm
0825     double pitchColPS_;
0826     // barrel layer limit r value to partition into PS and 2S region
0827     double limitPSBarrel_;
0828     // barrel layer limit r value to partition into tilted and untilted region
0829     std::vector<double> limitsTiltedR_;
0830     // barrel layer limit |z| value to partition into tilted and untilted region
0831     std::vector<double> limitsTiltedZ_;
0832     // endcap disk limit |z| value to partition into PS and 2S region
0833     std::vector<double> limitsPSDiksZ_;
0834     // endcap disk limit r value to partition into PS and 2S region
0835     std::vector<double> limitsPSDiksR_;
0836     // barrel layer limit |z| value to partition into tilted and untilted region
0837     std::vector<double> tiltedLayerLimitsZ_;
0838     // endcap disk limit r value to partition into PS and 2S region
0839     std::vector<double> psDiskLimitsR_;
0840 
0841     // number of bits used for internal stub bend
0842     int widthBend_;
0843     // number of bits used for internal stub column
0844     int widthCol_;
0845     // number of bits used for internal stub row
0846     int widthRow_;
0847     // precision of internal stub bend in pitch units
0848     double baseBend_;
0849     // precision of internal stub column in pitch units
0850     double baseCol_;
0851     // precision of internal stub row in pitch units
0852     double baseRow_;
0853     // precision of window sizes in pitch units
0854     double baseWindowSize_;
0855     // used stub bend uncertainty in pitch units
0856     double bendCut_;
0857 
0858     // number of phi slices the outer tracker readout is organized in
0859     int numRegions_;
0860     // number of regions a reconstructable particles may cross
0861     int numOverlappingRegions_;
0862     // number of Slots in used ATCA crates
0863     int numATCASlots_;
0864     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0865     int numDTCsPerRegion_;
0866     // max number of sensor modules connected to one DTC board
0867     int numModulesPerDTC_;
0868     // number of systiloic arrays in stub router firmware
0869     int dtcNumRoutingBlocks_;
0870     // fifo depth in stub router firmware
0871     int dtcDepthMemory_;
0872     // number of row bits used in look up table
0873     int dtcWidthRowLUT_;
0874     // number of bits used for stub inv2R. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0875     int dtcWidthInv2R_;
0876     // tk layout det id minus DetSetVec->detId
0877     int offsetDetIdDSV_;
0878     // tk layout det id minus TrackerTopology lower det id
0879     int offsetDetIdTP_;
0880     // offset in layer ids between barrel layer and endcap disks
0881     int offsetLayerDisks_;
0882     // offset between 0 and smallest layer id (barrel layer 1)
0883     int offsetLayerId_;
0884     // number of barrel layer
0885     int numBarrelLayer_;
0886     // number of barrel ps layer
0887     int numBarrelLayerPS_;
0888     // total number of output channel
0889     int dtcNumStreams_;
0890     // slot number changing from PS to 2S (default: 6)
0891     int slotLimitPS_;
0892     // slot number changing from 10 gbps to 5gbps (default: 3)
0893     int slotLimit10gbps_;
0894 
0895     // number of bits used for phi0
0896     int tfpWidthPhi0_;
0897     // umber of bits used for qOverPt
0898     int tfpWidthInvR_;
0899     // number of bits used for cot(theta)
0900     int tfpWidthCot_;
0901     // number of bits used for z0
0902     int tfpWidthZ0_;
0903     // number of output links
0904     int tfpNumChannel_;
0905 
0906     // number of phi sectors used in hough transform
0907     int gpNumBinsPhiT_;
0908     // number of eta sectors used in hough transform
0909     int gpNumBinsZT_;
0910     // # critical radius defining r-z sector shape in cm
0911     double chosenRofZ_;
0912     // fifo depth in stub router firmware
0913     int gpDepthMemory_;
0914     //
0915     int gpWidthModule_;
0916     //
0917     int gpPosPS_;
0918     //
0919     int gpPosBarrel_;
0920     //
0921     int gpPosTilted_;
0922 
0923     // number of inv2R bins used in hough transform
0924     int htNumBinsInv2R_;
0925     // number of phiT bins used in hough transform
0926     int htNumBinsPhiT_;
0927     // required number of stub layers to form a candidate
0928     int htMinLayers_;
0929     // internal fifo depth
0930     int htDepthMemory_;
0931 
0932     // number of finer inv2R bins inside HT bin
0933     int ctbNumBinsInv2R_;
0934     // number of finer phiT bins inside HT bin
0935     int ctbNumBinsPhiT_;
0936     // number of used cot bins inside GP ZT bin
0937     int ctbNumBinsCot_;
0938     //number of used zT bins inside GP ZT bin
0939     int ctbNumBinsZT_;
0940     // required number of stub layers to form a candidate
0941     int ctbMinLayers_;
0942     // max number of output tracks per node
0943     int ctbMaxTracks_;
0944     // cut on number of stub per layer for input candidates
0945     int ctbMaxStubs_;
0946     // internal memory depth
0947     int ctbDepthMemory_;
0948 
0949     // double precision simulation of 5 parameter fit instead of bit accurate emulation of 4 parameter fit
0950     bool kfUse5ParameterFit_;
0951     // simulate KF instead of emulate
0952     bool kfUseSimmulation_;
0953     // stub residuals and radius are recalculated from seed parameter and TTStub position
0954     bool kfUseTTStubResiduals_;
0955     // track parameter are recalculated from seed TTStub positions
0956     bool kfUseTTStubParameters_;
0957     //
0958     bool kfApplyNonLinearCorrection_;
0959     // number of kf worker
0960     int kfNumWorker_;
0961     // max number of tracks a kf worker can process
0962     int kfMaxTracks_;
0963     // required number of stub layers to form a track
0964     int kfMinLayers_;
0965     // required number of ps stub layers to form a track
0966     int kfMinLayersPS_;
0967     // maximum number of  layers added to a track
0968     int kfMaxLayers_;
0969     //
0970     int kfMaxGaps_;
0971     //
0972     int kfMaxSeedingLayer_;
0973     //
0974     int kfNumSeedStubs_;
0975     //
0976     double kfMinSeedDeltaR_;
0977     // search window of each track parameter in initial uncertainties
0978     double kfRangeFactor_;
0979     // initial C00 is given by inv2R uncertainty squared times this power of 2
0980     int kfShiftInitialC00_;
0981     // initial C11 is given by phiT uncertainty squared times this power of 2
0982     int kfShiftInitialC11_;
0983     // initial C22 is given by cot uncertainty squared times this power of 2
0984     int kfShiftInitialC22_;
0985     // initial C33 is given by zT uncertainty squared times this power of 2
0986     int kfShiftInitialC33_;
0987     //
0988     int kfShiftChi20_;
0989     //
0990     int kfShiftChi21_;
0991     //
0992     double kfCutChi2_;
0993     //
0994     int kfWidthChi2_;
0995 
0996     // internal memory depth
0997     int drDepthMemory_;
0998 
0999     // number of output channel
1000     int tqNumChannel_;
1001 
1002     //
1003     // Derived constants
1004     //
1005 
1006     // TTStubAlgorithm
1007 
1008     // number of tilted layer rings per barrel layer
1009     std::vector<double> numTiltedLayerRings_;
1010     // stub bend window sizes for flat barrel layer in full pitch units
1011     std::vector<double> windowSizeBarrelLayers_;
1012     // stub bend window sizes for tilted barrel layer rings in full pitch units
1013     std::vector<std::vector<double>> windowSizeTiltedLayerRings_;
1014     // stub bend window sizes for endcap disks rings in full pitch units
1015     std::vector<std::vector<double>> windowSizeEndcapDisksRings_;
1016     // maximum stub bend window in half strip units
1017     int maxWindowSize_;
1018 
1019     // common Track finding
1020 
1021     // number of frames betwen 2 resets of 18 BX packets
1022     int numFramesHigh_;
1023     // number of frames betwen 2 resets of 18 BX packets
1024     int numFramesLow_;
1025     // number of valid frames per 18 BX packet
1026     int numFramesIOHigh_;
1027     // number of valid frames per 18 BX packet
1028     int numFramesIOLow_;
1029     // number of valid frames per 8 BX packet
1030     int numFramesFE_;
1031     // converts GeV in 1/cm
1032     double invPtToDphi_;
1033     // region size in rad
1034     double baseRegion_;
1035     // max cot(theta) of found tracks
1036     double maxCot_;
1037 
1038     // TMTT
1039 
1040     // number of bits used for stub layer id
1041     int widthLayerId_;
1042     // internal stub r precision in cm
1043     double tmttBaseR_;
1044     // internal stub z precision in cm
1045     double tmttBaseZ_;
1046     // internal stub phi precision in rad
1047     double tmttBasePhi_;
1048     // internal stub inv2R precision in 1/cm
1049     double tmttBaseInv2R_;
1050     // internal stub phiT precision in rad
1051     double tmttBasePhiT_;
1052     // number of padded 0s in output data format
1053     int dtcNumUnusedBits_;
1054     // number of bits used for stub layer id
1055     int tmttWidthLayer_;
1056     // number of bits used for stub eta sector
1057     int tmttWidthSectorEta_;
1058     // number of bits used for stub inv2R
1059     int tmttWidthInv2R_;
1060     // number of padded 0s in output data format
1061     int tmttNumUnusedBits_;
1062 
1063     // hybrid
1064 
1065     // number of bits used for stub layer id
1066     int hybridWidthLayerId_;
1067     // precision or r in cm for (barrelPS, barrel2S, diskPS, disk2S)
1068     std::vector<double> hybridBasesR_;
1069     // precision or phi in rad for (barrelPS, barrel2S, diskPS, disk2S)
1070     std::vector<double> hybridBasesPhi_;
1071     // precision or z in cm for (barrelPS, barrel2S, diskPS, disk2S)
1072     std::vector<double> hybridBasesZ_;
1073     // precision or alpha in pitch units for (barrelPS, barrel2S, diskPS, disk2S)
1074     std::vector<double> hybridBasesAlpha_;
1075     // stub r precision in cm
1076     double hybridBaseZ_;
1077     // stub z precision in cm
1078     double hybridBaseR_;
1079     // stub phi precision in rad
1080     double hybridBasePhi_;
1081     // stub cut on cot(theta) = tan(lambda) = sinh(eta)
1082     double hybridMaxCot_;
1083     // number of padded 0s in output data format for (barrelPS, barrel2S, diskPS, disk2S)
1084     std::vector<int> hybridNumsUnusedBits_;
1085     // center radius of outer tracker endcap 2S diks strips
1086     std::vector<std::vector<double>> disk2SRs_;
1087 
1088     // DTC
1089 
1090     // total number of outer tracker DTCs
1091     int numDTCs_;
1092     // number of DTCs connected to one TFP (48)
1093     int numDTCsPerTFP_;
1094     // total number of max possible outer tracker modules (72 per DTC)
1095     int numModules_;
1096     // max number of moudles connected to a systiloic array in stub router firmware
1097     int dtcNumModulesPerRoutingBlock_;
1098     // number of merged rows for look up
1099     int dtcNumMergedRows_;
1100     // number of bits used for phi of row slope
1101     int dtcWidthM_;
1102     // internal stub inv2R precision in 1 /cm
1103     double dtcBaseInv2R_;
1104     // phi of row slope precision in rad / pitch unit
1105     double dtcBaseM_;
1106     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for ps modules
1107     std::vector<std::vector<double>> encodingsBendPS_;
1108     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for 2s modules
1109     std::vector<std::vector<double>> encodingsBend2S_;
1110     // collection of outer tracker sensor modules
1111     std::vector<SensorModule> sensorModules_;
1112     // collection of outer tracker sensor modules organised in DTCS [0-215][0-71]
1113     std::vector<std::vector<SensorModule*>> dtcModules_;
1114     // hepler to convert Stubs quickly
1115     std::unordered_map<DetId, SensorModule*> detIdToSensorModule_;
1116 
1117     // GP
1118 
1119     // phi sector size in rad
1120     double baseSector_;
1121     //
1122     double maxRphi_;
1123     //
1124     double maxRz_;
1125     // total number of sectors
1126     int numSectors_;
1127 
1128     // CTB
1129 
1130     // number of bits used to count stubs per layer
1131     int ctbWidthLayerCount_;
1132 
1133     // KFout
1134 
1135     // Bins used to digitize dPhi for chi2 calculation
1136     std::vector<int> kfoutdPhiBins_;
1137     // Bins used to digitize dZ for chi2 calculation
1138     std::vector<int> kfoutdZBins_;
1139     // v0 weight Bins corresponding to dPhi Bins for chi2 calculation
1140     std::vector<int> kfoutv0Bins_;
1141     // v1 weight Bins corresponding to dZ Bins for chi2 calculation
1142     std::vector<int> kfoutv1Bins_;
1143   };
1144 
1145 }  // namespace tt
1146 
1147 EVENTSETUP_DATA_DEFAULT_RECORD(tt::Setup, tt::SetupRcd);
1148 
1149 #endif