Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-03 23:53:07

0001 #ifndef L1Trigger_TrackerDTC_Setup_h
0002 #define L1Trigger_TrackerDTC_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 
0022 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0023 #include "DataFormats/L1TrackTrigger/interface/TTDTC.h"
0024 #include "L1Trigger/TrackerDTC/interface/SetupRcd.h"
0025 #include "L1Trigger/TrackerDTC/interface/SensorModule.h"
0026 
0027 #include <vector>
0028 #include <unordered_map>
0029 
0030 namespace trackerDTC {
0031 
0032   typedef TTStubAlgorithm<Ref_Phase2TrackerDigi_> StubAlgorithm;
0033   typedef TTStubAlgorithm_official<Ref_Phase2TrackerDigi_> StubAlgorithmOfficial;
0034   // handles 2 pi overflow
0035   inline double deltaPhi(double lhs, double rhs = 0.) { return reco::deltaPhi(lhs, rhs); }
0036 
0037   /*! \class  trackerDTC::Setup
0038    *  \brief  Class to process and provide run-time constants used by Track Trigger emulators
0039    *  \author Thomas Schuh
0040    *  \date   2020, Apr
0041    */
0042   class Setup {
0043   public:
0044     Setup() {}
0045     Setup(const edm::ParameterSet& iConfig,
0046           const MagneticField& magneticField,
0047           const TrackerGeometry& trackerGeometry,
0048           const TrackerTopology& trackerTopology,
0049           const TrackerDetToDTCELinkCablingMap& cablingMap,
0050           const StubAlgorithmOfficial& stubAlgorithm,
0051           const edm::ParameterSet& pSetStubAlgorithm,
0052           const edm::ParameterSet& pSetGeometryConfiguration,
0053           const edm::ParameterSetID& pSetIdTTStubAlgorithm,
0054           const edm::ParameterSetID& pSetIdGeometryConfiguration);
0055     ~Setup() {}
0056 
0057     // true if tracker geometry and magnetic field supported
0058     bool configurationSupported() const { return configurationSupported_; }
0059     // checks current configuration vs input sample configuration
0060     void checkHistory(const edm::ProcessHistory& processHistory) const;
0061     // converts tk layout id into dtc id
0062     int dtcId(int tklId) const;
0063     // converts dtci id into tk layout id
0064     int tkLayoutId(int dtcId) const;
0065     // converts TFP identifier (region[0-8], channel[0-47]) into dtcId [0-215]
0066     int dtcId(int tfpRegion, int tfpChannel) const;
0067     // checks if given dtcId is connected to PS or 2S sensormodules
0068     bool psModule(int dtcId) const;
0069     // checks if given dtcId is connected to -z (false) or +z (true)
0070     bool side(int dtcId) const;
0071     // ATCA slot number [0-11] of given dtcId
0072     int slot(int dtcId) const;
0073     // sensor module for det id
0074     SensorModule* sensorModule(const DetId& detId) const;
0075     // TrackerGeometry
0076     const TrackerGeometry* trackerGeometry() const { return trackerGeometry_; }
0077     // TrackerTopology
0078     const TrackerTopology* trackerTopology() const { return trackerTopology_; }
0079     // returns bit accurate position of a stub from a given tfp identifier region [0-8] channel [0-47]
0080     GlobalPoint stubPos(bool hybrid, const TTDTC::Frame& frame, int tfpRegion, int tfpChannel) const;
0081     // returns global TTStub position
0082     GlobalPoint stubPos(const TTStubRef& ttStubRef) const;
0083     // empty trackerDTC EDProduct
0084     TTDTC ttDTC() const { return TTDTC(numRegions_, numOverlappingRegions_, numDTCsPerRegion_); }
0085 
0086     // Common track finding parameter
0087 
0088     // half lumi region size in cm
0089     double beamWindowZ() const { return beamWindowZ_; }
0090     // number of frames betwen 2 resets of 18 BX packets
0091     int numFrames() const { return numFrames_; }
0092     // number of valid frames per 18 BX packet
0093     int numFramesIO() const { return numFramesIO_; }
0094     // number of valid frames per 8 BX packet
0095     int numFramesFE() const { return numFramesFE_; }
0096     // converts GeV in 1/cm
0097     double invPtToDphi() const { return invPtToDphi_; }
0098     // region size in rad
0099     double baseRegion() const { return baseRegion_; }
0100     // TP eta cut
0101     double tpMaxEta() const { return tpMaxEta_; }
0102     // TP cut on vertex pos r in cm
0103     double tpMaxVertR() const { return tpMaxVertR_; }
0104     // TP cut on vertex pos z in cm
0105     double tpMaxVertZ() const { return tpMaxVertZ_; }
0106     // TP cut on impact parameter in cm
0107     double tpMaxD0() const { return tpMaxD0_; }
0108     // required number of associated layers to a TP to consider it reconstruct-able
0109     int tpMinLayers() const { return tpMinLayers_; }
0110     // required number of associated ps layers to a TP to consider it reconstruct-able
0111     int tpMinLayersPS() const { return tpMinLayersPS_; }
0112 
0113     // TMTT specific parameter
0114 
0115     // cut on stub and TP pt, also defines region overlap shape in GeV
0116     double minPt() const { return minPt_; }
0117     // cut on stub eta
0118     double maxEta() const { return maxEta_; }
0119     // critical radius defining region overlap shape in cm
0120     double chosenRofPhi() const { return chosenRofPhi_; }
0121     // number of detector layers a reconstructbale particle may cross
0122     int numLayers() const { return numLayers_; }
0123     // number of bits used for stub r - ChosenRofPhi
0124     int widthR() const { return widthR_; }
0125     // number of bits used for stub phi w.r.t. phi sector centre
0126     int widthPhi() const { return widthPhi_; }
0127     // number of bits used for stub z
0128     int widthZ() const { return widthZ_; }
0129     // number of bits used for stub layer id
0130     int widthLayer() const { return widthLayer_; }
0131     // internal stub r precision in cm
0132     double baseR() const { return baseR_; }
0133     // internal stub z precision in cm
0134     double baseZ() const { return baseZ_; }
0135     // internal stub phi precision in rad
0136     double basePhi() const { return basePhi_; }
0137     // number of padded 0s in output data format
0138     int dtcNumUnusedBits() const { return dtcNumUnusedBits_; }
0139 
0140     // Hybrid specific parameter
0141 
0142     // cut on stub and TP pt, also defines region overlap shape in GeV
0143     double hybridMinPt() const { return hybridMinPt_; }
0144     // cut on stub eta
0145     double hybridMaxEta() const { return hybridMaxEta_; }
0146     // critical radius defining region overlap shape in cm
0147     double hybridChosenRofPhi() const { return hybridChosenRofPhi_; }
0148     // max number of detector layer connected to one DTC
0149     int hybridNumLayers() const { return hybridNumLayers_; }
0150     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0151     int hybridWidthR(SensorModule::Type type) const { return hybridWidthsR_.at(type); }
0152     // number of bits used for stub z w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0153     int hybridWidthZ(SensorModule::Type type) const { return hybridWidthsZ_.at(type); }
0154     // number of bits used for stub phi w.r.t. region centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0155     int hybridWidthPhi(SensorModule::Type type) const { return hybridWidthsPhi_.at(type); }
0156     // number of bits used for stub row number for module types (barrelPS, barrel2S, diskPS, disk2S)
0157     int hybridWidthAlpha(SensorModule::Type type) const { return hybridWidthsAlpha_.at(type); }
0158     // number of bits used for stub bend number for module types (barrelPS, barrel2S, diskPS, disk2S)
0159     int hybridWidthBend(SensorModule::Type type) const { return hybridWidthsBend_.at(type); }
0160     // number of bits used for stub layer id
0161     int hybridWidthLayer() const { return hybridWidthLayer_; }
0162     // precision or r in cm for (barrelPS, barrel2S, diskPS, disk2S)
0163     double hybridBaseR(SensorModule::Type type) const { return hybridBasesR_.at(type); }
0164     // precision or phi in rad for (barrelPS, barrel2S, diskPS, disk2S)
0165     double hybridBasePhi(SensorModule::Type type) const { return hybridBasesPhi_.at(type); }
0166     // precision or z in cm for (barrelPS, barrel2S, diskPS, disk2S)
0167     double hybridBaseZ(SensorModule::Type type) const { return hybridBasesZ_.at(type); }
0168     // precision or alpha in pitch units for (barrelPS, barrel2S, diskPS, disk2S)
0169     double hybridBaseAlpha(SensorModule::Type type) const { return hybridBasesAlpha_.at(type); }
0170     // number of padded 0s in output data format for (barrelPS, barrel2S, diskPS, disk2S)
0171     int hybridNumUnusedBits(SensorModule::Type type) const { return hybridNumsUnusedBits_.at(type); }
0172     // stub cut on cot(theta) = tan(lambda) = sinh(eta)
0173     double hybridMaxCot() const { return hybridMaxCot_; }
0174     // number of outer PS rings for disk 1, 2, 3, 4, 5
0175     int hybridNumRingsPS(int layerId) const { return hybridNumRingsPS_.at(layerId); }
0176     // mean radius of outer tracker barrel layer
0177     double hybridLayerR(int layerId) const { return hybridLayerRs_.at(layerId); }
0178     // mean z of outer tracker endcap disks
0179     double hybridDiskZ(int layerId) const { return hybridDiskZs_.at(layerId); }
0180 
0181     // Parameter specifying TTStub algorithm
0182 
0183     // number of tilted layer rings per barrel layer
0184     double numTiltedLayerRing(int layerId) const { return numTiltedLayerRings_.at(layerId); };
0185     // stub bend window sizes for flat barrel layer in full pitch units
0186     double windowSizeBarrelLayer(int layerId) const { return windowSizeBarrelLayers_.at(layerId); };
0187     // stub bend window sizes for tilted barrel layer rings in full pitch units
0188     double windowSizeTiltedLayerRing(int layerId, int ring) const {
0189       return windowSizeTiltedLayerRings_.at(layerId).at(ring);
0190     };
0191     // stub bend window sizes for endcap disks rings in full pitch units
0192     double windowSizeEndcapDisksRing(int layerId, int ring) const {
0193       return windowSizeEndcapDisksRings_.at(layerId).at(ring);
0194     };
0195     // precision of window sizes in pitch units
0196     double baseWindowSize() const { return baseWindowSize_; }
0197     // index = encoded bend, value = decoded bend for given window size and module type
0198     const std::vector<double>& encodingBend(int windowSize, bool psModule) const;
0199 
0200     // Parameter specifying front-end
0201 
0202     // number of bits used for internal stub bend
0203     int widthBend() const { return widthBend_; }
0204     // number of bits used for internal stub column
0205     int widthCol() const { return widthCol_; }
0206     // number of bits used for internal stub row
0207     int widthRow() const { return widthRow_; }
0208     // precision of internal stub bend in pitch units
0209     double baseBend() const { return baseBend_; }
0210     // precision of internal stub column in pitch units
0211     double baseCol() const { return baseCol_; }
0212     // precision of internal stub row in pitch units
0213     double baseRow() const { return baseRow_; }
0214     // used stub bend uncertainty in pitch units
0215     double bendCut() const { return bendCut_; }
0216 
0217     // Parameter specifying DTC
0218 
0219     // number of phi slices the outer tracker readout is organized in
0220     int numRegions() const { return numRegions_; }
0221     // number of regions a reconstructable particles may cross
0222     int numOverlappingRegions() const { return numOverlappingRegions_; }
0223     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0224     int numDTCsPerRegion() const { return numDTCsPerRegion_; }
0225     // max number of sensor modules connected to one DTC board
0226     int numModulesPerDTC() const { return numModulesPerDTC_; }
0227     // number of systiloic arrays in stub router firmware
0228     int dtcNumRoutingBlocks() const { return dtcNumRoutingBlocks_; }
0229     // fifo depth in stub router firmware
0230     int dtcDepthMemory() const { return dtcDepthMemory_; }
0231     // number of row bits used in look up table
0232     int dtcWidthRowLUT() const { return dtcWidthRowLUT_; }
0233     // number of bits used for stub qOverPt. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0234     int dtcWidthQoverPt() const { return dtcWidthQoverPt_; }
0235     // tk layout det id minus DetSetVec->detId
0236     int offsetDetIdDSV() const { return offsetDetIdDSV_; }
0237     // tk layout det id minus TrackerTopology lower det id
0238     int offsetDetIdTP() const { return offsetDetIdTP_; }
0239     // offset in layer ids between barrel layer and endcap disks
0240     int offsetLayerDisks() const { return offsetLayerDisks_; }
0241     // offset between 0 and smallest layer id (barrel layer 1)
0242     int offsetLayerId() const { return offsetLayerId_; }
0243     // total number of outer tracker DTCs
0244     int numDTCs() const { return numDTCs_; }
0245     // number of DTCs connected to one TFP (48)
0246     int numDTCsPerTFP() const { return numDTCsPerTFP_; }
0247     // total number of max possible outer tracker modules (72 per DTC)
0248     int numModules() const { return numModules_; }
0249     // max number of moudles connected to a systiloic array in stub router firmware
0250     int dtcNumModulesPerRoutingBlock() const { return dtcNumModulesPerRoutingBlock_; }
0251     // number of merged rows for look up
0252     int dtcNumMergedRows() const { return dtcNumMergedRows_; }
0253     // number of bits used for phi of row slope
0254     int dtcWidthM() const { return dtcWidthM_; }
0255     // internal stub q over pt precision in 1 /cm
0256     double dtcBaseQoverPt() const { return dtcBaseQoverPt_; }
0257     // phi of row slope precision in rad / pitch unit
0258     double dtcBaseM() const { return dtcBaseM_; }
0259     // number of bits for internal stub phi
0260     int widthPhiDTC() const { return widthPhiDTC_; }
0261     // sensor modules connected to given dtc id
0262     const std::vector<SensorModule*>& dtcModules(int dtcId) const { return dtcModules_.at(dtcId); }
0263     // index = encoded layerId, inner value = decoded layerId for given tfp channel [0-47]
0264     const std::vector<int>& encodingLayerId(int tfpChannel) const;
0265 
0266     // Parameter specifying GeometricProcessor
0267 
0268     // number of phi sectors used in hough transform
0269     int numSectorsPhi() const { return numSectorsPhi_; }
0270     // number of eta sectors used in hough transform
0271     int numSectorsEta() const { return numSectorsEta_; }
0272     // # critical radius defining r-z sector shape in cm
0273     double chosenRofZ() const { return chosenRofZ_; }
0274     // fifo depth in stub router firmware
0275     int gpDepthMemory() const { return gpDepthMemory_; }
0276     // defining r-z sector shape
0277     double boundarieEta(int eta) const { return boundariesEta_.at(eta); }
0278     // phi sector size in rad
0279     double baseSector() const { return baseSector_; }
0280     // cut on zT
0281     double maxZT() const { return maxZT_; }
0282     // cut on stub cot theta
0283     double maxCot() const { return maxCot_; }
0284     // number of bits used for internal stub sector eta
0285     int widthSectorEta() const { return widthSectorEta_; }
0286     // number of bits to represent z residual w.r.t. sector center
0287     int widthChiZ() const { return widthChiZ_; }
0288 
0289     // Parameter specifying HoughTransform
0290 
0291     // number of qOverPt bins used in hough transform
0292     int htNumBinsQoverPt() const { return htNumBinsQoverPt_; }
0293     // number of phiT bins used in hough transform
0294     int htNumBinsPhiT() const { return htNumBinsPhiT_; }
0295     // required number of stub layers to form a candidate
0296     int htMinLayers() const { return htMinLayers_; }
0297     // internal fifo depth
0298     int htDepthMemory() const { return htDepthMemory_; }
0299     // number of bits used for candidate q over pt
0300     int htWidthQoverPt() const { return htWidthQoverPt_; }
0301     // number of bits used for candidate phiT
0302     int htWidthPhiT() const { return htWidthPhiT_; }
0303     // number of bits to represent phi residual w.r.t. ht candiate
0304     int widthChiPhi() const { return widthChiPhi_; }
0305     // q over pt bin width precision in 1 /cm
0306     double htBaseQoverPt() const { return htBaseQoverPt_; }
0307     // phiT bin width in rad
0308     double htBasePhiT() const { return htBasePhiT_; }
0309 
0310     // Parameter specifying MiniHoughTransform
0311 
0312     // number of finer qOverPt bins inside HT bin
0313     int mhtNumBinsQoverPt() const { return mhtNumBinsQoverPt_; }
0314     // number of finer phiT bins inside HT bin
0315     int mhtNumBinsPhiT() const { return mhtNumBinsPhiT_; }
0316     // number of dynamic load balancing steps
0317     int mhtNumDLB() const { return mhtNumDLB_; }
0318     // required number of stub layers to form a candidate
0319     int mhtMinLayers() const { return mhtMinLayers_; }
0320     // number of mht cells
0321     int mhtNumCells() const { return mhtNumCells_; }
0322     // number of bits used for candidate q over pt
0323     int mhtWidthQoverPt() const { return mhtWidthQoverPt_; }
0324     // number of bits used for candidate phiT
0325     int mhtWidthPhiT() const { return mhtWidthPhiT_; }
0326     // q over pt bin width precision in 1 /cm
0327     double mhtBaseQoverPt() const { return mhtBaseQoverPt_; }
0328     // phiT bin width in rad
0329     double mhtBasePhiT() const { return mhtBasePhiT_; }
0330 
0331     // Parameter specifying SeedFilter
0332 
0333     // required number of stub layers to form a candidate
0334     int sfMinLayers() const { return sfMinLayers_; }
0335     // cot(theta) precision
0336     double sfBaseCot() const { return sfBaseCot_; }
0337     // zT precision in cm
0338     double sfBaseZT() const { return sfBaseZT_; }
0339 
0340     // Parameter specifying KalmanFilter
0341 
0342     // number of bits for internal reciprocal look up
0343     int kfWidthLutInvPhi() const { return kfWidthLutInvPhi_; }
0344     // number of bits for internal reciprocal look up
0345     int kfWidthLutInvZ() const { return kfWidthLutInvZ_; }
0346     // cut on number of input candidates
0347     int kfNumTracks() const { return kfNumTracks_; }
0348     // required number of stub layers to form a track
0349     int kfMinLayers() const { return kfMinLayers_; }
0350     // maximum number of  layers added to a track
0351     int kfMaxLayers() const { return kfMaxLayers_; }
0352     // cut on number of stub per layer for input candidates
0353     int kfMaxStubsPerLayer() const { return kfMaxStubsPerLayer_; }
0354     // maximum allowed skipped layers from inside to outside to form a track
0355     int kfMaxSkippedLayers() const { return kfMaxSkippedLayers_; }
0356     double kfBasem0() const { return kfBasem0_; }
0357     double kfBasem1() const { return kfBasem1_; }
0358     double kfBasev0() const { return kfBasev0_; }
0359     double kfBasev1() const { return kfBasev1_; }
0360     double kfBasex0() const { return kfBasex0_; }
0361     double kfBasex1() const { return kfBasex1_; }
0362     double kfBasex2() const { return kfBasex2_; }
0363     double kfBasex3() const { return kfBasex3_; }
0364     double kfBaseH00() const { return kfBaseH00_; }
0365     double kfBaseH12() const { return kfBaseH12_; }
0366     double kfBaser0() const { return kfBaser0_; }
0367     double kfBaser1() const { return kfBaser1_; }
0368     double kfBaser02() const { return kfBaser02_; }
0369     double kfBaser12() const { return kfBaser12_; }
0370     double kfBaseS00() const { return kfBaseS00_; }
0371     double kfBaseS01() const { return kfBaseS01_; }
0372     double kfBaseS12() const { return kfBaseS12_; }
0373     double kfBaseS13() const { return kfBaseS13_; }
0374     double kfBaseR00() const { return kfBaseR00_; }
0375     double kfBaseR11() const { return kfBaseR11_; }
0376     double kfBaseInvR00() const { return kfBaseInvR00_; }
0377     double kfBaseInvR11() const { return kfBaseInvR11_; }
0378     double kfBaseK00() const { return kfBaseK00_; }
0379     double kfBaseK10() const { return kfBaseK10_; }
0380     double kfBaseK21() const { return kfBaseK21_; }
0381     double kfBaseK31() const { return kfBaseK31_; }
0382     double kfBaseC00() const { return kfBaseC00_; }
0383     double kfBaseC01() const { return kfBaseC01_; }
0384     double kfBaseC11() const { return kfBaseC11_; }
0385     double kfBaseC22() const { return kfBaseC22_; }
0386     double kfBaseC23() const { return kfBaseC23_; }
0387     double kfBaseC33() const { return kfBaseC33_; }
0388     double kfBaseChi20() const { return kfBaseChi20_; }
0389     double kfBaseChi21() const { return kfBaseChi21_; }
0390     double kfBaseChi2() const { return kfBaseChi2_; }
0391 
0392     // Parameter specifying DuplicateRemoval
0393 
0394     // internal memory depth
0395     int drDepthMemory() const { return drDepthMemory_; }
0396     // number of bist used for phi0
0397     int drWidthPhi0() const { return drWidthPhi0_; }
0398     // umber of bist used for qOverPt
0399     int drWidthQoverPt() const { return drWidthQoverPt_; }
0400     // number of bist used for cot(theta)
0401     int drWidthCot() const { return drWidthCot_; }
0402     // number of bist used for z0
0403     int drWidthZ0() const { return drWidthZ0_; }
0404     double drBaseQoverPt() const { return drBaseQoverPt_; }
0405     double drBasePhi0() const { return drBasePhi0_; }
0406     double drBaseCot() const { return drBaseCot_; }
0407     double drBaseZ0() const { return drBaseZ0_; }
0408 
0409   private:
0410     // checks consitency between history and current configuration for a specific module
0411     void checkHistory(const edm::ProcessHistory&,
0412                       const edm::pset::Registry*,
0413                       const std::string&,
0414                       const edm::ParameterSetID&) const;
0415     // dumps pSetHistory where incosistent lines with pSetProcess are highlighted
0416     std::string dumpDiff(const edm::ParameterSet& pSetHistory, const edm::ParameterSet& pSetProcess) const;
0417     // check if bField is supported
0418     void checkMagneticField();
0419     // check if geometry is supported
0420     void checkGeometry();
0421     // derive constants
0422     void calculateConstants();
0423     // convert configuration of TTStubAlgorithm
0424     void consumeStubAlgorithm();
0425     // create bend encodings
0426     void encodeBend(std::vector<std::vector<double>>&, bool) const;
0427     // create encodingsLayerId
0428     void encodeLayerId();
0429     // create sensor modules
0430     void produceSensorModules();
0431     // range check of dtc id
0432     void checkDTCId(int dtcId) const;
0433     // range check of tklayout id
0434     void checkTKLayoutId(int tkLayoutId) const;
0435     // range check of tfp identifier
0436     void checkTFPIdentifier(int tfpRegion, int tfpChannel) const;
0437 
0438     // MagneticField
0439     const MagneticField* magneticField_;
0440     // TrackerGeometry
0441     const TrackerGeometry* trackerGeometry_;
0442     // TrackerTopology
0443     const TrackerTopology* trackerTopology_;
0444     // CablingMap
0445     const TrackerDetToDTCELinkCablingMap* cablingMap_;
0446     // TTStub algorithm used to create bend encodings
0447     const StubAlgorithmOfficial* stubAlgorithm_;
0448     // pSet of ttStub algorithm, used to identify bend window sizes of sensor modules
0449     const edm::ParameterSet* pSetSA_;
0450     // pSet of geometry configuration, used to identify if geometry is supported
0451     const edm::ParameterSet* pSetGC_;
0452     // pset id of current TTStubAlgorithm
0453     edm::ParameterSetID pSetIdTTStubAlgorithm_;
0454     // pset id of current geometry configuration
0455     edm::ParameterSetID pSetIdGeometryConfiguration_;
0456 
0457     // DD4hep
0458     bool fromDD4hep_;
0459 
0460     // Parameter to check if configured Tracker Geometry is supported
0461     edm::ParameterSet pSetSG_;
0462     // label of ESProducer/ESSource
0463     std::string sgXMLLabel_;
0464     // compared path
0465     std::string sgXMLPath_;
0466     // compared filen ame
0467     std::string sgXMLFile_;
0468     // list of supported versions
0469     std::vector<std::string> sgXMLVersions_;
0470 
0471     // Parameter to check if Process History is consistent with process configuration
0472     edm::ParameterSet pSetPH_;
0473     // label of compared GeometryConfiguration
0474     std::string phGeometryConfiguration_;
0475     // label of compared TTStubAlgorithm
0476     std::string phTTStubAlgorithm_;
0477 
0478     // Common track finding parameter
0479     edm::ParameterSet pSetTF_;
0480     // half lumi region size in cm
0481     double beamWindowZ_;
0482     // required number of layers a found track has to have in common with a TP to consider it matched to it
0483     int matchedLayers_;
0484     // required number of ps layers a found track has to have in common with a TP to consider it matched to it
0485     int matchedLayersPS_;
0486     // allowed number of stubs a found track may have not in common with its matched TP
0487     int unMatchedStubs_;
0488     // allowed number of PS stubs a found track may have not in common with its matched TP
0489     int unMatchedStubsPS_;
0490 
0491     // TMTT specific parameter
0492     edm::ParameterSet pSetTMTT_;
0493     // cut on stub and TP pt, also defines region overlap shape in GeV
0494     double minPt_;
0495     // cut on stub eta
0496     double maxEta_;
0497     // critical radius defining region overlap shape in cm
0498     double chosenRofPhi_;
0499     // number of detector layers a reconstructbale particle may cross
0500     int numLayers_;
0501     // number of bits used for stub r - ChosenRofPhi
0502     int widthR_;
0503     // number of bits used for stub phi w.r.t. phi sector centre
0504     int widthPhi_;
0505     // number of bits used for stub z
0506     int widthZ_;
0507 
0508     // Hybrid specific parameter
0509     edm::ParameterSet pSetHybrid_;
0510     // cut on stub and TP pt, also defines region overlap shape in GeV
0511     double hybridMinPt_;
0512     // cut on stub eta
0513     double hybridMaxEta_;
0514     // critical radius defining region overlap shape in cm
0515     double hybridChosenRofPhi_;
0516     // max number of detector layer connected to one DTC
0517     int hybridNumLayers_;
0518     // number of outer PS rings for disk 1, 2, 3, 4, 5
0519     std::vector<int> hybridNumRingsPS_;
0520     // number of bits used for stub r w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0521     std::vector<int> hybridWidthsR_;
0522     // number of bits used for stub z w.r.t layer/disk centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0523     std::vector<int> hybridWidthsZ_;
0524     // number of bits used for stub phi w.r.t. region centre for module types (barrelPS, barrel2S, diskPS, disk2S)
0525     std::vector<int> hybridWidthsPhi_;
0526     // number of bits used for stub row number for module types (barrelPS, barrel2S, diskPS, disk2S)
0527     std::vector<int> hybridWidthsAlpha_;
0528     // number of bits used for stub bend number for module types (barrelPS, barrel2S, diskPS, disk2S)
0529     std::vector<int> hybridWidthsBend_;
0530     // range in stub r which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0531     std::vector<double> hybridRangesR_;
0532     // range in stub z which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0533     std::vector<double> hybridRangesZ_;
0534     // range in stub row which needs to be covered for module types (barrelPS, barrel2S, diskPS, disk2S)
0535     std::vector<double> hybridRangesAlpha_;
0536     // mean radius of outer tracker barrel layer
0537     std::vector<double> hybridLayerRs_;
0538     // mean z of outer tracker endcap disks
0539     std::vector<double> hybridDiskZs_;
0540     // center radius of outer tracker endcap 2S diks strips
0541     std::vector<edm::ParameterSet> hybridDisk2SRsSet_;
0542 
0543     // Parameter specifying TrackingParticle used for Efficiency measurements
0544     edm::ParameterSet pSetTP_;
0545     // eta cut
0546     double tpMaxEta_;
0547     // cut on vertex pos r in cm
0548     double tpMaxVertR_;
0549     // cut on vertex pos z in cm
0550     double tpMaxVertZ_;
0551     // cut on impact parameter in cm
0552     double tpMaxD0_;
0553     // required number of associated layers to a TP to consider it reconstruct-able
0554     int tpMinLayers_;
0555     // required number of associated ps layers to a TP to consider it reconstruct-able
0556     int tpMinLayersPS_;
0557 
0558     // Fimrware specific Parameter
0559     edm::ParameterSet pSetFW_;
0560     // needed gap between events of emp-infrastructure firmware
0561     int numFramesInfra_;
0562     // LHC bunch crossing rate in MHz
0563     double freqLHC_;
0564     // processing Frequency of DTC & TFP in MHz, has to be integer multiple of FreqLHC
0565     double freqBE_;
0566     // number of events collected in front-end
0567     int tmpFE_;
0568     // time multiplexed period of track finding processor
0569     int tmpTFP_;
0570     // speed of light used in FW in e8 m/s
0571     double speedOfLight_;
0572     // BField used in fw in T
0573     double bField_;
0574     // accepted BField difference between FW to EventSetup in T
0575     double bFieldError_;
0576     // outer radius of outer tracker in cm
0577     double outerRadius_;
0578     // inner radius of outer tracker in cm
0579     double innerRadius_;
0580     // half length of outer tracker in cm
0581     double halfLength_;
0582     // max strip/pixel pitch of outer tracker sensors in cm
0583     double maxPitch_;
0584 
0585     // Parameter specifying front-end
0586     edm::ParameterSet pSetFE_;
0587     // number of bits used for internal stub bend
0588     int widthBend_;
0589     // number of bits used for internal stub column
0590     int widthCol_;
0591     // number of bits used for internal stub row
0592     int widthRow_;
0593     // precision of internal stub bend in pitch units
0594     double baseBend_;
0595     // precision of internal stub column in pitch units
0596     double baseCol_;
0597     // precision of internal stub row in pitch units
0598     double baseRow_;
0599     // precision of window sizes in pitch units
0600     double baseWindowSize_;
0601     // used stub bend uncertainty in pitch units
0602     double bendCut_;
0603 
0604     // Parameter specifying DTC
0605     edm::ParameterSet pSetDTC_;
0606     // number of phi slices the outer tracker readout is organized in
0607     int numRegions_;
0608     // number of regions a reconstructable particles may cross
0609     int numOverlappingRegions_;
0610     // number of Slots in used ATCA crates
0611     int numATCASlots_;
0612     // number of DTC boards used to readout a detector region, likely constructed to be an integerer multiple of NumSlots_
0613     int numDTCsPerRegion_;
0614     // max number of sensor modules connected to one DTC board
0615     int numModulesPerDTC_;
0616     // number of systiloic arrays in stub router firmware
0617     int dtcNumRoutingBlocks_;
0618     // fifo depth in stub router firmware
0619     int dtcDepthMemory_;
0620     // number of row bits used in look up table
0621     int dtcWidthRowLUT_;
0622     // number of bits used for stub qOverPt. lut addr is col + bend = 11 => 1 BRAM -> 18 bits for min and max val -> 9
0623     int dtcWidthQoverPt_;
0624     // tk layout det id minus DetSetVec->detId
0625     int offsetDetIdDSV_;
0626     // tk layout det id minus TrackerTopology lower det id
0627     int offsetDetIdTP_;
0628     // offset in layer ids between barrel layer and endcap disks
0629     int offsetLayerDisks_;
0630     // offset between 0 and smallest layer id (barrel layer 1)
0631     int offsetLayerId_;
0632 
0633     // Parameter specifying GeometricProcessor
0634     edm::ParameterSet pSetGP_;
0635     // number of phi sectors used in hough transform
0636     int numSectorsPhi_;
0637     // number of eta sectors used in hough transform
0638     int numSectorsEta_;
0639     // # critical radius defining r-z sector shape in cm
0640     double chosenRofZ_;
0641     // range of stub z residual w.r.t. sector center which needs to be covered
0642     double neededRangeChiZ_;
0643     // fifo depth in stub router firmware
0644     int gpDepthMemory_;
0645     // defining r-z sector shape
0646     std::vector<double> boundariesEta_;
0647 
0648     // Parameter specifying HoughTransform
0649     edm::ParameterSet pSetHT_;
0650     // number of qOverPt bins used in hough transform
0651     int htNumBinsQoverPt_;
0652     // number of phiT bins used in hough transform
0653     int htNumBinsPhiT_;
0654     // required number of stub layers to form a candidate
0655     int htMinLayers_;
0656     // internal fifo depth
0657     int htDepthMemory_;
0658 
0659     // Parameter specifying MiniHoughTransform
0660     edm::ParameterSet pSetMHT_;
0661     // number of finer qOverPt bins inside HT bin
0662     int mhtNumBinsQoverPt_;
0663     // number of finer phiT bins inside HT bin
0664     int mhtNumBinsPhiT_;
0665     // number of dynamic load balancing steps
0666     int mhtNumDLB_;
0667     // required number of stub layers to form a candidate
0668     int mhtMinLayers_;
0669 
0670     // Parameter specifying SeedFilter
0671     edm::ParameterSet pSetSF_;
0672     // used cot(Theta) bin width = 2 ** this
0673     int sfPowerBaseCot_;
0674     // used zT bin width = baseZ * 2 ** this
0675     int sfBaseDiffZ_;
0676     // required number of stub layers to form a candidate
0677     int sfMinLayers_;
0678 
0679     // Parameter specifying KalmanFilter
0680     edm::ParameterSet pSetKF_;
0681     // number of bits for internal reciprocal look up
0682     int kfWidthLutInvPhi_;
0683     // number of bits for internal reciprocal look up
0684     int kfWidthLutInvZ_;
0685     // cut on number of input candidates
0686     int kfNumTracks_;
0687     // required number of stub layers to form a track
0688     int kfMinLayers_;
0689     // maximum number of  layers added to a track
0690     int kfMaxLayers_;
0691     // cut on number of stub per layer for input candidates
0692     int kfMaxStubsPerLayer_;
0693     // maximum allowed skipped layers from inside to outside to form a track
0694     int kfMaxSkippedLayers_;
0695     int kfBaseShiftr0_;
0696     int kfBaseShiftr02_;
0697     int kfBaseShiftv0_;
0698     int kfBaseShiftS00_;
0699     int kfBaseShiftS01_;
0700     int kfBaseShiftK00_;
0701     int kfBaseShiftK10_;
0702     int kfBaseShiftR00_;
0703     int kfBaseShiftInvR00_;
0704     int kfBaseShiftChi20_;
0705     int kfBaseShiftC00_;
0706     int kfBaseShiftC01_;
0707     int kfBaseShiftC11_;
0708     int kfBaseShiftr1_;
0709     int kfBaseShiftr12_;
0710     int kfBaseShiftv1_;
0711     int kfBaseShiftS12_;
0712     int kfBaseShiftS13_;
0713     int kfBaseShiftK21_;
0714     int kfBaseShiftK31_;
0715     int kfBaseShiftR11_;
0716     int kfBaseShiftInvR11_;
0717     int kfBaseShiftChi21_;
0718     int kfBaseShiftC22_;
0719     int kfBaseShiftC23_;
0720     int kfBaseShiftC33_;
0721     int kfBaseShiftChi2_;
0722 
0723     // Parameter specifying DuplicateRemoval
0724     edm::ParameterSet pSetDR_;
0725     // internal memory depth
0726     int drDepthMemory_;
0727     // number of bist used for phi0
0728     int drWidthPhi0_;
0729     // umber of bist used for qOverPt
0730     int drWidthQoverPt_;
0731     // number of bist used for cot(theta)
0732     int drWidthCot_;
0733     // number of bist used for z0
0734     int drWidthZ0_;
0735 
0736     //
0737     // Derived constants
0738     //
0739 
0740     // true if tracker geometry and magnetic field supported
0741     bool configurationSupported_;
0742 
0743     // TTStubAlgorithm
0744 
0745     // number of tilted layer rings per barrel layer
0746     std::vector<double> numTiltedLayerRings_;
0747     // stub bend window sizes for flat barrel layer in full pitch units
0748     std::vector<double> windowSizeBarrelLayers_;
0749     // stub bend window sizes for tilted barrel layer rings in full pitch units
0750     std::vector<std::vector<double>> windowSizeTiltedLayerRings_;
0751     // stub bend window sizes for endcap disks rings in full pitch units
0752     std::vector<std::vector<double>> windowSizeEndcapDisksRings_;
0753     // maximum stub bend window in half strip units
0754     int maxWindowSize_;
0755 
0756     // common Track finding
0757 
0758     // number of frames betwen 2 resets of 18 BX packets
0759     int numFrames_;
0760     // number of valid frames per 18 BX packet
0761     int numFramesIO_;
0762     // number of valid frames per 8 BX packet
0763     int numFramesFE_;
0764     // converts GeV in 1/cm
0765     double invPtToDphi_;
0766     // region size in rad
0767     double baseRegion_;
0768 
0769     // TMTT
0770 
0771     // number of bits used for stub layer id
0772     int widthLayer_;
0773     // internal stub r precision in cm
0774     double baseR_;
0775     // internal stub z precision in cm
0776     double baseZ_;
0777     // internal stub phi precision in rad
0778     double basePhi_;
0779     // number of padded 0s in output data format
0780     int dtcNumUnusedBits_;
0781 
0782     // hybrid
0783 
0784     // number of bits used for stub layer id
0785     int hybridWidthLayer_;
0786     // precision or r in cm for (barrelPS, barrel2S, diskPS, disk2S)
0787     std::vector<double> hybridBasesR_;
0788     // precision or phi in rad for (barrelPS, barrel2S, diskPS, disk2S)
0789     std::vector<double> hybridBasesPhi_;
0790     // precision or z in cm for (barrelPS, barrel2S, diskPS, disk2S)
0791     std::vector<double> hybridBasesZ_;
0792     // precision or alpha in pitch units for (barrelPS, barrel2S, diskPS, disk2S)
0793     std::vector<double> hybridBasesAlpha_;
0794     // stub r precision in cm
0795     double hybridBaseZ_;
0796     // stub z precision in cm
0797     double hybridBaseR_;
0798     // stub phi precision in rad
0799     double hybridBasePhi_;
0800     // stub cut on cot(theta) = tan(lambda) = sinh(eta)
0801     double hybridMaxCot_;
0802     // number of padded 0s in output data format for (barrelPS, barrel2S, diskPS, disk2S)
0803     std::vector<int> hybridNumsUnusedBits_;
0804     // center radius of outer tracker endcap 2S diks strips
0805     std::vector<std::vector<double>> disk2SRs_;
0806 
0807     // DTC
0808 
0809     // total number of outer tracker DTCs
0810     int numDTCs_;
0811     // number of DTCs connected to one TFP (48)
0812     int numDTCsPerTFP_;
0813     // total number of max possible outer tracker modules (72 per DTC)
0814     int numModules_;
0815     // max number of moudles connected to a systiloic array in stub router firmware
0816     int dtcNumModulesPerRoutingBlock_;
0817     // number of merged rows for look up
0818     int dtcNumMergedRows_;
0819     // number of bits used for phi of row slope
0820     int dtcWidthM_;
0821     // internal stub q over pt precision in 1 /cm
0822     double dtcBaseQoverPt_;
0823     // phi of row slope precision in rad / pitch unit
0824     double dtcBaseM_;
0825     // number of bits for internal stub phi
0826     int widthPhiDTC_;
0827     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for ps modules
0828     std::vector<std::vector<double>> encodingsBendPS_;
0829     // outer index = module window size, inner index = encoded bend, inner value = decoded bend, for 2s modules
0830     std::vector<std::vector<double>> encodingsBend2S_;
0831     // outer index = dtc id in region, inner index = encoded layerId, inner value = decoded layerId
0832     std::vector<std::vector<int>> encodingsLayerId_;
0833     // collection of outer tracker sensor modules
0834     std::vector<SensorModule> sensorModules_;
0835     // collection of outer tracker sensor modules organised in DTCS [0-215][0-71]
0836     std::vector<std::vector<SensorModule*>> dtcModules_;
0837     // hepler to convert Stubs quickly
0838     std::unordered_map<DetId, SensorModule*> detIdToSensorModule_;
0839 
0840     // GP
0841 
0842     // phi sector size in rad
0843     double baseSector_;
0844     // cut on zT
0845     double maxZT_;
0846     // cut on stub cot theta
0847     double maxCot_;
0848     // number of bits used for internal stub sector eta
0849     int widthSectorEta_;
0850     // number of bits to represent z residual w.r.t. sector center
0851     int widthChiZ_;
0852 
0853     // HT
0854 
0855     // number of bits used for candidate q over pt
0856     int htWidthQoverPt_;
0857     // number of bits used for candidate phiT
0858     int htWidthPhiT_;
0859     // number of bits to represent phi residual w.r.t. ht candiate
0860     int widthChiPhi_;
0861     // q over pt bin width precision in 1 /cm
0862     double htBaseQoverPt_;
0863     // phiT bin width precision in rad
0864     double htBasePhiT_;
0865 
0866     // MHT
0867 
0868     // number of mht cells
0869     int mhtNumCells_;
0870     // number of bits used for candidate q over pt
0871     int mhtWidthQoverPt_;
0872     // number of bits used for candidate phiT
0873     int mhtWidthPhiT_;
0874     // q over pt bin width precision in 1 /cm
0875     double mhtBaseQoverPt_;
0876     // phiT bin width in rad
0877     double mhtBasePhiT_;
0878 
0879     // SF
0880 
0881     // cot(theta) precision
0882     double sfBaseCot_;
0883     // zT precision in cm
0884     double sfBaseZT_;
0885 
0886     // KF
0887 
0888     double kfBasem0_;
0889     double kfBasem1_;
0890     double kfBasev0_;
0891     double kfBasev1_;
0892     double kfBasex0_;
0893     double kfBasex1_;
0894     double kfBasex2_;
0895     double kfBasex3_;
0896     double kfBasex4_;
0897     double kfBaseH00_;
0898     double kfBaseH04_;
0899     double kfBaseH12_;
0900     double kfBaser0_;
0901     double kfBaser1_;
0902     double kfBaser02_;
0903     double kfBaser12_;
0904     double kfBaseS00_;
0905     double kfBaseS01_;
0906     double kfBaseS04_;
0907     double kfBaseS12_;
0908     double kfBaseS13_;
0909     double kfBaseR00_;
0910     double kfBaseR11_;
0911     double kfBaseInvR00_;
0912     double kfBaseInvR11_;
0913     double kfBaseK00_;
0914     double kfBaseK10_;
0915     double kfBaseK21_;
0916     double kfBaseK31_;
0917     double kfBaseK40_;
0918     double kfBaseC00_;
0919     double kfBaseC01_;
0920     double kfBaseC04_;
0921     double kfBaseC11_;
0922     double kfBaseC14_;
0923     double kfBaseC44_;
0924     double kfBaseC22_;
0925     double kfBaseC23_;
0926     double kfBaseC33_;
0927     double kfBaseChi20_;
0928     double kfBaseChi21_;
0929     double kfBaseChi2_;
0930 
0931     // DR
0932 
0933     double drBaseQoverPt_;
0934     double drBasePhi0_;
0935     double drBaseCot_;
0936     double drBaseZ0_;
0937   };
0938 
0939 }  // namespace trackerDTC
0940 
0941 EVENTSETUP_DATA_DEFAULT_RECORD(trackerDTC::Setup, trackerDTC::SetupRcd);
0942 
0943 #endif