56 std::pair<int, int>
areConnected(RPCStripsRing::TIdToRindMap::iterator ref,
57 RPCStripsRing::TIdToRindMap::iterator
other,
68 : m_towerBeg(iConfig.getParameter<
int>(
"towerBeg")), m_towerEnd(iConfig.getParameter<
int>(
"towerEnd")) {
76 auto pL1RPCConeBuilder = std::make_unique<L1RPCConeBuilder>();
87 ringsMap.begin()->second.compressConnections();
89 pL1RPCConeBuilder->setConeConnectionMap(ringsMap.begin()->second.getConnectionsMap());
91 pL1RPCConeBuilder->setCompressedConeConnectionMap(ringsMap.begin()->second.getCompressedConnectionsMap());
93 return pL1RPCConeBuilder;
100 auto uncompressedCons = std::make_shared<L1RPCConeBuilder::TConMap>();
102 for (
auto const& it : rpcGeom->
dets()) {
104 if (
roll ==
nullptr) {
109 auto found = ringsMap.find(ringId);
110 if (
found == ringsMap.end()) {
118 for (
auto& it : ringsMap) {
119 it.second.filterOverlapingChambers();
120 it.second.fillWithVirtualStrips();
124 for (
auto& it : ringsMap) {
137 if (
key != 2000 &&
key != 3014 &&
key != 4014) {
138 if (it.second.size() != ringsMap[
key].size()) {
139 throw cms::Exception(
"RPCInternal") <<
" Size differs for ring " <<
key <<
" +- 100 \n";
148 RPCStripsRing::TIdToRindMap::iterator itRef = ringsMap.begin();
149 for (; itRef != ringsMap.end(); ++itRef) {
153 if (!itRef->second.isReferenceRing())
156 RPCStripsRing::TIdToRindMap::iterator itOther = ringsMap.begin();
157 for (; itOther != ringsMap.end(); ++itOther) {
159 if (itOther->second.isReferenceRing())
162 std::pair<int, int>
pr =
areConnected(itRef, itOther, l1RPCConeDefinition);
163 if (
pr.first != -1) {
165 newOtherConn.
m_it = itOther;
168 ringsToConnect.push_back(newOtherConn);
172 std::pair<int, int> prRef =
areConnected(itRef, itRef, l1RPCConeDefinition);
173 if (prRef.first == -1) {
174 throw cms::Exception(
"RPCConfig") <<
" Cannot determine logplane for reference ring " << itRef->first <<
"\n ";
177 itRef->second.createRefConnections(ringsToConnect, prRef.first, prRef.second);
185 RPCStripsRing::TIdToRindMap::iterator
other,
190 if (ref->second.getEtaPartition() *
other->second.getEtaPartition() < 0)
191 return std::make_pair(-1, 0);
198 if (itRef.m_etaPart !=
std::abs(ref->second.getEtaPartition()) ||
199 itRef.m_hwPlane !=
std::abs(ref->second.getHwPlane() - 1)
205 refTower = itRef.m_tower;
208 if (itOther.m_etaPart !=
std::abs(
other->second.getEtaPartition()) ||
209 itOther.m_hwPlane !=
std::abs(
other->second.getHwPlane() - 1)
214 if (itOther.m_tower == refTower) {
215 index = itOther.m_index;
220 if (refTowerCnt > 1) {
221 throw cms::Exception(
"RPCConeBuilder") <<
" Reference(?) ring " << ref->first <<
" " 222 <<
"wants to be connected to " << refTowerCnt <<
" towers \n";
225 if (refTowerCnt == 0) {
226 throw cms::Exception(
"RPCConeBuilder") <<
" Reference(?) ring " << ref->first <<
" " 227 <<
" is not connected anywhere \n";
233 if (it.m_etaPart !=
std::abs(
other->second.getEtaPartition()) ||
240 for (
auto const& it : l1RPCConeDefinition->
getLPSizeVec()) {
241 if (it.m_tower !=
std::abs(refTower) || it.m_LP != logplane - 1) {
252 return std::make_pair(logplane, lpSize);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
RPCConeBuilder(const edm::ParameterSet &)
uint32_t cc[maxCellsPerHit]
std::vector< TOtherConnStruct > TOtherConnStructVec
Abs< T >::type abs(const T &t)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const TRingToTowerVec & getRingToTowerVec() const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
const TLPSizeVec & getLPSizeVec() const
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
std::unique_ptr< L1RPCConeBuilder > ReturnType
const TRingToLPVec & getRingToLPVec() const
void buildConnections(L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)
std::map< int, RPCStripsRing > TIdToRindMap
void buildCones(RPCGeometry const *, L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)
ReturnType produce(const L1RPCConeBuilderRcd &)
TIdToRindMap::iterator m_it
std::pair< int, int > areConnected(RPCStripsRing::TIdToRindMap::iterator ref, RPCStripsRing::TIdToRindMap::iterator other, L1RPCConeDefinition const *)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< L1RPCConeDefinition, L1RPCConeDefinitionRcd > m_l1RPCConeDefinitionToken