CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
RPCConeBuilder Class Reference
Inheritance diagram for RPCConeBuilder:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

using ReturnType = std::unique_ptr< L1RPCConeBuilder >
 

Public Member Functions

ReturnType produce (const L1RPCConeBuilderRcd &)
 
 RPCConeBuilder (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Member Functions

std::pair< int, int > areConnected (RPCStripsRing::TIdToRindMap::iterator ref, RPCStripsRing::TIdToRindMap::iterator other, L1RPCConeDefinition const *)
 
void buildCones (RPCGeometry const *, L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)
 
void buildConnections (L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)
 

Private Attributes

edm::ESGetToken< L1RPCConeDefinition, L1RPCConeDefinitionRcdm_l1RPCConeDefinitionToken
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordm_rpcGeometryToken
 
int m_towerBeg
 
int m_towerEnd
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Description: The RPCConeBuilder class is the emulator of the Run 1 RPC PAC Trigger. It is not used in the L1 Trigger decision since 2016. It might be needed just for the re-emulation of the Run 1 data.

Implementation: <Notes on="" implementation>="">

Definition at line 40 of file RPCConeBuilder.cc.

Member Typedef Documentation

◆ ReturnType

using RPCConeBuilder::ReturnType = std::unique_ptr<L1RPCConeBuilder>

Definition at line 44 of file RPCConeBuilder.cc.

Constructor & Destructor Documentation

◆ RPCConeBuilder()

RPCConeBuilder::RPCConeBuilder ( const edm::ParameterSet iConfig)

Definition at line 67 of file RPCConeBuilder.cc.

References m_l1RPCConeDefinitionToken, m_rpcGeometryToken, and edm::ESProducer::setWhatProduced().

68  : m_towerBeg(iConfig.getParameter<int>("towerBeg")), m_towerEnd(iConfig.getParameter<int>("towerEnd")) {
69  auto cc = setWhatProduced(this);
70  m_rpcGeometryToken = cc.consumes();
71  m_l1RPCConeDefinitionToken = cc.consumes();
72 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
edm::ESGetToken< L1RPCConeDefinition, L1RPCConeDefinitionRcd > m_l1RPCConeDefinitionToken

Member Function Documentation

◆ areConnected()

std::pair< int, int > RPCConeBuilder::areConnected ( RPCStripsRing::TIdToRindMap::iterator  ref,
RPCStripsRing::TIdToRindMap::iterator  other,
L1RPCConeDefinition const *  l1RPCConeDefinition 
)
private

In the pair that is returned, the first element is the logplane number for this connection (if not connected returns -1) and the second element is lpSize.

Definition at line 187 of file RPCConeBuilder.cc.

References funct::abs(), Exception, L1RPCConeDefinition::getLPSizeVec(), L1RPCConeDefinition::getRingToLPVec(), L1RPCConeDefinition::getRingToTowerVec(), and trackingPlots::other.

Referenced by buildConnections().

189  {
190  int logplane = -1;
191 
192  // Do not connect rolls lying on the oposite side of detector
193  if (ref->second.getEtaPartition() * other->second.getEtaPartition() < 0)
194  return std::make_pair(-1, 0);
195 
196  int refTowerCnt = 0;
197  int index = -1;
198  int refTower = -1;
199 
200  for (auto const& itRef : l1RPCConeDefinition->getRingToTowerVec()) {
201  if (itRef.m_etaPart != std::abs(ref->second.getEtaPartition()) ||
202  itRef.m_hwPlane != std::abs(ref->second.getHwPlane() - 1) // -1?
203  ) {
204  continue;
205  }
206 
207  ++refTowerCnt;
208  refTower = itRef.m_tower;
209 
210  for (auto const& itOther : l1RPCConeDefinition->getRingToTowerVec()) {
211  if (itOther.m_etaPart != std::abs(other->second.getEtaPartition()) ||
212  itOther.m_hwPlane != std::abs(other->second.getHwPlane() - 1) // -1?
213  ) {
214  continue;
215  }
216 
217  if (itOther.m_tower == refTower) {
218  index = itOther.m_index;
219  }
220  }
221  }
222 
223  if (refTowerCnt > 1) {
224  throw cms::Exception("RPCConeBuilder") << " Reference(?) ring " << ref->first << " "
225  << "wants to be connected to " << refTowerCnt << " towers \n";
226  }
227 
228  if (refTowerCnt == 0) {
229  throw cms::Exception("RPCConeBuilder") << " Reference(?) ring " << ref->first << " "
230  << " is not connected anywhere \n";
231  }
232 
233  int lpSize = 0;
234  if (index != -1) {
235  for (auto const& it : l1RPCConeDefinition->getRingToLPVec()) {
236  if (it.m_etaPart != std::abs(other->second.getEtaPartition()) ||
237  it.m_hwPlane != std::abs(other->second.getHwPlane() - 1) || it.m_index != index) {
238  continue;
239  }
240  logplane = it.m_LP;
241  }
242 
243  for (auto const& it : l1RPCConeDefinition->getLPSizeVec()) {
244  if (it.m_tower != std::abs(refTower) || it.m_LP != logplane - 1) {
245  continue;
246  }
247  lpSize = it.m_size;
248  }
249 
250  //FIXME
251  if (lpSize == -1) {
252  //throw cms::Exception("getLogStrip") << " lpSize==-1\n";
253  }
254  }
255  return std::make_pair(logplane, lpSize);
256 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ buildCones()

void RPCConeBuilder::buildCones ( RPCGeometry const *  rpcGeom,
L1RPCConeDefinition const *  l1RPCConeDefinition,
RPCStripsRing::TIdToRindMap ringsMap 
)
private

Definition at line 96 of file RPCConeBuilder.cc.

References buildConnections(), runTheMatrix::const, RPCGeometry::dets(), Exception, newFWLiteAna::found, RPCStripsRing::getRingId(), crabWrapper::key, and Validation_hcalonly_cfi::sign.

Referenced by produce().

98  {
99  // fetch geometrical data
100  auto uncompressedCons = std::make_shared<L1RPCConeBuilder::TConMap>();
101 
102  int rolls = 0;
103  for (auto const& it : rpcGeom->dets()) {
104  RPCRoll const* roll = dynamic_cast<RPCRoll const*>(it);
105  if (roll == nullptr) {
106  continue;
107  }
108 
109  ++rolls;
110 
111  int ringId = RPCStripsRing::getRingId(roll);
112  auto found = ringsMap.find(ringId);
113  if (found == ringsMap.end()) {
114  ringsMap[ringId] = RPCStripsRing(roll, uncompressedCons);
115  } else {
116  found->second.addRoll(roll);
117  }
118  }
119 
120  // filtermixed strips, fill gaps with virtual strips
121  for (auto& it : ringsMap) {
122  it.second.filterOverlapingChambers();
123  it.second.fillWithVirtualStrips();
124  }
125 
126  // Xcheck, if rings are symmetrical
127  for (auto& it : ringsMap) {
128  int key = it.first;
129  int sign = key / 100 - (key / 1000) * 10;
130 
131  if (sign == 0) {
132  key += 100;
133  } else {
134  key -= 100;
135  }
136 
137  // Check if the geometry has a complete ring:
138  // note that in the case of demo chambers, the ring is not filled because only 2 sectors are added.
139  // (3014 and 4014 lack counter-rings)
140  if (key != 2000 && key != 3014 && key != 4014) { // Key 2100 has no counter-ring
141  if (it.second.size() != ringsMap[key].size()) {
142  throw cms::Exception("RPCInternal") << " Size differs for ring " << key << " +- 100 \n";
143  }
144  }
145  }
146  buildConnections(l1RPCConeDefinition, ringsMap);
147 }
void buildConnections(L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)

◆ buildConnections()

void RPCConeBuilder::buildConnections ( L1RPCConeDefinition const *  l1RPCConeDefinition,
RPCStripsRing::TIdToRindMap ringsMap 
)
private

Definition at line 149 of file RPCConeBuilder.cc.

References areConnected(), Exception, RPCStripsRing::TOtherConnStruct::m_it, RPCStripsRing::TOtherConnStruct::m_logplane, and RPCStripsRing::TOtherConnStruct::m_logplaneSize.

Referenced by buildCones().

150  {
151  RPCStripsRing::TIdToRindMap::iterator itRef = ringsMap.begin();
152  for (; itRef != ringsMap.end(); ++itRef) { // iterate over reference rings
153 
154  RPCStripsRing::TOtherConnStructVec ringsToConnect;
155 
156  if (!itRef->second.isReferenceRing())
157  continue; // iterate over reference rings
158 
159  RPCStripsRing::TIdToRindMap::iterator itOther = ringsMap.begin();
160  for (; itOther != ringsMap.end(); ++itOther) { // iterate over nonreference rings
161 
162  if (itOther->second.isReferenceRing())
163  continue; // iterate over nonreference rings
164 
165  std::pair<int, int> pr = areConnected(itRef, itOther, l1RPCConeDefinition);
166  if (pr.first != -1) {
167  RPCStripsRing::TOtherConnStruct newOtherConn;
168  newOtherConn.m_it = itOther;
169  newOtherConn.m_logplane = pr.first;
170  newOtherConn.m_logplaneSize = pr.second;
171  ringsToConnect.push_back(newOtherConn);
172  }
173  } // OtherRings iteration ends
174 
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 ";
178  }
179 
180  itRef->second.createRefConnections(ringsToConnect, prRef.first, prRef.second);
181 
182  } // RefRings iteration ends
183 }
std::vector< TOtherConnStruct > TOtherConnStructVec
Definition: RPCStripsRing.h:48
TIdToRindMap::iterator m_it
Definition: RPCStripsRing.h:45
std::pair< int, int > areConnected(RPCStripsRing::TIdToRindMap::iterator ref, RPCStripsRing::TIdToRindMap::iterator other, L1RPCConeDefinition const *)

◆ produce()

RPCConeBuilder::ReturnType RPCConeBuilder::produce ( const L1RPCConeBuilderRcd iRecord)

Definition at line 75 of file RPCConeBuilder.cc.

References buildCones(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), m_l1RPCConeDefinitionToken, m_rpcGeometryToken, m_towerBeg, and m_towerEnd.

75  {
76  auto pL1RPCConeBuilder = std::make_unique<L1RPCConeBuilder>();
77 
78  pL1RPCConeBuilder->setFirstTower(m_towerBeg);
79  pL1RPCConeBuilder->setLastTower(m_towerEnd);
80 
82 
83  buildCones(&iRecord.get(m_rpcGeometryToken), &iRecord.get(m_l1RPCConeDefinitionToken), ringsMap);
84 
85  // Compress all connections. Since members of this class are shared
86  // pointers this call will compress all data
87  ringsMap.begin()->second.compressConnections();
88 
89  pL1RPCConeBuilder->setConeConnectionMap(ringsMap.begin()->second.getConnectionsMap());
90 
91  pL1RPCConeBuilder->setCompressedConeConnectionMap(ringsMap.begin()->second.getCompressedConnectionsMap());
92 
93  return pL1RPCConeBuilder;
94 }
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
std::map< int, RPCStripsRing > TIdToRindMap
Definition: RPCStripsRing.h:39
void buildCones(RPCGeometry const *, L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< L1RPCConeDefinition, L1RPCConeDefinitionRcd > m_l1RPCConeDefinitionToken

Member Data Documentation

◆ m_l1RPCConeDefinitionToken

edm::ESGetToken<L1RPCConeDefinition, L1RPCConeDefinitionRcd> RPCConeBuilder::m_l1RPCConeDefinitionToken
private

Definition at line 62 of file RPCConeBuilder.cc.

Referenced by produce(), and RPCConeBuilder().

◆ m_rpcGeometryToken

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> RPCConeBuilder::m_rpcGeometryToken
private

Definition at line 61 of file RPCConeBuilder.cc.

Referenced by produce(), and RPCConeBuilder().

◆ m_towerBeg

int RPCConeBuilder::m_towerBeg
private

Definition at line 63 of file RPCConeBuilder.cc.

Referenced by produce().

◆ m_towerEnd

int RPCConeBuilder::m_towerEnd
private

Definition at line 64 of file RPCConeBuilder.cc.

Referenced by produce().