Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:09

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/Provenance/interface/ProcessHistory.h"
0008 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0009 #include "DataFormats/DetId/interface/DetId.h"
0010 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0011 #include "DataFormats/Math/interface/deltaPhi.h"
0012 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0013 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0014 #include "Geometry/CommonTopologies/interface/PixelGeomDetUnit.h"
0015 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0016 #include "DetectorDescription/Core/interface/DDCompactView.h"
0017 #include "DetectorDescription/DDCMS/interface/DDCompactView.h"
0018 #include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm_official.h"
0019 #include "MagneticField/Engine/interface/MagneticField.h"
0020 #include "CondFormats/SiPhase2TrackerObjects/interface/TrackerDetToDTCELinkCablingMap.h"
0021 #include "SimTracker/Common/interface/TrackingParticleSelector.h"
0022 
0023 #include "SimTracker/TrackTriggerAssociation/interface/TTTypes.h"
0024 #include "DataFormats/L1TrackTrigger/interface/TTDTC.h"
0025 #include "L1Trigger/TrackTrigger/interface/SensorModule.h"
0026 #include "L1Trigger/TrackTrigger/interface/SetupRcd.h"
0027 
0028 #include <vector>
0029 #include <set>
0030 #include <unordered_map>
0031 
0032 namespace tt {
0033 
0034   typedef TTStubAlgorithm<Ref_Phase2TrackerDigi_> StubAlgorithm;
0035   typedef TTStubAlgorithm_official<Ref_Phase2TrackerDigi_> StubAlgorithmOfficial;
0036   // handles 2 pi overflow
0037   inline double deltaPhi(double lhs, double rhs = 0.) { return reco::deltaPhi(lhs, rhs); }
0038 
0039   /*! \class  tt::Setup
0040    *  \brief  Class to process and provide run-time constants used by Track Trigger emulators
0041    *  \author Thomas Schuh
0042    *  \date   2020, Apr
0043    */
0044   class Setup {
0045   public:
0046     Setup() {}
0047     Setup(const edm::ParameterSet& iConfig,
0048           const MagneticField& magneticField,
0049           const TrackerGeometry& trackerGeometry,
0050           const TrackerTopology& trackerTopology,
0051           const TrackerDetToDTCELinkCablingMap& cablingMap,
0052           const StubAlgorithmOfficial& stubAlgorithm,
0053           const edm::ParameterSet& pSetStubAlgorithm,
0054           const edm::ParameterSet& pSetGeometryConfiguration,
0055           const edm::ParameterSetID& pSetIdTTStubAlgorithm,
0056           const edm::ParameterSetID& pSetIdGeometryConfiguration);
0057     ~Setup() {}
0058 
0059     // true if tracker geometry and magnetic field supported
0060     bool configurationSupported() const { return configurationSupported_; }
0061     // checks current configuration vs input sample configuration
0062     void checkHistory(const edm::ProcessHistory& processHistory) const;
0063     // converts tk layout id into dtc id
0064     int dtcId(int tklId) const;
0065     // converts dtci id into tk layout id
0066     int tkLayoutId(int dtcId) const;
0067     // converts TFP identifier (region[0-8], channel[0-47]) into dtcId [0-215]
0068     int dtcId(int tfpRegion, int tfpChannel) const;
0069     // checks if given dtcId is connected to PS or 2S sensormodules
0070     bool psModule(int dtcId) const;
0071     // checks if given dtcId is connected via 10 gbps link
0072     bool gbps10(int dtcId) const;
0073     // checks if given dtcId is connected to -z (false) or +z (true)
0074     bool side(int dtcId) const;
0075     // ATCA slot number [0-11] of given dtcId
0076     int slot(int dtcId) const;
0077     // sensor module for det id
0078     SensorModule* sensorModule(const DetId& detId) const;
0079     // TrackerGeometry
0080     const TrackerGeometry* trackerGeometry() const { return trackerGeometry_; }
0081     // TrackerTopology
0082     const TrackerTopology* trackerTopology() const { return trackerTopology_; }
0083     // returns global TTStub position
0084     GlobalPoint stubPos(const TTStubRef& ttStubRef) const;
0085     // returns bit accurate hybrid stub radius for given TTStubRef and h/w bit word
0086     double stubR(const TTBV& hw, const TTStubRef& ttStubRef) const;
0087     // returns bit accurate position of a stub from a given tfp region [0-8]
0088     GlobalPoint stubPos(bool hybrid, const tt::FrameStub& frame, int region) const;
0089     // empty trackerDTC EDProduct
0090     TTDTC ttDTC() const { return TTDTC(numRegions_, numOverlappingRegions_, numDTCsPerRegion_); }
0091     // checks if stub collection is considered forming a reconstructable track
0092     bool reconstructable(const std::vector<TTStubRef>& ttStubRefs) const;
0093     // checks if tracking particle is selected for efficiency measurements
0094     bool useForAlgEff(const TrackingParticle& tp) const;
0095     // checks if tracking particle is selected for fake and duplicate rate measurements
0096     bool useForReconstructable(const TrackingParticle& tp) const { return tpSelectorLoose_(tp); }
0097     // stub layer id (barrel: 1 - 6, endcap: 11 - 15)
0098     int layerId(const TTStubRef& ttStubRef) const;
0099     // return tracklet layerId (barrel: [0-5], endcap: [6-10]) for given TTStubRef
0100     int trackletLayerId(const TTStubRef& ttStubRef) const;
0101     // return index layerId (barrel: [0-5], endcap: [0-6]) for given TTStubRef
0102     int indexLayerId(const TTStubRef& ttStubRef) const;
0103     // true if stub from barrel module
0104     bool barrel(const TTStubRef& ttStubRef) const;
0105     // true if stub from barrel module
0106     bool psModule(const TTStubRef& ttStubRef) const;
0107     // return sensor moduel type
0108     SensorModule::Type type(const TTStubRef& ttStubRef) const;
0109     //
0110     TTBV layerMap(const std::vector<int>& ints) const;
0111     //
0112     TTBV layerMap(const TTBV& hitPattern, const std::vector<int>& ints) const;
0113     //
0114     std::vector<int> layerMap(const TTBV& hitPattern, const TTBV& ttBV) const;
0115     //
0116     std::vector<int> layerMap(const TTBV& ttBV) const;
0117     // stub projected phi uncertainty
0118     double dPhi(const TTStubRef& ttStubRef, double inv2R) const;
0119     // stub projected z uncertainty
0120     double dZ(const TTStubRef& ttStubRef, double cot) const;
0121     // stub projected chi2phi wheight
0122     double v0(const TTStubRef& ttStubRef, double inv2R) const;
0123     // stub projected chi2z wheight
0124     double v1(const TTStubRef& ttStubRef, double cot) const;
0125     //
0126     const std::vector<SensorModule>& sensorModules() const { return sensorModules_; }
0127 
0128     // Firmware specific Parameter
0129 
0130     // width of the 'A' port of an DSP slice
0131     int widthDSPa() const { return widthDSPa_; }
0132     // width of the 'A' port of an DSP slice using biased twos complement
0133     int widthDSPab() const { return widthDSPab_; }
0134     // width of the 'A' port of an DSP slice using biased binary
0135     int widthDSPau() const { return widthDSPau_; }
0136     // width of the 'B' port of an DSP slice
0137     int widthDSPb() const { return widthDSPb_; }
0138     // width of the 'B' port of an DSP slice using biased twos complement
0139     int widthDSPbb() const { return widthDSPbb_; }
0140     // width of the 'B' port of an DSP slice using biased binary
0141     int widthDSPbu() const { return widthDSPbu_; }
0142     // width of the 'C' port of an DSP slice
0143     int widthDSPc() const { return widthDSPc_; }
0144     // width of the 'C' port of an DSP slice using biased twos complement
0145     int widthDSPcb() const { return widthDSPcb_; }
0146     // width of the 'C' port of an DSP slice using biased binary
0147     int widthDSPcu() const { return widthDSPcu_; }
0148     // smallest address width of an BRAM36 configured as broadest simple dual port memory
0149     int widthAddrBRAM36() const { return widthAddrBRAM36_; }
0150     // smallest address width of an BRAM18 configured as broadest simple dual port memory
0151     int widthAddrBRAM18() const { return widthAddrBRAM18_; }
0152     // number of frames betwen 2 resets of 18 BX packets
0153     int numFrames() const { return numFrames_; }
0154     // number of frames needed per reset
0155     int numFramesInfra() const { return numFramesInfra_; }
0156     // number of valid frames per 18 BX packet
0157     int numFramesIO() const { return numFramesIO_; }
0158     // number of valid frames per 8 BX packet
0159     int numFramesFE() const { return numFramesFE_; }
0160     // maximum representable stub phi uncertainty
0161     double maxdPhi() const { return maxdPhi_; }
0162     // maximum representable stub z uncertainty
0163     double maxdZ() const { return maxdZ_; }
0164     // barrel layer limit z value to partition into tilted and untilted region
0165     double tiltedLayerLimitZ(int layer) const { return tiltedLayerLimitsZ_.at(layer); }
0166     // endcap disk limit r value to partition into PS and 2S region
0167     double psDiskLimitR(int layer) const { return psDiskLimitsR_.at(layer); }
0168     // strip pitch of outer tracker sensors in cm
0169     double pitch2S() const { return pitch2S_; }
0170     // pixel pitch of outer tracker sensors in cm
0171     double pitchPS() const { return pitchPS_; }
0172     // strip length of outer tracker sensors in cm
0173     double length2S() const { return length2S_; }
0174     // pixel length of outer tracker sensors in cm
0175     double lengthPS() const { return lengthPS_; }
0176 
0177     // Common track finding parameter
0178 
0179     // half lumi region size in cm
0180     double beamWindowZ() const { return beamWindowZ_; }
0181     // converts GeV in 1/cm
0182     double invPtToDphi() const { return invPtToDphi_; }
0183     // region size in rad
0184     double baseRegion() const { return baseRegion_; }
0185     // pt cut
0186     double tpMinPt() const { return tpMinPt_; }
0187     // TP eta cut
0188     double tpMaxEta() const { return tpMaxEta_; }
0189     // TP cut on vertex pos r in cm
0190     double tpMaxVertR() const { return tpMaxVertR_; }
0191     // TP cut on vertex pos z in cm
0192     double tpMaxVertZ() const { return tpMaxVertZ_; }
0193     // TP cut on impact parameter in cm
0194     double tpMaxD0() const { return tpMaxD0_; }
0195     // required number of associated layers to a TP to consider it reconstruct-able
0196     int tpMinLayers() const { return tpMinLayers_; }
0197     // required number of associated ps layers to a TP to consider it reconstruct-able
0198     int tpMinLayersPS() const { return tpMinLayersPS_; }
0199     // max number of unassociated 2S stubs allowed to still associate TTTrack with TP
0200     int tpMaxBadStubs2S() const { return tpMaxBadStubs2S_; }
0201     // max number of unassociated PS stubs allowed to still associate TTTrack with TP
0202     int tpMaxBadStubsPS() const { return tpMaxBadStubsPS_; }
0203     // BField used in fw in T
0204     double bField() const { return bField_; }
0205 
0206     // TMTT specific parameter
0207 
0208     // cut on stub and TP pt, also defines region overlap shape in GeV
0209     double minPt() const { return minPt_; }
0210     // cut on stub eta
0211     double maxEta() const { return maxEta_; }
0212     // critical radius defining region overlap shape in cm
0213     double chosenRofPhi() const { return chosenRofPhi_; }
0214     // number of detector layers a reconstructbale particle may cross
0215     int numLayers() const { return numLayers_; }
0216     // number of bits used for stub r - ChosenRofPhi
0217     int tmttWidthR() const { return tmttWidthR_; }
0218     // number of bits used for stub phi w.r.t. phi sector centre
0219     int tmttWidthPhi() const { return tmttWidthPhi_; }
0220     // number of bits used for stub z
0221     int tmttWidthZ() const { return tmttWidthZ_; }
0222     // number of bits used for stub layer id
0223     int tmttWidthLayer() const { return tmttWidthLayer_; }
0224     // number of bits used for stub eta sector
0225     int tmttWidthSectorEta() const { return tmttWidthSectorEta_; }
0226     // number of bits used for stub inv2R
0227     int tmttWidthInv2R() const { return tmttWidthInv2R_; }
0228     // internal stub r precision in cm
0229     double tmttBaseR() const { return tmttBaseR_; }
0230     // internal stub z precision in cm
0231     double tmttBaseZ() const { return tmttBaseZ_; }
0232     // internal stub phi precision in rad
0233     double tmttBasePhi() const { return tmttBasePhi_; }
0234     // internal stub inv2R precision in 1/cm
0235     double tmttBaseInv2R() const { return tmttBaseInv2R_; }
0236     // internal stub phiT precision in rad
0237     double tmttBasePhiT() const { return tmttBasePhiT_; }
0238     // number of padded 0s in output data format
0239     int tmttNumUnusedBits() const { return tmttNumUnusedBits_; }
0240     // outer radius of outer tracker in cm
0241     double outerRadius() const { return outerRadius_; }
0242     // inner radius of outer tracker in cm
0243     double innerRadius() const { return innerRadius_; }
0244     // half length of outer tracker in cm
0245     double halfLength() const { return halfLength_; }
0246     // max strip/pixel length of outer tracker sensors in cm
0247     double maxLength() const { return maxLength_; }
0248     // In tilted barrel, grad*|z|/r + int approximates |cosTilt| + |sinTilt * cotTheta|
0249     double tiltApproxSlope() const { return tiltApproxSlope_; }
0250     // In tilted barrel, grad*|z|/r + int approximates |cosTilt| + |sinTilt * cotTheta|
0251     double tiltApproxIntercept() const { return tiltApproxIntercept_; }
0252     // In tilted barrel, constant assumed stub radial uncertainty * sqrt(12) in cm
0253     double tiltUncertaintyR() const { return tiltUncertaintyR_; }
0254     // scattering term used to add stub phi uncertainty depending on assumed track inv2R
0255     double scattering() const { return scattering_; }
0256 
0257     // Hybrid specific parameter
0258 
0259     // cut on stub pt in GeV, also defines region overlap shape
0260     double hybridMinPtStub() const { return hybridMinPtStub_; }
0261     // cut on andidate pt in GeV
0262     double hybridMinPtCand() const { return hybridMinPtCand_; }
0263     // cut on stub eta
0264     double hybridMaxEta() const { return hybridMaxEta_; }
0265     // critical radius defining region overlap shape in cm
0266     double hybridChosenRofPhi() const { return hybridChosenRofPhi_; }
0267     // max number of detector layer connected to one DTC
0268     int hybridNumLayers() const { return hybridNumLayers_; }
0269     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0270     int hybridWidthR(SensorModule::Type type) const { return hybridWidthsR_.at(type); }
0271     // number of bits used for stub z w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0272     int hybridWidthZ(SensorModule::Type type) const { return hybridWidthsZ_.at(type); }
0273     // number of bits used for stub phi w.r.t. region centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0274     int hybridWidthPhi(SensorModule::Type type) const { return hybridWidthsPhi_.at(type); }
0275     // number of bits used for stub row number for module types (barrelPS, barrel2S, diskPS, disk2S)
0276     int hybridWidthAlpha(SensorModule::Type type) const { return hybridWidthsAlpha_.at(type); }
0277     // number of bits used for stub bend number for module types (barrelPS, barrel2S, diskPS, disk2S)
0278     int hybridWidthBend(SensorModule::Type type) const { return hybridWidthsBend_.at(type); }
0279     // number of bits used for stub layer id
0280     int hybridWidthLayerId() const { return hybridWidthLayerId_; }
0281     // precision or r in cm for (barrelPS, barrel2S, diskPS, disk2S)
0282     double hybridBaseR(SensorModule::Type type) const { return hybridBasesR_.at(type); }
0283     // precision or phi in rad for (barrelPS, barrel2S, diskPS, disk2S)
0284     double hybridBasePhi(SensorModule::Type type) const { return hybridBasesPhi_.at(type); }
0285     // precision or z in cm for (barrelPS, barrel2S, diskPS, disk2S)
0286     double hybridBaseZ(SensorModule::Type type) const { return hybridBasesZ_.at(type); }
0287     // precision or alpha in pitch units for (barrelPS, barrel2S, diskPS, disk2S)
0288     double hybridBaseAlpha(SensorModule::Type type) const { return hybridBasesAlpha_.at(type); }
0289     // number of padded 0s in output data format for (barrelPS, barrel2S, diskPS, disk2S)
0290     int hybridNumUnusedBits(SensorModule::Type type) const { return hybridNumsUnusedBits_.at(type); }
0291     // stub cut on cot(theta) = tan(lambda) = sinh(eta)
0292     double hybridMaxCot() const { return hybridMaxCot_; }
0293     // number of outer PS rings for disk 1, 2, 3, 4, 5
0294     int hybridNumRingsPS(int layerId) const { return hybridNumRingsPS_.at(layerId); }
0295     // mean radius of outer tracker barrel layer
0296     double hybridLayerR(int layerId) const { return hybridLayerRs_.at(layerId); }
0297     // mean z of outer tracker endcap disks
0298     double hybridDiskZ(int layerId) const { return hybridDiskZs_.at(layerId); }
0299     // range of stub phi in rad
0300     double hybridRangePhi() const { return hybridRangePhi_; }
0301     // range of stub r in cm
0302     double hybridRangeR() const { return hybridRangesR_[SensorModule::DiskPS]; }
0303     // smallest stub radius after TrackBuilder in cm
0304     double tbInnerRadius() const { return tbInnerRadius_; }
0305     // center radius of outer tracker endcap 2S diks strips
0306     double disk2SR(int layerId, int r) const { return disk2SRs_.at(layerId).at(r); }
0307     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S) after TrackBuilder
0308     int tbWidthR(SensorModule::Type type) const { return tbWidthsR_.at(type); }
0309 
0310     // Parameter specifying TTStub algorithm
0311 
0312     // number of tilted layer rings per barrel layer
0313     double numTiltedLayerRing(int layerId) const { return numTiltedLayerRings_.at(layerId); };
0314     // stub bend window sizes for flat barrel layer in full pitch units
0315     double windowSizeBarrelLayer(int layerId) const { return windowSizeBarrelLayers_.at(layerId); };
0316     // stub bend window sizes for tilted barrel layer rings in full pitch units
0317     double windowSizeTiltedLayerRing(int layerId, int ring) const {
0318       return windowSizeTiltedLayerRings_.at(layerId).at(ring);
0319     };
0320     // stub bend window sizes for endcap disks rings in full pitch units
0321     double windowSizeEndcapDisksRing(int layerId, int ring) const {
0322       return windowSizeEndcapDisksRings_.at(layerId).at(ring);
0323     };
0324     // precision of window sizes in pitch units
0325     double baseWindowSize() const { return baseWindowSize_; }
0326     // index = encoded bend, value = decoded bend for given window size and module type
0327     const std::vector<double>& encodingBend(int windowSize, bool psModule) const;
0328 
0329     // Parameter specifying front-end
0330 
0331     // number of bits used for internal stub bend
0332     int widthBend() const { return widthBend_; }
0333     // number of bits used for internal stub column
0334     int widthCol() const { return widthCol_; }
0335     // number of bits used for internal stub row
0336     int widthRow() const { return widthRow_; }
0337     // precision of internal stub bend in pitch units
0338     double baseBend() const { return baseBend_; }
0339     // precision of internal stub column in pitch units
0340     double baseCol() const { return baseCol_; }
0341     // precision of internal stub row in pitch units
0342     double baseRow() const { return baseRow_; }
0343     // used stub bend uncertainty in pitch units
0344     double bendCut() const { return bendCut_; }
0345 
0346     // Parameter specifying DTC
0347 
0348     // number of phi slices the outer tracker readout is organized in
0349     int numRegions() const { return numRegions_; }
0350     // number of regions a reconstructable particles may cross
0351     int numOverlappingRegions() const { return numOverlappingRegions_; }
0352     // number of Tracker boards per ATCA crate.
0353     int numATCASlots() const { return numATCASlots_; }
0354     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0355     int numDTCsPerRegion() const { return numDTCsPerRegion_; }
0356     // max number of sensor modules connected to one DTC board
0357     int numModulesPerDTC() const { return numModulesPerDTC_; }
0358     // number of systiloic arrays in stub router firmware
0359     int dtcNumRoutingBlocks() const { return dtcNumRoutingBlocks_; }
0360     // fifo depth in stub router firmware
0361     int dtcDepthMemory() const { return dtcDepthMemory_; }
0362     // number of row bits used in look up table
0363     int dtcWidthRowLUT() const { return dtcWidthRowLUT_; }
0364     // number of bits used for stub inv2R. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0365     int dtcWidthInv2R() const { return dtcWidthInv2R_; }
0366     // tk layout det id minus DetSetVec->detId
0367     int offsetDetIdDSV() const { return offsetDetIdDSV_; }
0368     // tk layout det id minus TrackerTopology lower det id
0369     int offsetDetIdTP() const { return offsetDetIdTP_; }
0370     // offset in layer ids between barrel layer and endcap disks
0371     int offsetLayerDisks() const { return offsetLayerDisks_; }
0372     // offset between 0 and smallest layer id (barrel layer 1)
0373     int offsetLayerId() const { return offsetLayerId_; }
0374     //
0375     int numBarrelLayer() const { return numBarrelLayer_; }
0376     // total number of outer tracker DTCs
0377     int numDTCs() const { return numDTCs_; }
0378     // number of DTCs connected to one TFP (48)
0379     int numDTCsPerTFP() const { return numDTCsPerTFP_; }
0380     // total number of max possible outer tracker modules (72 per DTC)
0381     int numModules() const { return numModules_; }
0382     // max number of moudles connected to a systiloic array in stub router firmware
0383     int dtcNumModulesPerRoutingBlock() const { return dtcNumModulesPerRoutingBlock_; }
0384     // number of merged rows for look up
0385     int dtcNumMergedRows() const { return dtcNumMergedRows_; }
0386     // number of bits used for phi of row slope
0387     int dtcWidthM() const { return dtcWidthM_; }
0388     // internal stub inv2R precision in 1 /cm
0389     double dtcBaseInv2R() const { return dtcBaseInv2R_; }
0390     // phi of row slope precision in rad / pitch unit
0391     double dtcBaseM() const { return dtcBaseM_; }
0392     // sensor modules connected to given dtc id
0393     const std::vector<SensorModule*>& dtcModules(int dtcId) const { return dtcModules_.at(dtcId); }
0394     // total number of output channel
0395     int dtcNumStreams() const { return dtcNumStreams_; }
0396 
0397     // Parameter specifying TFP
0398 
0399     // number of bist used for phi0
0400     int tfpWidthPhi0() const { return tfpWidthPhi0_; }
0401     // umber of bist used for inv2R
0402     int tfpWidthInv2R() const { return tfpWidthInv2R_; }
0403     // number of bist used for cot(theta)
0404     int tfpWidthCot() const { return tfpWidthCot_; }
0405     // number of bist used for z0
0406     int tfpWidthZ0() const { return tfpWidthZ0_; }
0407     // number of output links
0408     int tfpNumChannel() const { return tfpNumChannel_; }
0409 
0410     // Parameter specifying GeometricProcessor
0411 
0412     // number of phi sectors in a processing nonant used in hough transform
0413     int numSectorsPhi() const { return numSectorsPhi_; }
0414     // number of eta sectors used in hough transform
0415     int numSectorsEta() const { return numSectorsEta_; }
0416     // # critical radius defining r-z sector shape in cm
0417     double chosenRofZ() const { return chosenRofZ_; }
0418     // fifo depth in stub router firmware
0419     int gpDepthMemory() const { return gpDepthMemory_; }
0420     // defining r-z sector shape
0421     double boundarieEta(int eta) const { return boundariesEta_.at(eta); }
0422     std::vector<double> boundarieEta() const { return boundariesEta_; }
0423     // phi sector size in rad
0424     double baseSector() const { return baseSector_; }
0425     // cut on zT
0426     double maxZT() const { return maxZT_; }
0427     // cut on stub cot theta
0428     double maxCot() const { return maxCot_; }
0429     // total number of sectors
0430     int numSectors() const { return numSectors_; }
0431     // cot(theta) of given eta sector
0432     double sectorCot(int eta) const { return sectorCots_.at(eta); }
0433     //
0434     double neededRangeChiZ() const { return neededRangeChiZ_; }
0435 
0436     // Parameter specifying HoughTransform
0437 
0438     // number of inv2R bins used in hough transform
0439     int htNumBinsInv2R() const { return htNumBinsInv2R_; }
0440     // number of phiT bins used in hough transform
0441     int htNumBinsPhiT() const { return htNumBinsPhiT_; }
0442     // required number of stub layers to form a candidate
0443     int htMinLayers() const { return htMinLayers_; }
0444     // internal fifo depth
0445     int htDepthMemory() const { return htDepthMemory_; }
0446 
0447     // Parameter specifying MiniHoughTransform
0448 
0449     // number of finer inv2R bins inside HT bin
0450     int mhtNumBinsInv2R() const { return mhtNumBinsInv2R_; }
0451     // number of finer phiT bins inside HT bin
0452     int mhtNumBinsPhiT() const { return mhtNumBinsPhiT_; }
0453     // number of dynamic load balancing steps
0454     int mhtNumDLBs() const { return mhtNumDLBs_; }
0455     // number of units per dynamic load balancing step
0456     int mhtNumDLBNodes() const { return mhtNumDLBNodes_; }
0457     // number of inputs per dynamic load balancing unit
0458     int mhtNumDLBChannel() const { return mhtNumDLBChannel_; }
0459     // required number of stub layers to form a candidate
0460     int mhtMinLayers() const { return mhtMinLayers_; }
0461     // number of mht cells
0462     int mhtNumCells() const { return mhtNumCells_; }
0463 
0464     // Parameter specifying ZHoughTransform
0465 
0466     //number of used zT bins
0467     int zhtNumBinsZT() const { return zhtNumBinsZT_; }
0468     // number of used cot bins
0469     int zhtNumBinsCot() const { return zhtNumBinsCot_; }
0470     //  number of stages
0471     int zhtNumStages() const { return zhtNumStages_; }
0472     // required number of stub layers to form a candidate
0473     int zhtMinLayers() const { return zhtMinLayers_; }
0474     // max number of output tracks per node
0475     int zhtMaxTracks() const { return zhtMaxTracks_; }
0476     // cut on number of stub per layer for input candidates
0477     int zhtMaxStubsPerLayer() const { return zhtMaxStubsPerLayer_; }
0478     // number of zht cells
0479     int zhtNumCells() const { return zhtNumCells_; }
0480 
0481     // Parameter specifying KalmanFilter Input Formatter
0482 
0483     // power of 2 multiplier of stub phi residual range
0484     int kfinShiftRangePhi() const { return kfinShiftRangePhi_; }
0485     // power of 2 multiplier of stub z residual range
0486     int kfinShiftRangeZ() const { return kfinShiftRangeZ_; }
0487 
0488     // Parameter specifying KalmanFilter
0489 
0490     // number of kf worker
0491     int kfNumWorker() const { return kfNumWorker_; }
0492     // required number of stub layers to form a track
0493     int kfMinLayers() const { return kfMinLayers_; }
0494     // maximum number of  layers added to a track
0495     int kfMaxLayers() const { return kfMaxLayers_; }
0496     // search window of each track parameter in initial uncertainties
0497     double kfRangeFactor() const { return kfRangeFactor_; }
0498     //
0499     int kfShiftInitialC00() const { return kfShiftInitialC00_; }
0500     //
0501     int kfShiftInitialC11() const { return kfShiftInitialC11_; }
0502     //
0503     int kfShiftInitialC22() const { return kfShiftInitialC22_; }
0504     //
0505     int kfShiftInitialC33() const { return kfShiftInitialC33_; }
0506 
0507     // Parameter specifying KalmanFilter Output Formatter
0508     // Conversion factor between dphi^2/weight and chi2rphi
0509     int kfoutchi2rphiConv() const { return kfoutchi2rphiConv_; }
0510     // Conversion factor between dz^2/weight and chi2rz
0511     int kfoutchi2rzConv() const { return kfoutchi2rzConv_; }
0512     // Fraction of total dphi and dz ranges to calculate v0 and v1 LUT for
0513     int weightBinFraction() const { return weightBinFraction_; }
0514     // Constant used in FW to prevent 32-bit int overflow
0515     int dzTruncation() const { return dzTruncation_; }
0516     // Constant used in FW to prevent 32-bit int overflow
0517     int dphiTruncation() const { return dphiTruncation_; }
0518 
0519     // Parameter specifying DuplicateRemoval
0520 
0521     // internal memory depth
0522     int drDepthMemory() const { return drDepthMemory_; }
0523 
0524     //getBendCut
0525     const StubAlgorithmOfficial* stubAlgorithm() const { return stubAlgorithm_; }
0526 
0527   private:
0528     // checks consitency between history and current configuration for a specific module
0529     void checkHistory(const edm::ProcessHistory&,
0530                       const edm::pset::Registry*,
0531                       const std::string&,
0532                       const edm::ParameterSetID&) const;
0533     // dumps pSetHistory where incosistent lines with pSetProcess are highlighted
0534     std::string dumpDiff(const edm::ParameterSet& pSetHistory, const edm::ParameterSet& pSetProcess) const;
0535     // check if bField is supported
0536     void checkMagneticField();
0537     // check if geometry is supported
0538     void checkGeometry();
0539     // derive constants
0540     void calculateConstants();
0541     // convert configuration of TTStubAlgorithm
0542     void consumeStubAlgorithm();
0543     // create bend encodings
0544     void encodeBend(std::vector<std::vector<double>>&, bool) const;
0545     // create sensor modules
0546     void produceSensorModules();
0547     // range check of dtc id
0548     void checkDTCId(int dtcId) const;
0549     // range check of tklayout id
0550     void checkTKLayoutId(int tkLayoutId) const;
0551     // range check of tfp identifier
0552     void checkTFPIdentifier(int tfpRegion, int tfpChannel) const;
0553     // configure TPSelector
0554     void configureTPSelector();
0555 
0556     // MagneticField
0557     const MagneticField* magneticField_;
0558     // TrackerGeometry
0559     const TrackerGeometry* trackerGeometry_;
0560     // TrackerTopology
0561     const TrackerTopology* trackerTopology_;
0562     // CablingMap
0563     const TrackerDetToDTCELinkCablingMap* cablingMap_;
0564     // TTStub algorithm used to create bend encodings
0565     const StubAlgorithmOfficial* stubAlgorithm_;
0566     // pSet of ttStub algorithm, used to identify bend window sizes of sensor modules
0567     const edm::ParameterSet* pSetSA_;
0568     // pSet of geometry configuration, used to identify if geometry is supported
0569     const edm::ParameterSet* pSetGC_;
0570     // pset id of current TTStubAlgorithm
0571     edm::ParameterSetID pSetIdTTStubAlgorithm_;
0572     // pset id of current geometry configuration
0573     edm::ParameterSetID pSetIdGeometryConfiguration_;
0574 
0575     // DD4hep
0576     bool fromDD4hep_;
0577 
0578     // Parameter to check if configured Tracker Geometry is supported
0579     edm::ParameterSet pSetSG_;
0580     // label of ESProducer/ESSource
0581     std::string sgXMLLabel_;
0582     // compared path
0583     std::string sgXMLPath_;
0584     // compared filen ame
0585     std::string sgXMLFile_;
0586     // list of supported versions
0587     std::vector<std::string> sgXMLVersions_;
0588 
0589     // Parameter to check if Process History is consistent with process configuration
0590     edm::ParameterSet pSetPH_;
0591     // label of compared GeometryConfiguration
0592     std::string phGeometryConfiguration_;
0593     // label of compared TTStubAlgorithm
0594     std::string phTTStubAlgorithm_;
0595 
0596     // Common track finding parameter
0597     edm::ParameterSet pSetTF_;
0598     // half lumi region size in cm
0599     double beamWindowZ_;
0600     // required number of layers a found track has to have in common with a TP to consider it matched to it
0601     int matchedLayers_;
0602     // required number of ps layers a found track has to have in common with a TP to consider it matched to it
0603     int matchedLayersPS_;
0604     // allowed number of stubs a found track may have not in common with its matched TP
0605     int unMatchedStubs_;
0606     // allowed number of PS stubs a found track may have not in common with its matched TP
0607     int unMatchedStubsPS_;
0608     // scattering term used to add stub phi uncertainty depending on assumed track inv2R
0609     double scattering_;
0610 
0611     // TMTT specific parameter
0612     edm::ParameterSet pSetTMTT_;
0613     // cut on stub and TP pt, also defines region overlap shape in GeV
0614     double minPt_;
0615     // cut on stub eta
0616     double maxEta_;
0617     // critical radius defining region overlap shape in cm
0618     double chosenRofPhi_;
0619     // number of detector layers a reconstructbale particle may cross
0620     int numLayers_;
0621     // number of bits used for stub r - ChosenRofPhi
0622     int tmttWidthR_;
0623     // number of bits used for stub phi w.r.t. phi sector centre
0624     int tmttWidthPhi_;
0625     // number of bits used for stub z
0626     int tmttWidthZ_;
0627 
0628     // Hybrid specific parameter
0629     edm::ParameterSet pSetHybrid_;
0630     // cut on stub pt in GeV, also defines region overlap shape
0631     double hybridMinPtStub_;
0632     // cut on andidate pt in GeV
0633     double hybridMinPtCand_;
0634     // cut on stub eta
0635     double hybridMaxEta_;
0636     // critical radius defining region overlap shape in cm
0637     double hybridChosenRofPhi_;
0638     // max number of detector layer connected to one DTC
0639     int hybridNumLayers_;
0640     // number of outer PS rings for disk 1, 2, 3, 4, 5
0641     std::vector<int> hybridNumRingsPS_;
0642     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0643     std::vector<int> hybridWidthsR_;
0644     // number of bits used for stub z w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0645     std::vector<int> hybridWidthsZ_;
0646     // number of bits used for stub phi w.r.t. region centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0647     std::vector<int> hybridWidthsPhi_;
0648     // number of bits used for stub row number for module types (barrelPS, barrel2S, diskPS, disk2S)
0649     std::vector<int> hybridWidthsAlpha_;
0650     // number of bits used for stub bend number for module types (barrelPS, barrel2S, diskPS, disk2S)
0651     std::vector<int> hybridWidthsBend_;
0652     // range in stub r which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0653     std::vector<double> hybridRangesR_;
0654     // range in stub z which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0655     std::vector<double> hybridRangesZ_;
0656     // range in stub row which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0657     std::vector<double> hybridRangesAlpha_;
0658     // mean radius of outer tracker barrel layer
0659     std::vector<double> hybridLayerRs_;
0660     // mean z of outer tracker endcap disks
0661     std::vector<double> hybridDiskZs_;
0662     // center radius of outer tracker endcap 2S diks strips
0663     std::vector<edm::ParameterSet> hybridDisk2SRsSet_;
0664     // range of stub phi in rad
0665     double hybridRangePhi_;
0666     // smallest stub radius after TrackBuilder in cm
0667     double tbInnerRadius_;
0668     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S) after TrackBuilder
0669     std::vector<int> tbWidthsR_;
0670 
0671     // Parameter specifying TrackingParticle used for Efficiency measurements
0672     edm::ParameterSet pSetTP_;
0673     // pt cut
0674     double tpMinPt_;
0675     // eta cut
0676     double tpMaxEta_;
0677     // cut on vertex pos r in cm
0678     double tpMaxVertR_;
0679     // cut on vertex pos z in cm
0680     double tpMaxVertZ_;
0681     // cut on impact parameter in cm
0682     double tpMaxD0_;
0683     // required number of associated layers to a TP to consider it reconstruct-able
0684     int tpMinLayers_;
0685     // required number of associated ps layers to a TP to consider it reconstruct-able
0686     int tpMinLayersPS_;
0687     // max number of unassociated 2S stubs allowed to still associate TTTrack with TP
0688     int tpMaxBadStubs2S_;
0689     // max number of unassociated PS stubs allowed to still associate TTTrack with TP
0690     int tpMaxBadStubsPS_;
0691 
0692     // Firmware specific Parameter
0693     edm::ParameterSet pSetFW_;
0694     // width of the 'A' port of an DSP slice
0695     int widthDSPa_;
0696     // width of the 'A' port of an DSP slice using biased twos complement
0697     int widthDSPab_;
0698     // width of the 'A' port of an DSP slice using biased binary
0699     int widthDSPau_;
0700     // width of the 'B' port of an DSP slice
0701     int widthDSPb_;
0702     // width of the 'B' port of an DSP slice using biased twos complement
0703     int widthDSPbb_;
0704     // width of the 'B' port of an DSP slice using biased binary
0705     int widthDSPbu_;
0706     // width of the 'C' port of an DSP slice
0707     int widthDSPc_;
0708     // width of the 'C' port of an DSP slice using biased twos complement
0709     int widthDSPcb_;
0710     // width of the 'C' port of an DSP slice using biased binary
0711     int widthDSPcu_;
0712     // smallest address width of an BRAM36 configured as broadest simple dual port memory
0713     int widthAddrBRAM36_;
0714     // smallest address width of an BRAM18 configured as broadest simple dual port memory
0715     int widthAddrBRAM18_;
0716     // needed gap between events of emp-infrastructure firmware
0717     int numFramesInfra_;
0718     // LHC bunch crossing rate in MHz
0719     double freqLHC_;
0720     // processing Frequency of DTC & TFP in MHz, has to be integer multiple of FreqLHC
0721     double freqBE_;
0722     // number of events collected in front-end
0723     int tmpFE_;
0724     // time multiplexed period of track finding processor
0725     int tmpTFP_;
0726     // speed of light used in FW in e8 m/s
0727     double speedOfLight_;
0728     // BField used in fw in T
0729     double bField_;
0730     // accepted BField difference between FW to EventSetup in T
0731     double bFieldError_;
0732     // outer radius of outer tracker in cm
0733     double outerRadius_;
0734     // inner radius of outer tracker in cm
0735     double innerRadius_;
0736     // half length of outer tracker in cm
0737     double halfLength_;
0738     // max strip/pixel pitch of outer tracker sensors in cm
0739     double maxPitch_;
0740     // max strip/pixel length of outer tracker sensors in cm
0741     double maxLength_;
0742     // approximated tilt correction parameter used to project r to z uncertainty
0743     double tiltApproxSlope_;
0744     // approximated tilt correction parameter used to project r to z uncertainty
0745     double tiltApproxIntercept_;
0746     // In tilted barrel, constant assumed stub radial uncertainty * sqrt(12) in cm
0747     double tiltUncertaintyR_;
0748     // minimum representable stub phi uncertainty
0749     double mindPhi_;
0750     // maximum representable stub phi uncertainty
0751     double maxdPhi_;
0752     // minimum representable stub z uncertainty
0753     double mindZ_;
0754     // maximum representable stub z uncertainty
0755     double maxdZ_;
0756     // strip pitch of outer tracker sensors in cm
0757     double pitch2S_;
0758     // pixel pitch of outer tracker sensors in cm
0759     double pitchPS_;
0760     // strip length of outer tracker sensors in cm
0761     double length2S_;
0762     // pixel length of outer tracker sensors in cm
0763     double lengthPS_;
0764     // barrel layer limit |z| value to partition into tilted and untilted region
0765     std::vector<double> tiltedLayerLimitsZ_;
0766     // endcap disk limit r value to partition into PS and 2S region
0767     std::vector<double> psDiskLimitsR_;
0768 
0769     // Parameter specifying front-end
0770     edm::ParameterSet pSetFE_;
0771     // number of bits used for internal stub bend
0772     int widthBend_;
0773     // number of bits used for internal stub column
0774     int widthCol_;
0775     // number of bits used for internal stub row
0776     int widthRow_;
0777     // precision of internal stub bend in pitch units
0778     double baseBend_;
0779     // precision of internal stub column in pitch units
0780     double baseCol_;
0781     // precision of internal stub row in pitch units
0782     double baseRow_;
0783     // precision of window sizes in pitch units
0784     double baseWindowSize_;
0785     // used stub bend uncertainty in pitch units
0786     double bendCut_;
0787 
0788     // Parameter specifying DTC
0789     edm::ParameterSet pSetDTC_;
0790     // number of phi slices the outer tracker readout is organized in
0791     int numRegions_;
0792     // number of regions a reconstructable particles may cross
0793     int numOverlappingRegions_;
0794     // number of Slots in used ATCA crates
0795     int numATCASlots_;
0796     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0797     int numDTCsPerRegion_;
0798     // max number of sensor modules connected to one DTC board
0799     int numModulesPerDTC_;
0800     // number of systiloic arrays in stub router firmware
0801     int dtcNumRoutingBlocks_;
0802     // fifo depth in stub router firmware
0803     int dtcDepthMemory_;
0804     // number of row bits used in look up table
0805     int dtcWidthRowLUT_;
0806     // number of bits used for stub inv2R. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0807     int dtcWidthInv2R_;
0808     // tk layout det id minus DetSetVec->detId
0809     int offsetDetIdDSV_;
0810     // tk layout det id minus TrackerTopology lower det id
0811     int offsetDetIdTP_;
0812     // offset in layer ids between barrel layer and endcap disks
0813     int offsetLayerDisks_;
0814     // offset between 0 and smallest layer id (barrel layer 1)
0815     int offsetLayerId_;
0816     //
0817     int numBarrelLayer_;
0818     // total number of output channel
0819     int dtcNumStreams_;
0820     // slot number changing from PS to 2S (default: 6)
0821     int slotLimitPS_;
0822     // slot number changing from 10 gbps to 5gbps (default: 3)
0823     int slotLimit10gbps_;
0824 
0825     // Parameter specifying TFP
0826     edm::ParameterSet pSetTFP_;
0827     // number of bist used for phi0
0828     int tfpWidthPhi0_;
0829     // umber of bist used for qOverPt
0830     int tfpWidthInv2R_;
0831     // number of bist used for cot(theta)
0832     int tfpWidthCot_;
0833     // number of bist used for z0
0834     int tfpWidthZ0_;
0835     // number of output links
0836     int tfpNumChannel_;
0837 
0838     // Parameter specifying GeometricProcessor
0839     edm::ParameterSet pSetGP_;
0840     // number of phi sectors used in hough transform
0841     int numSectorsPhi_;
0842     // number of eta sectors used in hough transform
0843     int numSectorsEta_;
0844     // # critical radius defining r-z sector shape in cm
0845     double chosenRofZ_;
0846     // range of stub z residual w.r.t. sector center which needs to be covered
0847     double neededRangeChiZ_;
0848     // fifo depth in stub router firmware
0849     int gpDepthMemory_;
0850     // defining r-z sector shape
0851     std::vector<double> boundariesEta_;
0852 
0853     // Parameter specifying HoughTransform
0854     edm::ParameterSet pSetHT_;
0855     // number of inv2R bins used in hough transform
0856     int htNumBinsInv2R_;
0857     // number of phiT bins used in hough transform
0858     int htNumBinsPhiT_;
0859     // required number of stub layers to form a candidate
0860     int htMinLayers_;
0861     // internal fifo depth
0862     int htDepthMemory_;
0863 
0864     // Parameter specifying MiniHoughTransform
0865     edm::ParameterSet pSetMHT_;
0866     // number of finer inv2R bins inside HT bin
0867     int mhtNumBinsInv2R_;
0868     // number of finer phiT bins inside HT bin
0869     int mhtNumBinsPhiT_;
0870     // number of dynamic load balancing steps
0871     int mhtNumDLBs_;
0872     // number of units per dynamic load balancing step
0873     int mhtNumDLBNodes_;
0874     // number of inputs per dynamic load balancing unit
0875     int mhtNumDLBChannel_;
0876     // required number of stub layers to form a candidate
0877     int mhtMinLayers_;
0878 
0879     // Parameter specifying ZHoughTransform
0880     edm::ParameterSet pSetZHT_;
0881     //number of used zT bins
0882     int zhtNumBinsZT_;
0883     // number of used cot bins
0884     int zhtNumBinsCot_;
0885     // number of stages
0886     int zhtNumStages_;
0887     // required number of stub layers to form a candidate
0888     int zhtMinLayers_;
0889     // max number of output tracks per node
0890     int zhtMaxTracks_;
0891     // cut on number of stub per layer for input candidates
0892     int zhtMaxStubsPerLayer_;
0893 
0894     // Parameter specifying KalmanFilter Input Formatter
0895     edm::ParameterSet pSetKFin_;
0896     // power of 2 multiplier of stub phi residual range
0897     int kfinShiftRangePhi_;
0898     // power of 2 multiplier of stub z residual range
0899     int kfinShiftRangeZ_;
0900 
0901     // Parameter specifying KalmanFilter
0902     edm::ParameterSet pSetKF_;
0903     // number of kf worker
0904     int kfNumWorker_;
0905     // required number of stub layers to form a track
0906     int kfMinLayers_;
0907     // maximum number of  layers added to a track
0908     int kfMaxLayers_;
0909     // search window of each track parameter in initial uncertainties
0910     double kfRangeFactor_;
0911     //
0912     int kfShiftInitialC00_;
0913     //
0914     int kfShiftInitialC11_;
0915     //
0916     int kfShiftInitialC22_;
0917     //
0918     int kfShiftInitialC33_;
0919 
0920     // Parameter specifying KalmanFilter Output Formatter
0921     edm::ParameterSet pSetKFOut_;
0922     // Conversion factor between dphi^2/weight and chi2rphi
0923     int kfoutchi2rphiConv_;
0924     // Conversion factor between dz^2/weight and chi2rz
0925     int kfoutchi2rzConv_;
0926     // Fraction of total dphi and dz ranges to calculate v0 and v1 LUT for
0927     int weightBinFraction_;
0928     // Constant used in FW to prevent 32-bit int overflow
0929     int dzTruncation_;
0930     // Constant used in FW to prevent 32-bit int overflow
0931     int dphiTruncation_;
0932 
0933     // Parameter specifying DuplicateRemoval
0934     edm::ParameterSet pSetDR_;
0935     // internal memory depth
0936     int drDepthMemory_;
0937 
0938     //
0939     // Derived constants
0940     //
0941 
0942     // true if tracker geometry and magnetic field supported
0943     bool configurationSupported_;
0944     // selector to partly select TPs for efficiency measurements
0945     TrackingParticleSelector tpSelector_;
0946     // selector to partly select TPs for fake and duplicate rate measurements
0947     TrackingParticleSelector tpSelectorLoose_;
0948 
0949     // TTStubAlgorithm
0950 
0951     // number of tilted layer rings per barrel layer
0952     std::vector<double> numTiltedLayerRings_;
0953     // stub bend window sizes for flat barrel layer in full pitch units
0954     std::vector<double> windowSizeBarrelLayers_;
0955     // stub bend window sizes for tilted barrel layer rings in full pitch units
0956     std::vector<std::vector<double>> windowSizeTiltedLayerRings_;
0957     // stub bend window sizes for endcap disks rings in full pitch units
0958     std::vector<std::vector<double>> windowSizeEndcapDisksRings_;
0959     // maximum stub bend window in half strip units
0960     int maxWindowSize_;
0961 
0962     // common Track finding
0963 
0964     // number of frames betwen 2 resets of 18 BX packets
0965     int numFrames_;
0966     // number of valid frames per 18 BX packet
0967     int numFramesIO_;
0968     // number of valid frames per 8 BX packet
0969     int numFramesFE_;
0970     // converts GeV in 1/cm
0971     double invPtToDphi_;
0972     // region size in rad
0973     double baseRegion_;
0974 
0975     // TMTT
0976 
0977     // number of bits used for stub layer id
0978     int widthLayerId_;
0979     // internal stub r precision in cm
0980     double tmttBaseR_;
0981     // internal stub z precision in cm
0982     double tmttBaseZ_;
0983     // internal stub phi precision in rad
0984     double tmttBasePhi_;
0985     // internal stub inv2R precision in 1/cm
0986     double tmttBaseInv2R_;
0987     // internal stub phiT precision in rad
0988     double tmttBasePhiT_;
0989     // number of padded 0s in output data format
0990     int dtcNumUnusedBits_;
0991     // number of bits used for stub layer id
0992     int tmttWidthLayer_;
0993     // number of bits used for stub eta sector
0994     int tmttWidthSectorEta_;
0995     // number of bits used for stub inv2R
0996     int tmttWidthInv2R_;
0997     // number of padded 0s in output data format
0998     int tmttNumUnusedBits_;
0999 
1000     // hybrid
1001 
1002     // number of bits used for stub layer id
1003     int hybridWidthLayerId_;
1004     // precision or r in cm for (barrelPS, barrel2S, diskPS, disk2S)
1005     std::vector<double> hybridBasesR_;
1006     // precision or phi in rad for (barrelPS, barrel2S, diskPS, disk2S)
1007     std::vector<double> hybridBasesPhi_;
1008     // precision or z in cm for (barrelPS, barrel2S, diskPS, disk2S)
1009     std::vector<double> hybridBasesZ_;
1010     // precision or alpha in pitch units for (barrelPS, barrel2S, diskPS, disk2S)
1011     std::vector<double> hybridBasesAlpha_;
1012     // stub r precision in cm
1013     double hybridBaseZ_;
1014     // stub z precision in cm
1015     double hybridBaseR_;
1016     // stub phi precision in rad
1017     double hybridBasePhi_;
1018     // stub cut on cot(theta) = tan(lambda) = sinh(eta)
1019     double hybridMaxCot_;
1020     // number of padded 0s in output data format for (barrelPS, barrel2S, diskPS, disk2S)
1021     std::vector<int> hybridNumsUnusedBits_;
1022     // center radius of outer tracker endcap 2S diks strips
1023     std::vector<std::vector<double>> disk2SRs_;
1024 
1025     // DTC
1026 
1027     // total number of outer tracker DTCs
1028     int numDTCs_;
1029     // number of DTCs connected to one TFP (48)
1030     int numDTCsPerTFP_;
1031     // total number of max possible outer tracker modules (72 per DTC)
1032     int numModules_;
1033     // max number of moudles connected to a systiloic array in stub router firmware
1034     int dtcNumModulesPerRoutingBlock_;
1035     // number of merged rows for look up
1036     int dtcNumMergedRows_;
1037     // number of bits used for phi of row slope
1038     int dtcWidthM_;
1039     // internal stub inv2R precision in 1 /cm
1040     double dtcBaseInv2R_;
1041     // phi of row slope precision in rad / pitch unit
1042     double dtcBaseM_;
1043     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for ps modules
1044     std::vector<std::vector<double>> encodingsBendPS_;
1045     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for 2s modules
1046     std::vector<std::vector<double>> encodingsBend2S_;
1047     // collection of outer tracker sensor modules
1048     std::vector<SensorModule> sensorModules_;
1049     // collection of outer tracker sensor modules organised in DTCS [0-215][0-71]
1050     std::vector<std::vector<SensorModule*>> dtcModules_;
1051     // hepler to convert Stubs quickly
1052     std::unordered_map<DetId, SensorModule*> detIdToSensorModule_;
1053 
1054     // GP
1055 
1056     // phi sector size in rad
1057     double baseSector_;
1058     // cut on zT
1059     double maxZT_;
1060     // cut on stub cot theta
1061     double maxCot_;
1062     // total number of sectors
1063     int numSectors_;
1064     // number of unused bits in GP output format
1065     int gpNumUnusedBits_;
1066     // cot(theta) of eta sectors
1067     std::vector<double> sectorCots_;
1068 
1069     // MHT
1070 
1071     // number of mht cells
1072     int mhtNumCells_;
1073 
1074     // ZHT
1075 
1076     // number of zht cells
1077     int zhtNumCells_;
1078 
1079     // KF
1080 
1081     int kfWidthLayerCount_;
1082   };
1083 
1084 }  // namespace tt
1085 
1086 EVENTSETUP_DATA_DEFAULT_RECORD(tt::Setup, tt::SetupRcd);
1087 
1088 #endif