16 RefHitDef::RefHitDef(
unsigned int aInput,
int aPhiMin,
int aPhiMax,
unsigned int aRegion,
unsigned int aRefLayer)
17 : iInput(aInput), iRegion(aRegion), iRefLayer(aRefLayer),
range(
std::pair<
int,
int>(aPhiMin, aPhiMax)) {}
25 <<
" range: (" << aRefHitDef.
range.first <<
", " << aRefHitDef.
range.second << std::endl;
33 std::vector<int> aLayer1D(
nInputs(), 0);
37 aLayer2D.assign(
nLayers(), aLayer1D);
61 const std::vector<int> *connectedSectorsStartVec =
omtfParams->connectedSectorsStart();
62 const std::vector<int> *connectedSectorsEndVec =
omtfParams->connectedSectorsEnd();
64 std::copy(connectedSectorsStartVec->begin(), connectedSectorsStartVec->begin() + 6,
barrelMin.begin());
65 std::copy(connectedSectorsStartVec->begin() + 6, connectedSectorsStartVec->begin() + 12,
endcap10DegMin.begin());
68 std::copy(connectedSectorsEndVec->begin(), connectedSectorsEndVec->begin() + 6,
barrelMax.begin());
73 const std::vector<L1TMuonOverlapParams::LayerMapNode> *layerMap =
omtfParams->layerMap();
75 for (
unsigned int iLayer = 0; iLayer <
nLayers(); ++iLayer) {
86 const std::vector<L1TMuonOverlapParams::RefLayerMapNode> *refLayerMap =
omtfParams->refLayerMap();
87 for (
unsigned int iRefLayer = 0; iRefLayer <
nRefLayers(); ++iRefLayer) {
106 std::vector<std::pair<int, int> > aRefHit1D(
nLogicRegions(), std::pair<int, int>(9999, 9999));
108 std::vector<std::vector<std::pair<int, int> > > aRefHit2D;
114 std::vector<RefHitDef> aRefHitsDefs(
nRefHits());
118 const std::vector<int> *phiStartMap =
omtfParams->globalPhiStartMap();
119 const std::vector<L1TMuonOverlapParams::RefHitNode> *refHitMap =
omtfParams->refHitMap();
120 const std::vector<L1TMuonOverlapParams::LayerInputNode> *layerInputMap =
omtfParams->layerInputMap();
121 unsigned int tmpIndex = 0;
122 for (
unsigned int iProcessor = 0; iProcessor <
nProcessors(); ++iProcessor) {
123 for (
unsigned int iRefLayer = 0; iRefLayer <
nRefLayers(); ++iRefLayer) {
124 int iPhiStart = phiStartMap->at(iRefLayer + iProcessor *
nRefLayers());
127 for (
unsigned int iRefHit = 0; iRefHit <
nRefHits(); ++iRefHit) {
128 int iPhiMin = refHitMap->at(iRefHit + iProcessor *
nRefHits()).iPhiMin;
129 int iPhiMax = refHitMap->at(iRefHit + iProcessor *
nRefHits()).iPhiMax;
130 unsigned int iInput = refHitMap->at(iRefHit + iProcessor *
nRefHits()).iInput;
131 unsigned int iRegion = refHitMap->at(iRefHit + iProcessor *
nRefHits()).iRegion;
132 unsigned int iRefLayer = refHitMap->at(iRefHit + iProcessor *
nRefHits()).iRefLayer;
136 for (
unsigned int iLogicRegion = 0; iLogicRegion <
nLogicRegions(); ++iLogicRegion) {
137 for (
unsigned int iLayer = 0; iLayer <
nLayers(); ++iLayer) {
139 unsigned int iFirstInput = layerInputMap->at(tmpIndex).iFirstInput;
140 unsigned int nInputsInRegion = layerInputMap->at(tmpIndex).nInputs;
142 std::pair<unsigned int, unsigned int>(iFirstInput, nInputsInRegion);
157 <<
" nPdfValBits: " << aConfig.
nPdfValBits() << std::endl;
159 for (
unsigned int iProcessor = 0; iProcessor < aConfig.
nProcessors(); ++iProcessor) {
160 out <<
"Processor: " << iProcessor;
161 for (
unsigned int iRefLayer = 0; iRefLayer < aConfig.
nRefLayers(); ++iRefLayer) {
178 return iPhiStart <= iPhi && iPhiStart + (int)coneSize > iPhi;
179 }
else if (iPhi > (
int)
nPhiBins() / 2) {
180 return iPhiStart <= iPhi;
181 }
else if (iPhi < (
int)
nPhiBins() / 2) {
189 for (
unsigned int iRegion = 0; iRegion <
nLogicRegions(); ++iRegion) {
209 std::cout <<
"PROBLEM: hit in unknown Det, detID: " <<
detId.det() << std::endl;
213 switch (
detId.subdetId()) {
226 aLayer =
dt.station();
231 aLayer =
csc.station();
232 if (
csc.ring() == 2 &&
csc.station() == 1)
234 if (
csc.station() == 4)
240 int hwNumber = aLayer + 100 *
detId.subdetId();
std::vector< std::pair< unsigned int, unsigned int > > vector1D_pair
unsigned int hwNumber
short layer number used within OMTF emulator
std::vector< unsigned int > endcap20DegMax
void initCounterMatrices()
unsigned int logicNumber
logic numer of the layer
std::vector< unsigned int > endcap10DegMin
std::vector< unsigned int > barrelMax
unsigned int iInput
Hit input number within a cone.
vector4D measurements4D
4D matrices used during creation of the connections tables.
unsigned int nPdfValBits() const
std::vector< std::vector< std::vector< std::pair< int, int > > > > regionPhisVsRefLayerVsInput
std::map< int, int > logicToLogic
unsigned int nRefHits() const
U second(std::pair< T, U > const &p)
unsigned int nHitsPerLayer() const
std::vector< vector1D > vector2D
vector4D measurements4Dref
unsigned int nPhiBins() const
omtfParams
OMTF ESProducer.
unsigned int getRegionNumberFromMap(unsigned int iInput, unsigned int iRefLayer, int iPhi) const
std::vector< unsigned int > barrelMin
unsigned int nPdfAddrBits() const
bool isInRegionRange(int iPhiStart, unsigned int coneSize, int iPhi) const
bool fitsRange(int iPhi) const
std::vector< std::vector< int > > processorPhiVsRefLayer
vector3D_pair connections
Map of connections.
std::vector< int > vector1D
unsigned int nLayers() const
RefHitDef(unsigned int aInput=15, int aPhiMin=5760, int aPhiMax=5760, unsigned int aRegion=99, unsigned int aRefLayer=99)
bool bendingLayer
Is this a bending layers?
std::vector< int > refToLogicNumber
int globalPhiStart(unsigned int iProcessor) const
void configure(const L1TMuonOverlapParams *omtfParams)
unsigned int nRefLayers() const
std::ostream & operator<<(std::ostream &out, const RefHitDef &aRefHitDef)
std::map< int, int > hwToLogicLayer
unsigned int refLayer
Reference layer number.
std::map< int, int > logicToHwLayer
std::vector< vector2D > vector3D
std::pair< int, int > range
unsigned int nInputs() const
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
std::set< int > bendingLayers
L1TMuonOverlapParams rawParams
unsigned int iRefLayer
Reference layer logic number (0-7)
unsigned int logicNumber
Corresponding logical layer number.
unsigned int connectedToLayer
unsigned int iRegion
Region number assigned to this referecne hit.
unsigned int nProcessors() const
std::vector< unsigned int > endcap10DegMax
uint32_t getLayerNumber(uint32_t rawId) const
std::vector< unsigned int > endcap20DegMin
unsigned int nLogicRegions() const
std::vector< vector1D_pair > vector2D_pair
std::vector< std::vector< RefHitDef > > refHitsDefs