Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:58

0001 #include "L1Trigger/L1TGlobal/interface/GlobalParamsHelper.h"
0002 
0003 using namespace l1t;
0004 
0005 const GlobalParamsHelper* GlobalParamsHelper::readFromEventSetup(const L1TGlobalParameters* es) {
0006   return new GlobalParamsHelper(es);
0007 }
0008 
0009 GlobalParamsHelper* GlobalParamsHelper::readAndWriteFromEventSetup(const L1TGlobalParameters* es) {
0010   GlobalParamsHelper* x = new GlobalParamsHelper(es);
0011   x->useCopy();
0012   return x;
0013 }
0014 
0015 GlobalParamsHelper::GlobalParamsHelper(L1TGlobalParameters* w) {
0016   write_ = w;
0017   check_write();
0018   we_own_write_ = false;
0019   write_->m_version = VERSION;
0020   read_ = write_;
0021 }
0022 
0023 GlobalParamsHelper::GlobalParamsHelper(const L1TGlobalParameters* es) {
0024   read_ = es;
0025   write_ = nullptr;
0026 }
0027 
0028 void GlobalParamsHelper::useCopy() {
0029   write_ = new L1TGlobalParameters(*read_);
0030   we_own_write_ = true;
0031   read_ = write_;
0032 }
0033 
0034 GlobalParamsHelper::~GlobalParamsHelper() {
0035   if (we_own_write_ && write_)
0036     delete write_;
0037 }
0038 
0039 // set the number of bx in event
0040 void GlobalParamsHelper::setTotalBxInEvent(const int& numberBxValue) {
0041   check_write();
0042   write_->m_totalBxInEvent = numberBxValue;
0043 }
0044 
0045 // set the number of physics trigger algorithms
0046 void GlobalParamsHelper::setNumberPhysTriggers(const unsigned int& numberPhysTriggersValue) {
0047   check_write();
0048   write_->m_numberPhysTriggers = numberPhysTriggersValue;
0049 }
0050 
0051 // set the number of L1 muons received by GT
0052 void GlobalParamsHelper::setNumberL1Mu(const unsigned int& numberL1MuValue) {
0053   check_write();
0054   write_->m_numberL1Mu = numberL1MuValue;
0055 }
0056 
0057 //  set the number of L1 e/gamma objects received by GT
0058 void GlobalParamsHelper::setNumberL1EG(const unsigned int& numberL1EGValue) {
0059   check_write();
0060   write_->m_numberL1EG = numberL1EGValue;
0061 }
0062 
0063 // set the number of L1 central jets received by GT
0064 void GlobalParamsHelper::setNumberL1Jet(const unsigned int& numberL1JetValue) {
0065   check_write();
0066   write_->m_numberL1Jet = numberL1JetValue;
0067 }
0068 
0069 // set the number of L1 tau jets received by GT
0070 void GlobalParamsHelper::setNumberL1Tau(const unsigned int& numberL1TauValue) {
0071   check_write();
0072   write_->m_numberL1Tau = numberL1TauValue;
0073 }
0074 
0075 // hardware stuff
0076 
0077 // set the number of condition chips in GTL
0078 void GlobalParamsHelper::setNumberChips(const unsigned int& numberChipsValue) {
0079   check_write();
0080   write_->m_numberChips = numberChipsValue;
0081 }
0082 
0083 // set the number of pins on the GTL condition chips
0084 void GlobalParamsHelper::setPinsOnChip(const unsigned int& pinsOnChipValue) {
0085   check_write();
0086   write_->m_pinsOnChip = pinsOnChipValue;
0087 }
0088 
0089 // set the correspondence "condition chip - GTL algorithm word"
0090 // in the hardware
0091 void GlobalParamsHelper::setOrderOfChip(const std::vector<int>& orderOfChipValue) {
0092   check_write();
0093   write_->m_orderOfChip = orderOfChipValue;
0094 }
0095 
0096 // print all the L1 GT stable parameters
0097 void GlobalParamsHelper::print(std::ostream& myStr) const {
0098   myStr << "\nL1T Global  Parameters \n" << std::endl;
0099 
0100   // number of bx
0101   myStr << "\n  Number of bx in Event =            " << read_->m_totalBxInEvent << std::endl;
0102 
0103   // trigger decision
0104 
0105   // number of physics trigger algorithms
0106   myStr << "\n  Number of physics trigger algorithms =            " << read_->m_numberPhysTriggers << std::endl;
0107 
0108   // muons
0109   myStr << "\n  Number of muons received by L1 GT =                     " << read_->m_numberL1Mu << std::endl;
0110 
0111   // e/gamma and isolated e/gamma objects
0112   myStr << "  Number of e/gamma objects received by L1 GT =          " << read_->m_numberL1EG << std::endl;
0113 
0114   // central, forward and tau jets
0115   myStr << "\n  Number of  jets received by L1 GT =             " << read_->m_numberL1Jet << std::endl;
0116 
0117   myStr << "  Number of tau  received by L1 GT =                 " << read_->m_numberL1Tau << std::endl;
0118 
0119   // hardware
0120 
0121   // number of condition chips
0122   myStr << "\n  Number of condition chips =                        " << read_->m_numberChips << std::endl;
0123 
0124   // number of pins on the GTL condition chips
0125   myStr << "  Number of pins on chips =        " << read_->m_pinsOnChip << std::endl;
0126 
0127   // correspondence "condition chip - GTL algorithm word" in the hardware
0128   // chip 2: 0 - 95;  chip 1: 96 - 128 (191)
0129   myStr << "  Order of  chips for algorithm word = {";
0130 
0131   for (unsigned int iChip = 0; iChip < read_->m_orderOfChip.size(); ++iChip) {
0132     myStr << read_->m_orderOfChip[iChip];
0133     if (iChip != (read_->m_orderOfChip.size() - 1)) {
0134       myStr << ", ";
0135     }
0136   }
0137 
0138   myStr << "}" << std::endl;
0139 
0140   myStr << "\n" << std::endl;
0141 }