32 m_towerBeg(iConfig.getParameter<
int>(
"towerBeg")),
33 m_towerEnd(iConfig.getParameter<
int>(
"towerEnd"))
42 auto pL1RPCConeBuilder = std::make_unique<L1RPCConeBuilder>();
59 ringsMap.begin()->second.compressConnections();
61 pL1RPCConeBuilder->setConeConnectionMap(ringsMap.begin()->second.getConnectionsMap());
63 pL1RPCConeBuilder->setCompressedConeConnectionMap(
64 ringsMap.begin()->second.getCompressedConnectionsMap());
66 return pL1RPCConeBuilder;
74 auto uncompressedCons = std::make_shared<L1RPCConeBuilder::TConMap>();
77 for (
auto const& it : rpcGeom->
dets()) {
79 if ( dynamic_cast< RPCRoll const * >( it ) ==
nullptr ) {
87 if ( ringsMap.find(ringId) == ringsMap.end() ) {
90 ringsMap[ringId].addRoll(roll);
95 for (
auto& it : ringsMap) {
97 it.second.filterOverlapingChambers();
98 it.second.fillWithVirtualStrips();
102 for (
auto& it : ringsMap) {
104 int sign = key/100 - (key/1000)*10;
113 if (it.second.size() != ringsMap[
key].size())
115 throw cms::Exception(
"RPCInternal") <<
" Size differs for ring " << key <<
" +- 100 \n";
125 RPCStripsRing::TIdToRindMap::iterator itRef = ringsMap.begin();
126 for (;itRef != ringsMap.end(); ++itRef){
130 if (!itRef->second.isReferenceRing())
continue;
132 RPCStripsRing::TIdToRindMap::iterator itOther = ringsMap.begin();
133 for (;itOther != ringsMap.end(); ++itOther){
135 if (itOther->second.isReferenceRing())
continue;
137 std::pair<int,int>
pr =
areConnected(itRef, itOther, l1RPCConeDefinition);
138 if ( pr.first != -1 ) {
140 newOtherConn.
m_it = itOther;
143 ringsToConnect.push_back(newOtherConn);
147 std::pair<int,int> prRef =
areConnected(itRef, itRef, l1RPCConeDefinition);
148 if (prRef.first == -1){
149 throw cms::Exception(
"RPCConfig") <<
" Cannot determine logplane for reference ring " 150 << itRef->first <<
"\n ";
153 itRef->second.createRefConnections(ringsToConnect, prRef.first, prRef.second);
162 RPCStripsRing::TIdToRindMap::iterator
other,
168 if ( ref->second.getEtaPartition()*other->second.getEtaPartition()<0 )
169 return std::make_pair(-1,0);
177 if ( itRef.m_etaPart !=
std::abs(ref->second.getEtaPartition())
178 || itRef.m_hwPlane !=
std::abs(ref->second.getHwPlane()-1)
184 refTower = itRef.m_tower;
188 if ( itOther.m_etaPart !=
std::abs(other->second.getEtaPartition())
189 || itOther.m_hwPlane !=
std::abs(other->second.getHwPlane()-1)
194 if (itOther.m_tower == refTower) {
195 index = itOther.m_index;
200 if (refTowerCnt > 1) {
203 <<
"wants to be connected to " << refTowerCnt <<
" towers \n";
206 if (refTowerCnt == 0) {
209 <<
" is not connected anywhere \n";
216 if (it.m_etaPart !=
std::abs(other->second.getEtaPartition())
217 || it.m_hwPlane !=
std::abs(other->second.getHwPlane()-1)
218 || it.m_index != index) {
224 for (
auto const& it : l1RPCConeDefinition->
getLPSizeVec()) {
225 if (it.m_tower !=
std::abs(refTower) || it.m_LP != logplane-1) {
236 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
const DepRecordT getRecord() const
std::vector< TOtherConnStruct > TOtherConnStructVec
Abs< T >::type abs(const T &t)
const TLPSizeVec & getLPSizeVec() const
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::unique_ptr< L1RPCConeBuilder > ReturnType
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 *)
T const * product() const