15 #include "xercesc/framework/StdOutFormatTarget.hpp"
16 #include "xercesc/framework/LocalFileFormatTarget.hpp"
17 #include "xercesc/parsers/XercesDOMParser.hpp"
18 #include "xercesc/dom/DOM.hpp"
19 #include "xercesc/dom/DOMException.hpp"
20 #include "xercesc/dom/DOMImplementation.hpp"
21 #include "xercesc/sax/HandlerBase.hpp"
22 #include "xercesc/util/XMLString.hpp"
23 #include "xercesc/util/PlatformUtils.hpp"
24 #include "xercesc/util/XercesDefs.hpp"
25 XERCES_CPP_NAMESPACE_USE
44 XMLPlatformUtils::Initialize();
47 parser =
new XercesDOMParser();
48 parser->setValidationScheme(XercesDOMParser::Val_Auto);
49 parser->setDoNamespaces(
false);
60 std::stringstream strStream;
64 if(type==
"iCharge") outWidth = 1;
65 if(type==
"iEta") outWidth = 2;
66 if(type==
"iPt") outWidth = 6;
67 if(type==
"meanDistPhi"){
77 strStream <<
"#<header> V1 "<<totalInWidth<<
" "<<outWidth<<
" </header> "<<std::endl;
84 if(type==
"iCharge") out = it->key().theCharge + 1*(it->key().theCharge<0);
85 if(type==
"iEta") out = it->key().theEtaCode;
86 if(type==
"iPt") out = it->key().thePtCode;
87 if(type==
"meanDistPhi"){
90 out = (1<<(outWidth-1)) + it->meanDistPhiValue(iLayer,iRefLayer);
91 strStream<<in<<
" "<<out<<std::endl;
100 out = it->pdfValue(iLayer,iRefLayer,iPdf);
101 strStream<<in<<
" "<<out<<std::endl;
107 if(type!=
"meanDistPhi" && type!=
"pdf"){
108 strStream<<in<<
" "<<out<<std::endl;
113 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);
163 std::ostringstream stringStr;
164 if(index>0) stringStr<<
"iPt"<<
index;
165 else stringStr.str(
"iPt");
167 unsigned int iPt = std::atoi(
_toString(aGPElement->getAttribute(
_toDOMS(stringStr.str().c_str()))).c_str());
170 int iEta = std::atoi(
_toString(aGPElement->getAttribute(
_toDOMS(
"iEta"))).c_str());
171 int iCharge = std::atoi(
_toString(aGPElement->getAttribute(
_toDOMS(
"iCharge"))).c_str());
173 unsigned int nLayers = aGPElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
176 DOMElement* aLayerElement = 0;
177 DOMElement* aItemElement = 0;
183 for(
unsigned int iLayer=0;iLayer<nLayers;++iLayer){
184 aNode = aGPElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iLayer);
185 aLayerElement =
static_cast<DOMElement *
>(aNode);
187 unsigned int nItems = aLayerElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->getLength();
190 for(
unsigned int iItem=0;iItem<nItems;++iItem){
191 aNode = aLayerElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->item(iItem);
192 aItemElement =
static_cast<DOMElement *
>(aNode);
193 val = std::atoi(
_toString(aItemElement->getAttribute(
_toDOMS(
"meanDistPhi"))).c_str());
194 meanDistPhi1D[iItem] = val;
196 meanDistPhi2D[iLayer] = meanDistPhi1D;
200 if(index>0) stringStr<<
"value"<<
index;
201 else stringStr.str(
"value");
202 nItems = aLayerElement->getElementsByTagName(
_toDOMS(
"PDF"))->getLength();
208 aItemElement =
static_cast<DOMElement *
>(aNode);
209 val = std::atoi(
_toString(aItemElement->getAttribute(
_toDOMS(stringStr.str().c_str()))).c_str());
212 pdf2D[iRefLayer] = pdf1D;
214 pdf3D[iLayer] = pdf2D;
217 Key aKey(iEta,iPt,iCharge);
227 unsigned int iProcessor,
239 unsigned int nElem =
doc->getElementsByTagName(
_toDOMS(
"OMTF_Events"))->getLength();
242 DOMNode *aNode =
doc->getElementsByTagName(
_toDOMS(
"OMTF_Events"))->item(0);
243 DOMElement* aOMTFElement =
static_cast<DOMElement *
>(aNode);
244 DOMElement* aEventElement = 0;
245 DOMElement* aBxElement = 0;
246 DOMElement* aProcElement = 0;
247 DOMElement* aLayerElement = 0;
248 DOMElement* aHitElement = 0;
250 int val = 0,
input=0;
252 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"Event"))->getLength();
255 edm::LogError(
"critical")<<
"not enough events found: "<<nElem<<std::endl;
259 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"Event"))->item(iEvent);
260 aEventElement =
static_cast<DOMElement *
>(aNode);
262 unsigned int nBX = aEventElement->getElementsByTagName(
_toDOMS(
"bx"))->getLength();
264 aNode = aEventElement->getElementsByTagName(
_toDOMS(
"bx"))->item(0);
265 aBxElement =
static_cast<DOMElement *
>(aNode);
267 unsigned int nProc = aEventElement->getElementsByTagName(
_toDOMS(
"Processor"))->getLength();
268 unsigned int aProcID = 99;
269 assert(nProc>=iProcessor);
270 for(
unsigned int aProc=0;aProc<nProc;++aProc){
271 aNode = aBxElement->getElementsByTagName(
_toDOMS(
"Processor"))->item(aProc);
272 aProcElement =
static_cast<DOMElement *
>(aNode);
273 aProcID = std::atoi(
_toString(aProcElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
274 if(aProcID==iProcessor)
break;
276 if(aProcID!=iProcessor)
return input2D;
278 unsigned int nLayersHit = aProcElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
283 for(
unsigned int iLayer=0;iLayer<nLayersHit;++iLayer){
284 aNode = aProcElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iLayer);
285 aLayerElement =
static_cast<DOMElement *
>(aNode);
286 aLogicLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iLayer"))).c_str());
287 nElem = aLayerElement->getElementsByTagName(
_toDOMS(
"Hit"))->getLength();
289 for(
unsigned int iHit=0;iHit<nElem;++iHit){
290 aNode = aLayerElement->getElementsByTagName(
_toDOMS(
"Hit"))->item(iHit);
291 aHitElement =
static_cast<DOMElement *
>(aNode);
292 val = std::atoi(
_toString(aHitElement->getAttribute(
_toDOMS(
"iPhi"))).c_str());
293 if(readEta) val = std::atoi(
_toString(aHitElement->getAttribute(
_toDOMS(
"iEta"))).c_str());
295 input1D[
input] = val;
297 input2D[aLogicLayer] = input1D;
308 xercesc::DOMDocument*
doc =
parser->getDocument();
310 unsigned int nElem = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->getLength();
315 DOMNode *aNode = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->item(0);
316 DOMElement* aOMTFElement =
static_cast<DOMElement *
>(aNode);
322 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->getLength();
324 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->item(0);
325 DOMElement* aElement =
static_cast<DOMElement *
>(aNode);
327 unsigned int nPdfAddrBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfAddrBits"))).c_str());
328 unsigned int nPdfValBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfValBits"))).c_str());
329 unsigned int nHitsPerLayer = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nHitsPerLayer"))).c_str());
330 unsigned int nPhiBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPhiBits"))).c_str());
332 unsigned int nRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nRefHits"))).c_str());
333 unsigned int nTestRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nTestRefHits"))).c_str());
334 unsigned int nProcessors = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nProcessors"))).c_str());
335 unsigned int nLogicRegions = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nLogicRegions"))).c_str());
336 unsigned int nInputs = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
337 unsigned int nLayers = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nLayers"))).c_str());
338 unsigned int nRefLayers = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nRefLayers"))).c_str());
339 unsigned int nGoldenPatterns = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nGoldenPatterns"))).c_str());
359 std::vector<int> sectorsStart(3*6), sectorsEnd(3*6);
360 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->getLength();
361 DOMElement* aConnectionElement = 0;
362 for(uint
i=0;
i<nElem;++
i){
363 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->item(
i);
364 aConnectionElement =
static_cast<DOMElement *
>(aNode);
365 unsigned int iProcessor = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
366 unsigned int barrelMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMin"))).c_str());
367 unsigned int barrelMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMax"))).c_str());
368 unsigned int endcap10DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMin"))).c_str());
369 unsigned int endcap10DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMax"))).c_str());
370 unsigned int endcap20DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMin"))).c_str());
371 unsigned int endcap20DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMax"))).c_str());
373 sectorsStart[iProcessor] = barrelMin;
374 sectorsStart[iProcessor + 6] = endcap10DegMin;
375 sectorsStart[iProcessor +12] = endcap20DegMin;
377 sectorsEnd[iProcessor] = barrelMax;
378 sectorsEnd[iProcessor + 6] = endcap10DegMax;
379 sectorsEnd[iProcessor + 12] = endcap20DegMax;
386 std::vector<L1TMuonOverlapParams::LayerMapNode> aLayerMapVec;
389 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->getLength();
390 DOMElement* aLayerElement = 0;
391 for(uint
i=0;
i<nElem;++
i){
392 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->item(
i);
393 aLayerElement =
static_cast<DOMElement *
>(aNode);
394 unsigned int hwNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"hwNumber"))).c_str());
395 unsigned int logicNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
396 unsigned int isBendingLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"bendingLayer"))).c_str());
397 unsigned int iConnectedLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"connectedToLayer"))).c_str());
402 aLayerMapVec.push_back(aLayerMapNode);
407 std::vector<L1TMuonOverlapParams::RefLayerMapNode> aRefLayerMapVec;
410 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->getLength();
411 DOMElement* aRefLayerElement = 0;
412 for(uint
i=0;
i<nElem;++
i){
413 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->item(
i);
414 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
415 unsigned int refLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"refLayer"))).c_str());
416 unsigned int logicNumber = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
419 aRefLayerMapVec.push_back(aRefLayerNode);
424 std::vector<int> aGlobalPhiStartVec(nProcessors*nRefLayers);
426 std::vector<L1TMuonOverlapParams::RefHitNode> aRefHitMapVec(nProcessors*nRefHits);
429 std::vector<L1TMuonOverlapParams::LayerInputNode> aLayerInputMapVec(nProcessors*nLogicRegions*nLayers);
432 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->getLength();
433 assert(nElem==nProcessors);
434 DOMElement* aProcessorElement = 0;
435 for(uint
i=0;
i<nElem;++
i){
436 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->item(
i);
437 aProcessorElement =
static_cast<DOMElement *
>(aNode);
438 unsigned int iProcessor = std::atoi(
_toString(aProcessorElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
439 unsigned int nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->getLength();
440 assert(nElem1==nRefLayers);
441 DOMElement* aRefLayerElement = 0;
442 for(uint
ii=0;
ii<nElem1;++
ii){
443 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->item(
ii);
444 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
445 unsigned int iRefLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
446 int iPhi = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iGlobalPhiStart"))).c_str());
447 aGlobalPhiStartVec[iRefLayer + iProcessor*nRefLayers] = iPhi;
450 nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->getLength();
452 DOMElement* aRefHitElement = 0;
453 for(uint
ii=0;
ii<nElem1;++
ii){
454 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->item(
ii);
455 aRefHitElement =
static_cast<DOMElement *
>(aNode);
456 unsigned int iRefHit = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefHit"))).c_str());
457 int iPhiMin = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMin"))).c_str());
458 int iPhiMax = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMax"))).c_str());
459 unsigned int iInput = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iInput"))).c_str());
460 unsigned int iRegion = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
461 unsigned int iRefLayer = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
466 aRefHitNode.
iInput = iInput;
469 aRefHitMapVec[iRefHit + iProcessor*nRefHits] = aRefHitNode;
472 unsigned int nElem2 = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->getLength();
473 assert(nElem2==nProcessors);
474 DOMElement* aRegionElement = 0;
475 for(uint
ii=0;
ii<nElem2;++
ii){
476 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->item(
ii);
477 aRegionElement =
static_cast<DOMElement *
>(aNode);
478 unsigned int iRegion = std::atoi(
_toString(aRegionElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
479 unsigned int nElem3 = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
481 DOMElement* aLayerElement = 0;
482 for(uint iii=0;iii<nElem3;++iii){
483 aNode = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iii);
484 aLayerElement =
static_cast<DOMElement *
>(aNode);
485 unsigned int iLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iLayer"))).c_str());
486 unsigned int iFirstInput = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iFirstInput"))).c_str());
487 unsigned int nInputs = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
488 aLayerInputNode.
iLayer = iLayer;
490 aLayerInputNode.
nInputs = nInputs;
491 aLayerInputMapVec[iLayer + iRegion*nLayers + iProcessor*nLayers*nLogicRegions] = aLayerInputNode;
507 xercesc::DOMDocument*
doc =
parser->getDocument();
509 unsigned int nElem = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->getLength();
514 DOMNode *aNode = doc->getElementsByTagName(
_toDOMS(
"OMTF"))->item(0);
515 DOMElement* aOMTFElement =
static_cast<DOMElement *
>(aNode);
518 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->getLength();
520 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"GlobalData"))->item(0);
521 DOMElement* aElement =
static_cast<DOMElement *
>(aNode);
523 float minPdfVal = 0.001;
524 unsigned int nPdfAddrBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfAddrBits"))).c_str());
525 unsigned int nPdfValBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPdfValBits"))).c_str());
526 unsigned int nHitsPerLayer = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nHitsPerLayer"))).c_str());
527 unsigned int nPhiBits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nPhiBits"))).c_str());
529 unsigned int nRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nRefHits"))).c_str());
530 unsigned int nTestRefHits = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nTestRefHits"))).c_str());
531 unsigned int nProcessors = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nProcessors"))).c_str());
532 unsigned int nLogicRegions = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nLogicRegions"))).c_str());
533 unsigned int nInputs = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
534 unsigned int nGoldenPatterns = std::atoi(
_toString(aElement->getAttribute(
_toDOMS(
"nGoldenPatterns"))).c_str());
558 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->getLength();
559 DOMElement* aConnectionElement = 0;
560 for(uint
i=0;
i<nElem;++
i){
561 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"ConnectionMap"))->item(
i);
562 aConnectionElement =
static_cast<DOMElement *
>(aNode);
563 unsigned int iProcessor = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
564 unsigned int barrelMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMin"))).c_str());
565 unsigned int barrelMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"barrelMax"))).c_str());
566 unsigned int endcap10DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMin"))).c_str());
567 unsigned int endcap10DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap10DegMax"))).c_str());
568 unsigned int endcap20DegMin = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMin"))).c_str());
569 unsigned int endcap20DegMax = std::atoi(
_toString(aConnectionElement->getAttribute(
_toDOMS(
"endcap20DegMax"))).c_str());
572 OMTFConfiguration::endcap10DegMin[iProcessor] = endcap10DegMin;
573 OMTFConfiguration::endcap20DegMin[iProcessor] = endcap20DegMin;
575 OMTFConfiguration::barrelMax[iProcessor] = barrelMax;
576 OMTFConfiguration::endcap10DegMax[iProcessor] = endcap10DegMax;
577 OMTFConfiguration::endcap20DegMax[iProcessor] = endcap20DegMax;
581 unsigned int nLogicLayers = 0;
582 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->getLength();
583 DOMElement* aLayerElement = 0;
584 for(uint
i=0;
i<nElem;++
i){
585 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"LayerMap"))->item(
i);
586 aLayerElement =
static_cast<DOMElement *
>(aNode);
587 unsigned int hwNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"hwNumber"))).c_str());
588 unsigned int logicNumber = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
589 unsigned int isBendingLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"bendingLayer"))).c_str());
590 unsigned int iConnectedLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"connectedToLayer"))).c_str());
594 if(isBendingLayer) aConfig->
bendingLayers.insert(logicNumber);
595 if(nLogicLayers<logicNumber) nLogicLayers = logicNumber;
601 unsigned int nRefLayers = 0;
602 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->getLength();
604 DOMElement* aRefLayerElement = 0;
605 for(uint
i=0;
i<nElem;++
i){
606 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"RefLayerMap"))->item(
i);
607 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
608 unsigned int refLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"refLayer"))).c_str());
609 unsigned int logicNumber = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"logicNumber"))).c_str());
611 if(nRefLayers<logicNumber) nRefLayers = refLayer;
633 std::vector<std::vector<std::pair<int,int> > > aRefHit2D;
643 nElem = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->getLength();
645 DOMElement* aProcessorElement = 0;
646 for(uint
i=0;
i<nElem;++
i){
647 aNode = aOMTFElement->getElementsByTagName(
_toDOMS(
"Processor"))->item(
i);
648 aProcessorElement =
static_cast<DOMElement *
>(aNode);
649 unsigned int iProcessor = std::atoi(
_toString(aProcessorElement->getAttribute(
_toDOMS(
"iProcessor"))).c_str());
650 unsigned int nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->getLength();
652 DOMElement* aRefLayerElement = 0;
653 for(uint
ii=0;
ii<nElem1;++
ii){
654 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefLayer"))->item(
ii);
655 aRefLayerElement =
static_cast<DOMElement *
>(aNode);
656 unsigned int iRefLayer = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
657 int iPhi = std::atoi(
_toString(aRefLayerElement->getAttribute(
_toDOMS(
"iGlobalPhiStart"))).c_str());
661 nElem1 = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->getLength();
663 DOMElement* aRefHitElement = 0;
664 std::vector<int> starts;
666 for(uint
ii=0;
ii<nElem1;++
ii){
667 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"RefHit"))->item(
ii);
668 aRefHitElement =
static_cast<DOMElement *
>(aNode);
669 unsigned int iRefHit = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefHit"))).c_str());
670 int iPhiMin = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMin"))).c_str());
671 int iPhiMax = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iPhiMax"))).c_str());
672 unsigned int iInput = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iInput"))).c_str());
673 unsigned int iRegion = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
674 unsigned int iRefLayer = std::atoi(
_toString(aRefHitElement->getAttribute(
_toDOMS(
"iRefLayer"))).c_str());
680 unsigned int nElem2 = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->getLength();
682 DOMElement* aRegionElement = 0;
683 for(uint
ii=0;
ii<nElem2;++
ii){
684 aNode = aProcessorElement->getElementsByTagName(
_toDOMS(
"LogicRegion"))->item(
ii);
685 aRegionElement =
static_cast<DOMElement *
>(aNode);
686 unsigned int iRegion = std::atoi(
_toString(aRegionElement->getAttribute(
_toDOMS(
"iRegion"))).c_str());
687 unsigned int nElem3 = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->getLength();
689 DOMElement* aLayerElement = 0;
690 for(uint iii=0;iii<nElem3;++iii){
691 aNode = aRegionElement->getElementsByTagName(
_toDOMS(
"Layer"))->item(iii);
692 aLayerElement =
static_cast<DOMElement *
>(aNode);
693 unsigned int iLayer = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iLayer"))).c_str());
694 unsigned int iFirstInput = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"iFirstInput"))).c_str());
695 unsigned int nInputs = std::atoi(
_toString(aLayerElement->getAttribute(
_toDOMS(
"nInputs"))).c_str());
static unsigned int nLayers
void setLayerMap(const std::vector< LayerMapNode > &aVector)
Connections definitions.
GoldenPattern * buildGP(xercesc::DOMElement *aGPElement, unsigned int index=0)
static unsigned int nInputs
void setConnectedSectorsEnd(const std::vector< int > &aVector)
xercesc::DOMDocument * doc
unsigned int hwNumber
short layer number used within OMTF emulator
static std::vector< unsigned int > endcap20DegMax
static vector3D_A connections
std::vector< int > vector1D
void setRefLayerMap(const std::vector< RefLayerMapNode > &aVector)
std::string _toString(const XMLCh *toTranscode)
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)
static std::vector< unsigned int > endcap10DegMin
static std::vector< unsigned int > barrelMax
static unsigned int nProcessors
static unsigned int nLogicRegions
static std::map< int, int > logicToLogic
static std::string const input
static unsigned int nPdfAddrBits
int read(std::istream &stream)
std::vector< vector1D > vector2D
std::vector< vector2D > vector3D
void setPdf(const vector3D &aPdf)
void setGeneralParams(const std::vector< int > ¶msVec)
static std::vector< unsigned int > barrelMin
static unsigned int nTestRefHits
XMLCh * transcode(const T &fInput)
static unsigned int nHitsPerLayer
static std::vector< std::vector< int > > processorPhiVsRefLayer
std::vector< std::pair< unsigned int, unsigned int > > vector1D_A
Map of connections.
static unsigned int nPhiBins
void readLUT(l1t::LUT *lut, const std::string &type)
void readConfig(const std::string fName)
bool bendingLayer
Is this a bending layers?
static std::vector< int > refToLogicNumber
static unsigned int nPhiBits
void setConnectedSectorsStart(const std::vector< int > &aVector)
xercesc::XercesDOMParser * parser
static std::map< int, int > hwToLogicLayer
unsigned int refLayer
Reference layer number.
void setGlobalPhiStartMap(const std::vector< int > &aVector)
static unsigned int nRefLayers
void setLayerInputMap(const std::vector< LayerInputNode > &aVector)
static std::map< int, int > logicToHwLayer
std::vector< GoldenPattern * > aGPs
Cache with GPs read.
std::vector< GoldenPattern * > readPatterns()
void setRefHitMap(const std::vector< RefHitNode > &aVector)
static unsigned int nRefHits
static std::set< int > bendingLayers
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)
static unsigned int nGoldenPatterns
std::vector< vector1D_A > vector2D_A
static std::vector< unsigned int > endcap10DegMax
static std::vector< std::vector< std::vector< std::pair< int, int > > > > regionPhisVsRefLayerVsProcessor
static std::vector< unsigned int > endcap20DegMin
static unsigned int nPdfValBits
static std::vector< std::vector< RefHitDef > > refHitsDefs