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  // FE stub extraction limits (only for experts, not used by default)
69 
70  bool applyFE; // Turn ON (true) or OFF (false) the dynamic FE inefficiency accounting
71  // OFF is by default, ON is for experts only
72 
73  unsigned int maxStubs_2S; // CBC chip limit (in stubs/chip/BX)
74  unsigned int maxStubs_PS; // MPA chip limit (in stubs/chip/2BX)
75  unsigned int maxStubs_2S_CIC_5; // 2S 5G chip limit (in stubs/CIC/8BX)
76  unsigned int maxStubs_PS_CIC_5; // PS 5G chip limit (in stubs/CIC/8BX)
77  unsigned int maxStubs_PS_CIC_10; // PS 10G chip limit (in stubs/CIC/8BX)
78 
79  unsigned int tedd1_maxring; // PS 10G outermost ring in TEDD1 (default is 3)
80  unsigned int tedd2_maxring; // PS 10G outermost ring in TEDD2 (default is 0)
81 
82  int ievt;
83 
85 
86  std::unordered_map< int, std::vector< TTStub< Ref_Phase2TrackerDigi_ > > > moduleStubs_CIC;
87  std::unordered_map< int, int > moduleStubs_MPA;
88  std::unordered_map< int, int > moduleStubs_CBC;
89 
90  // Which disk rings are in 10G transmission scheme module
91  //
92  // sviret comment (221217): this info should be made available in conddb at some point
93  // not in TrackerTopology as some modules may switch between 10G and 5G transmission
94  // schemes during running period
95 
96  unsigned int high_rate_max_ring[5];
97 
98 };
99 
100 
101 
109 template< typename T >
112 {
113  clustersToken = consumes< edmNew::DetSetVector< TTCluster< T > > >(iConfig.getParameter< edm::InputTag >( "TTClusters" ));
114  ForbidMultipleStubs = iConfig.getParameter< bool >( "OnlyOnePerInputCluster" );
115  applyFE = iConfig.getParameter< bool >( "FEineffs" );
116  maxStubs_2S = iConfig.getParameter< uint32_t >( "CBClimit" );
117  maxStubs_PS = iConfig.getParameter< uint32_t >( "MPAlimit" );
118  maxStubs_2S_CIC_5 = iConfig.getParameter< uint32_t >( "SS5GCIClimit" );
119  maxStubs_PS_CIC_5 = iConfig.getParameter< uint32_t >( "PS5GCIClimit" );
120  maxStubs_PS_CIC_10 = iConfig.getParameter< uint32_t >( "PS10GCIClimit" );
121  tedd1_maxring = iConfig.getParameter< uint32_t >( "TEDD1Max10GRing" );
122  tedd2_maxring = iConfig.getParameter< uint32_t >( "TEDD2Max10GRing" );
123  produces< edmNew::DetSetVector< TTCluster< T > > >( "ClusterAccepted" );
124  produces< edmNew::DetSetVector< TTStub< T > > >( "StubAccepted" );
125  produces< edmNew::DetSetVector< TTStub< T > > >( "StubRejected" );
126 
128  high_rate_max_ring[1] = tedd1_maxring;
129  high_rate_max_ring[2] = tedd2_maxring;
130  high_rate_max_ring[3] = tedd2_maxring;
131  high_rate_max_ring[4] = tedd2_maxring;
132 }
133 
135 template< typename T >
137 
139 template< typename T >
141 {
144  ievt=0;
145  moduleStubs_CIC.clear();
146  moduleStubs_MPA.clear();
147  moduleStubs_CBC.clear();
148 }
149 
151 template< typename T >
153 
155 template< typename T >
156 bool TTStubBuilder< T >::SortStubBendPairs( const std::pair< unsigned int, double >& left, const std::pair< unsigned int, double >& right )
157 {
158  return fabs(left.second) < fabs(right.second);
159 }
160 
162 template< typename T >
164 {
165  return fabs(left.getTriggerBend()) < fabs(right.getTriggerBend());
166 }
167 
169 template< >
171 
172 #endif
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > clustersToken
Definition: TTStubBuilder.h:55
unsigned int maxStubs_PS_CIC_10
Definition: TTStubBuilder.h:77
std::unordered_map< int, int > moduleStubs_MPA
Definition: TTStubBuilder.h:87
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
unsigned int high_rate_max_ring[5]
Definition: TTStubBuilder.h:96
~TTStubBuilder() override
Destructor;.
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.
unsigned int maxStubs_2S_CIC_5
Definition: TTStubBuilder.h:75
std::unordered_map< int, int > moduleStubs_CBC
Definition: TTStubBuilder.h:88
int iEvent
Definition: GenABIO.cc:230
unsigned int tedd2_maxring
Definition: TTStubBuilder.h:80
std::unordered_map< int, std::vector< TTStub< Ref_Phase2TrackerDigi_ > > > moduleStubs_CIC
Temporary storage for stubs before max check.
Definition: TTStubBuilder.h:86
unsigned int maxStubs_2S
Definition: TTStubBuilder.h:73
double getTriggerBend() const
In FULL-STRIP units!
Definition: TTStub.h:159
Class to store the TTStubAlgorithm used in TTStubBuilder.
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
unsigned int maxStubs_PS
Definition: TTStubBuilder.h:74
TTStubBuilder(const edm::ParameterSet &iConfig)
Constructor.
unsigned int maxStubs_PS_CIC_5
Definition: TTStubBuilder.h:76
unsigned int tedd1_maxring
Definition: TTStubBuilder.h:79
T get() const
Definition: EventSetup.h:68
Definition: Run.h:44
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.