14 #include "xercesc/framework/StdOutFormatTarget.hpp"
15 #include "xercesc/framework/LocalFileFormatTarget.hpp"
16 #include "xercesc/parsers/XercesDOMParser.hpp"
17 #include "xercesc/dom/DOM.hpp"
18 #include "xercesc/dom/DOMException.hpp"
19 #include "xercesc/dom/DOMImplementation.hpp"
20 #include "xercesc/sax/HandlerBase.hpp"
21 #include "xercesc/util/XMLString.hpp"
22 #include "xercesc/util/PlatformUtils.hpp"
23 #include "xercesc/util/XercesDefs.hpp"
24 XERCES_CPP_NAMESPACE_USE
43 XMLPlatformUtils::Initialize();
46 parser =
new XercesDOMParser();
47 parser->setValidationScheme(XercesDOMParser::Val_Auto);
48 parser->setDoNamespaces(
false);
59 std::stringstream strStream;
63 if(type==
"iCharge") outWidth = 1;
64 if(type==
"iEta") outWidth = 2;
65 if(type==
"iPt") outWidth = 9;
66 if(type==
"meanDistPhi"){
76 strStream <<
"#<header> V1 "<<totalInWidth<<
" "<<outWidth<<
" </header> "<<std::endl;
83 if(type==
"iCharge") out = it->key().theCharge==-1 ? 0:1;
84 if(type==
"iEta") out = it->key().theEtaCode;
85 if(type==
"iPt") out = it->key().thePtCode;
86 if(type==
"meanDistPhi"){
89 out = (1<<(outWidth-1)) + it->meanDistPhiValue(iLayer,iRefLayer);
90 strStream<<in<<
" "<<out<<std::endl;
99 out = it->pdfValue(iLayer,iRefLayer,iPdf);
100 strStream<<in<<
" "<<out<<std::endl;
106 if(type!=
"meanDistPhi" && type!=
"pdf"){
107 strStream<<in<<
" "<<out<<std::endl;
112 lut->
read(strStream);
122 xercesc::DOMDocument*
doc =
parser->getDocument();
125 unsigned int nElem = doc->getElementsByTagName(
_toDOMS(
"GP"))->getLength();
128 edm::LogError(
"critical")<<
"No GoldenPattern items: GP found"<<std::endl;
133 DOMElement* aGPElement = 0;
134 for(
unsigned int iItem=0;iItem<nElem;++iItem){
135 aNode = doc->getElementsByTagName(
_toDOMS(
"GP"))->item(iItem);
136 aGPElement =
static_cast<DOMElement *
>(aNode);
138 std::ostringstream stringStr;
142 stringStr<<
"iPt"<<
index;
144 if(aGPElement->getAttributeNode(
_toDOMS(stringStr.str().c_str()))){
145 aGP =
buildGP(aGPElement,index);
146 if(aGP)
aGPs.push_back(aGP);
150 if(aGP)
aGPs.push_back(aGP);
164 std::ostringstream stringStr;
165 if(index>0) stringStr<<
"iPt"<<
index;
166 else stringStr.str(
"iPt");
168 unsigned int iPt = std::atoi(
_toString(aGPElement->getAttribute(
_toDOMS(stringStr.str().c_str()))).c_str());
171 int iEta = std::atoi(
_toString(aGPElement->getAttribute(
_toDOMS(
"iEta"))).c_str());
172 int iCharge = std::atoi(
_toString(aGPElement->getAttribute(
_toDOMS(
"iCharge"))).c_str());
174 unsigned int nLayers = aGPElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
177 DOMElement* aLayerElement = 0;
178 DOMElement* aItemElement = 0;
184 for(
unsigned int iLayer=0;iLayer<nLayers;++iLayer){
185 aNode = aGPElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iLayer);
186 aLayerElement =
static_cast<DOMElement *
>(aNode);
188 unsigned int nItems = aLayerElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->getLength();
191 for(
unsigned int iItem=0;iItem<nItems;++iItem){
192 aNode = aLayerElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->item(iItem);
193 aItemElement =
static_cast<DOMElement *
>(aNode);
194 val = std::atoi(
_toString(aItemElement->getAttribute(
_toDOMS(
"meanDistPhi"))).c_str());
195 meanDistPhi1D[iItem] = val;
197 meanDistPhi2D[iLayer] = meanDistPhi1D;
201 if(index>0) stringStr<<
"value"<<
index;
202 else stringStr.str(
"value");
203 nItems = aLayerElement->getElementsByTagName(
_toDOMS(
"PDF"))->getLength();
209 aItemElement =
static_cast<DOMElement *
>(aNode);
210 val = std::atoi(
_toString(aItemElement->getAttribute(
_toDOMS(stringStr.str().c_str()))).c_str());
213 pdf2D[iRefLayer] = pdf1D;
215 pdf3D[iLayer] = pdf2D;
218 Key aKey(iEta,iPt,iCharge);
228 unsigned int iProcessor,
240 unsigned int nElem =
doc->getElementsByTagName(
_toDOMS(
"OMTF_Events"))->getLength();
243 DOMNode *aNode =
doc->getElementsByTagName(
_toDOMS(
"OMTF_Events"))->item(0);
244 DOMElement* aOMTFElement =
static_cast<DOMElement *
>(aNode);
245 DOMElement* aEventElement = 0;
246 DOMElement* aBxElement = 0;
247 DOMElement* aProcElement = 0;
248 DOMElement* aLayerElement = 0;
249 DOMElement* aHitElement = 0;
251 int val = 0,
input=0;
253 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"Event"))->getLength();
256 edm::LogError(
"critical")<<
"not enough events found: "<<nElem<<std::endl;
260 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"Event"))->item(iEvent);
261 aEventElement =
static_cast<DOMElement *
>(aNode);
263 unsigned int nBX = aEventElement->getElementsByTagName(
_toDOMS(
"bx"))->getLength();
265 aNode = aEventElement->getElementsByTagName(
_toDOMS(
"bx"))->item(0);
266 aBxElement =
static_cast<DOMElement *
>(aNode);
268 unsigned int nProc = aEventElement->getElementsByTagName(
_toDOMS(
"Processor"))->getLength();
269 unsigned int aProcID = 99;
270 assert(nProc>=iProcessor);
271 for(
unsigned int aProc=0;aProc<nProc;++aProc){
272 aNode = aBxElement->getElementsByTagName(
_toDOMS(
"Processor"))->item(aProc);
273 aProcElement =
static_cast<DOMElement *
>(aNode);
274 aProcID = std::atoi(
_toString(aProcElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
275 if(aProcID==iProcessor)
break;
277 if(aProcID!=iProcessor)
return input2D;
279 unsigned int nLayersHit = aProcElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
280 assert(nLayersHit<=m_omtf_config->nLayers);
284 for(
unsigned int iLayer=0;iLayer<nLayersHit;++iLayer){
285 aNode = aProcElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iLayer);
286 aLayerElement =
static_cast<DOMElement *
>(aNode);
287 aLogicLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iLayer"))).c_str());
288 nElem = aLayerElement->getElementsByTagName(
_toDOMS(
"Hit"))->getLength();
290 for(
unsigned int iHit=0;iHit<nElem;++iHit){
291 aNode = aLayerElement->getElementsByTagName(
_toDOMS(
"Hit"))->item(iHit);
292 aHitElement =
static_cast<DOMElement *
>(aNode);
293 val = std::atoi(
_toString(aHitElement->getAttribute(
_toDOMS(
"iPhi"))).c_str());
294 if(readEta) val = std::atoi(
_toString(aHitElement->getAttribute(
_toDOMS(
"iEta"))).c_str());
296 input1D[
input] = val;
298 input2D[aLogicLayer] = input1D;
309 xercesc::DOMDocument*
doc =
parser->getDocument();
311 unsigned int nElem = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->getLength();
316 DOMNode *aNode = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->item(0);
317 DOMElement* aOMTFElement =
static_cast<DOMElement *
>(aNode);
323 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->getLength();
325 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->item(0);
326 DOMElement* aElement =
static_cast<DOMElement *
>(aNode);
328 unsigned int nPdfAddrBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfAddrBits"))).c_str());
329 unsigned int nPdfValBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfValBits"))).c_str());
330 unsigned int nHitsPerLayer = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nHitsPerLayer"))).c_str());
331 unsigned int nPhiBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPhiBits"))).c_str());
333 unsigned int nRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nRefHits"))).c_str());
334 unsigned int nTestRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nTestRefHits"))).c_str());
335 unsigned int nProcessors = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nProcessors"))).c_str());
336 unsigned int nLogicRegions = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nLogicRegions"))).c_str());
337 unsigned int nInputs = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
338 unsigned int nLayers = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nLayers"))).c_str());
339 unsigned int nRefLayers = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nRefLayers"))).c_str());
340 unsigned int nGoldenPatterns = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nGoldenPatterns"))).c_str());
360 std::vector<int> sectorsStart(3*6), sectorsEnd(3*6);
361 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->getLength();
362 DOMElement* aConnectionElement = 0;
363 for(uint
i=0;
i<nElem;++
i){
364 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->item(
i);
365 aConnectionElement =
static_cast<DOMElement *
>(aNode);
366 unsigned int iProcessor = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
367 unsigned int barrelMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMin"))).c_str());
368 unsigned int barrelMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMax"))).c_str());
369 unsigned int endcap10DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMin"))).c_str());
370 unsigned int endcap10DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMax"))).c_str());
371 unsigned int endcap20DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMin"))).c_str());
372 unsigned int endcap20DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMax"))).c_str());
374 sectorsStart[iProcessor] = barrelMin;
375 sectorsStart[iProcessor + 6] = endcap10DegMin;
376 sectorsStart[iProcessor +12] = endcap20DegMin;
378 sectorsEnd[iProcessor] = barrelMax;
379 sectorsEnd[iProcessor + 6] = endcap10DegMax;
380 sectorsEnd[iProcessor + 12] = endcap20DegMax;
387 std::vector<L1TMuonOverlapParams::LayerMapNode> aLayerMapVec;
390 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->getLength();
391 DOMElement* aLayerElement = 0;
392 for(uint
i=0;
i<nElem;++
i){
393 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->item(
i);
394 aLayerElement =
static_cast<DOMElement *
>(aNode);
395 unsigned int hwNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"hwNumber"))).c_str());
396 unsigned int logicNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
397 unsigned int isBendingLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"bendingLayer"))).c_str());
398 unsigned int iConnectedLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"connectedToLayer"))).c_str());
403 aLayerMapVec.push_back(aLayerMapNode);
408 std::vector<L1TMuonOverlapParams::RefLayerMapNode> aRefLayerMapVec;
411 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->getLength();
412 DOMElement* aRefLayerElement = 0;
413 for(uint
i=0;
i<nElem;++
i){
414 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->item(
i);
415 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
416 unsigned int refLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"refLayer"))).c_str());
417 unsigned int logicNumber = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
420 aRefLayerMapVec.push_back(aRefLayerNode);
425 std::vector<int> aGlobalPhiStartVec(nProcessors*nRefLayers);
427 std::vector<L1TMuonOverlapParams::RefHitNode> aRefHitMapVec(nProcessors*nRefHits);
430 std::vector<L1TMuonOverlapParams::LayerInputNode> aLayerInputMapVec(nProcessors*nLogicRegions*nLayers);
433 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->getLength();
434 assert(nElem==nProcessors);
435 DOMElement* aProcessorElement = 0;
436 for(uint
i=0;
i<nElem;++
i){
437 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->item(
i);
438 aProcessorElement =
static_cast<DOMElement *
>(aNode);
439 unsigned int iProcessor = std::atoi(
_toString(aProcessorElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
440 unsigned int nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->getLength();
441 assert(nElem1==nRefLayers);
442 DOMElement* aRefLayerElement = 0;
443 for(uint
ii=0;
ii<nElem1;++
ii){
444 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->item(
ii);
445 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
446 unsigned int iRefLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
447 int iPhi = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iGlobalPhiStart"))).c_str());
448 aGlobalPhiStartVec[iRefLayer + iProcessor*nRefLayers] = iPhi;
451 nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->getLength();
452 assert( (iProcessor==0 && nElem1==nRefHits) || (iProcessor!=0 && nElem1==0) );
453 DOMElement* aRefHitElement = 0;
454 for(uint
ii=0;
ii<nElem1;++
ii){
455 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->item(
ii);
456 aRefHitElement =
static_cast<DOMElement *
>(aNode);
457 unsigned int iRefHit = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefHit"))).c_str());
458 int iPhiMin = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMin"))).c_str());
459 int iPhiMax = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMax"))).c_str());
460 unsigned int iInput = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iInput"))).c_str());
461 unsigned int iRegion = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
462 unsigned int iRefLayer = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
467 aRefHitNode.
iInput = iInput;
471 for (
unsigned int ip=0; ip<nProcessors; ++ip) aRefHitMapVec[iRefHit + ip*nRefHits] = aRefHitNode;
474 unsigned int nElem2 = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->getLength();
475 assert( (iProcessor==0 && nElem2==nLogicRegions) || (iProcessor!=0 && nElem2==0) );
476 DOMElement* aRegionElement = 0;
477 for(uint
ii=0;
ii<nElem2;++
ii){
478 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->item(
ii);
479 aRegionElement =
static_cast<DOMElement *
>(aNode);
480 unsigned int iRegion = std::atoi(
_toString(aRegionElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
481 unsigned int nElem3 = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
483 DOMElement* aLayerElement = 0;
484 for(uint iii=0;iii<nElem3;++iii){
485 aNode = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iii);
486 aLayerElement =
static_cast<DOMElement *
>(aNode);
487 unsigned int iLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iLayer"))).c_str());
488 unsigned int iFirstInput = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iFirstInput"))).c_str());
489 unsigned int nInputs = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
490 aLayerInputNode.
iLayer = iLayer;
492 aLayerInputNode.
nInputs = nInputs;
494 for (
unsigned int ip=0; ip<nProcessors; ++ip) aLayerInputMapVec[iLayer + iRegion*nLayers + ip*nLayers*nLogicRegions] = aLayerInputNode;
510 xercesc::DOMDocument*
doc =
parser->getDocument();
512 unsigned int nElem = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->getLength();
517 DOMNode *aNode = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->item(0);
518 DOMElement* aOMTFElement =
static_cast<DOMElement *
>(aNode);
522 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->getLength();
524 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->item(0);
525 DOMElement* aElement =
static_cast<DOMElement *
>(aNode);
527 float minPdfVal = 0.001;
528 unsigned int nPdfAddrBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfAddrBits"))).c_str());
529 unsigned int nPdfValBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfValBits"))).c_str());
530 unsigned int nHitsPerLayer = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nHitsPerLayer"))).c_str());
531 unsigned int nPhiBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPhiBits"))).c_str());
533 unsigned int nRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nRefHits"))).c_str());
534 unsigned int nTestRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nTestRefHits"))).c_str());
535 unsigned int nProcessors = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nProcessors"))).c_str());
536 unsigned int nLogicRegions = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nLogicRegions"))).c_str());
537 unsigned int nInputs = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
538 unsigned int nGoldenPatterns = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nGoldenPatterns"))).c_str());
563 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->getLength();
564 DOMElement* aConnectionElement = 0;
565 for(uint
i=0;
i<nElem;++
i){
566 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->item(
i);
567 aConnectionElement =
static_cast<DOMElement *
>(aNode);
568 unsigned int iProcessor = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
569 unsigned int barrelMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMin"))).c_str());
570 unsigned int barrelMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMax"))).c_str());
571 unsigned int endcap10DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMin"))).c_str());
572 unsigned int endcap10DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMax"))).c_str());
573 unsigned int endcap20DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMin"))).c_str());
574 unsigned int endcap20DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMax"))).c_str());
586 unsigned int nLogicLayers = 0;
587 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->getLength();
588 DOMElement* aLayerElement = 0;
589 for(uint
i=0;
i<nElem;++
i){
590 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->item(
i);
591 aLayerElement =
static_cast<DOMElement *
>(aNode);
592 unsigned int hwNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"hwNumber"))).c_str());
593 unsigned int logicNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
594 unsigned int isBendingLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"bendingLayer"))).c_str());
595 unsigned int iConnectedLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"connectedToLayer"))).c_str());
599 if(isBendingLayer) aConfig->
bendingLayers.insert(logicNumber);
600 if(nLogicLayers<logicNumber) nLogicLayers = logicNumber;
606 unsigned int nRefLayers = 0;
607 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->getLength();
609 DOMElement* aRefLayerElement = 0;
610 for(uint
i=0;
i<nElem;++
i){
611 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->item(
i);
612 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
613 unsigned int refLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"refLayer"))).c_str());
614 unsigned int logicNumber = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
616 if(nRefLayers<logicNumber) nRefLayers = refLayer;
638 std::vector<std::vector<std::pair<int,int> > > aRefHit2D;
648 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->getLength();
650 DOMElement* aProcessorElement = 0;
651 for(uint
i=0;
i<nElem;++
i){
652 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->item(
i);
653 aProcessorElement =
static_cast<DOMElement *
>(aNode);
654 unsigned int iProcessor = std::atoi(
_toString(aProcessorElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
655 unsigned int nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->getLength();
657 DOMElement* aRefLayerElement = 0;
658 for(uint
ii=0;
ii<nElem1;++
ii){
659 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->item(
ii);
660 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
661 unsigned int iRefLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
662 int iPhi = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iGlobalPhiStart"))).c_str());
666 nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->getLength();
667 assert((iProcessor==0 && nElem1==nRefHits) || (iProcessor!=0 && nElem1==0) );
668 DOMElement* aRefHitElement = 0;
669 for(uint
ii=0;
ii<nElem1;++
ii){
670 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->item(
ii);
671 aRefHitElement =
static_cast<DOMElement *
>(aNode);
672 unsigned int iRefHit = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefHit"))).c_str());
673 int iPhiMin = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMin"))).c_str());
674 int iPhiMax = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMax"))).c_str());
675 unsigned int iInput = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iInput"))).c_str());
676 unsigned int iRegion = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
677 unsigned int iRefLayer = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
689 unsigned int nElem2 = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->getLength();
690 assert( (iProcessor==0 && nElem2==nLogicRegions) || (iProcessor!=0 && nElem2==0) );
691 DOMElement* aRegionElement = 0;
692 for(uint
ii=0;
ii<nElem2;++
ii){
693 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->item(
ii);
694 aRegionElement =
static_cast<DOMElement *
>(aNode);
695 unsigned int iRegion = std::atoi(
_toString(aRegionElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
696 unsigned int nElem3 = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
698 DOMElement* aLayerElement = 0;
699 for(uint iii=0;iii<nElem3;++iii){
700 aNode = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iii);
701 aLayerElement =
static_cast<DOMElement *
>(aNode);
702 unsigned int iLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iLayer"))).c_str());
703 unsigned int iFirstInput = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iFirstInput"))).c_str());
704 unsigned int nInputs = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
705 m_omtf_config->
connections[iProcessor][iRegion][iLayer] = std::pair<unsigned int, unsigned int>(iFirstInput,nInputs);
709 m_omtf_config->
connections[iProcessorTmp][iRegion][iLayer] = std::pair<unsigned int, unsigned int>(iFirstInput,nInputs);
std::vector< unsigned int > endcap20DegMax
std::map< int, int > logicToLogic
std::vector< unsigned int > endcap10DegMin
void setLayerMap(const std::vector< LayerMapNode > &aVector)
Connections definitions.
GoldenPattern * buildGP(xercesc::DOMElement *aGPElement, unsigned int index=0)
void setConnectedSectorsEnd(const std::vector< int > &aVector)
xercesc::DOMDocument * doc
unsigned int hwNumber
short layer number used within OMTF emulator
std::vector< int > vector1D
void setRefLayerMap(const std::vector< RefLayerMapNode > &aVector)
std::string _toString(const XMLCh *toTranscode)
OMTFConfiguration * m_omtf_config
unsigned int logicNumber
logic numer of the layer
std::vector< std::vector< int > > readEvent(unsigned int iEvent=0, unsigned int iProcessor=0, bool readEta=false)
std::vector< std::vector< int > > processorPhiVsRefLayer
unsigned int nLogicRegions
std::map< int, int > logicToHwLayer
std::vector< unsigned int > endcap20DegMin
static std::string const input
std::vector< int > refToLogicNumber
std::vector< unsigned int > endcap10DegMax
unsigned int nPdfAddrBits
int read(std::istream &stream)
std::vector< vector1D > vector2D
std::vector< vector2D > vector3D
void setPdf(const vector3D &aPdf)
XMLConfigReader(OMTFConfiguration *omtf_config)
void setGeneralParams(const std::vector< int > ¶msVec)
unsigned int nTestRefHits
XMLCh * transcode(const T &fInput)
unsigned int nHitsPerLayer
std::vector< std::vector< RefHitDef > > refHitsDefs
std::vector< std::pair< unsigned int, unsigned int > > vector1D_A
Map of connections.
void readLUT(l1t::LUT *lut, const std::string &type)
void readConfig(const std::string fName)
bool bendingLayer
Is this a bending layers?
void setConnectedSectorsStart(const std::vector< int > &aVector)
xercesc::XercesDOMParser * parser
std::vector< unsigned int > barrelMin
unsigned int refLayer
Reference layer number.
void setGlobalPhiStartMap(const std::vector< int > &aVector)
void setLayerInputMap(const std::vector< LayerInputNode > &aVector)
std::set< int > bendingLayers
std::map< int, int > hwToLogicLayer
std::vector< GoldenPattern * > aGPs
Cache with GPs read.
std::vector< GoldenPattern * > readPatterns()
void setRefHitMap(const std::vector< RefHitNode > &aVector)
std::vector< std::vector< double > > tmp
void setMeanDistPhi(const vector2D &aMeanDistPhi)
unsigned int logicNumber
Corresponding logical layer number.
unsigned int connectedToLayer
XMLCh * _toDOMS(std::string temp)
void setFwVersion(unsigned fwVersion)
unsigned int nGoldenPatterns
std::vector< vector1D_A > vector2D_A
std::vector< std::vector< std::vector< std::pair< int, int > > > > regionPhisVsRefLayerVsInput
std::vector< unsigned int > barrelMax