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 
23 
26 
31 
32 #include <memory>
33 #include <string>
34 #include <map>
35 #include <typeinfo>
36 
37 template< typename T >
39 {
40  private:
44  bool m_tilted;
46 
47  std::vector< double > barrelCut;
48  std::vector< std::vector< double > > ringCut;
49  std::vector< std::vector< double > > tiltedCut;
50  std::vector< double > barrelNTilt;
51 
52  public:
54  TTStubAlgorithm_official( const TrackerGeometry* const theTrackerGeom, const TrackerTopology* const theTrackerTopo,
55  std::vector< double > setBarrelCut,
56  std::vector< std::vector< double > > setRingCut,
57  std::vector< std::vector< double > > setTiltedCut,
58  std::vector< double > setBarrelNTilt,
59  bool aPerformZMatchingPS, bool aPerformZMatching2S )
60  : TTStubAlgorithm< T >( theTrackerGeom, theTrackerTopo, __func__ )
61  {
62  barrelCut = setBarrelCut;
63  ringCut = setRingCut;
64  tiltedCut = setTiltedCut;
65  barrelNTilt = setBarrelNTilt;
66  mPerformZMatchingPS = aPerformZMatchingPS;
67  mPerformZMatching2S = aPerformZMatching2S;
68  }
69 
72 
74  void PatternHitCorrelation( bool &aConfirmation,
75  int &aDisplacement,
76  int &anOffset,
77  float &anROffset,
78  float &anHardBend,
79  const TTStub< T > &aTTStub ) const override;
80 
81  float degradeBend(bool psModule, int window, int bend) const;
82 
83 };
84 
92 template< >
95  int &aDisplacement,
96  int &anOffset,
97  float &anROffset,
98  float &anHardBend,
99  const TTStub< Ref_Phase2TrackerDigi_ > &aTTStub ) const;
100 
101 template< >
102 float TTStubAlgorithm_official< Ref_Phase2TrackerDigi_ >::degradeBend(bool psModule, int window, int bend) const;
103 
104 
113 template< typename T >
115 {
116  private:
118  std::shared_ptr< TTStubAlgorithm< T > > _theAlgo;
119 
121  std::vector< double > setBarrelCut;
122  std::vector< std::vector< double > > setRingCut;
123  std::vector< std::vector< double > > setTiltedCut;
124 
125  std::vector< double > setBarrelNTilt;
126 
130 
131  public:
134  {
135  mPerformZMatchingPS = p.getParameter< bool >("zMatchingPS");
136  mPerformZMatching2S = p.getParameter< bool >("zMatching2S");
137  setBarrelCut = p.getParameter< std::vector< double > >("BarrelCut");
138  setBarrelNTilt = p.getParameter< std::vector< double > >("NTiltedRings");
139 
140  std::vector< edm::ParameterSet > vPSet = p.getParameter< std::vector< edm::ParameterSet > >("EndcapCutSet");
141  std::vector< edm::ParameterSet > vPSet2 = p.getParameter< std::vector< edm::ParameterSet > >("TiltedBarrelCutSet");
142 
143  std::vector< edm::ParameterSet >::const_iterator iPSet;
144  for ( iPSet = vPSet.begin(); iPSet != vPSet.end(); iPSet++ )
145  {
146  setRingCut.push_back( iPSet->getParameter< std::vector< double > >("EndcapCut") );
147  }
148 
149  for ( iPSet = vPSet2.begin(); iPSet != vPSet2.end(); iPSet++ )
150  {
151  setTiltedCut.push_back( iPSet->getParameter< std::vector< double > >("TiltedCut") );
152  }
153 
154 
155  setWhatProduced( this );
156  }
157 
160 
162  std::shared_ptr< TTStubAlgorithm< T > > produce( const TTStubAlgorithmRecord & record )
163  {
165  record.getRecord< TrackerDigiGeometryRecord >().get( tGeomHandle );
166  const TrackerGeometry* const theTrackerGeom = tGeomHandle.product();
167  edm::ESHandle<TrackerTopology> tTopoHandle;
168  record.getRecord< TrackerTopologyRcd >().get(tTopoHandle);
169  const TrackerTopology* const theTrackerTopo = tTopoHandle.product();
170 
171  TTStubAlgorithm< T >* TTStubAlgo = new TTStubAlgorithm_official< T >( theTrackerGeom, theTrackerTopo,
172  setBarrelCut, setRingCut, setTiltedCut, setBarrelNTilt,
174 
175  _theAlgo = std::shared_ptr< TTStubAlgorithm< T > >( TTStubAlgo );
176  return _theAlgo;
177  }
178 
179 };
180 
181 #endif
182 
183 
Class for "official" algorithm to be used in TTStubBuilder.
void PatternHitCorrelation(bool &aConfirmation, int &aDisplacement, int &anOffset, float &anROffset, float &anHardBend, const TTStub< T > &aTTStub) const override
Matching operations.
T getParameter(std::string const &) const
Base class for any algorithm to be used in TTStubBuilder.
JetCorrectorParameters::Record record
Definition: classes.h:7
Class to declare the algorithm to the framework.
float degradeBend(bool psModule, int window, int bend) const
std::shared_ptr< TTStubAlgorithm< T > > _theAlgo
Data members.
ES_TTStubAlgorithm_official(const edm::ParameterSet &p)
Constructor.
std::vector< std::vector< double > > setRingCut
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:642
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.
std::vector< double > barrelNTilt
Class to store the TTStubAlgorithm used in TTStubBuilder.
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
std::shared_ptr< TTStubAlgorithm< T > > produce(const TTStubAlgorithmRecord &record)
Implement the producer.
bool mPerformZMatchingPS
Data members.
std::vector< std::vector< double > > ringCut
std::vector< std::vector< double > > setTiltedCut
std::vector< std::vector< double > > tiltedCut
virtual ~ES_TTStubAlgorithm_official()
Destructor.
std::vector< double > barrelCut
long double T
T const * product() const
Definition: ESHandle.h:86
std::vector< double > setBarrelCut
Windows.