CMS 3D CMS Logo

TTStubAlgorithm_official.h
Go to the documentation of this file.
1 
16 #ifndef L1_TRACK_TRIGGER_STUB_ALGO_official_H
17 #define L1_TRACK_TRIGGER_STUB_ALGO_official_H
18 
22 
25 
30 
31 #include <memory>
32 #include <string>
33 #include <map>
34 #include <typeinfo>
35 
36 template <typename T>
38 private:
42  bool m_tilted;
44 
45  std::vector<double> barrelCut;
46  std::vector<std::vector<double>> ringCut;
47  std::vector<std::vector<double>> tiltedCut;
48  std::vector<double> barrelNTilt;
49 
50 public:
52  TTStubAlgorithm_official(const TrackerGeometry *const theTrackerGeom,
53  const TrackerTopology *const theTrackerTopo,
54  std::vector<double> setBarrelCut,
55  std::vector<std::vector<double>> setRingCut,
56  std::vector<std::vector<double>> setTiltedCut,
57  std::vector<double> setBarrelNTilt,
58  bool aPerformZMatchingPS,
59  bool aPerformZMatching2S)
60  : TTStubAlgorithm<T>(theTrackerGeom, theTrackerTopo, __func__) {
61  barrelCut = setBarrelCut;
62  ringCut = setRingCut;
63  tiltedCut = setTiltedCut;
64  barrelNTilt = setBarrelNTilt;
65  mPerformZMatchingPS = aPerformZMatchingPS;
66  mPerformZMatching2S = aPerformZMatching2S;
67  }
68 
71 
73  void PatternHitCorrelation(bool &aConfirmation,
74  int &aDisplacement,
75  int &anOffset,
76  float &anHardBend,
77  const TTStub<T> &aTTStub) const override;
78 
79  float degradeBend(bool psModule, int window, int bend) const;
80 
81 };
82 
90 template <>
93  bool &aConfirmation,
94  int &aDisplacement,
95  int &anOffset,
96  float &anHardBend,
97  const TTStub<Ref_Phase2TrackerDigi_> &aTTStub) const;
98 
99 template <>
100 float TTStubAlgorithm_official<Ref_Phase2TrackerDigi_>::degradeBend(bool psModule, int window, int bend) const;
101 
110 template <typename T>
112 private:
116 
118  std::vector<double> setBarrelCut;
119  std::vector<std::vector<double>> setRingCut;
120  std::vector<std::vector<double>> setTiltedCut;
121 
122  std::vector<double> setBarrelNTilt;
123 
127 
128 public:
131  mPerformZMatchingPS = p.getParameter<bool>("zMatchingPS");
132  mPerformZMatching2S = p.getParameter<bool>("zMatching2S");
133  setBarrelCut = p.getParameter<std::vector<double>>("BarrelCut");
134  setBarrelNTilt = p.getParameter<std::vector<double>>("NTiltedRings");
135 
136  std::vector<edm::ParameterSet> vPSet = p.getParameter<std::vector<edm::ParameterSet>>("EndcapCutSet");
137  std::vector<edm::ParameterSet> vPSet2 = p.getParameter<std::vector<edm::ParameterSet>>("TiltedBarrelCutSet");
138 
139  std::vector<edm::ParameterSet>::const_iterator iPSet;
140  for (iPSet = vPSet.begin(); iPSet != vPSet.end(); iPSet++) {
141  setRingCut.push_back(iPSet->getParameter<std::vector<double>>("EndcapCut"));
142  }
143 
144  for (iPSet = vPSet2.begin(); iPSet != vPSet2.end(); iPSet++) {
145  setTiltedCut.push_back(iPSet->getParameter<std::vector<double>>("TiltedCut"));
146  }
147 
148  auto cc = setWhatProduced(this);
149  mGeomToken = cc.consumes();
150  mTopoToken = cc.consumes();
151  }
152 
155 
157  std::unique_ptr<TTStubAlgorithm<T>> produce(const TTStubAlgorithmRecord &record) {
158  return std::make_unique<TTStubAlgorithm_official<T>>(&record.get(mGeomToken),
159  &record.get(mTopoToken),
160  setBarrelCut,
161  setRingCut,
162  setTiltedCut,
166  }
167 };
168 
169 #endif
Class for "official" algorithm to be used in TTStubBuilder.
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
Base class for any algorithm to be used in TTStubBuilder.
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > mGeomToken
Data members.
Class to declare the algorithm to the framework.
~TTStubAlgorithm_official() override
Destructor.
std::unique_ptr< TTStubAlgorithm< T > > produce(const TTStubAlgorithmRecord &record)
Implement the producer.
~ES_TTStubAlgorithm_official() override
Destructor.
void PatternHitCorrelation(bool &aConfirmation, int &aDisplacement, int &anOffset, float &anHardBend, const TTStub< T > &aTTStub) const override
Matching operations.
std::vector< std::vector< double > > setTiltedCut
ES_TTStubAlgorithm_official(const edm::ParameterSet &p)
Constructor.
std::vector< double > barrelNTilt
std::vector< std::vector< double > > ringCut
std::vector< double > setBarrelCut
Windows.
TTStubAlgorithm_official(const TrackerGeometry *const theTrackerGeom, const TrackerTopology *const theTrackerTopo, std::vector< double > setBarrelCut, std::vector< std::vector< double >> setRingCut, std::vector< std::vector< double >> setTiltedCut, std::vector< double > setBarrelNTilt, bool aPerformZMatchingPS, bool aPerformZMatching2S)
Constructor.
float degradeBend(bool psModule, int window, int bend) const
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
Definition: svgfig.py:643
Class to store the TTStubAlgorithm used in TTStubBuilder.
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
bool mPerformZMatchingPS
Data members.
std::vector< double > barrelCut
std::vector< std::vector< double > > setRingCut
std::vector< std::vector< double > > tiltedCut
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > mTopoToken
long double T