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 (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
 
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...
 
 DTReadOutMapping (DTReadOutMapping const &)=delete
 
std::string mapNameGR () const
 
std::string mapNameRG () const
 
DTReadOutMappingoperator= (DTReadOutMapping const &)=delete
 
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 66 of file DTReadOutMapping.h.

Member Typedef Documentation

Access methods to the connections.

Definition at line 149 of file DTReadOutMapping.h.

Member Enumeration Documentation

Enumerator
plain 
compact 

Definition at line 80 of file DTReadOutMapping.h.

Constructor & Destructor Documentation

DTReadOutMapping::DTReadOutMapping ( )

Constructor

Definition at line 34 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

34  :
35  cellMapVersion( " " ),
36  robMapVersion( " " ),
39 
40  readOutChannelDriftTubeMap.reserve( 2000 );
41 }
std::string robMapVersion
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
std::string cellMapVersion
DTReadOutMapping::DTReadOutMapping ( const std::string &  cell_map_version,
const std::string &  rob_map_version 
)

Definition at line 44 of file DTReadOutMapping.cc.

References readOutChannelDriftTubeMap.

45  :
46  cellMapVersion( cell_map_version ),
47  robMapVersion( rob_map_version ),
50 
51  readOutChannelDriftTubeMap.reserve( 2000 );
52 }
std::string robMapVersion
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
std::string cellMapVersion
DTReadOutMapping::~DTReadOutMapping ( )

Destructor

Definition at line 72 of file DTReadOutMapping.cc.

72  {
73 }
DTReadOutMapping::DTReadOutMapping ( DTReadOutMapping const &  )
privatedelete

Member Function Documentation

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

Definition at line 161 of file DTReadOutMapping.h.

161 { return atomicCache_; }
edm::AtomicPtrCache< DTReadOutMappingCache > atomicCache_
edm::AtomicPtrCache<DTReadOutMappingCache>& DTReadOutMapping::atomicCache ( )
inlineprivate

Definition at line 162 of file DTReadOutMapping.h.

162 { return atomicCache_; }
edm::AtomicPtrCache< DTReadOutMappingCache > atomicCache_
DTReadOutMapping::const_iterator DTReadOutMapping::begin ( void  ) const

Definition at line 463 of file DTReadOutMapping.cc.

Referenced by expandMap().

463  {
464  return readOutChannelDriftTubeMap.begin();
465 }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
void DTReadOutMapping::cacheMap ( ) const
private

read and store full content

Definition at line 580 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, crabWrapper::key, DTReadOutGeometryLink::layerId, eostools::move(), DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, DTReadOutGeometryLink::tdcId, heppy_batch::val, and DTReadOutGeometryLink::wheelId.

580  {
581 
582  std::unique_ptr<DTReadOutMappingCache> localCache(new DTReadOutMappingCache);
583 
584  localCache->mType.insert( 0, 0 );
585 
586  int entryNum = 0;
587  int entryMax = readOutChannelDriftTubeMap.size();
588  std::vector<int> cellKey;
589  cellKey.reserve(6);
590  std::vector<int> chanKey;
591  chanKey.reserve(5);
592  int defaultValue = 0;
593  int key;
594  int val;
595  int rosMapKey = 0;
596  int robMapKey = 0;
597  std::map<int,std::vector<int>*> dduEntries;
598  for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
599 
600  const DTReadOutGeometryLink& link( readOutChannelDriftTubeMap[entryNum] );
601 
602  key = link.dduId;
603  val = link.stationId;
604  if ( key > 0x3fffffff ) {
605  if ( link. tdcId > 0x3fffffff ) {
606  localCache->mType.insert( 0, defaultValue = link. tdcId );
607  rosMapKey = key;
608  }
609  else {
610  localCache->mType.insert( 0, defaultValue = link.wheelId );
611  robMapKey = key;
612  }
613  }
614 
615  if ( defaultValue == 0 ) {
616 
617  chanKey.clear();
618  chanKey.push_back( link. dduId );
619  chanKey.push_back( link. rosId );
620  chanKey.push_back( link. robId );
621  chanKey.push_back( link. tdcId );
622  chanKey.push_back( link.channelId );
623 
624  localCache->rgBuf.insert( chanKey.begin(), chanKey.end(), entryNum );
625 
626  cellKey.clear();
627  cellKey.push_back( link. wheelId );
628  cellKey.push_back( link.stationId );
629  cellKey.push_back( link. sectorId );
630  cellKey.push_back( link. slId );
631  cellKey.push_back( link. layerId );
632  cellKey.push_back( link. cellId );
633 
634  localCache->grBuf.insert( cellKey.begin(), cellKey.end(), entryNum );
635 
636  }
637 
638  if ( key == robMapKey ) {
639 
640  chanKey.clear();
641  chanKey.push_back( link. rosId );
642  chanKey.push_back( link. tdcId );
643  chanKey.push_back( link.channelId );
644  localCache->rgROB.insert( chanKey.begin(), chanKey.end(), entryNum );
645 
646  cellKey.clear();
647  cellKey.push_back( link. cellId );
648  cellKey.push_back( link.layerId );
649  cellKey.push_back( link. slId );
650  std::vector<int>* robMLgr;
651  localCache->grROB.find( cellKey.begin(), cellKey.end(), robMLgr );
652  if ( robMLgr == nullptr ) {
653  std::unique_ptr<std::vector<int> > newVector(new std::vector<int>);
654  robMLgr = newVector.get();
655  localCache->grROB.insert( cellKey.begin(), cellKey.end(),
656  std::move(newVector));
657  }
658  robMLgr->push_back( entryNum );
659  }
660 
661  if ( key == rosMapKey ) {
662 
663  chanKey.clear();
664  chanKey.push_back( link.rosId );
665  chanKey.push_back( link.robId );
666  localCache->rgROS.insert( chanKey.begin(), chanKey.end(), entryNum );
667 
668  cellKey.clear();
669  cellKey.push_back( link. cellId );
670  cellKey.push_back( link.stationId );
671  std::vector<int>* rosMLgr;
672  localCache->grROS.find( cellKey.begin(), cellKey.end(), rosMLgr );
673  if ( rosMLgr == nullptr ) {
674  std::unique_ptr<std::vector<int> > newVector(new std::vector<int>);
675  rosMLgr = newVector.get();
676  localCache->grROS.insert( cellKey.begin(), cellKey.end(),
677  std::move(newVector));
678  }
679  rosMLgr->push_back( entryNum );
680  }
681 
682  if ( ( key < 0x3fffffff ) &&
683  ( val > 0x3fffffff ) ) {
684 
685  chanKey.clear();
686  chanKey.push_back( link.dduId );
687  chanKey.push_back( link.rosId );
688  localCache->rgDDU.insert( chanKey.begin(), chanKey.end(), entryNum );
689 
690  int mapId = link.cellId;
691  std::vector<int>* dduMLgr;
692  std::map<int,std::vector<int>*>::const_iterator dduEntIter =
693  dduEntries.find( mapId );
694  if ( dduEntIter == dduEntries.end() )
695  dduEntries.insert( std::pair<int,std::vector<int>*>( mapId,
696  dduMLgr = new std::vector<int> ) );
697  else dduMLgr = dduEntIter->second;
698  dduMLgr->push_back( entryNum );
699 
700  }
701 
702  }
703 
704  if ( defaultValue != 0 ) {
705  for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
706  const DTReadOutGeometryLink& link(
707  readOutChannelDriftTubeMap[entryNum] );
708  key = link.dduId;
709  if ( key != rosMapKey ) continue;
710  int mapId = link. rosId;
711  int whchkId = link. wheelId;
712  int secchkId = link.sectorId;
713 
714  std::vector<int>* dduMLgr;
715  std::map<int,std::vector<int>*>::const_iterator dduEntIter =
716  dduEntries.find( mapId );
717  if ( dduEntIter != dduEntries.end() ) dduMLgr = dduEntIter->second;
718  else continue;
719  std::vector<int>::const_iterator dduIter = dduMLgr->begin();
720  std::vector<int>::const_iterator dduIend = dduMLgr->end();
721  while( dduIter != dduIend ) {
722  int ientry = *dduIter++;
723  const DTReadOutGeometryLink& lros(
724  readOutChannelDriftTubeMap[ientry] );
725  int wheelId = whchkId;
726  int sectorId = secchkId;
727  if ( wheelId == defaultValue ) wheelId = lros. wheelId;
728  if ( sectorId == defaultValue ) sectorId = lros.sectorId;
729  cellKey.clear();
730  cellKey.push_back( mapId );
731  cellKey.push_back( wheelId );
732  cellKey.push_back( sectorId );
733  std::vector<int>* dduMLgr = nullptr;
734  localCache->grDDU.find( cellKey.begin(), cellKey.end(), dduMLgr );
735  if ( dduMLgr == nullptr ) {
736  std::unique_ptr<std::vector<int> > newVector(new std::vector<int>);
737  dduMLgr = newVector.get();
738  localCache->grDDU.insert( cellKey.begin(), cellKey.end(),
739  std::move(newVector) );
740  }
741  dduMLgr->push_back( ientry );
742  }
743  }
744 
745  std::map<int,std::vector<int>*>::const_iterator dduEntIter =
746  dduEntries.begin();
747  std::map<int,std::vector<int>*>::const_iterator dduEntIend =
748  dduEntries.end();
749  while ( dduEntIter != dduEntIend ) {
750  const std::pair<int,std::vector<int>*>& dduEntry = *dduEntIter++;
751  delete dduEntry.second;
752  }
753 
754  localCache->rgBuf.clear();
755  localCache->grBuf.clear();
756  }
757 
758  atomicCache().set(std::move(localCache));
759 
760  return;
761 }
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
bool set(std::unique_ptr< T > iNewValue) const
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
def move(src, dest)
Definition: eostools.py:511
void DTReadOutMapping::clear ( void  )
DTReadOutMapping::const_iterator DTReadOutMapping::end ( void  ) const

Definition at line 468 of file DTReadOutMapping.cc.

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

468  {
469  return readOutChannelDriftTubeMap.end();
470 }
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
DTReadOutMapping * DTReadOutMapping::expandMap ( const DTReadOutMapping compMap)
staticprivate

Definition at line 481 of file DTReadOutMapping.cc.

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

481  {
482  std::vector<DTReadOutGeometryLink> entryList;
483  DTReadOutMapping::const_iterator compIter = compMap.begin();
484  DTReadOutMapping::const_iterator compIend = compMap.end();
485  while ( compIter != compIend ) entryList.push_back( *compIter++ );
486 
488  rosMap = "expand_";
489  rosMap += compMap.mapRobRos();
491  tdcMap = "expand_";
492  tdcMap += compMap.mapCellTdc();
493  DTReadOutMapping* fullMap = new DTReadOutMapping( tdcMap, rosMap );
494  int ddu;
495  int ros;
496  int rch;
497  int tdc;
498  int tch;
499  int whe;
500  int sta;
501  int sec;
502  int rob;
503  int qua;
504  int lay;
505  int cel;
506  int mt1;
507  int mi1;
508  int mt2;
509  int mi2;
510  int def;
511  int wha;
512  int sea;
513  std::vector<DTReadOutGeometryLink>::const_iterator iter = entryList.begin();
514  std::vector<DTReadOutGeometryLink>::const_iterator iend = entryList.end();
515  std::vector<DTReadOutGeometryLink>::const_iterator iros = entryList.end();
516  std::vector<DTReadOutGeometryLink>::const_iterator irob = entryList.end();
517  while ( iter != iend ) {
518  const DTReadOutGeometryLink& rosEntry( *iter++ );
519  if ( rosEntry.dduId > 0x3fffffff ) continue;
520  ddu = rosEntry.dduId;
521  ros = rosEntry.rosId;
522  whe = rosEntry.wheelId;
523  def = rosEntry.stationId;
524  sec = rosEntry.sectorId;
525  rob = rosEntry.slId;
526  mt1 = rosEntry.layerId;
527  mi1 = rosEntry.cellId;
528  iros = entryList.begin();
529  while ( iros != iend ) {
530  wha = whe;
531  sea = sec;
532  const DTReadOutGeometryLink& rchEntry( *iros++ );
533  if ( ( rchEntry.dduId != mt1 ) ||
534  ( rchEntry.rosId != mi1 ) ) continue;
535  rch = rchEntry.robId;
536  if ( rchEntry.wheelId != def ) wha = rchEntry.wheelId;
537  sta = rchEntry.stationId;
538  if ( rchEntry.sectorId != def ) sea = rchEntry.sectorId;
539  rob = rchEntry.slId;
540  mt2 = rchEntry.layerId;
541  mi2 = rchEntry.cellId;
542  irob = entryList.begin();
543  while ( irob != iend ) {
544  const DTReadOutGeometryLink& robEntry( *irob++ );
545  if ( ( robEntry.dduId != mt2 ) ||
546  ( robEntry.rosId != mi2 ) ) continue;
547  if ( robEntry.robId != rob ) {
548  std::cout << "ROB mismatch " << rob << " "
549  << robEntry.robId << std::endl;
550  }
551  tdc = robEntry.tdcId;
552  tch = robEntry.channelId;
553  qua = robEntry.slId;
554  lay = robEntry.layerId;
555  cel = robEntry.cellId;
556  fullMap->insertReadOutGeometryLink( ddu, ros, rch, tdc, tch,
557  wha, sta, sea,
558  qua, lay, cel );
559 
560  }
561  }
562  }
563  return fullMap;
564 }
const_iterator end() const
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
const std::string & mapCellTdc() const
access parent maps identifiers
const_iterator begin() 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
const std::string & mapRobRos() const
JetCorrectorParameters::Definitions def
Definition: classes.h:6
const DTReadOutMapping * fullMap() const
Expand to full map.
const DTReadOutMapping * DTReadOutMapping::fullMap ( ) const

Expand to full map.

Definition at line 473 of file DTReadOutMapping.cc.

473  {
474  if ( mapType() == plain ) return this;
475  return expandMap( *this );
476 }
static DTReadOutMapping * expandMap(const DTReadOutMapping &compMap)
type mapType() const
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 223 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::tdcId, and DTReadOutGeometryLink::wheelId.

Referenced by DTuROSDigiToRaw::process().

233  {
234 
235  dduId =
236  rosId =
237  robId =
238  tdcId =
239  channelId = 0;
240 
241  if(!atomicCache().isSet()) {
242  cacheMap();
243  }
244 
245  int defaultValue;
246  atomicCache()->mType.find( 0, defaultValue );
247  if ( defaultValue ) {
248 
249  int loop1 = 0;
250  int loop2 = 0;
251  int loop3 = 0;
252  int loop0 = 0;
253 
254  int searchStatus;
255  int mapId = 0;
256  std::vector<int> const* robMLgr;
257  std::vector<int> const* rosMLgr;
258  std::vector<int> const* dduMLgr;
259 
260  std::vector<int> cellKey;
261  cellKey.reserve(6);
262  cellKey.push_back( cellId );
263  cellKey.push_back( layerId );
264  cellKey.push_back( slId );
265  std::vector<int> stdcKey = cellKey;
266  searchStatus = atomicCache()->grROB.find( cellKey.begin(), cellKey.end(), robMLgr );
267  if ( searchStatus ) return searchStatus;
268  if ( !( robMLgr->size() ) ) return 1;
269  std::vector<int>::const_iterator tdc_iter = robMLgr->begin();
270  std::vector<int>::const_iterator tdc_iend = robMLgr->end();
271  while( tdc_iter != tdc_iend ) {
272  loop1++;
273  const DTReadOutGeometryLink& ltdc(
274  readOutChannelDriftTubeMap[*tdc_iter++] );
275  channelId = ltdc.channelId;
276  tdcId = ltdc. tdcId;
277  mapId = ltdc.rosId;
278  cellKey.clear();
279  cellKey.push_back( mapId );
280  cellKey.push_back( stationId );
281  std::vector<int> srosKey = cellKey;
282  searchStatus = atomicCache()->grROS.find( cellKey.begin(), cellKey.end(), rosMLgr );
283  if ( searchStatus ) continue;
284  if ( !( rosMLgr->size() ) ) continue;
285  std::vector<int>::const_iterator ros_iter = rosMLgr->begin();
286  std::vector<int>::const_iterator ros_iend = rosMLgr->end();
287  while( ros_iter != ros_iend ) {
288  loop2++;
289  const DTReadOutGeometryLink& lros(
290  readOutChannelDriftTubeMap[*ros_iter++] );
291  int secCk = lros.sectorId;
292  int wheCk = lros. wheelId;
293  if ( ( secCk != defaultValue ) &&
294  ( secCk != sectorId ) ) continue;
295  if ( ( wheCk != defaultValue ) &&
296  ( wheCk != wheelId ) ) continue;
297  robId = lros.robId;
298  mapId = lros.rosId;
299  cellKey.clear();
300  cellKey.push_back( mapId );
301  cellKey.push_back( wheelId );
302  cellKey.push_back( sectorId );
303  std::vector<int> sdduKey = cellKey;
304  searchStatus = atomicCache()->grDDU.find( cellKey.begin(), cellKey.end(), dduMLgr );
305  if ( searchStatus ) continue;
306  if ( !( dduMLgr->size() ) ) continue;
307  if ( searchStatus ) return searchStatus;
308  if ( !( dduMLgr->size() ) ) return 1;
309  loop0++;
310  std::vector<int>::const_iterator ddu_iter = dduMLgr->begin();
311  std::vector<int>::const_iterator ddu_iend = dduMLgr->end();
312  while( ddu_iter != ddu_iend ) {
313  loop3++;
314  const DTReadOutGeometryLink& lddu(
315  readOutChannelDriftTubeMap[*ddu_iter++] );
316  if ( ( ( sectorId == secCk ) ||
317  ( sectorId == lddu.sectorId ) ) &&
318  ( ( wheelId == wheCk ) ||
319  ( wheelId == lddu.wheelId ) ) ) {
320  rosId = lddu.rosId;
321  dduId = lddu.dduId;
322  return 0;
323  }
324  }
325  }
326  }
327 
328  return 1;
329 
330  }
331 
332  std::vector<int> cellKey;
333  cellKey.reserve(6);
334  cellKey.push_back( wheelId );
335  cellKey.push_back( stationId );
336  cellKey.push_back( sectorId );
337  cellKey.push_back( slId );
338  cellKey.push_back( layerId );
339  cellKey.push_back( cellId );
340  int ientry;
341  int searchStatus = atomicCache()->grBuf.find( cellKey.begin(), cellKey.end(), ientry );
342  if ( !searchStatus ) {
343  const DTReadOutGeometryLink& link( readOutChannelDriftTubeMap[ientry] );
344  dduId = link. dduId;
345  rosId = link. rosId;
346  robId = link. robId;
347  tdcId = link. tdcId;
348  channelId = link.channelId;
349  }
350 
351  return searchStatus;
352 
353 }
DTBufferTree< int, int > grBuf
DTBufferTree< int, int > mType
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROB
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROS
void cacheMap() const
read and store full content
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grDDU
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
int DTReadOutMapping::geometryToReadOut ( const DTWireId wireId,
int &  dduId,
int &  rosId,
int &  robId,
int &  tdcId,
int &  channelId 
) const

Definition at line 203 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, DTLayerId::layer(), DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTChamberId::sector(), DTChamberId::station(), DTSuperLayerId::superLayer(), DTReadOutGeometryLink::tdcId, DTChamberId::wheel(), and DTWireId::wire().

208  {
209  return geometryToReadOut( wireId.wheel(),
210  wireId.station(),
211  wireId.sector(),
212  wireId.superLayer(),
213  wireId.layer(),
214  wireId.wire(),
215  dduId,
216  rosId,
217  robId,
218  tdcId,
219  channelId);
220 }
int layer() const
Return the layer number.
Definition: DTLayerId.h:53
int superLayer() const
Return the superlayer number.
int wire() const
Return the wire number.
Definition: DTWireId.h:56
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 sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
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 400 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::channelId, DTReadOutGeometryLink::dduId, DTBufferTree< Key, Content >::insert(), DTReadOutGeometryLink::layerId, DTReadOutGeometryLink::robId, DTReadOutGeometryLink::rosId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, DTReadOutGeometryLink::tdcId, and DTReadOutGeometryLink::wheelId.

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

410  {
412  link. dduId = dduId;
413  link. rosId = rosId;
414  link. robId = robId;
415  link. tdcId = tdcId;
416  link.channelId = channelId;
417  link. wheelId = wheelId;
418  link.stationId = stationId;
419  link. sectorId = sectorId;
420  link. slId = slId;
421  link. layerId = layerId;
422  link. cellId = cellId;
423 
424  int ientry = readOutChannelDriftTubeMap.size();
425  readOutChannelDriftTubeMap.push_back( link );
426 
427  DTBufferTree<int,int>* pgrBuf;
428  DTBufferTree<int,int>* prgBuf;
429 
430  if(atomicCache().isSet()) {
431  pgrBuf = &atomicCache()->grBuf;
432  prgBuf = &atomicCache()->rgBuf;
433  } else {
434  pgrBuf = grBuf.get();
435  prgBuf = rgBuf.get();
436  }
437 
438  std::vector<int> cellKey;
439  cellKey.reserve(6);
440  cellKey.push_back( wheelId );
441  cellKey.push_back( stationId );
442  cellKey.push_back( sectorId );
443  cellKey.push_back( slId );
444  cellKey.push_back( layerId );
445  cellKey.push_back( cellId );
446  int grStatus = pgrBuf->insert( cellKey.begin(), cellKey.end(), ientry );
447 
448  std::vector<int> chanKey;
449  chanKey.reserve(5);
450  chanKey.push_back( dduId );
451  chanKey.push_back( rosId );
452  chanKey.push_back( robId );
453  chanKey.push_back( tdcId );
454  chanKey.push_back( channelId );
455  int rgStatus = prgBuf->insert( chanKey.begin(), chanKey.end(), ientry );
456 
457  if ( grStatus || rgStatus ) return 1;
458  else return 0;
459 
460 }
DTBufferTree< int, int > grBuf
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
DTBufferTree< int, int > rgBuf
int insert(ElementKey fKey, ElementKey lKey, Content cont)
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
T const * get() const
const std::string & DTReadOutMapping::mapCellTdc ( ) const

access parent maps identifiers

Definition at line 370 of file DTReadOutMapping.cc.

Referenced by expandMap().

370  {
371  return cellMapVersion;
372 }
std::string cellMapVersion
std::string & DTReadOutMapping::mapCellTdc ( )

Definition at line 375 of file DTReadOutMapping.cc.

375  {
376  return cellMapVersion;
377 }
std::string cellMapVersion
std::string DTReadOutMapping::mapNameGR ( ) const
private

Definition at line 566 of file DTReadOutMapping.cc.

References dataset::name.

566  {
567  std::stringstream name;
568  name << cellMapVersion << "_" << robMapVersion << "_map_GR" << this;
569  return name.str();
570 }
std::string robMapVersion
std::string cellMapVersion
std::string DTReadOutMapping::mapNameRG ( ) const
private

Definition at line 573 of file DTReadOutMapping.cc.

References dataset::name.

573  {
574  std::stringstream name;
575  name << cellMapVersion << "_" << robMapVersion << "_map_RG" << this;
576  return name.str();
577 }
std::string robMapVersion
std::string cellMapVersion
const std::string & DTReadOutMapping::mapRobRos ( ) const

Definition at line 381 of file DTReadOutMapping.cc.

Referenced by expandMap().

381  {
382  return robMapVersion;
383 }
std::string robMapVersion
std::string & DTReadOutMapping::mapRobRos ( )

Definition at line 386 of file DTReadOutMapping.cc.

386  {
387  return robMapVersion;
388 }
std::string robMapVersion
DTReadOutMapping::type DTReadOutMapping::mapType ( ) const

Definition at line 356 of file DTReadOutMapping.cc.

356  {
357 
358  if(!atomicCache().isSet()) {
359  cacheMap();
360  }
361 
362  int defaultValue;
363  atomicCache()->mType.find( 0, defaultValue );
364  if ( defaultValue ) return compact;
365  else return plain;
366 }
DTBufferTree< int, int > mType
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
void cacheMap() const
read and store full content
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
DTReadOutMapping& DTReadOutMapping::operator= ( DTReadOutMapping const &  )
privatedelete
int DTReadOutMapping::readOutToGeometry ( int  dduId,
int  rosId,
int  robId,
int  tdcId,
int  channelId,
DTWireId wireId 
) const

transform identifiers

Operations

Definition at line 81 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::layerId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, mps_update::status, and DTReadOutGeometryLink::wheelId.

Referenced by DTBlockedROChannelsTest::fillChamberMap(), DTROS25Unpacker::interpretRawData(), DTROS8Unpacker::interpretRawData(), DTuROSRawToDigi::process(), DTBlockedROChannelsTest::readOutToGeometry(), and DTDataIntegrityTest::readOutToGeometry().

86  {
87 
88  int wheelId;
89  int stationId;
90  int sectorId;
91  int slId;
92  int layerId;
93  int cellId;
94 
95  int status = readOutToGeometry( dduId,
96  rosId,
97  robId,
98  tdcId,
99  channelId,
100  wheelId,
101  stationId,
102  sectorId,
103  slId,
104  layerId,
105  cellId );
106 
107  wireId = DTWireId( wheelId, stationId, sectorId, slId, layerId, cellId );
108  return status;
109 
110 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
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 113 of file DTReadOutMapping.cc.

References DTReadOutGeometryLink::cellId, DTReadOutGeometryLink::layerId, DTReadOutGeometryLink::sectorId, DTReadOutGeometryLink::slId, DTReadOutGeometryLink::stationId, and DTReadOutGeometryLink::wheelId.

123  {
124 
125  wheelId =
126  stationId =
127  sectorId =
128  slId =
129  layerId =
130  cellId = 0;
131 
132  if(!atomicCache().isSet()) {
133  cacheMap();
134  }
135 
136  int defaultValue;
137  atomicCache()->mType.find( 0, defaultValue );
138  if ( defaultValue ) {
139 
140  int searchStatus;
141  int ientry;
142 
143  std::vector<int> dduKey;
144  dduKey.reserve( 5 );
145  dduKey.push_back( dduId );
146  dduKey.push_back( rosId );
147  searchStatus = atomicCache()->rgDDU.find( dduKey.begin(), dduKey.end(), ientry );
148  if ( searchStatus ) return searchStatus;
149  const DTReadOutGeometryLink& lros( readOutChannelDriftTubeMap[ientry] );
150  wheelId = lros. wheelId;
151  sectorId = lros. sectorId;
152 
153  std::vector<int> rosKey;
154  rosKey.reserve( 5 );
155  rosKey.push_back( lros. cellId );
156  rosKey.push_back( robId );
157  searchStatus = atomicCache()->rgROS.find( rosKey.begin(), rosKey.end(), ientry );
158  if ( searchStatus ) return searchStatus;
159  const DTReadOutGeometryLink& lrob( readOutChannelDriftTubeMap[ientry] );
160  if ( lrob. wheelId != defaultValue ) wheelId = lrob. wheelId;
161  stationId = lrob.stationId;
162  if ( lrob. sectorId != defaultValue ) sectorId = lrob. sectorId;
163 
164  std::vector<int> robKey;
165  robKey.reserve( 5 );
166  robKey.push_back( lrob. cellId );
167  robKey.push_back( tdcId );
168  robKey.push_back( channelId );
169  searchStatus = atomicCache()->rgROB.find( robKey.begin(), robKey.end(), ientry );
170  if ( searchStatus ) return searchStatus;
171  const DTReadOutGeometryLink& ltdc( readOutChannelDriftTubeMap[ientry] );
172  slId = ltdc. slId;
173  layerId = ltdc. layerId;
174  cellId = ltdc. cellId;
175  return 0;
176 
177  }
178 
179  std::vector<int> chanKey;
180  chanKey.reserve(5);
181  chanKey.push_back( dduId );
182  chanKey.push_back( rosId );
183  chanKey.push_back( robId );
184  chanKey.push_back( tdcId );
185  chanKey.push_back( channelId );
186  int ientry;
187  int searchStatus = atomicCache()->rgBuf.find( chanKey.begin(), chanKey.end(), ientry );
188  if ( !searchStatus ) {
189  const DTReadOutGeometryLink& link( readOutChannelDriftTubeMap[ientry] );
190  wheelId = link. wheelId;
191  stationId = link.stationId;
192  sectorId = link. sectorId;
193  slId = link. slId;
194  layerId = link. layerId;
195  cellId = link. cellId;
196  }
197 
198  return searchStatus;
199 
200 }
DTBufferTree< int, int > rgROB
DTBufferTree< int, int > mType
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
DTBufferTree< int, int > rgBuf
void cacheMap() const
read and store full content
DTBufferTree< int, int > rgROS
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
DTBufferTree< int, int > rgDDU
template<class Archive >
void DTReadOutMapping::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 182 of file DTReadOutMapping.h.

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

Definition at line 182 of file DTReadOutMapping.h.

Member Data Documentation

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

Definition at line 171 of file DTReadOutMapping.h.

std::string DTReadOutMapping::cellMapVersion
private

Definition at line 166 of file DTReadOutMapping.h.

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

Definition at line 173 of file DTReadOutMapping.h.

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

Definition at line 169 of file DTReadOutMapping.h.

Referenced by DTReadOutMapping().

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

Definition at line 172 of file DTReadOutMapping.h.

std::string DTReadOutMapping::robMapVersion
private

Definition at line 167 of file DTReadOutMapping.h.