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 
124  high_rate_max_ring[0] = tedd1_maxring;
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>
139  iSetup.get<TTStubAlgorithmRecord>().get(theStubFindingAlgoHandle);
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
TTStubBuilder::ievt
int ievt
Definition: TTStubBuilder.h:82
TTStubAlgorithmRecord.h
TrackerGeometry.h
PixelTopology.h
EDProducer.h
ESHandle.h
TTStubAlgorithm.h
edm::Run
Definition: Run.h:45
edm::EDGetTokenT
Definition: EDGetToken.h:33
TTStubBuilder::maxStubs_2S
unsigned int maxStubs_2S
Definition: TTStubBuilder.h:73
TTStubBuilder::moduleStubs_MPA
std::unordered_map< int, int > moduleStubs_MPA
Definition: TTStubBuilder.h:87
TTStubBuilder::endRun
void endRun(const edm::Run &run, const edm::EventSetup &iSetup) override
End run.
Definition: TTStubBuilder.h:148
TTStubBuilder
Plugin to load the Stub finding algorithm and produce the collection of Stubs that goes in the event ...
Definition: TTStubBuilder.h:43
TTStubBuilder::TTStubBuilder
TTStubBuilder(const edm::ParameterSet &iConfig)
Constructor.
Definition: TTStubBuilder.h:109
TTStubBuilder::tedd1_maxring
unsigned int tedd1_maxring
Definition: TTStubBuilder.h:79
TTStubBuilder::beginRun
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
Mandatory methods.
Definition: TTStubBuilder.h:137
MakerMacros.h
TrackerTopology.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TTStubBuilder::maxStubs_PS_CIC_10
unsigned int maxStubs_PS_CIC_10
Definition: TTStubBuilder.h:77
TTStubBuilder::clustersToken
edm::EDGetTokenT< edmNew::DetSetVector< TTCluster< T > > > clustersToken
Definition: TTStubBuilder.h:54
TTStub
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
edm::ESHandle
Definition: DTSurvey.h:22
TTStub::bendFE
double bendFE() const
BendFE(): In FULL-STRIP units from FE! Rename of getTriggerBend()
Definition: TTStub.h:203
TTStubBuilder::maxStubs_PS_CIC_5
unsigned int maxStubs_PS_CIC_5
Definition: TTStubBuilder.h:76
TTStubBuilder::moduleStubs_CBC
std::unordered_map< int, int > moduleStubs_CBC
Definition: TTStubBuilder.h:88
TTStubBuilder::moduleStubs_CIC
std::unordered_map< int, std::vector< TTStub< Ref_Phase2TrackerDigi_ > > > moduleStubs_CIC
Temporary storage for stubs before max check.
Definition: TTStubBuilder.h:86
edm::ParameterSet
Definition: ParameterSet.h:36
TTStubBuilder::~TTStubBuilder
~TTStubBuilder() override
Destructor;.
Definition: TTStubBuilder.h:133
Event.h
TTStubBuilder::applyFE
bool applyFE
Definition: TTStubBuilder.h:70
TTStubBuilder::tedd2_maxring
unsigned int tedd2_maxring
Definition: TTStubBuilder.h:80
TTStubBuilder::ForbidMultipleStubs
bool ForbidMultipleStubs
Definition: TTStubBuilder.h:55
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
TTStubBuilder::SortStubsBend
static bool SortStubsBend(const TTStub< T > &left, const TTStub< T > &right)
Analogous sorting routine directly from stubs.
Definition: TTStubBuilder.h:159
get
#define get
TTStubBuilder::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
TTStubBuilder::maxStubs_2S_CIC_5
unsigned int maxStubs_2S_CIC_5
Definition: TTStubBuilder.h:75
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TTStubAlgorithmRecord
Class to store the TTStubAlgorithm used in TTStubBuilder.
Definition: TTStubAlgorithmRecord.h:23
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Frameworkfwd.h
PixelGeomDetUnit.h
TTStubBuilder::theStubFindingAlgoHandle
edm::ESHandle< TTStubAlgorithm< T > > theStubFindingAlgoHandle
Data members.
Definition: TTStubBuilder.h:53
EventSetup.h
edm::EDProducer
Definition: EDProducer.h:36
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
TTStubBuilder::high_rate_max_ring
unsigned int high_rate_max_ring[5]
Definition: TTStubBuilder.h:96
edm::Event
Definition: Event.h:73
TTStubBuilder::maxStubs_PS
unsigned int maxStubs_PS
Definition: TTStubBuilder.h:74
DetSetVectorNew.h
edm::InputTag
Definition: InputTag.h:15
TTStubBuilder::SortStubBendPairs
static bool SortStubBendPairs(const std::pair< unsigned int, double > &left, const std::pair< unsigned int, double > &right)
Sort routine for stub ordering.
Definition: TTStubBuilder.h:152