00001
00017
00018 #include "DataFormats/L1GlobalTrigger/interface/L1GtFdlWord.h"
00019
00020
00021 #include <iostream>
00022 #include <iomanip>
00023 #include <vector>
00024 #include <string>
00025
00026
00027
00028 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00029 #include "FWCore/MessageLogger/interface/MessageDrop.h"
00030
00031
00032
00033
00034 L1GtFdlWord::L1GtFdlWord()
00035 {
00036
00037 m_boardId = 0;
00038 m_bxInEvent = 0;
00039 m_bxNr = 0;
00040 m_eventNr = 0;
00041
00042
00043 m_gtTechnicalTriggerWord.reserve(
00044 L1GlobalTriggerReadoutSetup::NumberTechnicalTriggers);
00045 m_gtTechnicalTriggerWord.assign(
00046 L1GlobalTriggerReadoutSetup::NumberTechnicalTriggers, false);
00047
00048
00049 m_gtDecisionWord.reserve(
00050 L1GlobalTriggerReadoutSetup::NumberPhysTriggers);
00051 m_gtDecisionWord.assign(
00052 L1GlobalTriggerReadoutSetup::NumberPhysTriggers, false);
00053
00054
00055 m_gtDecisionWordExtended.reserve(
00056 L1GlobalTriggerReadoutSetup::NumberPhysTriggersExtended);
00057 m_gtDecisionWordExtended.assign(
00058 L1GlobalTriggerReadoutSetup::NumberPhysTriggersExtended, false);
00059
00060 m_physicsDeclared = 0;
00061 m_gtPrescaleFactorIndexTech = 0;
00062 m_gtPrescaleFactorIndexAlgo = 0;
00063
00064 m_noAlgo = 0;
00065
00066 m_finalOR = 0;
00067
00068
00069 m_orbitNr = 0;
00070 m_lumiSegmentNr = 0;
00071 m_localBxNr = 0;
00072
00073 }
00074
00075
00076 L1GtFdlWord::L1GtFdlWord(boost::uint16_t boardIdValue, int bxInEventValue,
00077 boost::uint16_t bxNrValue, boost::uint32_t eventNrValue,
00078 TechnicalTriggerWord gtTechnicalTriggerWordValue,
00079 DecisionWord gtDecisionWordValue,
00080 DecisionWordExtended gtDecisionWordExtendedValue,
00081 boost::uint16_t gtPrescaleFactorIndexTechValue,
00082 boost::uint16_t gtPrescaleFactorIndexAlgoValue,
00083 boost::uint16_t noAlgoValue, boost::uint16_t finalORValue,
00084 boost::uint32_t orbitNrValue, boost::uint16_t lumiSegmentNrValue,
00085 boost::uint16_t localBxNrValue) :
00086 m_boardId(boardIdValue), m_bxInEvent(bxInEventValue), m_bxNr(bxNrValue),
00087 m_eventNr(eventNrValue),
00088 m_gtTechnicalTriggerWord(gtTechnicalTriggerWordValue),
00089 m_gtDecisionWord(gtDecisionWordValue),
00090 m_gtDecisionWordExtended(gtDecisionWordExtendedValue),
00091 m_gtPrescaleFactorIndexTech(gtPrescaleFactorIndexTechValue),
00092 m_gtPrescaleFactorIndexAlgo(gtPrescaleFactorIndexAlgoValue),
00093 m_noAlgo(noAlgoValue), m_finalOR(finalORValue),
00094 m_orbitNr(orbitNrValue), m_lumiSegmentNr(lumiSegmentNrValue),
00095 m_localBxNr(localBxNrValue)
00096
00097 {
00098 m_physicsDeclared = 0;
00099
00100
00101 }
00102
00103
00104 L1GtFdlWord::~L1GtFdlWord()
00105 {
00106
00107
00108 }
00109
00110
00111 bool L1GtFdlWord::operator==(const L1GtFdlWord& result) const
00112 {
00113
00114 if (m_boardId != result.m_boardId) {
00115 return false;
00116 }
00117
00118 if (m_bxInEvent != result.m_bxInEvent) {
00119 return false;
00120 }
00121
00122 if (m_bxNr != result.m_bxNr) {
00123 return false;
00124 }
00125 if (m_eventNr != result.m_eventNr) {
00126 return false;
00127 }
00128
00129 if (m_gtTechnicalTriggerWord != result.m_gtTechnicalTriggerWord) {
00130 return false;
00131 }
00132
00133 if (m_gtDecisionWord != result.m_gtDecisionWord) {
00134 return false;
00135 }
00136
00137 if (m_gtDecisionWordExtended != result.m_gtDecisionWordExtended) {
00138 return false;
00139 }
00140
00141 if (m_physicsDeclared != result.m_physicsDeclared) {
00142 return false;
00143 }
00144
00145 if (m_gtPrescaleFactorIndexTech != result.m_gtPrescaleFactorIndexTech) {
00146 return false;
00147 }
00148
00149 if (m_gtPrescaleFactorIndexAlgo != result.m_gtPrescaleFactorIndexAlgo) {
00150 return false;
00151 }
00152
00153 if (m_noAlgo != result.m_noAlgo) {
00154 return false;
00155 }
00156
00157 if (m_finalOR != result.m_finalOR) {
00158 return false;
00159 }
00160
00161 if (m_orbitNr != result.m_orbitNr) {
00162 return false;
00163 }
00164
00165 if (m_lumiSegmentNr != result.m_lumiSegmentNr) {
00166 return false;
00167 }
00168
00169 if (m_localBxNr != result.m_localBxNr) {
00170 return false;
00171 }
00172
00173
00174 return true;
00175
00176 }
00177
00178
00179 bool L1GtFdlWord::operator!=(const L1GtFdlWord& result) const
00180 {
00181
00182 return !( result == *this);
00183
00184 }
00185
00186
00187
00188
00189
00190 void L1GtFdlWord::setBoardId(const boost::uint64_t& word64)
00191 {
00192 m_boardId = (word64 & BoardIdMask) >> BoardIdShift;
00193
00194 }
00195
00196
00197
00198 void L1GtFdlWord::setBoardIdWord64(boost::uint64_t& word64, const int iWord)
00199 {
00200
00201 if (iWord == BoardIdWord) {
00202 word64 = word64 | (static_cast<boost::uint64_t> (m_boardId) << BoardIdShift);
00203 }
00204
00205 }
00206
00207
00208
00209 void L1GtFdlWord::setBxInEvent(const boost::uint64_t& word64)
00210 {
00211 int baseValue = 16;
00212 int hexBxInEvent = (word64 & BxInEventMask) >> BxInEventShift;
00213 m_bxInEvent = (hexBxInEvent + baseValue/2)%baseValue - baseValue/2;
00214
00215 }
00216
00217
00218
00219 void L1GtFdlWord::setBxInEventWord64(boost::uint64_t& word64, const int iWord)
00220 {
00221
00222 if (iWord == BxInEventWord) {
00223 int baseValue = 16;
00224 int hexBxInEvent = (m_bxInEvent + baseValue)%baseValue;
00225 word64 = word64 | (static_cast<boost::uint64_t> (hexBxInEvent)
00226 << BxInEventShift);
00227 }
00228
00229 }
00230
00231
00232
00233 void L1GtFdlWord::setBxNr(const boost::uint64_t& word64)
00234 {
00235 m_bxNr = (word64 & BxNrMask) >> BxNrShift;
00236
00237 }
00238
00239
00240
00241 void L1GtFdlWord::setBxNrWord64(boost::uint64_t& word64, const int iWord)
00242 {
00243
00244 if (iWord == BxNrWord) {
00245 word64 = word64 | (static_cast<boost::uint64_t> (m_bxNr) << BxNrShift);
00246 }
00247
00248 }
00249
00250
00251
00252 void L1GtFdlWord::setEventNr(const boost::uint64_t& word64)
00253 {
00254 m_eventNr = (word64 & EventNrMask) >> EventNrShift;
00255
00256 }
00257
00258
00259
00260 void L1GtFdlWord::setEventNrWord64(boost::uint64_t& word64, const int iWord)
00261 {
00262
00263 if (iWord == EventNrWord) {
00264 word64 = word64 | (static_cast<boost::uint64_t> (m_eventNr) << EventNrShift);
00265 }
00266
00267 }
00268
00269
00270
00271
00272
00273 void L1GtFdlWord::printGtTechnicalTriggerWord(std::ostream& myCout) const
00274 {
00275
00276 myCout << " Technical triggers (bitset style): \n " ;
00277
00278 int sizeW64 = 64;
00279 int iBit = 0;
00280
00281 for (std::vector<bool>::const_reverse_iterator ritBit = m_gtTechnicalTriggerWord.rbegin();
00282 ritBit != m_gtTechnicalTriggerWord.rend(); ++ritBit) {
00283
00284 myCout << (*ritBit ? '1' : '0');
00285
00286 if ( (((iBit + 1)%16) == (sizeW64%16)) && (iBit != 63) ) {
00287 myCout << " ";
00288 }
00289
00290 iBit++;
00291 }
00292
00293
00294 }
00295
00296
00297 void L1GtFdlWord::setGtTechnicalTriggerWord(const boost::uint64_t& word64)
00298 {
00299
00300 int word64Size = sizeof(word64)*8;
00301 boost::uint64_t wordTT = (word64 & GtTechnicalTriggerWordMask)
00302 >> GtTechnicalTriggerWordShift;
00303
00304 boost::uint64_t one64 = 1ULL;
00305 for (int iBit = 0; iBit < word64Size; ++iBit) {
00306 m_gtTechnicalTriggerWord.at(iBit) = wordTT & (one64 << iBit);
00307 }
00308
00309 }
00310
00311
00312
00313 void L1GtFdlWord::setGtTechnicalTriggerWordWord64(boost::uint64_t& word64, const int iWord)
00314 {
00315
00316 if (iWord == GtTechnicalTriggerWordWord) {
00317
00318 int word64Size = sizeof(word64)*8;
00319 boost::uint64_t wordTT = 0x0000000000000000ULL;
00320
00321 int iBit = 0;
00322 boost::uint64_t iDecision = 0ULL;
00323
00324 for (std::vector<bool>::const_iterator itBit = m_gtTechnicalTriggerWord.begin();
00325 itBit != m_gtTechnicalTriggerWord.end(); ++itBit) {
00326
00327 iDecision = static_cast<boost::uint64_t> (*itBit);
00328 wordTT = wordTT | (iDecision << iBit);
00329
00330 iBit++;
00331 if (iBit >= word64Size) {
00332 break;
00333 }
00334
00335 }
00336
00337 word64 = word64 | (wordTT << GtTechnicalTriggerWordShift);
00338
00339 }
00340
00341 }
00342
00343
00344
00345
00346
00347 void L1GtFdlWord::printGtDecisionWord(std::ostream& myCout) const
00348 {
00349
00350
00351 int sizeW64 = 64;
00352
00353 int iBit = 0;
00354 int jBit = m_gtDecisionWord.size();
00355 int nrDecWord = m_gtDecisionWord.size()/sizeW64;
00356
00357 std::ostringstream stream64;
00358
00359 std::vector<std::string> decWord;
00360 decWord.reserve(nrDecWord);
00361
00362 for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWord.rbegin();
00363 ritBit != m_gtDecisionWord.rend(); ++ritBit) {
00364
00365 stream64 << (*ritBit ? '1' : '0');
00366
00367 if ( (((iBit + 1)%16) == (sizeW64%16)) ) {
00368 stream64 << " ";
00369 }
00370
00371 if ( ((iBit + 1)%sizeW64) == 0) {
00372 std::string iW = stream64.str();
00373 stream64.str("");
00374
00375 decWord.push_back(iW);
00376 }
00377
00378
00379 iBit++;
00380 jBit--;
00381 }
00382
00383 int iWord = 0;
00384
00385 for (std::vector<std::string>::reverse_iterator ritWord = decWord.rbegin();
00386 ritWord != decWord.rend(); ++ritWord) {
00387
00388 myCout << std::endl;
00389 myCout << " DecisionWord (bitset style): bits "
00390 << iWord*sizeW64 + sizeW64 - 1 << " : " << iWord*sizeW64 << "\n ";
00391 myCout << *ritWord;
00392
00393 iWord++;
00394
00395 }
00396 }
00397
00398
00399
00400 void L1GtFdlWord::setGtDecisionWordA(const boost::uint64_t& word64)
00401 {
00402
00403 int word64Size = sizeof(word64)*8;
00404 boost::uint64_t wordA = (word64 & GtDecisionWordAMask) >> GtDecisionWordAShift;
00405
00406 boost::uint64_t one64 = 1ULL;
00407
00408 for (int iBit = 0; iBit < word64Size; ++iBit) {
00409 m_gtDecisionWord.at(iBit) = wordA & (one64 << iBit);
00410 }
00411
00412 }
00413
00414
00415
00416 void L1GtFdlWord::setGtDecisionWordB(const boost::uint64_t& word64)
00417 {
00418
00419 int word64Size = sizeof(word64)*8;
00420 boost::uint64_t wordB = (word64 & GtDecisionWordBMask) >> GtDecisionWordBShift;
00421
00422 boost::uint64_t one64 = 1ULL;
00423
00424 for (int iBit = 0; iBit < word64Size; ++iBit) {
00425 m_gtDecisionWord.at(iBit + word64Size) = wordB & (one64 << iBit);
00426
00427 }
00428
00429 }
00430
00431
00432
00433
00434
00435
00436
00437 void L1GtFdlWord::setGtDecisionWordAWord64(boost::uint64_t& word64, const int iWord)
00438 {
00439
00440 if (iWord == GtDecisionWordAWord) {
00441
00442 int word64Size = sizeof(word64)*8;
00443 boost::uint64_t wordA = 0x0000000000000000ULL;
00444
00445 int iBit = 0;
00446 boost::uint64_t iDecision = 0ULL;
00447
00448 for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin();
00449 itBit != m_gtDecisionWord.end(); ++itBit) {
00450
00451 iDecision = static_cast<boost::uint64_t> (*itBit);
00452 wordA = wordA | (iDecision << iBit);
00453
00454 iBit++;
00455 if (iBit >= word64Size) {
00456 break;
00457 }
00458
00459 }
00460
00461 word64 = word64 | (wordA << GtDecisionWordAShift);
00462
00463 }
00464
00465 }
00466
00467
00468
00469
00470
00471
00472
00473 void L1GtFdlWord::setGtDecisionWordBWord64(boost::uint64_t& word64, const int iWord)
00474 {
00475
00476 if (iWord == GtDecisionWordBWord) {
00477
00478 int word64Size = sizeof(word64)*8;
00479 boost::uint64_t wordB = 0x0000000000000000ULL;
00480
00481 int iBit = 0;
00482 boost::uint64_t iDecision = 0ULL;
00483
00484 for (std::vector<bool>::const_iterator itBit = m_gtDecisionWord.begin();
00485 itBit != m_gtDecisionWord.end(); ++itBit) {
00486
00487 if (iBit >= word64Size) {
00488
00489 iDecision = static_cast<boost::uint64_t> (*itBit);
00490 wordB = wordB | ( iDecision << (iBit - word64Size) );
00491 }
00492
00493 iBit++;
00494
00495 }
00496
00497 word64 = word64 | (wordB << GtDecisionWordBShift);
00498 }
00499
00500 }
00501
00502
00503
00504
00505 void L1GtFdlWord::printGtDecisionWordExtended(std::ostream& myCout) const
00506 {
00507
00508 myCout << " DecisionWordExtended (bitset style): \n " ;
00509
00510 int sizeW64 = 64;
00511 int iBit = 0;
00512
00513 for (std::vector<bool>::const_reverse_iterator ritBit = m_gtDecisionWordExtended.rbegin();
00514 ritBit != m_gtDecisionWordExtended.rend(); ++ritBit) {
00515
00516 myCout << (*ritBit ? '1' : '0');
00517
00518 if ( (((iBit + 1)%16) == (sizeW64%16)) && (iBit != 63) ) {
00519 myCout << " ";
00520 }
00521
00522 iBit++;
00523
00524 }
00525
00526 }
00527
00528
00529 void L1GtFdlWord::setGtDecisionWordExtended(const boost::uint64_t& word64)
00530 {
00531
00532 int word64Size = sizeof(word64)*8;
00533 boost::uint64_t wordE = (word64 & GtDecisionWordExtendedMask)
00534 >> GtDecisionWordExtendedShift;
00535
00536 boost::uint64_t one64 = 1ULL;
00537
00538 for (int iBit = 0; iBit < word64Size; ++iBit) {
00539 m_gtDecisionWordExtended.at(iBit) = wordE & (one64 << iBit);
00540 }
00541
00542
00543 }
00544
00545
00546
00547 void L1GtFdlWord::setGtDecisionWordExtendedWord64(boost::uint64_t& word64, const int iWord)
00548 {
00549
00550 if (iWord == GtDecisionWordExtendedWord) {
00551
00552 int word64Size = sizeof(word64)*8;
00553 boost::uint64_t wordE = 0x0000000000000000ULL;
00554
00555 int iBit = 0;
00556 boost::uint64_t iDecision = 0ULL;
00557
00558 for (std::vector<bool>::const_iterator itBit = m_gtDecisionWordExtended.begin();
00559 itBit != m_gtDecisionWordExtended.end(); ++itBit) {
00560
00561 iDecision = static_cast<boost::uint64_t> (*itBit);
00562 wordE = wordE | (iDecision << iBit);
00563
00564 iBit++;
00565 if (iBit >= word64Size) {
00566 break;
00567 }
00568
00569 }
00570
00571 word64 = word64 | (wordE << GtDecisionWordExtendedShift);
00572
00573 }
00574
00575 }
00576
00577
00578
00579 void L1GtFdlWord::setPhysicsDeclared(const boost::uint64_t& word64)
00580 {
00581 m_physicsDeclared = (word64 & PhysicsDeclaredMask) >> PhysicsDeclaredShift;
00582 }
00583
00584
00585
00586 void L1GtFdlWord::setPhysicsDeclaredWord64(boost::uint64_t& word64, const int iWord)
00587 {
00588
00589 if (iWord == PhysicsDeclaredWord) {
00590 word64 = word64 | (static_cast<boost::uint64_t> (m_physicsDeclared)
00591 << PhysicsDeclaredShift);
00592 }
00593
00594 }
00595
00596
00597
00598 void L1GtFdlWord::setGtPrescaleFactorIndexTech(const boost::uint64_t& word64) {
00599 m_gtPrescaleFactorIndexTech = (word64 & GtPrescaleFactorIndexTechMask)
00600 >> GtPrescaleFactorIndexTechShift;
00601 }
00602
00603
00604
00605 void L1GtFdlWord::setGtPrescaleFactorIndexTechWord64(boost::uint64_t& word64,
00606 const int iWord) {
00607
00608 if (iWord == GtPrescaleFactorIndexTechWord) {
00609 word64 = word64
00610 | (static_cast<boost::uint64_t> (m_gtPrescaleFactorIndexTech)
00611 << GtPrescaleFactorIndexTechShift);
00612 }
00613
00614 }
00615
00616
00617
00618 void L1GtFdlWord::setGtPrescaleFactorIndexAlgo(const boost::uint64_t& word64) {
00619 m_gtPrescaleFactorIndexAlgo = (word64 & GtPrescaleFactorIndexAlgoMask)
00620 >> GtPrescaleFactorIndexAlgoShift;
00621 }
00622
00623
00624
00625 void L1GtFdlWord::setGtPrescaleFactorIndexAlgoWord64(boost::uint64_t& word64,
00626 const int iWord) {
00627
00628 if (iWord == GtPrescaleFactorIndexAlgoWord) {
00629 word64 = word64
00630 | (static_cast<boost::uint64_t> (m_gtPrescaleFactorIndexAlgo)
00631 << GtPrescaleFactorIndexAlgoShift);
00632 }
00633
00634 }
00635
00636
00637 void L1GtFdlWord::setNoAlgo(const boost::uint64_t& word64)
00638 {
00639 m_noAlgo = (word64 & NoAlgoMask) >> NoAlgoShift;
00640 }
00641
00642
00643
00644 void L1GtFdlWord::setNoAlgoWord64(boost::uint64_t& word64, const int iWord)
00645 {
00646
00647 if (iWord == NoAlgoWord) {
00648 word64 = word64 | (static_cast<boost::uint64_t> (m_noAlgo)
00649 << NoAlgoShift);
00650 }
00651
00652 }
00653
00654
00655
00656
00657
00658 void L1GtFdlWord::setFinalOR(const boost::uint64_t& word64)
00659 {
00660 m_finalOR = (word64 & FinalORMask) >> FinalORShift;
00661
00662 }
00663
00664
00665
00666 void L1GtFdlWord::setFinalORWord64(boost::uint64_t& word64, const int iWord)
00667 {
00668
00669 if (iWord == FinalORWord) {
00670 word64 = word64 | (static_cast<boost::uint64_t> (m_finalOR)
00671 << FinalORShift);
00672 }
00673
00674 }
00675
00676
00677
00678 void L1GtFdlWord::setOrbitNr(const boost::uint64_t& word64) {
00679 m_orbitNr = (word64 & OrbitNrMask) >> OrbitNrShift;
00680 }
00681
00682
00683
00684 void L1GtFdlWord::setOrbitNrWord64(boost::uint64_t& word64, const int iWord) {
00685
00686 if (iWord == OrbitNrWord) {
00687 word64 = word64 | (static_cast<boost::uint64_t> (m_orbitNr)
00688 << OrbitNrShift);
00689 }
00690
00691 }
00692
00693
00694
00695
00696 void L1GtFdlWord::setLumiSegmentNr(const boost::uint64_t& word64) {
00697 m_lumiSegmentNr = (word64 & LumiSegmentNrMask) >> LumiSegmentNrShift;
00698 }
00699
00700
00701
00702 void L1GtFdlWord::setLumiSegmentNrWord64(boost::uint64_t& word64,
00703 const int iWord) {
00704
00705 if (iWord == LumiSegmentNrWord) {
00706 word64 = word64 | (static_cast<boost::uint64_t> (m_lumiSegmentNr)
00707 << LumiSegmentNrShift);
00708 }
00709
00710 }
00711
00712
00713
00714 void L1GtFdlWord::setLocalBxNr(const boost::uint64_t& word64)
00715 {
00716 m_localBxNr = (word64 & LocalBxNrMask) >> LocalBxNrShift;
00717 }
00718
00719
00720
00721 void L1GtFdlWord::setLocalBxNrWord64(boost::uint64_t& word64, const int iWord)
00722 {
00723
00724 if (iWord == LocalBxNrWord) {
00725 word64 = word64 | (static_cast<boost::uint64_t> (m_localBxNr)
00726 << LocalBxNrShift);
00727 }
00728
00729 }
00730
00731
00732
00733
00734 void L1GtFdlWord::reset()
00735 {
00736
00737 m_boardId = 0;
00738 m_bxInEvent = 0;
00739 m_bxNr = 0;
00740 m_eventNr = 0;
00741
00742
00743 m_gtTechnicalTriggerWord.assign(
00744 L1GlobalTriggerReadoutSetup::NumberTechnicalTriggers, false);
00745
00746
00747 m_gtDecisionWord.assign(
00748 L1GlobalTriggerReadoutSetup::NumberPhysTriggers, false);
00749
00750
00751 m_gtDecisionWordExtended.assign(
00752 L1GlobalTriggerReadoutSetup::NumberPhysTriggersExtended, false);
00753
00754 m_physicsDeclared = 0;
00755 m_gtPrescaleFactorIndexTech = 0;
00756 m_gtPrescaleFactorIndexAlgo = 0;
00757
00758 m_noAlgo = 0;
00759 m_finalOR = 0;
00760
00761 m_orbitNr = 0;
00762 m_lumiSegmentNr = 0;
00763 m_localBxNr = 0;
00764
00765 }
00766
00767
00768 void L1GtFdlWord::print(std::ostream& myCout) const
00769 {
00770
00771 myCout << "\n L1GtFdlWord::print \n" << std::endl;
00772
00773 int iWord = 0;
00774
00775 myCout << "\n Word " << iWord << std::endl;
00776
00777 myCout << " Board Id: "
00778 << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0') << m_boardId
00779 << std::setfill(' ')
00780 << std::dec << " dec: " << m_boardId
00781 << std::endl;
00782
00783
00784 int baseValue = 16;
00785 int hexBxInEvent = (m_bxInEvent + baseValue)%baseValue;
00786
00787 myCout << " BxInEvent: "
00788 << std::hex << " hex: " << " " << std::setw(1) << hexBxInEvent
00789 << std::dec << " dec: " << m_bxInEvent
00790 << std::endl;
00791
00792 myCout << " BxNr: "
00793 << std::hex << " hex: " << " " << std::setw(3) << std::setfill('0') << m_bxNr
00794 << std::setfill(' ')
00795 << std::dec << " dec: " << m_bxNr
00796 << std::endl;
00797
00798
00799 myCout << " EventNr: "
00800 << std::hex << " hex: " << " " << std::setw(6) << std::setfill('0') << m_eventNr
00801 << std::setfill(' ')
00802 << std::dec << " dec: " << m_eventNr
00803 << std::endl;
00804
00805
00806
00807 iWord++;
00808 myCout << "\n Word " << iWord << std::endl;
00809
00810 printGtTechnicalTriggerWord(myCout);
00811 myCout << std::endl;
00812
00813
00814
00815 iWord++;
00816 myCout << "\n Word " << iWord;
00817 iWord++;
00818 myCout << " and word " << iWord;
00819
00820 printGtDecisionWord(myCout);
00821 myCout << std::endl;
00822
00823
00824
00825 iWord++;
00826 myCout << "\n Word " << iWord << std::endl;
00827
00828 printGtDecisionWordExtended(myCout);
00829 myCout << std::endl;
00830
00831
00832 iWord++;
00833 myCout << "\n Word " << iWord << std::endl;
00834
00835 myCout << " PhysicsDeclared: "
00836 << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0')
00837 << m_physicsDeclared
00838 << std::setfill(' ')
00839 << std::dec << " dec: " << m_physicsDeclared
00840 << std::endl;
00841
00842 myCout << " GtPrescaleFactorIndexTech: "
00843 << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0')
00844 << m_gtPrescaleFactorIndexTech
00845 << std::setfill(' ')
00846 << std::dec << " dec: " << m_gtPrescaleFactorIndexTech
00847 << std::endl;
00848
00849 myCout << " GtPrescaleFactorIndexAlgo: "
00850 << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0')
00851 << m_gtPrescaleFactorIndexAlgo
00852 << std::setfill(' ')
00853 << std::dec << " dec: " << m_gtPrescaleFactorIndexAlgo
00854 << std::endl;
00855
00856 myCout << " NoAlgo: "
00857 << std::hex << " hex: " << " " << std::setw(1) << std::setfill('0') << m_noAlgo
00858 << std::setfill(' ')
00859 << std::dec << " dec: " << m_noAlgo
00860 << std::endl;
00861
00862 myCout << " FinalOR: "
00863 << std::hex << " hex: " << " " << std::setw(2) << std::setfill('0') << m_finalOR
00864 << std::setfill(' ')
00865 << std::dec << " dec: " << m_finalOR
00866 << std::endl;
00867
00868 iWord++;
00869 myCout << "\n Word " << iWord << std::endl;
00870
00871 myCout << " OrbitNr: "
00872 << std::hex << " hex: " << "" << std::setw(8) << std::setfill('0') << m_orbitNr
00873 << std::setfill(' ')
00874 << std::dec << " dec: " << m_orbitNr
00875 << std::endl;
00876
00877 myCout << " LumiSegmentNr: "
00878 << std::hex << " hex: " << " " << std::setw(4) << std::setfill('0') << m_lumiSegmentNr
00879 << std::setfill(' ')
00880 << std::dec << " dec: " << m_lumiSegmentNr
00881 << std::endl;
00882
00883 myCout << " LocalBxNr: "
00884 << std::hex << " hex: " << " " << std::setw(3) << std::setfill('0') << m_localBxNr
00885 << std::setfill(' ')
00886 << std::dec << " dec: " << m_localBxNr
00887 << std::endl;
00888
00889 }
00890
00891
00892
00893 void L1GtFdlWord::unpack(const unsigned char* fdlPtr)
00894 {
00895 LogDebug("L1GtFdlWord")
00896 << "\nUnpacking FDL block.\n"
00897 << std::endl;
00898
00899 const boost::uint64_t* payload =
00900 reinterpret_cast<boost::uint64_t*>(const_cast<unsigned char*>(fdlPtr));
00901
00902 setBoardId(payload[BoardIdWord]);
00903 setBxInEvent(payload[BxInEventWord]);
00904 setBxNr(payload[BxNrWord]);
00905 setEventNr(payload[EventNrWord]);
00906
00907 setGtTechnicalTriggerWord(payload[GtTechnicalTriggerWordWord]);
00908
00909 setGtDecisionWordA(payload[GtDecisionWordAWord]);
00910
00911 setGtDecisionWordB(payload[GtDecisionWordBWord]);
00912
00913 setGtDecisionWordExtended(payload[GtDecisionWordExtendedWord]);
00914
00915 setPhysicsDeclared(payload[PhysicsDeclaredWord]);
00916 setGtPrescaleFactorIndexTech(payload[GtPrescaleFactorIndexTechWord]);
00917 setGtPrescaleFactorIndexAlgo(payload[GtPrescaleFactorIndexAlgoWord]);
00918 setNoAlgo(payload[NoAlgoWord]);
00919 setFinalOR(payload[FinalORWord]);
00920
00921 setOrbitNr(payload[OrbitNrWord]);
00922 setLumiSegmentNr(payload[LumiSegmentNrWord]);
00923 setLocalBxNr(payload[LocalBxNrWord]);
00924
00925 if ( edm::isDebugEnabled() ) {
00926
00927 for (int iWord = 0; iWord < BlockSize; ++iWord) {
00928 LogTrace("L1GtFdlWord")
00929 << std::setw(4) << iWord << " "
00930 << std::hex << std::setfill('0')
00931 << std::setw(16) << payload[iWord]
00932 << std::dec << std::setfill(' ')
00933 << std::endl;
00934 }
00935
00936 }
00937
00938 }
00939
00940
00941
00942
00943
00944
00945
00946 const int L1GtFdlWord::BlockSize = 7;
00947
00948
00949
00950
00951 const int L1GtFdlWord::BoardIdWord = 0;
00952 const int L1GtFdlWord::BxInEventWord = 0;
00953 const int L1GtFdlWord::BxNrWord = 0;
00954 const int L1GtFdlWord::EventNrWord = 0;
00955
00956
00957 const boost::uint64_t L1GtFdlWord::BoardIdMask = 0xFFFF000000000000ULL;
00958 const boost::uint64_t L1GtFdlWord::BxInEventMask = 0x0000F00000000000ULL;
00959 const boost::uint64_t L1GtFdlWord::BxNrMask = 0x00000FFF00000000ULL;
00960 const boost::uint64_t L1GtFdlWord::EventNrMask = 0x0000000000FFFFFFULL;
00961
00962
00963 const int L1GtFdlWord::BoardIdShift = 48;
00964 const int L1GtFdlWord::BxInEventShift = 44;
00965 const int L1GtFdlWord::BxNrShift = 32;
00966 const int L1GtFdlWord::EventNrShift = 0;
00967
00968
00969
00970 const int L1GtFdlWord::GtTechnicalTriggerWordWord = 1;
00971 const boost::uint64_t L1GtFdlWord::GtTechnicalTriggerWordMask = 0xFFFFFFFFFFFFFFFFULL;
00972 const int L1GtFdlWord::GtTechnicalTriggerWordShift = 0;
00973
00974
00975
00976 const int L1GtFdlWord::GtDecisionWordAWord = 2;
00977 const boost::uint64_t L1GtFdlWord::GtDecisionWordAMask = 0xFFFFFFFFFFFFFFFFULL;
00978 const int L1GtFdlWord::GtDecisionWordAShift = 0;
00979
00980
00981
00982 const int L1GtFdlWord::GtDecisionWordBWord = 3;
00983 const boost::uint64_t L1GtFdlWord::GtDecisionWordBMask = 0xFFFFFFFFFFFFFFFFULL;
00984 const int L1GtFdlWord::GtDecisionWordBShift = 0;
00985
00986
00987
00988 const int L1GtFdlWord::GtDecisionWordExtendedWord = 4;
00989 const boost::uint64_t L1GtFdlWord::GtDecisionWordExtendedMask = 0xFFFFFFFFFFFFFFFFULL;
00990 const int L1GtFdlWord::GtDecisionWordExtendedShift = 0;
00991
00992
00993 const int L1GtFdlWord::PhysicsDeclaredWord = 5;
00994 const int L1GtFdlWord::GtPrescaleFactorIndexTechWord = 5;
00995 const int L1GtFdlWord::GtPrescaleFactorIndexAlgoWord = 5;
00996 const int L1GtFdlWord::NoAlgoWord = 5;
00997 const int L1GtFdlWord::FinalORWord = 5;
00998
00999 const boost::uint64_t L1GtFdlWord::PhysicsDeclaredMask = 0x8000000000000000ULL;
01000 const boost::uint64_t L1GtFdlWord::GtPrescaleFactorIndexTechMask = 0x00FF000000000000ULL;
01001 const boost::uint64_t L1GtFdlWord::GtPrescaleFactorIndexAlgoMask = 0x000000FF00000000ULL;
01002 const boost::uint64_t L1GtFdlWord::NoAlgoMask = 0x0000000000000100ULL;
01003 const boost::uint64_t L1GtFdlWord::FinalORMask = 0x00000000000000FFULL;
01004
01005 const int L1GtFdlWord::PhysicsDeclaredShift = 63;
01006 const int L1GtFdlWord::GtPrescaleFactorIndexTechShift = 48;
01007 const int L1GtFdlWord::GtPrescaleFactorIndexAlgoShift = 32;
01008 const int L1GtFdlWord::NoAlgoShift = 8;
01009 const int L1GtFdlWord::FinalORShift = 0;
01010
01011
01012 const int L1GtFdlWord::OrbitNrWord = 6;
01013 const int L1GtFdlWord::LumiSegmentNrWord = 6;
01014 const int L1GtFdlWord::LocalBxNrWord = 6;
01015
01016 const boost::uint64_t L1GtFdlWord::OrbitNrMask = 0xFFFFFFFF00000000ULL;
01017 const boost::uint64_t L1GtFdlWord::LumiSegmentNrMask = 0x00000000FFFF0000ULL;
01018 const boost::uint64_t L1GtFdlWord::LocalBxNrMask = 0x0000000000000FFFULL;
01019
01020 const int L1GtFdlWord::OrbitNrShift = 32;
01021 const int L1GtFdlWord::LumiSegmentNrShift = 16;
01022 const int L1GtFdlWord::LocalBxNrShift = 0;
01023