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::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () 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::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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 gpuPixelDoublets::cc, 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:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
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 184 of file RPCConeBuilder.cc.

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

Referenced by buildConnections().

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

Referenced by produce().

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

◆ buildConnections()

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

Definition at line 146 of file RPCConeBuilder.cc.

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

Referenced by buildCones().

147  {
148  RPCStripsRing::TIdToRindMap::iterator itRef = ringsMap.begin();
149  for (; itRef != ringsMap.end(); ++itRef) { // iterate over reference rings
150 
151  RPCStripsRing::TOtherConnStructVec ringsToConnect;
152 
153  if (!itRef->second.isReferenceRing())
154  continue; // iterate over reference rings
155 
156  RPCStripsRing::TIdToRindMap::iterator itOther = ringsMap.begin();
157  for (; itOther != ringsMap.end(); ++itOther) { // iterate over nonreference rings
158 
159  if (itOther->second.isReferenceRing())
160  continue; // iterate over nonreference rings
161 
162  std::pair<int, int> pr = areConnected(itRef, itOther, l1RPCConeDefinition);
163  if (pr.first != -1) {
164  RPCStripsRing::TOtherConnStruct newOtherConn;
165  newOtherConn.m_it = itOther;
166  newOtherConn.m_logplane = pr.first;
167  newOtherConn.m_logplaneSize = pr.second;
168  ringsToConnect.push_back(newOtherConn);
169  }
170  } // OtherRings iteration ends
171 
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 ";
175  }
176 
177  itRef->second.createRefConnections(ringsToConnect, prRef.first, prRef.second);
178 
179  } // RefRings iteration ends
180 }
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().