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 public:
46  explicit TTStubBuilder(const edm::ParameterSet& iConfig);
47 
49  ~TTStubBuilder() override;
50 
51 private:
56 
58  void beginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
59  void endRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
60  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
61 
64  static bool SortStubBendPairs(const std::pair<unsigned int, double>& left,
65  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 
107 template <typename T>
110  clustersToken = consumes<edmNew::DetSetVector<TTCluster<T> > >(iConfig.getParameter<edm::InputTag>("TTClusters"));
111  ForbidMultipleStubs = iConfig.getParameter<bool>("OnlyOnePerInputCluster");
112  applyFE = iConfig.getParameter<bool>("FEineffs");
113  maxStubs_2S = iConfig.getParameter<uint32_t>("CBClimit");
114  maxStubs_PS = iConfig.getParameter<uint32_t>("MPAlimit");
115  maxStubs_2S_CIC_5 = iConfig.getParameter<uint32_t>("SS5GCIClimit");
116  maxStubs_PS_CIC_5 = iConfig.getParameter<uint32_t>("PS5GCIClimit");
117  maxStubs_PS_CIC_10 = iConfig.getParameter<uint32_t>("PS10GCIClimit");
118  tedd1_maxring = iConfig.getParameter<uint32_t>("TEDD1Max10GRing");
119  tedd2_maxring = iConfig.getParameter<uint32_t>("TEDD2Max10GRing");
120  produces<edmNew::DetSetVector<TTCluster<T> > >("ClusterAccepted");
121  produces<edmNew::DetSetVector<TTStub<T> > >("StubAccepted");
122  produces<edmNew::DetSetVector<TTStub<T> > >("StubRejected");
123 
125  high_rate_max_ring[1] = tedd1_maxring;
126  high_rate_max_ring[2] = tedd2_maxring;
127  high_rate_max_ring[3] = tedd2_maxring;
128  high_rate_max_ring[4] = tedd2_maxring;
129 }
130 
132 template <typename T>
134 
136 template <typename T>
140  ievt = 0;
141  moduleStubs_CIC.clear();
142  moduleStubs_MPA.clear();
143  moduleStubs_CBC.clear();
144 }
145 
147 template <typename T>
148 void TTStubBuilder<T>::endRun(const edm::Run& run, const edm::EventSetup& iSetup) {}
149 
151 template <typename T>
152 bool TTStubBuilder<T>::SortStubBendPairs(const std::pair<unsigned int, double>& left,
153  const std::pair<unsigned int, double>& right) {
154  return std::abs(left.second) < std::abs(right.second);
155 }
156 
158 template <typename T>
159 bool TTStubBuilder<T>::SortStubsBend(const TTStub<T>& left, const TTStub<T>& right) {
160  return std::abs(left.bendFE()) < std::abs(right.bendFE());
161 }
162 
164 template <>
166 
167 #endif
T getParameter(std::string const &) const
unsigned int maxStubs_PS_CIC_10
Definition: TTStubBuilder.h:77
edm::ESHandle< TTStubAlgorithm< T > > theStubFindingAlgoHandle
Data members.
Definition: TTStubBuilder.h:53
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:55
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
int iEvent
Definition: GenABIO.cc:224
unsigned int tedd2_maxring
Definition: TTStubBuilder.h:80
unsigned int maxStubs_2S
Definition: TTStubBuilder.h:73
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > clustersToken
Definition: TTStubBuilder.h:54
Class to store the TTStubAlgorithm used in TTStubBuilder.
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
std::unordered_map< int, int > moduleStubs_MPA
Definition: TTStubBuilder.h:87
unsigned int maxStubs_PS
Definition: TTStubBuilder.h:74
std::unordered_map< int, int > moduleStubs_CBC
Definition: TTStubBuilder.h:88
TTStubBuilder(const edm::ParameterSet &iConfig)
Constructor.
double bendFE() const
BendFE(): In FULL-STRIP units from FE! Rename of getTriggerBend()
Definition: TTStub.h:203
unsigned int maxStubs_PS_CIC_5
Definition: TTStubBuilder.h:76
unsigned int tedd1_maxring
Definition: TTStubBuilder.h:79
T get() const
Definition: EventSetup.h:73
std::unordered_map< int, std::vector< TTStub< Ref_Phase2TrackerDigi_ > > > moduleStubs_CIC
Temporary storage for stubs before max check.
Definition: TTStubBuilder.h:86
Definition: Run.h:45
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
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
Mandatory methods.