35 cellMapVersion(
" " ),
46 cellMapVersion( cell_map_version ),
47 robMapVersion( rob_map_version ),
107 wireId =
DTWireId( wheelId, stationId, sectorId, slId, layerId, cellId );
123 int& cellId )
const {
138 if ( defaultValue ) {
143 std::vector<int> dduKey;
145 dduKey.push_back( dduId );
146 dduKey.push_back( rosId );
148 if ( searchStatus )
return searchStatus;
150 wheelId = lros. wheelId;
151 sectorId = lros. sectorId;
153 std::vector<int> rosKey;
155 rosKey.push_back( lros. cellId );
156 rosKey.push_back( robId );
158 if ( searchStatus )
return searchStatus;
160 if ( lrob. wheelId != defaultValue ) wheelId = lrob. wheelId;
162 if ( lrob. sectorId != defaultValue ) sectorId = lrob. sectorId;
164 std::vector<int> robKey;
166 robKey.push_back( lrob. cellId );
167 robKey.push_back( tdcId );
168 robKey.push_back( channelId );
170 if ( searchStatus )
return searchStatus;
173 layerId = ltdc. layerId;
174 cellId = ltdc. cellId;
179 std::vector<int> chanKey;
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 );
188 if ( !searchStatus ) {
190 wheelId = link. wheelId;
192 sectorId = link. sectorId;
194 layerId = link. layerId;
195 cellId = link. cellId;
208 int& channelId )
const {
233 int& channelId )
const {
247 if ( defaultValue ) {
256 std::vector<int>
const* robMLgr;
257 std::vector<int>
const* rosMLgr;
258 std::vector<int>
const* dduMLgr;
260 std::vector<int> cellKey;
262 cellKey.push_back( cellId );
263 cellKey.push_back( layerId );
264 cellKey.push_back( slId );
265 std::vector<int> stdcKey = cellKey;
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 ) {
279 cellKey.push_back( mapId );
280 cellKey.push_back( stationId );
281 std::vector<int> srosKey = cellKey;
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 ) {
292 int wheCk = lros. wheelId;
293 if ( ( secCk != defaultValue ) &&
294 ( secCk != sectorId ) )
continue;
295 if ( ( wheCk != defaultValue ) &&
296 ( wheCk != wheelId ) )
continue;
300 cellKey.push_back( mapId );
301 cellKey.push_back( wheelId );
302 cellKey.push_back( sectorId );
303 std::vector<int> sdduKey = cellKey;
305 if ( searchStatus )
continue;
306 if ( !( dduMLgr->size() ) )
continue;
307 if ( searchStatus )
return searchStatus;
308 if ( !( dduMLgr->size() ) )
return 1;
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 ) {
316 if ( ( ( sectorId == secCk ) ||
318 ( ( wheelId == wheCk ) ||
319 ( wheelId == lddu.
wheelId ) ) ) {
332 std::vector<int> cellKey;
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 );
342 if ( !searchStatus ) {
364 if ( defaultValue )
return compact;
417 link. wheelId = wheelId;
419 link. sectorId = sectorId;
421 link. layerId = layerId;
422 link. cellId = cellId;
438 std::vector<int> cellKey;
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 );
448 std::vector<int> chanKey;
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 );
457 if ( grStatus || rgStatus )
return 1;
482 std::vector<DTReadOutGeometryLink> entryList;
485 while ( compIter != compIend ) entryList.push_back( *compIter++ );
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 ) {
519 if ( rosEntry.
dduId > 0x3fffffff )
continue;
520 ddu = rosEntry.
dduId;
521 ros = rosEntry.
rosId;
528 iros = entryList.begin();
529 while ( iros != iend ) {
533 if ( ( rchEntry.
dduId != mt1 ) ||
534 ( rchEntry.
rosId != mi1 ) )
continue;
535 rch = rchEntry.
robId;
542 irob = entryList.begin();
543 while ( irob != iend ) {
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;
551 tdc = robEntry.
tdcId;
567 std::stringstream
name;
574 std::stringstream
name;
584 localCache->mType.insert( 0, 0 );
588 std::vector<int> cellKey;
590 std::vector<int> chanKey;
592 int defaultValue = 0;
597 std::map<int,std::vector<int>*> dduEntries;
598 for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
604 if ( key > 0x3fffffff ) {
605 if ( link. tdcId > 0x3fffffff ) {
606 localCache->mType.insert( 0, defaultValue = link. tdcId );
610 localCache->mType.insert( 0, defaultValue = link.
wheelId );
615 if ( defaultValue == 0 ) {
618 chanKey.push_back( link. dduId );
619 chanKey.push_back( link. rosId );
620 chanKey.push_back( link. robId );
621 chanKey.push_back( link. tdcId );
624 localCache->rgBuf.insert( chanKey.begin(), chanKey.end(), entryNum );
627 cellKey.push_back( link. wheelId );
629 cellKey.push_back( link. sectorId );
630 cellKey.push_back( link. slId );
631 cellKey.push_back( link. layerId );
632 cellKey.push_back( link. cellId );
634 localCache->grBuf.insert( cellKey.begin(), cellKey.end(), entryNum );
638 if ( key == robMapKey ) {
641 chanKey.push_back( link. rosId );
642 chanKey.push_back( link. tdcId );
644 localCache->rgROB.insert( chanKey.begin(), chanKey.end(), entryNum );
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 == 0 ) {
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));
658 robMLgr->push_back( entryNum );
661 if ( key == rosMapKey ) {
664 chanKey.push_back( link.
rosId );
665 chanKey.push_back( link.
robId );
666 localCache->rgROS.insert( chanKey.begin(), chanKey.end(), entryNum );
669 cellKey.push_back( link. cellId );
671 std::vector<int>* rosMLgr;
672 localCache->grROS.find( cellKey.begin(), cellKey.end(), rosMLgr );
673 if ( rosMLgr == 0 ) {
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));
679 rosMLgr->push_back( entryNum );
682 if ( ( key < 0x3fffffff ) &&
683 ( val > 0x3fffffff ) ) {
686 chanKey.push_back( link.
dduId );
687 chanKey.push_back( link.
rosId );
688 localCache->rgDDU.insert( chanKey.begin(), chanKey.end(), entryNum );
691 std::vector<int>* dduMLgr;
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 );
704 if ( defaultValue != 0 ) {
705 for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
709 if ( key != rosMapKey )
continue;
710 int mapId = link. rosId;
711 int whchkId = link. wheelId;
714 std::vector<int>* dduMLgr;
716 dduEntries.find( mapId );
717 if ( dduEntIter != dduEntries.end() ) dduMLgr = dduEntIter->second;
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++;
725 int wheelId = whchkId;
726 int sectorId = secchkId;
727 if ( wheelId == defaultValue ) wheelId = lros. wheelId;
728 if ( sectorId == defaultValue ) sectorId = lros.
sectorId;
730 cellKey.push_back( mapId );
731 cellKey.push_back( wheelId );
732 cellKey.push_back( sectorId );
733 std::vector<int>* dduMLgr = 0;
734 localCache->grDDU.find( cellKey.begin(), cellKey.end(), dduMLgr );
735 if ( dduMLgr == 0 ) {
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) );
741 dduMLgr->push_back( ientry );
749 while ( dduEntIter != dduEntIend ) {
750 const std::pair<int,std::vector<int>*>& dduEntry = *dduEntIter++;
751 delete dduEntry.second;
754 localCache->rgBuf.clear();
755 localCache->grBuf.clear();
std::string robMapVersion
const_iterator end() const
DTBufferTree< int, int > rgROB
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
DTBufferTree< int, int > grBuf
std::string mapNameRG() const
int layer() const
Return the layer number.
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
DTBufferTree< int, int > mType
void reset()
unsets the value and deletes the memory
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
const std::string & mapCellTdc() const
access parent maps identifiers
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
int superLayer() const
Return the superlayer number.
const_iterator begin() const
DTBufferTree< int, int > rgBuf
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
int wire() const
Return the wire number.
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
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROB
bool set(std::unique_ptr< T > iNewValue) const
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROS
const std::string & mapRobRos() const
static DTReadOutMapping * expandMap(const DTReadOutMapping &compMap)
void cacheMap() const
read and store full content
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grDDU
int insert(ElementKey fKey, ElementKey lKey, Content cont)
std::string cellMapVersion
DTBufferTree< int, int > rgROS
std::string mapNameGR() const
int station() const
Return the station number.
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() const
int wheel() const
Return the wheel number.
DTBufferTree< int, int > rgDDU
const DTReadOutMapping * fullMap() const
Expand to full map.