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>();
103 for (
auto const& it : rpcGeom->
dets()) {
105 if (roll ==
nullptr) {
112 auto found = ringsMap.find(ringId);
113 if (
found == ringsMap.end()) {
116 found->second.addRoll(roll);
121 for (
auto& it : ringsMap) {
122 it.second.filterOverlapingChambers();
123 it.second.fillWithVirtualStrips();
127 for (
auto& it : ringsMap) {
129 int sign = key / 100 - (key / 1000) * 10;
140 if (key != 2000 && key != 3014 && key != 4014) {
141 if (it.second.size() != ringsMap[
key].size()) {
142 throw cms::Exception(
"RPCInternal") <<
" Size differs for ring " << key <<
" +- 100 \n";
151 RPCStripsRing::TIdToRindMap::iterator itRef = ringsMap.begin();
152 for (; itRef != ringsMap.end(); ++itRef) {
156 if (!itRef->second.isReferenceRing())
159 RPCStripsRing::TIdToRindMap::iterator itOther = ringsMap.begin();
160 for (; itOther != ringsMap.end(); ++itOther) {
162 if (itOther->second.isReferenceRing())
165 std::pair<int, int> pr =
areConnected(itRef, itOther, l1RPCConeDefinition);
166 if (pr.first != -1) {
168 newOtherConn.
m_it = itOther;
171 ringsToConnect.push_back(newOtherConn);
175 std::pair<int, int> prRef =
areConnected(itRef, itRef, l1RPCConeDefinition);
176 if (prRef.first == -1) {
177 throw cms::Exception(
"RPCConfig") <<
" Cannot determine logplane for reference ring " << itRef->first <<
"\n ";
180 itRef->second.createRefConnections(ringsToConnect, prRef.first, prRef.second);
188 RPCStripsRing::TIdToRindMap::iterator other,
193 if (ref->second.getEtaPartition() * other->second.getEtaPartition() < 0)
194 return std::make_pair(-1, 0);
201 if (itRef.m_etaPart !=
std::abs(ref->second.getEtaPartition()) ||
202 itRef.m_hwPlane !=
std::abs(ref->second.getHwPlane() - 1)
208 refTower = itRef.m_tower;
211 if (itOther.m_etaPart !=
std::abs(other->second.getEtaPartition()) ||
212 itOther.m_hwPlane !=
std::abs(other->second.getHwPlane() - 1)
217 if (itOther.m_tower == refTower) {
218 index = itOther.m_index;
223 if (refTowerCnt > 1) {
224 throw cms::Exception(
"RPCConeBuilder") <<
" Reference(?) ring " << ref->first <<
" "
225 <<
"wants to be connected to " << refTowerCnt <<
" towers \n";
228 if (refTowerCnt == 0) {
229 throw cms::Exception(
"RPCConeBuilder") <<
" Reference(?) ring " << ref->first <<
" "
230 <<
" is not connected anywhere \n";
236 if (it.m_etaPart !=
std::abs(other->second.getEtaPartition()) ||
237 it.m_hwPlane !=
std::abs(other->second.getHwPlane() - 1) || it.m_index != index) {
243 for (
auto const& it : l1RPCConeDefinition->
getLPSizeVec()) {
244 if (it.m_tower !=
std::abs(refTower) || it.m_LP != logplane - 1) {
255 return std::make_pair(logplane, lpSize);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
RPCConeBuilder(const edm::ParameterSet &)
const TRingToLPVec & getRingToLPVec() const
const TRingToTowerVec & getRingToTowerVec() const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::vector< TOtherConnStruct > TOtherConnStructVec
tuple key
prepare the HTCondor submission files and eventually submit them
Abs< T >::type abs(const T &t)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const TLPSizeVec & getLPSizeVec() const
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
std::unique_ptr< L1RPCConeBuilder > ReturnType
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
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 *)
edm::ESGetToken< L1RPCConeDefinition, L1RPCConeDefinitionRcd > m_l1RPCConeDefinitionToken