File indexing completed on 2024-04-06 12:22:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef L1_TRACK_TRIGGER_STUB_ALGO_CBC3_H
0012 #define L1_TRACK_TRIGGER_STUB_ALGO_CBC3_H
0013
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/Framework/interface/ModuleFactory.h"
0016 #include "FWCore/Framework/interface/ESProducer.h"
0017
0018 #include "L1Trigger/TrackTrigger/interface/TTStubAlgorithm.h"
0019 #include "L1Trigger/TrackTrigger/interface/TTStubAlgorithmRecord.h"
0020
0021 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementPoint.h"
0022 #include "Geometry/CommonTopologies/interface/Topology.h"
0023
0024 #include <memory>
0025 #include <string>
0026 #include <map>
0027 #include <typeinfo>
0028
0029 template <typename T>
0030 class TTStubAlgorithm_cbc3 : public TTStubAlgorithm<T> {
0031 private:
0032
0033 bool mPerformZMatching2S;
0034 std::string className_;
0035
0036 public:
0037
0038 TTStubAlgorithm_cbc3(const TrackerGeometry *const theTrackerGeom,
0039 const TrackerTopology *const theTrackerTopo,
0040 bool aPerformZMatching2S)
0041 : TTStubAlgorithm<T>(theTrackerGeom, theTrackerTopo, __func__) {
0042 mPerformZMatching2S = aPerformZMatching2S;
0043 }
0044
0045
0046 ~TTStubAlgorithm_cbc3() override {}
0047
0048
0049 void PatternHitCorrelation(bool &aConfirmation,
0050 int &aDisplacement,
0051 int &anOffset,
0052 float &anHardBend,
0053 const TTStub<T> &aTTStub) const override;
0054
0055 };
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 template <>
0066 void TTStubAlgorithm_cbc3<Ref_Phase2TrackerDigi_>::PatternHitCorrelation(
0067 bool &aConfirmation,
0068 int &aDisplacement,
0069 int &anOffset,
0070 float &anHardBend,
0071 const TTStub<Ref_Phase2TrackerDigi_> &aTTStub) const;
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 template <typename T>
0082 class ES_TTStubAlgorithm_cbc3 : public edm::ESProducer {
0083 private:
0084
0085 edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> mGeomToken;
0086 edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> mTopoToken;
0087
0088
0089 bool mPerformZMatching2S;
0090
0091 public:
0092
0093 ES_TTStubAlgorithm_cbc3(const edm::ParameterSet &p) {
0094 mPerformZMatching2S = p.getParameter<bool>("zMatching2S");
0095 auto cc = setWhatProduced(this);
0096 mGeomToken = cc.consumes();
0097 mTopoToken = cc.consumes();
0098 }
0099
0100
0101 ~ES_TTStubAlgorithm_cbc3() override {}
0102
0103
0104 std::unique_ptr<TTStubAlgorithm<T> > produce(const TTStubAlgorithmRecord &record) {
0105 return std::make_unique<TTStubAlgorithm_cbc3<T> >(
0106 &record.get(mGeomToken), &record.get(mTopoToken), mPerformZMatching2S);
0107 }
0108 };
0109
0110 #endif