CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
DTReadOutMapping Class Reference

#include <DTReadOutMapping.h>

Public Types

typedef std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
 Access methods to the connections. More...
 
enum  type { plain, compact }
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 clear map More...
 
 DTReadOutMapping ()
 
 DTReadOutMapping (DTReadOutMapping const &)=delete
 
 DTReadOutMapping (const std::string &cell_map_version, const std::string &rob_map_version)
 
const_iterator end () const
 
const DTReadOutMappingfullMap () const
 Expand to full map. More...
 
int geometryToReadOut (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, int &dduId, int &rosId, int &robId, int &tdcId, int &channelId) const
 
int geometryToReadOut (const DTWireId &wireId, int &dduId, int &rosId, int &robId, int &tdcId, int &channelId) const
 
int insertReadOutGeometryLink (int dduId, int rosId, int robId, int tdcId, int channelId, int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId)
 insert connection More...
 
const std::string & mapCellTdc () const
 access parent maps identifiers More...
 
std::string & mapCellTdc ()
 
const std::string & mapRobRos () const
 
std::string & mapRobRos ()
 
type mapType () const
 
DTReadOutMappingoperator= (DTReadOutMapping const &)=delete
 
int readOutToGeometry (int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
 transform identifiers More...
 
int readOutToGeometry (int dduId, int rosId, int robId, int tdcId, int channelId, int &wheelId, int &stationId, int &sectorId, int &slId, int &layerId, int &cellId) const
 
 ~DTReadOutMapping ()
 

Private Member Functions

edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache () const
 
edm::AtomicPtrCache< DTReadOutMappingCache > & atomicCache ()
 
void cacheMap () const
 read and store full content More...
 
std::string mapNameGR () const
 
std::string mapNameRG () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Static Private Member Functions

static DTReadOutMappingexpandMap (const DTReadOutMapping &compMap)
 

Private Attributes

edm::AtomicPtrCache< DTReadOutMappingCacheatomicCache_
 
std::string cellMapVersion
 
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
 
std::vector< DTReadOutGeometryLinkreadOutChannelDriftTubeMap
 
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
 
std::string robMapVersion
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Description: Class to map read-out channels to physical drift tubes Many details related to this class are described in internal note IN 2010_033. In particular the compact format is described there.

Author
Paolo Ronchese INFN Padova

Definition at line 62 of file DTReadOutMapping.h.

Member Typedef Documentation

◆ const_iterator

Access methods to the connections.

Definition at line 132 of file DTReadOutMapping.h.

Member Enumeration Documentation

◆ type

Enumerator
plain 
compact 

Definition at line 75 of file DTReadOutMapping.h.

Constructor & Destructor Documentation

◆ DTReadOutMapping() [1/3]

DTReadOutMapping::DTReadOutMapping ( )

Constructor

Definition at line 33 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

Referenced by expandMap().

35  readOutChannelDriftTubeMap.reserve(2000);
36 }
std::string robMapVersion
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
std::string cellMapVersion

◆ DTReadOutMapping() [2/3]

DTReadOutMapping::DTReadOutMapping ( DTReadOutMapping const &  )
delete

◆ DTReadOutMapping() [3/3]

DTReadOutMapping::DTReadOutMapping ( const std::string &  cell_map_version,
const std::string &  rob_map_version 
)

Definition at line 38 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

39  : cellMapVersion(cell_map_version),
40  robMapVersion(rob_map_version),
43  readOutChannelDriftTubeMap.reserve(2000);
44 }
std::string robMapVersion
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
std::string cellMapVersion

◆ ~DTReadOutMapping()

DTReadOutMapping::~DTReadOutMapping ( )

Destructor

Definition at line 62 of file DTReadOutMapping.cc.

62 {}

Member Function Documentation

◆ atomicCache() [1/2]

edm::AtomicPtrCache<DTReadOutMappingCache> const& DTReadOutMapping::atomicCache ( ) const
inlineprivate

Definition at line 140 of file DTReadOutMapping.h.

References atomicCache_.

Referenced by cacheMap(), clear(), geometryToReadOut(), insertReadOutGeometryLink(), mapType(), and readOutToGeometry().

140 { return atomicCache_; }
edm::AtomicPtrCache< DTReadOutMappingCache > atomicCache_

◆ atomicCache() [2/2]

edm::AtomicPtrCache<DTReadOutMappingCache>& DTReadOutMapping::atomicCache ( )
inlineprivate

Definition at line 141 of file DTReadOutMapping.h.

References atomicCache_.

141 { return atomicCache_; }
edm::AtomicPtrCache< DTReadOutMappingCache > atomicCache_

◆ begin()

DTReadOutMapping::const_iterator DTReadOutMapping::begin ( void  ) const

Definition at line 395 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

Referenced by expandMap().

395 { return readOutChannelDriftTubeMap.begin(); }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap

◆ cacheMap()

void DTReadOutMapping::cacheMap ( ) const
private

read and store full content

Definition at line 502 of file DTReadOutMapping.cc.

References atomicCache(), DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, hltPixelClustersMultiplicity_cfi::defaultValue, submitPVResolutionJobs::key, DTReadOutGeometryLink::layerId, eostools::move(), readOutChannelDriftTubeMap, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, edm::AtomicPtrCache< T >::set(), DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, DTReadOutGeometryLink::tdcId, heppy_batch::val, and DTReadOutGeometryLink::wheelId.

Referenced by geometryToReadOut(), mapType(), and readOutToGeometry().

502  {
503  std::unique_ptr<DTReadOutMappingCache> localCache(new DTReadOutMappingCache);
504 
505  localCache->mType.insert(0, 0);
506 
507  int entryNum = 0;
508  int entryMax = readOutChannelDriftTubeMap.size();
509  std::vector<int> cellKey;
510  cellKey.reserve(6);
511  std::vector<int> chanKey;
512  chanKey.reserve(5);
513  int defaultValue = 0;
514  int key;
515  int val;
516  int rosMapKey = 0;
517  int robMapKey = 0;
518  std::map<int, std::vector<int>*> dduEntries;
519  for (entryNum = 0; entryNum < entryMax; entryNum++) {
520  const DTReadOutGeometryLink& link(readOutChannelDriftTubeMap[entryNum]);
521 
522  key = link.dduId;
523  val = link.stationId;
524  if (key > 0x3fffffff) {
525  if (link.tdcId > 0x3fffffff) {
526  localCache->mType.insert(0, defaultValue = link.tdcId);
527  rosMapKey = key;
528  } else {
529  localCache->mType.insert(0, defaultValue = link.wheelId);
530  robMapKey = key;
531  }
532  }
533 
534  if (defaultValue == 0) {
535  chanKey.clear();
536  chanKey.push_back(link.dduId);
537  chanKey.push_back(link.rosId);
538  chanKey.push_back(link.robId);
539  chanKey.push_back(link.tdcId);
540  chanKey.push_back(link.channelId);
541 
542  localCache->rgBuf.insert(chanKey.begin(), chanKey.end(), entryNum);
543 
544  cellKey.clear();
545  cellKey.push_back(link.wheelId);
546  cellKey.push_back(link.stationId);
547  cellKey.push_back(link.sectorId);
548  cellKey.push_back(link.slId);
549  cellKey.push_back(link.layerId);
550  cellKey.push_back(link.cellId);
551 
552  localCache->grBuf.insert(cellKey.begin(), cellKey.end(), entryNum);
553  }
554 
555  if (key == robMapKey) {
556  chanKey.clear();
557  chanKey.push_back(link.rosId);
558  chanKey.push_back(link.tdcId);
559  chanKey.push_back(link.channelId);
560  localCache->rgROB.insert(chanKey.begin(), chanKey.end(), entryNum);
561 
562  cellKey.clear();
563  cellKey.push_back(link.cellId);
564  cellKey.push_back(link.layerId);
565  cellKey.push_back(link.slId);
566  std::vector<int>* robMLgr;
567  localCache->grROB.find(cellKey.begin(), cellKey.end(), robMLgr);
568  if (robMLgr == nullptr) {
569  std::unique_ptr<std::vector<int> > newVector(new std::vector<int>);
570  robMLgr = newVector.get();
571  localCache->grROB.insert(cellKey.begin(), cellKey.end(), std::move(newVector));
572  }
573  robMLgr->push_back(entryNum);
574  }
575 
576  if (key == rosMapKey) {
577  chanKey.clear();
578  chanKey.push_back(link.rosId);
579  chanKey.push_back(link.robId);
580  localCache->rgROS.insert(chanKey.begin(), chanKey.end(), entryNum);
581 
582  cellKey.clear();
583  cellKey.push_back(link.cellId);
584  cellKey.push_back(link.stationId);
585  std::vector<int>* rosMLgr;
586  localCache->grROS.find(cellKey.begin(), cellKey.end(), rosMLgr);
587  if (rosMLgr == nullptr) {
588  std::unique_ptr<std::vector<int> > newVector(new std::vector<int>);
589  rosMLgr = newVector.get();
590  localCache->grROS.insert(cellKey.begin(), cellKey.end(), std::move(newVector));
591  }
592  rosMLgr->push_back(entryNum);
593  }
594 
595  if ((key < 0x3fffffff) && (val > 0x3fffffff)) {
596  chanKey.clear();
597  chanKey.push_back(link.dduId);
598  chanKey.push_back(link.rosId);
599  localCache->rgDDU.insert(chanKey.begin(), chanKey.end(), entryNum);
600 
601  int mapId = link.cellId;
602  std::vector<int>* dduMLgr;
603  std::map<int, std::vector<int>*>::const_iterator dduEntIter = dduEntries.find(mapId);
604  if (dduEntIter == dduEntries.end())
605  dduEntries.insert(std::pair<int, std::vector<int>*>(mapId, dduMLgr = new std::vector<int>));
606  else
607  dduMLgr = dduEntIter->second;
608  dduMLgr->push_back(entryNum);
609  }
610  }
611 
612  if (defaultValue != 0) {
613  for (entryNum = 0; entryNum < entryMax; entryNum++) {
614  const DTReadOutGeometryLink& link(readOutChannelDriftTubeMap[entryNum]);
615  key = link.dduId;
616  if (key != rosMapKey)
617  continue;
618  int mapId = link.rosId;
619  int whchkId = link.wheelId;
620  int secchkId = link.sectorId;
621 
622  std::vector<int>* dduMLgr;
623  std::map<int, std::vector<int>*>::const_iterator dduEntIter = dduEntries.find(mapId);
624  if (dduEntIter != dduEntries.end())
625  dduMLgr = dduEntIter->second;
626  else
627  continue;
628  std::vector<int>::const_iterator dduIter = dduMLgr->begin();
629  std::vector<int>::const_iterator dduIend = dduMLgr->end();
630  while (dduIter != dduIend) {
631  int ientry = *dduIter++;
633  int wheelId = whchkId;
634  int sectorId = secchkId;
635  if (wheelId == defaultValue)
636  wheelId = lros.wheelId;
637  if (sectorId == defaultValue)
638  sectorId = lros.sectorId;
639  cellKey.clear();
640  cellKey.push_back(mapId);
641  cellKey.push_back(wheelId);
642  cellKey.push_back(sectorId);
643  std::vector<int>* dduMLgr = nullptr;
644  localCache->grDDU.find(cellKey.begin(), cellKey.end(), dduMLgr);
645  if (dduMLgr == nullptr) {
646  std::unique_ptr<std::vector<int> > newVector(new std::vector<int>);
647  dduMLgr = newVector.get();
648  localCache->grDDU.insert(cellKey.begin(), cellKey.end(), std::move(newVector));
649  }
650  dduMLgr->push_back(ientry);
651  }
652  }
653 
654  std::map<int, std::vector<int>*>::const_iterator dduEntIter = dduEntries.begin();
655  std::map<int, std::vector<int>*>::const_iterator dduEntIend = dduEntries.end();
656  while (dduEntIter != dduEntIend) {
657  const std::pair<int, std::vector<int>*>& dduEntry = *dduEntIter++;
658  delete dduEntry.second;
659  }
660 
661  localCache->rgBuf.clear();
662  localCache->grBuf.clear();
663  }
664 
665  atomicCache().set(std::move(localCache));
666 
667  return;
668 }
bool set(std::unique_ptr< T > iNewValue) const
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
key
prepare the HTCondor submission files and eventually submit them
def move(src, dest)
Definition: eostools.py:511

◆ clear()

void DTReadOutMapping::clear ( void  )

clear map

Definition at line 324 of file DTReadOutMapping.cc.

References atomicCache(), DTBufferTree< Key, Content >::clear(), grBuf, readOutChannelDriftTubeMap, edm::AtomicPtrCache< T >::reset(), and rgBuf.

324  {
325  atomicCache().reset();
326  rgBuf->clear();
327  grBuf->clear();
329  return;
330 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
void reset()
unsets the value and deletes the memory
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const

◆ end()

DTReadOutMapping::const_iterator DTReadOutMapping::end ( void  ) const

Definition at line 397 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

Referenced by Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), and expandMap().

397 { return readOutChannelDriftTubeMap.end(); }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap

◆ expandMap()

DTReadOutMapping * DTReadOutMapping::expandMap ( const DTReadOutMapping compMap)
staticprivate

Definition at line 407 of file DTReadOutMapping.cc.

References begin(), DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::channelId, gather_cfg::cout, DTReadOutGeometryLink::dduId, spu::def(), DTReadOutMapping(), end(), fullMap(), insertReadOutGeometryLink(), DTReadOutGeometryLink::layerId, mapCellTdc(), mapRobRos(), MT2Analyzer::mt2, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, fileinputsource_cfi::sec, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, AlCaHLTBitMon_QueryRunRegistry::string, DTReadOutGeometryLink::tdcId, and DTReadOutGeometryLink::wheelId.

Referenced by fullMap().

407  {
408  std::vector<DTReadOutGeometryLink> entryList;
409  DTReadOutMapping::const_iterator compIter = compMap.begin();
410  DTReadOutMapping::const_iterator compIend = compMap.end();
411  while (compIter != compIend)
412  entryList.push_back(*compIter++);
413 
414  std::string rosMap = "expand_";
415  rosMap += compMap.mapRobRos();
416  std::string tdcMap = "expand_";
417  tdcMap += compMap.mapCellTdc();
418  DTReadOutMapping* fullMap = new DTReadOutMapping(tdcMap, rosMap);
419  int ddu;
420  int ros;
421  int rch;
422  int tdc;
423  int tch;
424  int whe;
425  int sta;
426  int sec;
427  int rob;
428  int qua;
429  int lay;
430  int cel;
431  int mt1;
432  int mi1;
433  int mt2;
434  int mi2;
435  int def;
436  int wha;
437  int sea;
438  std::vector<DTReadOutGeometryLink>::const_iterator iter = entryList.begin();
439  std::vector<DTReadOutGeometryLink>::const_iterator iend = entryList.end();
440  std::vector<DTReadOutGeometryLink>::const_iterator iros = entryList.end();
441  std::vector<DTReadOutGeometryLink>::const_iterator irob = entryList.end();
442  while (iter != iend) {
443  const DTReadOutGeometryLink& rosEntry(*iter++);
444  if (rosEntry.dduId > 0x3fffffff)
445  continue;
446  ddu = rosEntry.dduId;
447  ros = rosEntry.rosId;
448  whe = rosEntry.wheelId;
449  def = rosEntry.stationId;
450  sec = rosEntry.sectorId;
451  rob = rosEntry.slId;
452  mt1 = rosEntry.layerId;
453  mi1 = rosEntry.cellId;
454  iros = entryList.begin();
455  while (iros != iend) {
456  wha = whe;
457  sea = sec;
458  const DTReadOutGeometryLink& rchEntry(*iros++);
459  if ((rchEntry.dduId != mt1) || (rchEntry.rosId != mi1))
460  continue;
461  rch = rchEntry.robId;
462  if (rchEntry.wheelId != def)
463  wha = rchEntry.wheelId;
464  sta = rchEntry.stationId;
465  if (rchEntry.sectorId != def)
466  sea = rchEntry.sectorId;
467  rob = rchEntry.slId;
468  mt2 = rchEntry.layerId;
469  mi2 = rchEntry.cellId;
470  irob = entryList.begin();
471  while (irob != iend) {
472  const DTReadOutGeometryLink& robEntry(*irob++);
473  if ((robEntry.dduId != mt2) || (robEntry.rosId != mi2))
474  continue;
475  if (robEntry.robId != rob) {
476  std::cout << "ROB mismatch " << rob << " " << robEntry.robId << std::endl;
477  }
478  tdc = robEntry.tdcId;
479  tch = robEntry.channelId;
480  qua = robEntry.slId;
481  lay = robEntry.layerId;
482  cel = robEntry.cellId;
483  fullMap->insertReadOutGeometryLink(ddu, ros, rch, tdc, tch, wha, sta, sea, qua, lay, cel);
484  }
485  }
486  }
487  return fullMap;
488 }
int def(FILE *, FILE *, int)
const DTReadOutMapping * fullMap() const
Expand to full map.
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
const std::string & mapRobRos() const
const_iterator begin() const
const std::string & mapCellTdc() const
access parent maps identifiers
int insertReadOutGeometryLink(int dduId, int rosId, int robId, int tdcId, int channelId, int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId)
insert connection
const_iterator end() const

◆ fullMap()

const DTReadOutMapping * DTReadOutMapping::fullMap ( ) const

Expand to full map.

Definition at line 399 of file DTReadOutMapping.cc.

References expandMap(), mapType(), and plain.

Referenced by expandMap().

399  {
400  if (mapType() == plain)
401  return this;
402  return expandMap(*this);
403 }
static DTReadOutMapping * expandMap(const DTReadOutMapping &compMap)
type mapType() const

◆ geometryToReadOut() [1/2]

int DTReadOutMapping::geometryToReadOut ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
int &  dduId,
int &  rosId,
int &  robId,
int &  tdcId,
int &  channelId 
) const

Definition at line 185 of file DTReadOutMapping.cc.

References atomicCache(), cacheMap(), DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, hltPixelClustersMultiplicity_cfi::defaultValue, DTBufferTree< Key, Content >::find(), DTReadOutMappingCache::grBuf, DTReadOutMappingCache::grDDU, DTReadOutMappingCache::grROB, DTReadOutMappingCache::grROS, DTReadOutMappingCache::mType, readOutChannelDriftTubeMap, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::tdcId, and DTReadOutGeometryLink::wheelId.

Referenced by DTDigiTask::channelsMap(), and geometryToReadOut().

195  {
196  dduId = rosId = robId = tdcId = channelId = 0;
197 
198  if (!atomicCache().isSet()) {
199  cacheMap();
200  }
201 
202  int defaultValue;
204  if (defaultValue) {
205  int searchStatus;
206  int mapId = 0;
207  std::vector<int> const* robMLgr;
208  std::vector<int> const* rosMLgr;
209  std::vector<int> const* dduMLgr;
210 
211  std::vector<int> cellKey;
212  cellKey.reserve(6);
213  cellKey.push_back(cellId);
214  cellKey.push_back(layerId);
215  cellKey.push_back(slId);
216  std::vector<int> stdcKey = cellKey;
217  searchStatus = atomicCache()->grROB.find(cellKey.begin(), cellKey.end(), robMLgr);
218  if (searchStatus)
219  return searchStatus;
220  if (robMLgr->empty())
221  return 1;
222  std::vector<int>::const_iterator tdc_iter = robMLgr->begin();
223  std::vector<int>::const_iterator tdc_iend = robMLgr->end();
224  while (tdc_iter != tdc_iend) {
225  const DTReadOutGeometryLink& ltdc(readOutChannelDriftTubeMap[*tdc_iter++]);
226  channelId = ltdc.channelId;
227  tdcId = ltdc.tdcId;
228  mapId = ltdc.rosId;
229  cellKey.clear();
230  cellKey.push_back(mapId);
231  cellKey.push_back(stationId);
232  std::vector<int> srosKey = cellKey;
233  searchStatus = atomicCache()->grROS.find(cellKey.begin(), cellKey.end(), rosMLgr);
234  if (searchStatus)
235  continue;
236  if (rosMLgr->empty())
237  continue;
238  std::vector<int>::const_iterator ros_iter = rosMLgr->begin();
239  std::vector<int>::const_iterator ros_iend = rosMLgr->end();
240  while (ros_iter != ros_iend) {
241  const DTReadOutGeometryLink& lros(readOutChannelDriftTubeMap[*ros_iter++]);
242  int secCk = lros.sectorId;
243  int wheCk = lros.wheelId;
244  if ((secCk != defaultValue) && (secCk != sectorId))
245  continue;
246  if ((wheCk != defaultValue) && (wheCk != wheelId))
247  continue;
248  robId = lros.robId;
249  mapId = lros.rosId;
250  cellKey.clear();
251  cellKey.push_back(mapId);
252  cellKey.push_back(wheelId);
253  cellKey.push_back(sectorId);
254  std::vector<int> sdduKey = cellKey;
255  searchStatus = atomicCache()->grDDU.find(cellKey.begin(), cellKey.end(), dduMLgr);
256  if (searchStatus)
257  continue;
258  if (dduMLgr->empty())
259  continue;
260  if (searchStatus)
261  return searchStatus;
262  if (dduMLgr->empty())
263  return 1;
264  std::vector<int>::const_iterator ddu_iter = dduMLgr->begin();
265  std::vector<int>::const_iterator ddu_iend = dduMLgr->end();
266  while (ddu_iter != ddu_iend) {
267  const DTReadOutGeometryLink& lddu(readOutChannelDriftTubeMap[*ddu_iter++]);
268  if (((sectorId == secCk) || (sectorId == lddu.sectorId)) &&
269  ((wheelId == wheCk) || (wheelId == lddu.wheelId))) {
270  rosId = lddu.rosId;
271  dduId = lddu.dduId;
272  return 0;
273  }
274  }
275  }
276  }
277 
278  return 1;
279  }
280 
281  std::vector<int> cellKey;
282  cellKey.reserve(6);
283  cellKey.push_back(wheelId);
284  cellKey.push_back(stationId);
285  cellKey.push_back(sectorId);
286  cellKey.push_back(slId);
287  cellKey.push_back(layerId);
288  cellKey.push_back(cellId);
289  int ientry;
290  int searchStatus = atomicCache()->grBuf.find(cellKey.begin(), cellKey.end(), ientry);
291  if (!searchStatus) {
293  dduId = link.dduId;
294  rosId = link.rosId;
295  robId = link.robId;
296  tdcId = link.tdcId;
297  channelId = link.channelId;
298  }
299 
300  return searchStatus;
301 }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
DTBufferTree< int, int > mType
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROB
void cacheMap() const
read and store full content
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROS
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grDDU
DTBufferTree< int, int > grBuf

◆ geometryToReadOut() [2/2]

int DTReadOutMapping::geometryToReadOut ( const DTWireId wireId,
int &  dduId,
int &  rosId,
int &  robId,
int &  tdcId,
int &  channelId 
) const

Definition at line 170 of file DTReadOutMapping.cc.

References geometryToReadOut(), DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTChamberId::wheel(), and DTWireId::wire().

171  {
172  return geometryToReadOut(wireId.wheel(),
173  wireId.station(),
174  wireId.sector(),
175  wireId.superLayer(),
176  wireId.layer(),
177  wireId.wire(),
178  dduId,
179  rosId,
180  robId,
181  tdcId,
182  channelId);
183 }
int station() const
Return the station number.
Definition: DTChamberId.h:45
int superLayer() const
Return the superlayer number.
int wire() const
Return the wire number.
Definition: DTWireId.h:45
int geometryToReadOut(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, int &dduId, int &rosId, int &robId, int &tdcId, int &channelId) const
int layer() const
Return the layer number.
Definition: DTLayerId.h:45
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52

◆ insertReadOutGeometryLink()

int DTReadOutMapping::insertReadOutGeometryLink ( int  dduId,
int  rosId,
int  robId,
int  tdcId,
int  channelId,
int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId 
)

insert connection

Definition at line 332 of file DTReadOutMapping.cc.

References atomicCache(), DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, edm::ConstRespectingPtr< T >::get(), DTReadOutMappingCache::grBuf, grBuf, DTBufferTree< Key, Content >::insert(), DTReadOutGeometryLink::layerId, readOutChannelDriftTubeMap, DTReadOutMappingCache::rgBuf, rgBuf, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, DTReadOutGeometryLink::tdcId, and DTReadOutGeometryLink::wheelId.

Referenced by expandMap(), and DTReadOutMappingHandler::getNewObjects().

342  {
344  link.dduId = dduId;
345  link.rosId = rosId;
346  link.robId = robId;
347  link.tdcId = tdcId;
348  link.channelId = channelId;
349  link.wheelId = wheelId;
350  link.stationId = stationId;
351  link.sectorId = sectorId;
352  link.slId = slId;
353  link.layerId = layerId;
354  link.cellId = cellId;
355 
356  int ientry = readOutChannelDriftTubeMap.size();
357  readOutChannelDriftTubeMap.push_back(link);
358 
359  DTBufferTree<int, int>* pgrBuf;
360  DTBufferTree<int, int>* prgBuf;
361 
362  if (atomicCache().isSet()) {
363  pgrBuf = &atomicCache()->grBuf;
364  prgBuf = &atomicCache()->rgBuf;
365  } else {
366  pgrBuf = grBuf.get();
367  prgBuf = rgBuf.get();
368  }
369 
370  std::vector<int> cellKey;
371  cellKey.reserve(6);
372  cellKey.push_back(wheelId);
373  cellKey.push_back(stationId);
374  cellKey.push_back(sectorId);
375  cellKey.push_back(slId);
376  cellKey.push_back(layerId);
377  cellKey.push_back(cellId);
378  int grStatus = pgrBuf->insert(cellKey.begin(), cellKey.end(), ientry);
379 
380  std::vector<int> chanKey;
381  chanKey.reserve(5);
382  chanKey.push_back(dduId);
383  chanKey.push_back(rosId);
384  chanKey.push_back(robId);
385  chanKey.push_back(tdcId);
386  chanKey.push_back(channelId);
387  int rgStatus = prgBuf->insert(chanKey.begin(), chanKey.end(), ientry);
388 
389  if (grStatus || rgStatus)
390  return 1;
391  else
392  return 0;
393 }
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
DTBufferTree< int, int > rgBuf
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
int insert(ElementKey fKey, ElementKey lKey, Content cont)
DTBufferTree< int, int > grBuf

◆ mapCellTdc() [1/2]

const std::string & DTReadOutMapping::mapCellTdc ( ) const

access parent maps identifiers

Definition at line 316 of file DTReadOutMapping.cc.

References cellMapVersion.

Referenced by expandMap().

316 { return cellMapVersion; }
std::string cellMapVersion

◆ mapCellTdc() [2/2]

std::string & DTReadOutMapping::mapCellTdc ( )

Definition at line 318 of file DTReadOutMapping.cc.

References cellMapVersion.

318 { return cellMapVersion; }
std::string cellMapVersion

◆ mapNameGR()

std::string DTReadOutMapping::mapNameGR ( ) const
private

Definition at line 490 of file DTReadOutMapping.cc.

References cellMapVersion, Skims_PA_cff::name, and robMapVersion.

490  {
491  std::stringstream name;
492  name << cellMapVersion << "_" << robMapVersion << "_map_GR" << this;
493  return name.str();
494 }
std::string robMapVersion
std::string cellMapVersion

◆ mapNameRG()

std::string DTReadOutMapping::mapNameRG ( ) const
private

Definition at line 496 of file DTReadOutMapping.cc.

References cellMapVersion, Skims_PA_cff::name, and robMapVersion.

496  {
497  std::stringstream name;
498  name << cellMapVersion << "_" << robMapVersion << "_map_RG" << this;
499  return name.str();
500 }
std::string robMapVersion
std::string cellMapVersion

◆ mapRobRos() [1/2]

const std::string & DTReadOutMapping::mapRobRos ( ) const

Definition at line 320 of file DTReadOutMapping.cc.

References robMapVersion.

Referenced by expandMap().

320 { return robMapVersion; }
std::string robMapVersion

◆ mapRobRos() [2/2]

std::string & DTReadOutMapping::mapRobRos ( )

Definition at line 322 of file DTReadOutMapping.cc.

References robMapVersion.

322 { return robMapVersion; }
std::string robMapVersion

◆ mapType()

DTReadOutMapping::type DTReadOutMapping::mapType ( ) const

Definition at line 303 of file DTReadOutMapping.cc.

References atomicCache(), cacheMap(), compact, hltPixelClustersMultiplicity_cfi::defaultValue, DTBufferTree< Key, Content >::find(), DTReadOutMappingCache::mType, and plain.

Referenced by fullMap().

303  {
304  if (!atomicCache().isSet()) {
305  cacheMap();
306  }
307 
308  int defaultValue;
310  if (defaultValue)
311  return compact;
312  else
313  return plain;
314 }
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
DTBufferTree< int, int > mType
void cacheMap() const
read and store full content
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const

◆ operator=()

DTReadOutMapping& DTReadOutMapping::operator= ( DTReadOutMapping const &  )
delete

◆ readOutToGeometry() [1/2]

int DTReadOutMapping::readOutToGeometry ( int  dduId,
int  rosId,
int  robId,
int  tdcId,
int  channelId,
DTWireId wireId 
) const

transform identifiers

Operations

Definition at line 69 of file DTReadOutMapping.cc.

References mps_update::status.

Referenced by DTDAQInfo::dqmEndLuminosityBlock(), DTBlockedROChannelsTest::fillChamberMap(), DTDataIntegrityTest::readOutToGeometry(), and DTBlockedROChannelsTest::readOutToGeometry().

70  {
71  int wheelId;
72  int stationId;
73  int sectorId;
74  int slId;
75  int layerId;
76  int cellId;
77 
78  int status =
79  readOutToGeometry(dduId, rosId, robId, tdcId, channelId, wheelId, stationId, sectorId, slId, layerId, cellId);
80 
81  wireId = DTWireId(wheelId, stationId, sectorId, slId, layerId, cellId);
82  return status;
83 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers

◆ readOutToGeometry() [2/2]

int DTReadOutMapping::readOutToGeometry ( int  dduId,
int  rosId,
int  robId,
int  tdcId,
int  channelId,
int &  wheelId,
int &  stationId,
int &  sectorId,
int &  slId,
int &  layerId,
int &  cellId 
) const

Definition at line 85 of file DTReadOutMapping.cc.

References atomicCache(), cacheMap(), DTReadOutGeometryLink::cellId, hltPixelClustersMultiplicity_cfi::defaultValue, DTBufferTree< Key, Content >::find(), DTReadOutGeometryLink::layerId, DTReadOutMappingCache::mType, readOutChannelDriftTubeMap, DTReadOutMappingCache::rgBuf, DTReadOutMappingCache::rgDDU, DTReadOutMappingCache::rgROB, DTReadOutMappingCache::rgROS, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, and DTReadOutGeometryLink::wheelId.

95  {
96  wheelId = stationId = sectorId = slId = layerId = cellId = 0;
97 
98  if (!atomicCache().isSet()) {
99  cacheMap();
100  }
101 
102  int defaultValue;
104  if (defaultValue) {
105  int searchStatus;
106  int ientry;
107 
108  std::vector<int> dduKey;
109  dduKey.reserve(5);
110  dduKey.push_back(dduId);
111  dduKey.push_back(rosId);
112  searchStatus = atomicCache()->rgDDU.find(dduKey.begin(), dduKey.end(), ientry);
113  if (searchStatus)
114  return searchStatus;
116  wheelId = lros.wheelId;
117  sectorId = lros.sectorId;
118 
119  std::vector<int> rosKey;
120  rosKey.reserve(5);
121  rosKey.push_back(lros.cellId);
122  rosKey.push_back(robId);
123  searchStatus = atomicCache()->rgROS.find(rosKey.begin(), rosKey.end(), ientry);
124  if (searchStatus)
125  return searchStatus;
127  if (lrob.wheelId != defaultValue)
128  wheelId = lrob.wheelId;
129  stationId = lrob.stationId;
130  if (lrob.sectorId != defaultValue)
131  sectorId = lrob.sectorId;
132 
133  std::vector<int> robKey;
134  robKey.reserve(5);
135  robKey.push_back(lrob.cellId);
136  robKey.push_back(tdcId);
137  robKey.push_back(channelId);
138  searchStatus = atomicCache()->rgROB.find(robKey.begin(), robKey.end(), ientry);
139  if (searchStatus)
140  return searchStatus;
142  slId = ltdc.slId;
143  layerId = ltdc.layerId;
144  cellId = ltdc.cellId;
145  return 0;
146  }
147 
148  std::vector<int> chanKey;
149  chanKey.reserve(5);
150  chanKey.push_back(dduId);
151  chanKey.push_back(rosId);
152  chanKey.push_back(robId);
153  chanKey.push_back(tdcId);
154  chanKey.push_back(channelId);
155  int ientry;
156  int searchStatus = atomicCache()->rgBuf.find(chanKey.begin(), chanKey.end(), ientry);
157  if (!searchStatus) {
159  wheelId = link.wheelId;
160  stationId = link.stationId;
161  sectorId = link.sectorId;
162  slId = link.slId;
163  layerId = link.layerId;
164  cellId = link.cellId;
165  }
166 
167  return searchStatus;
168 }
DTBufferTree< int, int > rgDDU
DTBufferTree< int, int > rgBuf
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
DTBufferTree< int, int > rgROB
DTBufferTree< int, int > mType
void cacheMap() const
read and store full content
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
DTBufferTree< int, int > rgROS

◆ serialize()

template<class Archive >
void DTReadOutMapping::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 160 of file DTReadOutMapping.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 160 of file DTReadOutMapping.h.

Member Data Documentation

◆ atomicCache_

edm::AtomicPtrCache<DTReadOutMappingCache> DTReadOutMapping::atomicCache_
private

Definition at line 150 of file DTReadOutMapping.h.

Referenced by atomicCache().

◆ cellMapVersion

std::string DTReadOutMapping::cellMapVersion
private

Definition at line 145 of file DTReadOutMapping.h.

Referenced by mapCellTdc(), mapNameGR(), and mapNameRG().

◆ grBuf

edm::ConstRespectingPtr<DTBufferTree<int, int> > DTReadOutMapping::grBuf
private

Definition at line 152 of file DTReadOutMapping.h.

Referenced by clear(), and insertReadOutGeometryLink().

◆ readOutChannelDriftTubeMap

std::vector<DTReadOutGeometryLink> DTReadOutMapping::readOutChannelDriftTubeMap
private

◆ rgBuf

edm::ConstRespectingPtr<DTBufferTree<int, int> > DTReadOutMapping::rgBuf
private

Definition at line 151 of file DTReadOutMapping.h.

Referenced by clear(), and insertReadOutGeometryLink().

◆ robMapVersion

std::string DTReadOutMapping::robMapVersion
private

Definition at line 146 of file DTReadOutMapping.h.

Referenced by mapNameGR(), mapNameRG(), and mapRobRos().