37 cellMapVersion(
" " ),
38 robMapVersion(
" " ) {
47 cellMapVersion( cell_map_version ),
48 robMapVersion( rob_map_version ) {
86 while ( gr_iter != gr_iend )
delete *gr_iter++;
92 while ( gr_iter != gr_iend )
delete *gr_iter++;
98 while ( gr_iter != gr_iend )
delete *gr_iter++;
139 wireId =
DTWireId( wheelId, stationId, sectorId, slId, layerId, cellId );
155 int& cellId )
const {
164 if ( (
mType == 0 ) ||
172 if ( defaultValue ) {
177 std::vector<int> dduKey;
179 dduKey.push_back( dduId );
180 dduKey.push_back( rosId );
181 searchStatus =
rgDDU->
find( dduKey.begin(), dduKey.end(), ientry );
182 if ( searchStatus )
return searchStatus;
184 wheelId = lros. wheelId;
185 sectorId = lros. sectorId;
187 std::vector<int> rosKey;
189 rosKey.push_back( lros. cellId );
190 rosKey.push_back( robId );
191 searchStatus =
rgROS->
find( rosKey.begin(), rosKey.end(), ientry );
192 if ( searchStatus )
return searchStatus;
194 if ( lrob. wheelId != defaultValue ) wheelId = lrob. wheelId;
196 if ( lrob. sectorId != defaultValue ) sectorId = lrob. sectorId;
198 std::vector<int> robKey;
200 robKey.push_back( lrob. cellId );
201 robKey.push_back( tdcId );
202 robKey.push_back( channelId );
203 searchStatus =
rgROB->
find( robKey.begin(), robKey.end(), ientry );
204 if ( searchStatus )
return searchStatus;
207 layerId = ltdc. layerId;
208 cellId = ltdc. cellId;
213 std::vector<int> chanKey;
215 chanKey.push_back( dduId );
216 chanKey.push_back( rosId );
217 chanKey.push_back( robId );
218 chanKey.push_back( tdcId );
219 chanKey.push_back( channelId );
221 int searchStatus =
rgBuf->
find( chanKey.begin(), chanKey.end(), ientry );
222 if ( !searchStatus ) {
224 wheelId = link. wheelId;
226 sectorId = link. sectorId;
228 layerId = link. layerId;
229 cellId = link. cellId;
242 int& channelId )
const {
267 int& channelId )
const {
275 if ( (
mType == 0 ) ||
283 if ( defaultValue ) {
292 std::vector<int>* robMLgr;
293 std::vector<int>* rosMLgr;
294 std::vector<int>* dduMLgr;
296 std::vector<int> cellKey;
298 cellKey.push_back( cellId );
299 cellKey.push_back( layerId );
300 cellKey.push_back( slId );
301 std::vector<int> stdcKey = cellKey;
302 searchStatus =
grROB->
find( cellKey.begin(), cellKey.end(), robMLgr );
303 if ( searchStatus )
return searchStatus;
304 if ( !( robMLgr->size() ) )
return 1;
305 std::vector<int>::const_iterator tdc_iter = robMLgr->begin();
306 std::vector<int>::const_iterator tdc_iend = robMLgr->end();
307 while( tdc_iter != tdc_iend ) {
315 cellKey.push_back( mapId );
316 cellKey.push_back( stationId );
317 std::vector<int> srosKey = cellKey;
318 searchStatus =
grROS->
find( cellKey.begin(), cellKey.end(), rosMLgr );
319 if ( searchStatus )
continue;
320 if ( !( rosMLgr->size() ) )
continue;
321 std::vector<int>::const_iterator ros_iter = rosMLgr->begin();
322 std::vector<int>::const_iterator ros_iend = rosMLgr->end();
323 while( ros_iter != ros_iend ) {
328 int wheCk = lros. wheelId;
329 if ( ( secCk != defaultValue ) &&
330 ( secCk != sectorId ) )
continue;
331 if ( ( wheCk != defaultValue ) &&
332 ( wheCk != wheelId ) )
continue;
336 cellKey.push_back( mapId );
337 cellKey.push_back( wheelId );
338 cellKey.push_back( sectorId );
339 std::vector<int> sdduKey = cellKey;
340 searchStatus =
grDDU->
find( cellKey.begin(), cellKey.end(), dduMLgr );
341 if ( searchStatus )
continue;
342 if ( !( dduMLgr->size() ) )
continue;
343 if ( searchStatus )
return searchStatus;
344 if ( !( dduMLgr->size() ) )
return 1;
346 std::vector<int>::const_iterator ddu_iter = dduMLgr->begin();
347 std::vector<int>::const_iterator ddu_iend = dduMLgr->end();
348 while( ddu_iter != ddu_iend ) {
353 if ( ( ( sectorId == secCk ) ||
355 ( ( wheelId == wheCk ) ||
356 ( wheelId == lddu.
wheelId ) ) ) {
369 std::vector<int> cellKey;
371 cellKey.push_back( wheelId );
372 cellKey.push_back( stationId );
373 cellKey.push_back( sectorId );
374 cellKey.push_back( slId );
375 cellKey.push_back( layerId );
376 cellKey.push_back( cellId );
378 int searchStatus =
grBuf->
find( cellKey.begin(), cellKey.end(), ientry );
379 if ( !searchStatus ) {
397 if ( defaultValue )
return compact;
451 link. wheelId = wheelId;
453 link. sectorId = sectorId;
455 link. layerId = layerId;
456 link. cellId = cellId;
472 std::vector<int> cellKey;
474 cellKey.push_back( wheelId );
475 cellKey.push_back( stationId );
476 cellKey.push_back( sectorId );
477 cellKey.push_back( slId );
478 cellKey.push_back( layerId );
479 cellKey.push_back( cellId );
481 grBuf->
insert( cellKey.begin(), cellKey.end(), ientry );
482 std::vector<int> chanKey;
484 chanKey.push_back( dduId );
485 chanKey.push_back( rosId );
486 chanKey.push_back( robId );
487 chanKey.push_back( tdcId );
488 chanKey.push_back( channelId );
490 rgBuf->
insert( chanKey.begin(), chanKey.end(), ientry );
492 if ( grStatus || rgStatus )
return 1;
512 if ( cmHandler == 0 ) {
513 std::cout <<
"CondCoreDTPlugins library not loaded, "
514 <<
"compactMapHandler plugin missing" << std::endl;
522 std::stringstream
name;
529 std::stringstream
name;
578 std::vector<int> cellKey;
580 std::vector<int> chanKey;
582 int defaultValue = 0;
587 std::map<int,std::vector<int>*> dduEntries;
588 for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
594 if ( key > 0x3fffffff ) {
595 if ( link. tdcId > 0x3fffffff ) {
605 if ( defaultValue == 0 ) {
608 chanKey.push_back( link. dduId );
609 chanKey.push_back( link. rosId );
610 chanKey.push_back( link. robId );
611 chanKey.push_back( link. tdcId );
614 rgBuf->
insert( chanKey.begin(), chanKey.end(), entryNum );
617 cellKey.push_back( link. wheelId );
619 cellKey.push_back( link. sectorId );
620 cellKey.push_back( link. slId );
621 cellKey.push_back( link. layerId );
622 cellKey.push_back( link. cellId );
624 grBuf->
insert( cellKey.begin(), cellKey.end(), entryNum );
628 if ( key == robMapKey ) {
631 chanKey.push_back( link. rosId );
632 chanKey.push_back( link. tdcId );
634 rgROB->
insert( chanKey.begin(), chanKey.end(), entryNum );
637 cellKey.push_back( link. cellId );
638 cellKey.push_back( link.
layerId );
639 cellKey.push_back( link. slId );
640 std::vector<int>* robMLgr;
641 grROB->
find( cellKey.begin(), cellKey.end(), robMLgr );
642 if ( robMLgr == 0 )
grROB->
insert( cellKey.begin(), cellKey.end(),
643 robMLgr =
new std::vector<int> );
644 robMLgr->push_back( entryNum );
648 if ( key == rosMapKey ) {
651 chanKey.push_back( link.
rosId );
652 chanKey.push_back( link.
robId );
653 rgROS->
insert( chanKey.begin(), chanKey.end(), entryNum );
656 cellKey.push_back( link. cellId );
658 std::vector<int>* rosMLgr;
659 grROS->
find( cellKey.begin(), cellKey.end(), rosMLgr );
660 if ( rosMLgr == 0 )
grROS->
insert( cellKey.begin(), cellKey.end(),
661 rosMLgr =
new std::vector<int> );
662 rosMLgr->push_back( entryNum );
666 if ( ( key < 0x3fffffff ) &&
667 ( val > 0x3fffffff ) ) {
670 chanKey.push_back( link.
dduId );
671 chanKey.push_back( link.
rosId );
672 rgDDU->
insert( chanKey.begin(), chanKey.end(), entryNum );
675 std::vector<int>* dduMLgr;
677 dduEntries.find( mapId );
678 if ( dduEntIter == dduEntries.end() )
679 dduEntries.insert( std::pair<
int,std::vector<int>*>( mapId,
680 dduMLgr =
new std::vector<int> ) );
681 else dduMLgr = dduEntIter->second;
682 dduMLgr->push_back( entryNum );
688 if ( defaultValue != 0 ) {
689 for ( entryNum = 0; entryNum < entryMax; entryNum++ ) {
693 if ( key != rosMapKey )
continue;
694 int mapId = link. rosId;
695 int whchkId = link. wheelId;
698 std::vector<int>* dduMLgr;
700 dduEntries.find( mapId );
701 if ( dduEntIter != dduEntries.end() ) dduMLgr = dduEntIter->second;
703 std::vector<int>::const_iterator dduIter = dduMLgr->begin();
704 std::vector<int>::const_iterator dduIend = dduMLgr->end();
705 while( dduIter != dduIend ) {
706 int ientry = *dduIter++;
709 int wheelId = whchkId;
710 int sectorId = secchkId;
711 if ( wheelId == defaultValue ) wheelId = lros. wheelId;
712 if ( sectorId == defaultValue ) sectorId = lros.
sectorId;
714 cellKey.push_back( mapId );
715 cellKey.push_back( wheelId );
716 cellKey.push_back( sectorId );
717 std::vector<int>* dduMLgr = 0;
718 grDDU->
find( cellKey.begin(), cellKey.end(), dduMLgr );
719 if ( dduMLgr == 0 )
grDDU->
insert( cellKey.begin(), cellKey.end(),
720 dduMLgr =
new std::vector<int> );
721 dduMLgr->push_back( ientry );
730 while ( dduEntIter != dduEntIend ) {
731 const std::pair<int,std::vector<int>*>& dduEntry = *dduEntIter++;
732 delete dduEntry.second;
static DTCompactMapAbstractHandler * getInstance()
get static object
std::string robMapVersion
DTBufferTree< int, std::vector< int > * > * grROB
const_iterator end() const
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
int insert(ElementKey fKey, ElementKey lKey, const Content &cont)
std::string mapNameRG() const
int layer() const
Return the layer number.
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
std::string link(std::string &nm, std::string &ns)
const std::string & mapCellTdc() const
access parent maps identifiers
DTBufferTree< int, int > * rgROS
static void setDefault(const Content &def)
int superLayer() const
Return the superlayer number.
std::vector< Content > contList()
const_iterator begin() const
DTBufferTree< int, std::vector< int > * > * grROS
DTBufferTree< int, int > * mType
DTBufferTree< int, int > * rgROB
DTBufferTree< int, int > * grBuf
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
int find(ElementKey fKey, ElementKey lKey, Content &cont)
const std::string & mapRobRos() const
DTBufferTree< int, int > * rgBuf
void cacheMap() const
read and store full content
virtual DTReadOutMapping * expandMap(const DTReadOutMapping &compMap)
expand compact map
DTBufferTree< int, int > * rgDDU
std::string cellMapVersion
DTBufferTree< int, std::vector< int > * > * grDDU
std::string mapNameGR() const
int station() const
Return the station number.
int wheel() const
Return the wheel number.
const DTReadOutMapping * fullMap() const
Expand to full map.