39 : cellMapVersion(cell_map_version),
40 robMapVersion(rob_map_version),
70 int dduId,
int rosId,
int robId,
int tdcId,
int channelId,
DTWireId& wireId)
const {
79 readOutToGeometry(dduId, rosId, robId, tdcId,
channelId, wheelId, stationId, sectorId, slId, layerId, cellId);
81 wireId =
DTWireId(wheelId, stationId, sectorId, slId, layerId, cellId);
96 wheelId = stationId = sectorId = slId = layerId = cellId = 0;
108 std::vector<int> dduKey;
110 dduKey.push_back(dduId);
111 dduKey.push_back(rosId);
119 std::vector<int> rosKey;
121 rosKey.push_back(lros.
cellId);
122 rosKey.push_back(robId);
133 std::vector<int> robKey;
135 robKey.push_back(lrob.
cellId);
136 robKey.push_back(tdcId);
148 std::vector<int> chanKey;
150 chanKey.push_back(dduId);
151 chanKey.push_back(rosId);
152 chanKey.push_back(robId);
153 chanKey.push_back(tdcId);
171 const DTWireId& wireId,
int& dduId,
int& rosId,
int& robId,
int& tdcId,
int&
channelId)
const {
196 dduId = rosId = robId = tdcId =
channelId = 0;
207 std::vector<int>
const* robMLgr;
208 std::vector<int>
const* rosMLgr;
209 std::vector<int>
const* dduMLgr;
211 std::vector<int> cellKey;
213 cellKey.push_back(cellId);
214 cellKey.push_back(layerId);
215 cellKey.push_back(slId);
216 std::vector<int> stdcKey = cellKey;
220 if (robMLgr->empty())
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) {
230 cellKey.push_back(mapId);
231 cellKey.push_back(stationId);
232 std::vector<int> srosKey = cellKey;
236 if (rosMLgr->empty())
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) {
251 cellKey.push_back(mapId);
252 cellKey.push_back(wheelId);
253 cellKey.push_back(sectorId);
254 std::vector<int> sdduKey = cellKey;
258 if (dduMLgr->empty())
262 if (dduMLgr->empty())
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) {
268 if (((sectorId == secCk) || (sectorId == lddu.
sectorId)) &&
269 ((wheelId == wheCk) || (wheelId == lddu.
wheelId))) {
281 std::vector<int> cellKey;
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);
370 std::vector<int> cellKey;
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);
380 std::vector<int> chanKey;
382 chanKey.push_back(dduId);
383 chanKey.push_back(rosId);
384 chanKey.push_back(robId);
385 chanKey.push_back(tdcId);
387 int rgStatus = prgBuf->
insert(chanKey.begin(), chanKey.end(), ientry);
389 if (grStatus || rgStatus)
408 std::vector<DTReadOutGeometryLink> entryList;
411 while (compIter != compIend)
412 entryList.push_back(*compIter++);
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) {
444 if (rosEntry.
dduId > 0x3fffffff)
446 ddu = rosEntry.
dduId;
447 ros = rosEntry.
rosId;
454 iros = entryList.begin();
455 while (iros != iend) {
459 if ((rchEntry.
dduId != mt1) || (rchEntry.
rosId != mi1))
461 rch = rchEntry.
robId;
470 irob = entryList.begin();
471 while (irob != iend) {
475 if (robEntry.
robId != rob) {
476 std::cout <<
"ROB mismatch " << rob <<
" " << robEntry.
robId << std::endl;
478 tdc = robEntry.
tdcId;
483 fullMap->
insertReadOutGeometryLink(ddu, ros, rch, tdc, tch, wha, sta, sea, qua, lay, cel);
491 std::stringstream
name;
497 std::stringstream
name;
505 localCache->mType.insert(0, 0);
509 std::vector<int> cellKey;
511 std::vector<int> chanKey;
518 std::map<int, std::vector<int>*> dduEntries;
519 for (entryNum = 0; entryNum < entryMax; entryNum++) {
524 if (
key > 0x3fffffff) {
525 if (link.
tdcId > 0x3fffffff) {
536 chanKey.push_back(link.
dduId);
537 chanKey.push_back(link.
rosId);
538 chanKey.push_back(link.
robId);
539 chanKey.push_back(link.
tdcId);
542 localCache->rgBuf.insert(chanKey.begin(), chanKey.end(), entryNum);
545 cellKey.push_back(link.
wheelId);
548 cellKey.push_back(link.
slId);
549 cellKey.push_back(link.
layerId);
550 cellKey.push_back(link.
cellId);
552 localCache->grBuf.insert(cellKey.begin(), cellKey.end(), entryNum);
555 if (
key == robMapKey) {
557 chanKey.push_back(link.
rosId);
558 chanKey.push_back(link.
tdcId);
560 localCache->rgROB.insert(chanKey.begin(), chanKey.end(), entryNum);
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));
573 robMLgr->push_back(entryNum);
576 if (
key == rosMapKey) {
578 chanKey.push_back(link.
rosId);
579 chanKey.push_back(link.
robId);
580 localCache->rgROS.insert(chanKey.begin(), chanKey.end(), entryNum);
583 cellKey.push_back(link.
cellId);
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));
592 rosMLgr->push_back(entryNum);
595 if ((
key < 0x3fffffff) && (
val > 0x3fffffff)) {
597 chanKey.push_back(link.
dduId);
598 chanKey.push_back(link.
rosId);
599 localCache->rgDDU.insert(chanKey.begin(), chanKey.end(), entryNum);
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>));
607 dduMLgr = dduEntIter->second;
608 dduMLgr->push_back(entryNum);
613 for (entryNum = 0; entryNum < entryMax; entryNum++) {
616 if (
key != rosMapKey)
618 int mapId = link.
rosId;
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;
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;
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));
650 dduMLgr->push_back(ientry);
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;
661 localCache->rgBuf.clear();
662 localCache->grBuf.clear();
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
DTBufferTree< int, int > rgDDU
int station() const
Return the station number.
int def(FILE *, FILE *, int)
std::string robMapVersion
std::string mapNameRG() const
edm::ConstRespectingPtr< DTBufferTree< int, int > > rgBuf
int superLayer() const
Return the superlayer number.
bool set(std::unique_ptr< T > iNewValue) const
int wire() const
Return the wire number.
DTBufferTree< int, int > rgBuf
const DTReadOutMapping * fullMap() const
Expand to full map.
std::vector< DTReadOutGeometryLink >::const_iterator const_iterator
Access methods to the connections.
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
void reset()
unsets the value and deletes the memory
std::vector< DTReadOutGeometryLink > readOutChannelDriftTubeMap
edm::ConstRespectingPtr< DTBufferTree< int, int > > grBuf
const std::string & mapRobRos() const
const_iterator begin() const
edm::AtomicPtrCache< DTReadOutMappingCache > const & atomicCache() 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
DTBufferTree< int, int > rgROB
DTBufferTree< int, int > mType
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROB
void cacheMap() const
read and store full content
uint8_t channelId(const VFATFrame &frame)
retrieve this channel identifier
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grROS
const_iterator end() const
static DTReadOutMapping * expandMap(const DTReadOutMapping &compMap)
int layer() const
Return the layer number.
int find(ElementKey fKey, ElementKey lKey, typename DTBufferTreeTrait< Content >::outputTypeOfConstFind &cont) const
int wheel() const
Return the wheel number.
DTBufferTree< int, std::unique_ptr< std::vector< int > > > grDDU
int insert(ElementKey fKey, ElementKey lKey, Content cont)
std::string cellMapVersion
DTBufferTree< int, int > grBuf
DTBufferTree< int, int > rgROS
std::string mapNameGR() const