CMS 3D CMS Logo

TTStubBuilder.h
Go to the documentation of this file.
1 
16 #ifndef L1_TRACK_TRIGGER_STUB_BUILDER_H
17 #define L1_TRACK_TRIGGER_STUB_BUILDER_H
18 
26 
29 
32 
34 
35 #include <memory>
36 #include <map>
37 #include <vector>
38 
41 
42 template< typename T >
44 {
45  public:
47  explicit TTStubBuilder( const edm::ParameterSet& iConfig );
48 
50  ~TTStubBuilder() override;
51 
52  private:
57 
59  void beginRun( const edm::Run& run, const edm::EventSetup& iSetup ) override;
60  void endRun( const edm::Run& run, const edm::EventSetup& iSetup ) override;
61  void produce( edm::Event& iEvent, const edm::EventSetup& iSetup ) override;
62 
65  static bool SortStubBendPairs( const std::pair< unsigned int, double >& left, const std::pair< unsigned int, double >& right );
66  static bool SortStubsBend( const TTStub< T >& left, const TTStub< T >& right );
67 };
68 
76 template< typename T >
79 {
80  clustersToken = consumes< edmNew::DetSetVector< TTCluster< T > > >(iConfig.getParameter< edm::InputTag >( "TTClusters" ));
81  ForbidMultipleStubs = iConfig.getParameter< bool >( "OnlyOnePerInputCluster" );
82  produces< edmNew::DetSetVector< TTCluster< T > > >( "ClusterAccepted" );
83  produces< edmNew::DetSetVector< TTStub< T > > >( "StubAccepted" );
84  produces< edmNew::DetSetVector< TTStub< T > > >( "StubRejected" );
85 }
86 
88 template< typename T >
90 
92 template< typename T >
94 {
97 }
98 
100 template< typename T >
102 
104 template< typename T >
105 bool TTStubBuilder< T >::SortStubBendPairs( const std::pair< unsigned int, double >& left, const std::pair< unsigned int, double >& right )
106 {
107  return fabs(left.second) < fabs(right.second);
108 }
109 
111 template< typename T >
113 {
114  return fabs(left.getTriggerBend()) < fabs(right.getTriggerBend());
115 }
116 
118 template< >
120 
121 #endif
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > clustersToken
Definition: TTStubBuilder.h:55
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
~TTStubBuilder() override
Destructor;.
Definition: TTStubBuilder.h:89
bool ForbidMultipleStubs
Definition: TTStubBuilder.h:56
static bool SortStubBendPairs(const std::pair< unsigned int, double > &left, const std::pair< unsigned int, double > &right)
Sort routine for stub ordering.
static bool SortStubsBend(const TTStub< T > &left, const TTStub< T > &right)
Analogous sorting routine directly from stubs.
int iEvent
Definition: GenABIO.cc:230
double getTriggerBend() const
In FULL-STRIP units!
Definition: TTStub.h:136
Class to store the TTStubAlgorithm used in TTStubBuilder.
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
TTStubBuilder(const edm::ParameterSet &iConfig)
Constructor.
Definition: TTStubBuilder.h:78
const T & get() const
Definition: EventSetup.h:55
Definition: Run.h:42
void endRun(const edm::Run &run, const edm::EventSetup &iSetup) override
End run.
Plugin to load the Stub finding algorithm and produce the collection of Stubs that goes in the event ...
Definition: TTStubBuilder.h:43
edm::ESHandle< TTStubAlgorithm< T > > theStubFindingAlgoHandle
Data members.
Definition: TTStubBuilder.h:54
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
Mandatory methods.
Definition: TTStubBuilder.h:93