Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:14:03

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 
0306     // Parameter specifying TTStub algorithm
0307 
0308     // number of tilted layer rings per barrel layer
0309     double numTiltedLayerRing(int layerId) const { return numTiltedLayerRings_.at(layerId); };
0310     // stub bend window sizes for flat barrel layer in full pitch units
0311     double windowSizeBarrelLayer(int layerId) const { return windowSizeBarrelLayers_.at(layerId); };
0312     // stub bend window sizes for tilted barrel layer rings in full pitch units
0313     double windowSizeTiltedLayerRing(int layerId, int ring) const {
0314       return windowSizeTiltedLayerRings_.at(layerId).at(ring);
0315     };
0316     // stub bend window sizes for endcap disks rings in full pitch units
0317     double windowSizeEndcapDisksRing(int layerId, int ring) const {
0318       return windowSizeEndcapDisksRings_.at(layerId).at(ring);
0319     };
0320     // precision of window sizes in pitch units
0321     double baseWindowSize() const { return baseWindowSize_; }
0322     // index = encoded bend, value = decoded bend for given window size and module type
0323     const std::vector<double>& encodingBend(int windowSize, bool psModule) const;
0324 
0325     // Parameter specifying front-end
0326 
0327     // number of bits used for internal stub bend
0328     int widthBend() const { return widthBend_; }
0329     // number of bits used for internal stub column
0330     int widthCol() const { return widthCol_; }
0331     // number of bits used for internal stub row
0332     int widthRow() const { return widthRow_; }
0333     // precision of internal stub bend in pitch units
0334     double baseBend() const { return baseBend_; }
0335     // precision of internal stub column in pitch units
0336     double baseCol() const { return baseCol_; }
0337     // precision of internal stub row in pitch units
0338     double baseRow() const { return baseRow_; }
0339     // used stub bend uncertainty in pitch units
0340     double bendCut() const { return bendCut_; }
0341 
0342     // Parameter specifying DTC
0343 
0344     // number of phi slices the outer tracker readout is organized in
0345     int numRegions() const { return numRegions_; }
0346     // number of regions a reconstructable particles may cross
0347     int numOverlappingRegions() const { return numOverlappingRegions_; }
0348     // number of Tracker boards per ATCA crate.
0349     int numATCASlots() const { return numATCASlots_; }
0350     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0351     int numDTCsPerRegion() const { return numDTCsPerRegion_; }
0352     // max number of sensor modules connected to one DTC board
0353     int numModulesPerDTC() const { return numModulesPerDTC_; }
0354     // number of systiloic arrays in stub router firmware
0355     int dtcNumRoutingBlocks() const { return dtcNumRoutingBlocks_; }
0356     // fifo depth in stub router firmware
0357     int dtcDepthMemory() const { return dtcDepthMemory_; }
0358     // number of row bits used in look up table
0359     int dtcWidthRowLUT() const { return dtcWidthRowLUT_; }
0360     // number of bits used for stub inv2R. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0361     int dtcWidthInv2R() const { return dtcWidthInv2R_; }
0362     // tk layout det id minus DetSetVec->detId
0363     int offsetDetIdDSV() const { return offsetDetIdDSV_; }
0364     // tk layout det id minus TrackerTopology lower det id
0365     int offsetDetIdTP() const { return offsetDetIdTP_; }
0366     // offset in layer ids between barrel layer and endcap disks
0367     int offsetLayerDisks() const { return offsetLayerDisks_; }
0368     // offset between 0 and smallest layer id (barrel layer 1)
0369     int offsetLayerId() const { return offsetLayerId_; }
0370     //
0371     int numBarrelLayer() const { return numBarrelLayer_; }
0372     // total number of outer tracker DTCs
0373     int numDTCs() const { return numDTCs_; }
0374     // number of DTCs connected to one TFP (48)
0375     int numDTCsPerTFP() const { return numDTCsPerTFP_; }
0376     // total number of max possible outer tracker modules (72 per DTC)
0377     int numModules() const { return numModules_; }
0378     // max number of moudles connected to a systiloic array in stub router firmware
0379     int dtcNumModulesPerRoutingBlock() const { return dtcNumModulesPerRoutingBlock_; }
0380     // number of merged rows for look up
0381     int dtcNumMergedRows() const { return dtcNumMergedRows_; }
0382     // number of bits used for phi of row slope
0383     int dtcWidthM() const { return dtcWidthM_; }
0384     // internal stub inv2R precision in 1 /cm
0385     double dtcBaseInv2R() const { return dtcBaseInv2R_; }
0386     // phi of row slope precision in rad / pitch unit
0387     double dtcBaseM() const { return dtcBaseM_; }
0388     // sensor modules connected to given dtc id
0389     const std::vector<SensorModule*>& dtcModules(int dtcId) const { return dtcModules_.at(dtcId); }
0390     // total number of output channel
0391     int dtcNumStreams() const { return dtcNumStreams_; }
0392 
0393     // Parameter specifying TFP
0394 
0395     // number of bist used for phi0
0396     int tfpWidthPhi0() const { return tfpWidthPhi0_; }
0397     // umber of bist used for inv2R
0398     int tfpWidthInv2R() const { return tfpWidthInv2R_; }
0399     // number of bist used for cot(theta)
0400     int tfpWidthCot() const { return tfpWidthCot_; }
0401     // number of bist used for z0
0402     int tfpWidthZ0() const { return tfpWidthZ0_; }
0403     // number of output links
0404     int tfpNumChannel() const { return tfpNumChannel_; }
0405 
0406     // Parameter specifying GeometricProcessor
0407 
0408     // number of phi sectors in a processing nonant used in hough transform
0409     int numSectorsPhi() const { return numSectorsPhi_; }
0410     // number of eta sectors used in hough transform
0411     int numSectorsEta() const { return numSectorsEta_; }
0412     // # critical radius defining r-z sector shape in cm
0413     double chosenRofZ() const { return chosenRofZ_; }
0414     // fifo depth in stub router firmware
0415     int gpDepthMemory() const { return gpDepthMemory_; }
0416     // defining r-z sector shape
0417     double boundarieEta(int eta) const { return boundariesEta_.at(eta); }
0418     std::vector<double> boundarieEta() const { return boundariesEta_; }
0419     // phi sector size in rad
0420     double baseSector() const { return baseSector_; }
0421     // cut on zT
0422     double maxZT() const { return maxZT_; }
0423     // cut on stub cot theta
0424     double maxCot() const { return maxCot_; }
0425     // total number of sectors
0426     int numSectors() const { return numSectors_; }
0427     // cot(theta) of given eta sector
0428     double sectorCot(int eta) const { return sectorCots_.at(eta); }
0429     //
0430     double neededRangeChiZ() const { return neededRangeChiZ_; }
0431 
0432     // Parameter specifying HoughTransform
0433 
0434     // number of inv2R bins used in hough transform
0435     int htNumBinsInv2R() const { return htNumBinsInv2R_; }
0436     // number of phiT bins used in hough transform
0437     int htNumBinsPhiT() const { return htNumBinsPhiT_; }
0438     // required number of stub layers to form a candidate
0439     int htMinLayers() const { return htMinLayers_; }
0440     // internal fifo depth
0441     int htDepthMemory() const { return htDepthMemory_; }
0442 
0443     // Parameter specifying MiniHoughTransform
0444 
0445     // number of finer inv2R bins inside HT bin
0446     int mhtNumBinsInv2R() const { return mhtNumBinsInv2R_; }
0447     // number of finer phiT bins inside HT bin
0448     int mhtNumBinsPhiT() const { return mhtNumBinsPhiT_; }
0449     // number of dynamic load balancing steps
0450     int mhtNumDLBs() const { return mhtNumDLBs_; }
0451     // number of units per dynamic load balancing step
0452     int mhtNumDLBNodes() const { return mhtNumDLBNodes_; }
0453     // number of inputs per dynamic load balancing unit
0454     int mhtNumDLBChannel() const { return mhtNumDLBChannel_; }
0455     // required number of stub layers to form a candidate
0456     int mhtMinLayers() const { return mhtMinLayers_; }
0457     // number of mht cells
0458     int mhtNumCells() const { return mhtNumCells_; }
0459 
0460     // Parameter specifying ZHoughTransform
0461 
0462     //number of used zT bins
0463     int zhtNumBinsZT() const { return zhtNumBinsZT_; }
0464     // number of used cot bins
0465     int zhtNumBinsCot() const { return zhtNumBinsCot_; }
0466     //  number of stages
0467     int zhtNumStages() const { return zhtNumStages_; }
0468     // required number of stub layers to form a candidate
0469     int zhtMinLayers() const { return zhtMinLayers_; }
0470     // max number of output tracks per node
0471     int zhtMaxTracks() const { return zhtMaxTracks_; }
0472     // cut on number of stub per layer for input candidates
0473     int zhtMaxStubsPerLayer() const { return zhtMaxStubsPerLayer_; }
0474     // number of zht cells
0475     int zhtNumCells() const { return zhtNumCells_; }
0476 
0477     // Parameter specifying KalmanFilter Input Formatter
0478 
0479     // power of 2 multiplier of stub phi residual range
0480     int kfinShiftRangePhi() const { return kfinShiftRangePhi_; }
0481     // power of 2 multiplier of stub z residual range
0482     int kfinShiftRangeZ() const { return kfinShiftRangeZ_; }
0483 
0484     // Parameter specifying KalmanFilter
0485 
0486     // number of kf worker
0487     int kfNumWorker() const { return kfNumWorker_; }
0488     // required number of stub layers to form a track
0489     int kfMinLayers() const { return kfMinLayers_; }
0490     // maximum number of  layers added to a track
0491     int kfMaxLayers() const { return kfMaxLayers_; }
0492     // search window of each track parameter in initial uncertainties
0493     double kfRangeFactor() const { return kfRangeFactor_; }
0494 
0495     // Parameter specifying KalmanFilter Output Formatter
0496 
0497     // Final Chi2rphi digitization TODO extract from TTTrack Word
0498     std::vector<double> kfoutchi2rphiBins() const { return kfoutchi2rphiBins_; }
0499     // Final Chi2rz digitization TODO extract from TTTrack Word
0500     std::vector<double> kfoutchi2rzBins() const { return kfoutchi2rzBins_; }
0501     // Conversion factor between dphi^2/weight and chi2rphi
0502     int kfoutchi2rphiConv() const { return kfoutchi2rphiConv_; }
0503     // Conversion factor between dz^2/weight and chi2rz
0504     int kfoutchi2rzConv() const { return kfoutchi2rzConv_; }
0505     // Number of bits for the tttrack word
0506     int tttrackBits() const { return tttrackBits_; }
0507     // Fraction of total dphi and dz ranges to calculate v0 and v1 LUT for
0508     int weightBinFraction() const { return weightBinFraction_; }
0509 
0510     // Parameter specifying DuplicateRemoval
0511 
0512     // internal memory depth
0513     int drDepthMemory() const { return drDepthMemory_; }
0514 
0515   private:
0516     // checks consitency between history and current configuration for a specific module
0517     void checkHistory(const edm::ProcessHistory&,
0518                       const edm::pset::Registry*,
0519                       const std::string&,
0520                       const edm::ParameterSetID&) const;
0521     // dumps pSetHistory where incosistent lines with pSetProcess are highlighted
0522     std::string dumpDiff(const edm::ParameterSet& pSetHistory, const edm::ParameterSet& pSetProcess) const;
0523     // check if bField is supported
0524     void checkMagneticField();
0525     // check if geometry is supported
0526     void checkGeometry();
0527     // derive constants
0528     void calculateConstants();
0529     // convert configuration of TTStubAlgorithm
0530     void consumeStubAlgorithm();
0531     // create bend encodings
0532     void encodeBend(std::vector<std::vector<double>>&, bool) const;
0533     // create sensor modules
0534     void produceSensorModules();
0535     // range check of dtc id
0536     void checkDTCId(int dtcId) const;
0537     // range check of tklayout id
0538     void checkTKLayoutId(int tkLayoutId) const;
0539     // range check of tfp identifier
0540     void checkTFPIdentifier(int tfpRegion, int tfpChannel) const;
0541     // configure TPSelector
0542     void configureTPSelector();
0543 
0544     // MagneticField
0545     const MagneticField* magneticField_;
0546     // TrackerGeometry
0547     const TrackerGeometry* trackerGeometry_;
0548     // TrackerTopology
0549     const TrackerTopology* trackerTopology_;
0550     // CablingMap
0551     const TrackerDetToDTCELinkCablingMap* cablingMap_;
0552     // TTStub algorithm used to create bend encodings
0553     const StubAlgorithmOfficial* stubAlgorithm_;
0554     // pSet of ttStub algorithm, used to identify bend window sizes of sensor modules
0555     const edm::ParameterSet* pSetSA_;
0556     // pSet of geometry configuration, used to identify if geometry is supported
0557     const edm::ParameterSet* pSetGC_;
0558     // pset id of current TTStubAlgorithm
0559     edm::ParameterSetID pSetIdTTStubAlgorithm_;
0560     // pset id of current geometry configuration
0561     edm::ParameterSetID pSetIdGeometryConfiguration_;
0562 
0563     // DD4hep
0564     bool fromDD4hep_;
0565 
0566     // Parameter to check if configured Tracker Geometry is supported
0567     edm::ParameterSet pSetSG_;
0568     // label of ESProducer/ESSource
0569     std::string sgXMLLabel_;
0570     // compared path
0571     std::string sgXMLPath_;
0572     // compared filen ame
0573     std::string sgXMLFile_;
0574     // list of supported versions
0575     std::vector<std::string> sgXMLVersions_;
0576 
0577     // Parameter to check if Process History is consistent with process configuration
0578     edm::ParameterSet pSetPH_;
0579     // label of compared GeometryConfiguration
0580     std::string phGeometryConfiguration_;
0581     // label of compared TTStubAlgorithm
0582     std::string phTTStubAlgorithm_;
0583 
0584     // Common track finding parameter
0585     edm::ParameterSet pSetTF_;
0586     // half lumi region size in cm
0587     double beamWindowZ_;
0588     // required number of layers a found track has to have in common with a TP to consider it matched to it
0589     int matchedLayers_;
0590     // required number of ps layers a found track has to have in common with a TP to consider it matched to it
0591     int matchedLayersPS_;
0592     // allowed number of stubs a found track may have not in common with its matched TP
0593     int unMatchedStubs_;
0594     // allowed number of PS stubs a found track may have not in common with its matched TP
0595     int unMatchedStubsPS_;
0596     // scattering term used to add stub phi uncertainty depending on assumed track inv2R
0597     double scattering_;
0598 
0599     // TMTT specific parameter
0600     edm::ParameterSet pSetTMTT_;
0601     // cut on stub and TP pt, also defines region overlap shape in GeV
0602     double minPt_;
0603     // cut on stub eta
0604     double maxEta_;
0605     // critical radius defining region overlap shape in cm
0606     double chosenRofPhi_;
0607     // number of detector layers a reconstructbale particle may cross
0608     int numLayers_;
0609     // number of bits used for stub r - ChosenRofPhi
0610     int tmttWidthR_;
0611     // number of bits used for stub phi w.r.t. phi sector centre
0612     int tmttWidthPhi_;
0613     // number of bits used for stub z
0614     int tmttWidthZ_;
0615 
0616     // Hybrid specific parameter
0617     edm::ParameterSet pSetHybrid_;
0618     // cut on stub pt in GeV, also defines region overlap shape
0619     double hybridMinPtStub_;
0620     // cut on andidate pt in GeV
0621     double hybridMinPtCand_;
0622     // cut on stub eta
0623     double hybridMaxEta_;
0624     // critical radius defining region overlap shape in cm
0625     double hybridChosenRofPhi_;
0626     // max number of detector layer connected to one DTC
0627     int hybridNumLayers_;
0628     // number of outer PS rings for disk 1, 2, 3, 4, 5
0629     std::vector<int> hybridNumRingsPS_;
0630     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0631     std::vector<int> hybridWidthsR_;
0632     // number of bits used for stub z w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0633     std::vector<int> hybridWidthsZ_;
0634     // number of bits used for stub phi w.r.t. region centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0635     std::vector<int> hybridWidthsPhi_;
0636     // number of bits used for stub row number for module types (barrelPS, barrel2S, diskPS, disk2S)
0637     std::vector<int> hybridWidthsAlpha_;
0638     // number of bits used for stub bend number for module types (barrelPS, barrel2S, diskPS, disk2S)
0639     std::vector<int> hybridWidthsBend_;
0640     // range in stub r which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0641     std::vector<double> hybridRangesR_;
0642     // range in stub z which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0643     std::vector<double> hybridRangesZ_;
0644     // range in stub row which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0645     std::vector<double> hybridRangesAlpha_;
0646     // mean radius of outer tracker barrel layer
0647     std::vector<double> hybridLayerRs_;
0648     // mean z of outer tracker endcap disks
0649     std::vector<double> hybridDiskZs_;
0650     // center radius of outer tracker endcap 2S diks strips
0651     std::vector<edm::ParameterSet> hybridDisk2SRsSet_;
0652     // range of stub phi in rad
0653     double hybridRangePhi_;
0654     // smallest stub radius after TrackBuilder in cm
0655     double tbInnerRadius_;
0656 
0657     // Parameter specifying TrackingParticle used for Efficiency measurements
0658     edm::ParameterSet pSetTP_;
0659     // pt cut
0660     double tpMinPt_;
0661     // eta cut
0662     double tpMaxEta_;
0663     // cut on vertex pos r in cm
0664     double tpMaxVertR_;
0665     // cut on vertex pos z in cm
0666     double tpMaxVertZ_;
0667     // cut on impact parameter in cm
0668     double tpMaxD0_;
0669     // required number of associated layers to a TP to consider it reconstruct-able
0670     int tpMinLayers_;
0671     // required number of associated ps layers to a TP to consider it reconstruct-able
0672     int tpMinLayersPS_;
0673     // max number of unassociated 2S stubs allowed to still associate TTTrack with TP
0674     int tpMaxBadStubs2S_;
0675     // max number of unassociated PS stubs allowed to still associate TTTrack with TP
0676     int tpMaxBadStubsPS_;
0677 
0678     // Firmware specific Parameter
0679     edm::ParameterSet pSetFW_;
0680     // width of the 'A' port of an DSP slice
0681     int widthDSPa_;
0682     // width of the 'A' port of an DSP slice using biased twos complement
0683     int widthDSPab_;
0684     // width of the 'A' port of an DSP slice using biased binary
0685     int widthDSPau_;
0686     // width of the 'B' port of an DSP slice
0687     int widthDSPb_;
0688     // width of the 'B' port of an DSP slice using biased twos complement
0689     int widthDSPbb_;
0690     // width of the 'B' port of an DSP slice using biased binary
0691     int widthDSPbu_;
0692     // width of the 'C' port of an DSP slice
0693     int widthDSPc_;
0694     // width of the 'C' port of an DSP slice using biased twos complement
0695     int widthDSPcb_;
0696     // width of the 'C' port of an DSP slice using biased binary
0697     int widthDSPcu_;
0698     // smallest address width of an BRAM36 configured as broadest simple dual port memory
0699     int widthAddrBRAM36_;
0700     // smallest address width of an BRAM18 configured as broadest simple dual port memory
0701     int widthAddrBRAM18_;
0702     // needed gap between events of emp-infrastructure firmware
0703     int numFramesInfra_;
0704     // LHC bunch crossing rate in MHz
0705     double freqLHC_;
0706     // processing Frequency of DTC & TFP in MHz, has to be integer multiple of FreqLHC
0707     double freqBE_;
0708     // number of events collected in front-end
0709     int tmpFE_;
0710     // time multiplexed period of track finding processor
0711     int tmpTFP_;
0712     // speed of light used in FW in e8 m/s
0713     double speedOfLight_;
0714     // BField used in fw in T
0715     double bField_;
0716     // accepted BField difference between FW to EventSetup in T
0717     double bFieldError_;
0718     // outer radius of outer tracker in cm
0719     double outerRadius_;
0720     // inner radius of outer tracker in cm
0721     double innerRadius_;
0722     // half length of outer tracker in cm
0723     double halfLength_;
0724     // max strip/pixel pitch of outer tracker sensors in cm
0725     double maxPitch_;
0726     // max strip/pixel length of outer tracker sensors in cm
0727     double maxLength_;
0728     // approximated tilt correction parameter used to project r to z uncertainty
0729     double tiltApproxSlope_;
0730     // approximated tilt correction parameter used to project r to z uncertainty
0731     double tiltApproxIntercept_;
0732     // In tilted barrel, constant assumed stub radial uncertainty * sqrt(12) in cm
0733     double tiltUncertaintyR_;
0734     // minimum representable stub phi uncertainty
0735     double mindPhi_;
0736     // maximum representable stub phi uncertainty
0737     double maxdPhi_;
0738     // minimum representable stub z uncertainty
0739     double mindZ_;
0740     // maximum representable stub z uncertainty
0741     double maxdZ_;
0742     // strip pitch of outer tracker sensors in cm
0743     double pitch2S_;
0744     // pixel pitch of outer tracker sensors in cm
0745     double pitchPS_;
0746     // strip length of outer tracker sensors in cm
0747     double length2S_;
0748     // pixel length of outer tracker sensors in cm
0749     double lengthPS_;
0750     // barrel layer limit |z| value to partition into tilted and untilted region
0751     std::vector<double> tiltedLayerLimitsZ_;
0752     // endcap disk limit r value to partition into PS and 2S region
0753     std::vector<double> psDiskLimitsR_;
0754 
0755     // Parameter specifying front-end
0756     edm::ParameterSet pSetFE_;
0757     // number of bits used for internal stub bend
0758     int widthBend_;
0759     // number of bits used for internal stub column
0760     int widthCol_;
0761     // number of bits used for internal stub row
0762     int widthRow_;
0763     // precision of internal stub bend in pitch units
0764     double baseBend_;
0765     // precision of internal stub column in pitch units
0766     double baseCol_;
0767     // precision of internal stub row in pitch units
0768     double baseRow_;
0769     // precision of window sizes in pitch units
0770     double baseWindowSize_;
0771     // used stub bend uncertainty in pitch units
0772     double bendCut_;
0773 
0774     // Parameter specifying DTC
0775     edm::ParameterSet pSetDTC_;
0776     // number of phi slices the outer tracker readout is organized in
0777     int numRegions_;
0778     // number of regions a reconstructable particles may cross
0779     int numOverlappingRegions_;
0780     // number of Slots in used ATCA crates
0781     int numATCASlots_;
0782     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0783     int numDTCsPerRegion_;
0784     // max number of sensor modules connected to one DTC board
0785     int numModulesPerDTC_;
0786     // number of systiloic arrays in stub router firmware
0787     int dtcNumRoutingBlocks_;
0788     // fifo depth in stub router firmware
0789     int dtcDepthMemory_;
0790     // number of row bits used in look up table
0791     int dtcWidthRowLUT_;
0792     // number of bits used for stub inv2R. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0793     int dtcWidthInv2R_;
0794     // tk layout det id minus DetSetVec->detId
0795     int offsetDetIdDSV_;
0796     // tk layout det id minus TrackerTopology lower det id
0797     int offsetDetIdTP_;
0798     // offset in layer ids between barrel layer and endcap disks
0799     int offsetLayerDisks_;
0800     // offset between 0 and smallest layer id (barrel layer 1)
0801     int offsetLayerId_;
0802     //
0803     int numBarrelLayer_;
0804     // total number of output channel
0805     int dtcNumStreams_;
0806     // slot number changing from PS to 2S (default: 6)
0807     int slotLimitPS_;
0808     // slot number changing from 10 gbps to 5gbps (default: 3)
0809     int slotLimit10gbps_;
0810 
0811     // Parameter specifying TFP
0812     edm::ParameterSet pSetTFP_;
0813     // number of bist used for phi0
0814     int tfpWidthPhi0_;
0815     // umber of bist used for qOverPt
0816     int tfpWidthInv2R_;
0817     // number of bist used for cot(theta)
0818     int tfpWidthCot_;
0819     // number of bist used for z0
0820     int tfpWidthZ0_;
0821     // number of output links
0822     int tfpNumChannel_;
0823 
0824     // Parameter specifying GeometricProcessor
0825     edm::ParameterSet pSetGP_;
0826     // number of phi sectors used in hough transform
0827     int numSectorsPhi_;
0828     // number of eta sectors used in hough transform
0829     int numSectorsEta_;
0830     // # critical radius defining r-z sector shape in cm
0831     double chosenRofZ_;
0832     // range of stub z residual w.r.t. sector center which needs to be covered
0833     double neededRangeChiZ_;
0834     // fifo depth in stub router firmware
0835     int gpDepthMemory_;
0836     // defining r-z sector shape
0837     std::vector<double> boundariesEta_;
0838 
0839     // Parameter specifying HoughTransform
0840     edm::ParameterSet pSetHT_;
0841     // number of inv2R bins used in hough transform
0842     int htNumBinsInv2R_;
0843     // number of phiT bins used in hough transform
0844     int htNumBinsPhiT_;
0845     // required number of stub layers to form a candidate
0846     int htMinLayers_;
0847     // internal fifo depth
0848     int htDepthMemory_;
0849 
0850     // Parameter specifying MiniHoughTransform
0851     edm::ParameterSet pSetMHT_;
0852     // number of finer inv2R bins inside HT bin
0853     int mhtNumBinsInv2R_;
0854     // number of finer phiT bins inside HT bin
0855     int mhtNumBinsPhiT_;
0856     // number of dynamic load balancing steps
0857     int mhtNumDLBs_;
0858     // number of units per dynamic load balancing step
0859     int mhtNumDLBNodes_;
0860     // number of inputs per dynamic load balancing unit
0861     int mhtNumDLBChannel_;
0862     // required number of stub layers to form a candidate
0863     int mhtMinLayers_;
0864 
0865     // Parameter specifying ZHoughTransform
0866     edm::ParameterSet pSetZHT_;
0867     //number of used zT bins
0868     int zhtNumBinsZT_;
0869     // number of used cot bins
0870     int zhtNumBinsCot_;
0871     // number of stages
0872     int zhtNumStages_;
0873     // required number of stub layers to form a candidate
0874     int zhtMinLayers_;
0875     // max number of output tracks per node
0876     int zhtMaxTracks_;
0877     // cut on number of stub per layer for input candidates
0878     int zhtMaxStubsPerLayer_;
0879 
0880     // Parameter specifying KalmanFilter Input Formatter
0881     edm::ParameterSet pSetKFin_;
0882     // power of 2 multiplier of stub phi residual range
0883     int kfinShiftRangePhi_;
0884     // power of 2 multiplier of stub z residual range
0885     int kfinShiftRangeZ_;
0886 
0887     // Parameter specifying KalmanFilter
0888     edm::ParameterSet pSetKF_;
0889     // number of kf worker
0890     int kfNumWorker_;
0891     // required number of stub layers to form a track
0892     int kfMinLayers_;
0893     // maximum number of  layers added to a track
0894     int kfMaxLayers_;
0895     // search window of each track parameter in initial uncertainties
0896     double kfRangeFactor_;
0897 
0898     // Parameter specifying KalmanFilter Output Formatter
0899     edm::ParameterSet pSetKFOut_;
0900     // Bins used to digitize dPhi for chi2 calculation
0901     std::vector<int> kfoutdPhiBins_;
0902     // Bins used to digitize dZ for chi2 calculation
0903     std::vector<int> kfoutdZBins_;
0904     // v0 weight Bins corresponding to dPhi Bins for chi2 calculation
0905     std::vector<int> kfoutv0Bins_;
0906     // v1 weight Bins corresponding to dZ Bins for chi2 calculation
0907     std::vector<int> kfoutv1Bins_;
0908     // Final Chi2rphi digitization TODO extract from TTTrack Word
0909     std::vector<double> kfoutchi2rphiBins_;
0910     // Final Chi2rz digitization TODO extract from TTTrack Word
0911     std::vector<double> kfoutchi2rzBins_;
0912     // Conversion factor between dphi^2/weight and chi2rphi
0913     int kfoutchi2rphiConv_;
0914     // Conversion factor between dz^2/weight and chi2rz
0915     int kfoutchi2rzConv_;
0916     // Number of bits for the tttrack word
0917     int tttrackBits_;
0918     // Fraction of total dphi and dz ranges to calculate v0 and v1 LUT for
0919     int weightBinFraction_;
0920 
0921     // Parameter specifying DuplicateRemoval
0922     edm::ParameterSet pSetDR_;
0923     // internal memory depth
0924     int drDepthMemory_;
0925 
0926     //
0927     // Derived constants
0928     //
0929 
0930     // true if tracker geometry and magnetic field supported
0931     bool configurationSupported_;
0932     // selector to partly select TPs for efficiency measurements
0933     TrackingParticleSelector tpSelector_;
0934     // selector to partly select TPs for fake and duplicate rate measurements
0935     TrackingParticleSelector tpSelectorLoose_;
0936 
0937     // TTStubAlgorithm
0938 
0939     // number of tilted layer rings per barrel layer
0940     std::vector<double> numTiltedLayerRings_;
0941     // stub bend window sizes for flat barrel layer in full pitch units
0942     std::vector<double> windowSizeBarrelLayers_;
0943     // stub bend window sizes for tilted barrel layer rings in full pitch units
0944     std::vector<std::vector<double>> windowSizeTiltedLayerRings_;
0945     // stub bend window sizes for endcap disks rings in full pitch units
0946     std::vector<std::vector<double>> windowSizeEndcapDisksRings_;
0947     // maximum stub bend window in half strip units
0948     int maxWindowSize_;
0949 
0950     // common Track finding
0951 
0952     // number of frames betwen 2 resets of 18 BX packets
0953     int numFrames_;
0954     // number of valid frames per 18 BX packet
0955     int numFramesIO_;
0956     // number of valid frames per 8 BX packet
0957     int numFramesFE_;
0958     // converts GeV in 1/cm
0959     double invPtToDphi_;
0960     // region size in rad
0961     double baseRegion_;
0962 
0963     // TMTT
0964 
0965     // number of bits used for stub layer id
0966     int widthLayerId_;
0967     // internal stub r precision in cm
0968     double tmttBaseR_;
0969     // internal stub z precision in cm
0970     double tmttBaseZ_;
0971     // internal stub phi precision in rad
0972     double tmttBasePhi_;
0973     // internal stub inv2R precision in 1/cm
0974     double tmttBaseInv2R_;
0975     // internal stub phiT precision in rad
0976     double tmttBasePhiT_;
0977     // number of padded 0s in output data format
0978     int dtcNumUnusedBits_;
0979     // number of bits used for stub layer id
0980     int tmttWidthLayer_;
0981     // number of bits used for stub eta sector
0982     int tmttWidthSectorEta_;
0983     // number of bits used for stub inv2R
0984     int tmttWidthInv2R_;
0985     // number of padded 0s in output data format
0986     int tmttNumUnusedBits_;
0987 
0988     // hybrid
0989 
0990     // number of bits used for stub layer id
0991     int hybridWidthLayerId_;
0992     // precision or r in cm for (barrelPS, barrel2S, diskPS, disk2S)
0993     std::vector<double> hybridBasesR_;
0994     // precision or phi in rad for (barrelPS, barrel2S, diskPS, disk2S)
0995     std::vector<double> hybridBasesPhi_;
0996     // precision or z in cm for (barrelPS, barrel2S, diskPS, disk2S)
0997     std::vector<double> hybridBasesZ_;
0998     // precision or alpha in pitch units for (barrelPS, barrel2S, diskPS, disk2S)
0999     std::vector<double> hybridBasesAlpha_;
1000     // stub r precision in cm
1001     double hybridBaseZ_;
1002     // stub z precision in cm
1003     double hybridBaseR_;
1004     // stub phi precision in rad
1005     double hybridBasePhi_;
1006     // stub cut on cot(theta) = tan(lambda) = sinh(eta)
1007     double hybridMaxCot_;
1008     // number of padded 0s in output data format for (barrelPS, barrel2S, diskPS, disk2S)
1009     std::vector<int> hybridNumsUnusedBits_;
1010     // center radius of outer tracker endcap 2S diks strips
1011     std::vector<std::vector<double>> disk2SRs_;
1012 
1013     // DTC
1014 
1015     // total number of outer tracker DTCs
1016     int numDTCs_;
1017     // number of DTCs connected to one TFP (48)
1018     int numDTCsPerTFP_;
1019     // total number of max possible outer tracker modules (72 per DTC)
1020     int numModules_;
1021     // max number of moudles connected to a systiloic array in stub router firmware
1022     int dtcNumModulesPerRoutingBlock_;
1023     // number of merged rows for look up
1024     int dtcNumMergedRows_;
1025     // number of bits used for phi of row slope
1026     int dtcWidthM_;
1027     // internal stub inv2R precision in 1 /cm
1028     double dtcBaseInv2R_;
1029     // phi of row slope precision in rad / pitch unit
1030     double dtcBaseM_;
1031     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for ps modules
1032     std::vector<std::vector<double>> encodingsBendPS_;
1033     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for 2s modules
1034     std::vector<std::vector<double>> encodingsBend2S_;
1035     // collection of outer tracker sensor modules
1036     std::vector<SensorModule> sensorModules_;
1037     // collection of outer tracker sensor modules organised in DTCS [0-215][0-71]
1038     std::vector<std::vector<SensorModule*>> dtcModules_;
1039     // hepler to convert Stubs quickly
1040     std::unordered_map<DetId, SensorModule*> detIdToSensorModule_;
1041 
1042     // GP
1043 
1044     // phi sector size in rad
1045     double baseSector_;
1046     // cut on zT
1047     double maxZT_;
1048     // cut on stub cot theta
1049     double maxCot_;
1050     // total number of sectors
1051     int numSectors_;
1052     // number of unused bits in GP output format
1053     int gpNumUnusedBits_;
1054     // cot(theta) of eta sectors
1055     std::vector<double> sectorCots_;
1056 
1057     // MHT
1058 
1059     // number of mht cells
1060     int mhtNumCells_;
1061 
1062     // ZHT
1063 
1064     // number of zht cells
1065     int zhtNumCells_;
1066 
1067     // KF
1068 
1069     int kfWidthLayerCount_;
1070   };
1071 
1072 }  // namespace tt
1073 
1074 EVENTSETUP_DATA_DEFAULT_RECORD(tt::Setup, tt::SetupRcd);
1075 
1076 #endif