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 char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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: <one line="" class="" summary>="">

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

Definition at line 38 of file RPCConeBuilder.cc.

Member Typedef Documentation

◆ ReturnType

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

Definition at line 42 of file RPCConeBuilder.cc.

Constructor & Destructor Documentation

◆ RPCConeBuilder()

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

Definition at line 65 of file RPCConeBuilder.cc.

66  : m_towerBeg(iConfig.getParameter<int>("towerBeg")), m_towerEnd(iConfig.getParameter<int>("towerEnd")) {
67  auto cc = setWhatProduced(this);
68  m_rpcGeometryToken = cc.consumes();
69  m_l1RPCConeDefinitionToken = cc.consumes();
70 }

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

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 182 of file RPCConeBuilder.cc.

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

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

Referenced by buildConnections().

◆ buildCones()

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

Definition at line 94 of file RPCConeBuilder.cc.

96  {
97  // fetch geometrical data
98  auto uncompressedCons = std::make_shared<L1RPCConeBuilder::TConMap>();
99 
100  int rolls = 0;
101  for (auto const& it : rpcGeom->dets()) {
102  RPCRoll const* roll = dynamic_cast<RPCRoll const*>(it);
103  if (roll == nullptr) {
104  continue;
105  }
106 
107  ++rolls;
108 
109  int ringId = RPCStripsRing::getRingId(roll);
110  auto found = ringsMap.find(ringId);
111  if (found == ringsMap.end()) {
112  ringsMap[ringId] = RPCStripsRing(roll, uncompressedCons);
113  } else {
114  found->second.addRoll(roll);
115  }
116  }
117 
118  // filtermixed strips, fill gaps with virtual strips
119  for (auto& it : ringsMap) {
120  it.second.filterOverlapingChambers();
121  it.second.fillWithVirtualStrips();
122  }
123 
124  // Xcheck, if rings are symettrical
125  for (auto& it : ringsMap) {
126  int key = it.first;
127  int sign = key / 100 - (key / 1000) * 10;
128 
129  if (sign == 0) {
130  key += 100;
131  } else {
132  key -= 100;
133  }
134 
135  if (key != 2000) { // Hey 2100 has no counterring
136  if (it.second.size() != ringsMap[key].size()) {
137  throw cms::Exception("RPCInternal") << " Size differs for ring " << key << " +- 100 \n";
138  }
139  }
140  }
141  buildConnections(l1RPCConeDefinition, ringsMap);
142 }

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

Referenced by produce().

◆ buildConnections()

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

Definition at line 144 of file RPCConeBuilder.cc.

145  {
146  RPCStripsRing::TIdToRindMap::iterator itRef = ringsMap.begin();
147  for (; itRef != ringsMap.end(); ++itRef) { // iterate over reference rings
148 
149  RPCStripsRing::TOtherConnStructVec ringsToConnect;
150 
151  if (!itRef->second.isReferenceRing())
152  continue; // iterate over reference rings
153 
154  RPCStripsRing::TIdToRindMap::iterator itOther = ringsMap.begin();
155  for (; itOther != ringsMap.end(); ++itOther) { // iterate over nonreference rings
156 
157  if (itOther->second.isReferenceRing())
158  continue; // iterate over nonreference rings
159 
160  std::pair<int, int> pr = areConnected(itRef, itOther, l1RPCConeDefinition);
161  if (pr.first != -1) {
162  RPCStripsRing::TOtherConnStruct newOtherConn;
163  newOtherConn.m_it = itOther;
164  newOtherConn.m_logplane = pr.first;
165  newOtherConn.m_logplaneSize = pr.second;
166  ringsToConnect.push_back(newOtherConn);
167  }
168  } // OtherRings iteration ends
169 
170  std::pair<int, int> prRef = areConnected(itRef, itRef, l1RPCConeDefinition);
171  if (prRef.first == -1) {
172  throw cms::Exception("RPCConfig") << " Cannot determine logplane for reference ring " << itRef->first << "\n ";
173  }
174 
175  itRef->second.createRefConnections(ringsToConnect, prRef.first, prRef.second);
176 
177  } // RefRings iteration ends
178 }

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

Referenced by buildCones().

◆ produce()

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

Definition at line 73 of file RPCConeBuilder.cc.

73  {
74  auto pL1RPCConeBuilder = std::make_unique<L1RPCConeBuilder>();
75 
76  pL1RPCConeBuilder->setFirstTower(m_towerBeg);
77  pL1RPCConeBuilder->setLastTower(m_towerEnd);
78 
80 
81  buildCones(&iRecord.get(m_rpcGeometryToken), &iRecord.get(m_l1RPCConeDefinitionToken), ringsMap);
82 
83  // Compress all connections. Since members of this class are shared
84  // pointers this call will compress all data
85  ringsMap.begin()->second.compressConnections();
86 
87  pL1RPCConeBuilder->setConeConnectionMap(ringsMap.begin()->second.getConnectionsMap());
88 
89  pL1RPCConeBuilder->setCompressedConeConnectionMap(ringsMap.begin()->second.getCompressedConnectionsMap());
90 
91  return pL1RPCConeBuilder;
92 }

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

Member Data Documentation

◆ m_l1RPCConeDefinitionToken

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

Definition at line 60 of file RPCConeBuilder.cc.

Referenced by produce(), and RPCConeBuilder().

◆ m_rpcGeometryToken

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

Definition at line 59 of file RPCConeBuilder.cc.

Referenced by produce(), and RPCConeBuilder().

◆ m_towerBeg

int RPCConeBuilder::m_towerBeg
private

Definition at line 61 of file RPCConeBuilder.cc.

Referenced by produce().

◆ m_towerEnd

int RPCConeBuilder::m_towerEnd
private

Definition at line 62 of file RPCConeBuilder.cc.

Referenced by produce().

RPCRoll
Definition: RPCRoll.h:12
RPCConeBuilder::areConnected
std::pair< int, int > areConnected(RPCStripsRing::TIdToRindMap::iterator ref, RPCStripsRing::TIdToRindMap::iterator other, L1RPCConeDefinition const *)
Definition: RPCConeBuilder.cc:182
RPCConeBuilder::m_towerEnd
int m_towerEnd
Definition: RPCConeBuilder.cc:62
RPCStripsRing::TOtherConnStructVec
std::vector< TOtherConnStruct > TOtherConnStructVec
Definition: RPCStripsRing.h:48
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
RPCStripsRing::TIdToRindMap
std::map< int, RPCStripsRing > TIdToRindMap
Definition: RPCStripsRing.h:39
RPCStripsRing::getRingId
int getRingId()
Definition: RPCStripsRing.cc:87
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:39
RPCStripsRing::TOtherConnStruct
Definition: RPCStripsRing.h:41
RPCConeBuilder::m_towerBeg
int m_towerBeg
Definition: RPCConeBuilder.cc:61
RPCStripsRing::TOtherConnStruct::m_logplane
short m_logplane
Definition: RPCStripsRing.h:42
RPCConeBuilder::buildCones
void buildCones(RPCGeometry const *, L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)
Definition: RPCConeBuilder.cc:94
RPCConeBuilder::m_rpcGeometryToken
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > m_rpcGeometryToken
Definition: RPCConeBuilder.cc:59
RPCStripsRing::TOtherConnStruct::m_logplaneSize
short m_logplaneSize
Definition: RPCStripsRing.h:44
cc
RPCConeBuilder::buildConnections
void buildConnections(L1RPCConeDefinition const *, RPCStripsRing::TIdToRindMap &)
Definition: RPCConeBuilder.cc:144
RPCStripsRing
Definition: RPCStripsRing.h:36
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
RPCConeBuilder::m_l1RPCConeDefinitionToken
edm::ESGetToken< L1RPCConeDefinition, L1RPCConeDefinitionRcd > m_l1RPCConeDefinitionToken
Definition: RPCConeBuilder.cc:60
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
RPCStripsRing::TOtherConnStruct::m_it
TIdToRindMap::iterator m_it
Definition: RPCStripsRing.h:45
crabWrapper.key
key
Definition: crabWrapper.py:19