File indexing completed on 2024-04-06 12:22:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef L1_TRACK_TRIGGER_CLUSTER_ALGO_official_H
0017 #define L1_TRACK_TRIGGER_CLUSTER_ALGO_official_H
0018
0019 #include "FWCore/Framework/interface/EventSetup.h"
0020 #include "FWCore/Framework/interface/ESHandle.h"
0021 #include "FWCore/Framework/interface/ModuleFactory.h"
0022 #include "FWCore/Framework/interface/ESProducer.h"
0023
0024 #include "L1Trigger/TrackTrigger/interface/TTClusterAlgorithm.h"
0025 #include "L1Trigger/TrackTrigger/interface/TTClusterAlgorithmRecord.h"
0026
0027 #include <memory>
0028 #include <string>
0029 #include <map>
0030
0031 template <typename T>
0032 class TTClusterAlgorithm_official : public TTClusterAlgorithm<T> {
0033 private:
0034
0035 int mWidthCut;
0036
0037
0038 static bool CompareClusters(const T& a, const T& b);
0039
0040 public:
0041
0042
0043 TTClusterAlgorithm_official(int aWidthCut) : TTClusterAlgorithm<T>(__func__) { mWidthCut = aWidthCut; }
0044
0045
0046 ~TTClusterAlgorithm_official() override {}
0047
0048
0049 void Cluster(std::vector<std::vector<T> >& output, const std::vector<T>& input, bool isPS) const override;
0050
0051 };
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 template <>
0062 bool TTClusterAlgorithm_official<Ref_Phase2TrackerDigi_>::CompareClusters(const Ref_Phase2TrackerDigi_& a,
0063 const Ref_Phase2TrackerDigi_& b);
0064
0065
0066 template <>
0067 void TTClusterAlgorithm_official<Ref_Phase2TrackerDigi_>::Cluster(
0068 std::vector<std::vector<Ref_Phase2TrackerDigi_> >& output,
0069 const std::vector<Ref_Phase2TrackerDigi_>& input,
0070 bool isPS) const;
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 template <typename T>
0081 class ES_TTClusterAlgorithm_official : public edm::ESProducer {
0082 private:
0083
0084 int mWidthCut;
0085
0086 public:
0087
0088 ES_TTClusterAlgorithm_official(const edm::ParameterSet& p) : mWidthCut(p.getParameter<int>("WidthCut")) {
0089 setWhatProduced(this);
0090 }
0091
0092
0093 ~ES_TTClusterAlgorithm_official() override {}
0094
0095
0096 std::unique_ptr<TTClusterAlgorithm<T> > produce(const TTClusterAlgorithmRecord& record) {
0097 TTClusterAlgorithm<T>* TTClusterAlgo = new TTClusterAlgorithm_official<T>(mWidthCut);
0098
0099 return std::unique_ptr<TTClusterAlgorithm<T> >(TTClusterAlgo);
0100 }
0101
0102 };
0103
0104 #endif