Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-29 23:32:23

0001 /**
0002  * \class GlobalCondition
0003  *
0004  *
0005  * Description: base class for L1 Global Trigger object templates (condition).
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Vladimir Rekovic,   Brian Winer, OSU   Vasile Mihai Ghete - HEPHY Vienna
0011  *          Elisa Fontanesi - extended for three-body correlation conditions
0012  *
0013  * $Date$
0014  * $Revision$
0015  *
0016  */
0017 
0018 // this class header
0019 #include "L1Trigger/L1TGlobal/interface/GlobalCondition.h"
0020 
0021 // system include files
0022 
0023 // user include files
0024 
0025 // forward declarations
0026 
0027 // constructor
0028 //    empty
0029 GlobalCondition::GlobalCondition() {
0030   m_condCategory = l1t::CondNull;
0031   m_condType = l1t::TypeNull;
0032   m_condChipNr = -1;
0033   m_condRelativeBx = 0;
0034 
0035   // the rest of private members are C++ initialized
0036 }
0037 
0038 //    constructor from condition name
0039 GlobalCondition::GlobalCondition(const std::string& cName) {
0040   m_condName = cName;
0041 
0042   m_condCategory = l1t::CondNull;
0043   m_condType = l1t::TypeNull;
0044   m_condChipNr = -1;
0045   m_condRelativeBx = 0;
0046 }
0047 
0048 //   constructor from condition name, category and type
0049 GlobalCondition::GlobalCondition(const std::string& cName,
0050                                  const l1t::GtConditionCategory& cCategory,
0051                                  const l1t::GtConditionType& cType) {
0052   m_condName = cName;
0053   m_condCategory = cCategory;
0054   m_condType = cType;
0055 
0056   m_condChipNr = -1;
0057   m_condRelativeBx = 0;
0058 }
0059 
0060 GlobalCondition::~GlobalCondition() {
0061   // empty
0062 }
0063 
0064 // get number of trigger objects
0065 const int GlobalCondition::nrObjects() const {
0066   switch (m_condType) {
0067     case l1t::TypeNull:
0068     case l1t::TypeExternal: {
0069       return 0;
0070     }
0071 
0072     break;
0073     case l1t::TypeCent0:
0074     case l1t::TypeCent1:
0075     case l1t::TypeCent2:
0076     case l1t::TypeCent3:
0077     case l1t::TypeCent4:
0078     case l1t::TypeCent5:
0079     case l1t::TypeCent6:
0080     case l1t::TypeCent7: {
0081       return 0;
0082     }
0083 
0084     case l1t::Type1s: {
0085       return 1;
0086     }
0087 
0088     break;
0089     case l1t::Type2s:
0090     case l1t::Type2wsc:
0091     case l1t::Type2cor: {
0092       return 2;
0093     }
0094 
0095     break;
0096     case l1t::Type2corWithOverlapRemoval: {
0097       return 3;
0098     }
0099 
0100     break;
0101     case l1t::Type3s: {
0102       return 3;
0103     }
0104 
0105     break;
0106     case l1t::Type4s: {
0107       return 4;
0108     }
0109 
0110     break;
0111     case l1t::TypeETT:
0112     case l1t::TypeETM:
0113     case l1t::TypeHTT:
0114     case l1t::TypeHTM:
0115     case l1t::TypeETMHF:
0116     case l1t::TypeTowerCount:
0117     case l1t::TypeMinBiasHFP0:
0118     case l1t::TypeMinBiasHFM0:
0119     case l1t::TypeMinBiasHFP1:
0120     case l1t::TypeMinBiasHFM1:
0121     case l1t::TypeAsymEt:
0122     case l1t::TypeAsymHt:
0123     case l1t::TypeAsymEtHF:
0124     case l1t::TypeAsymHtHF: {
0125       return 1;
0126     }
0127 
0128     break;
0129     default: {
0130       // TODO no such type, throw exception?
0131       return 0;
0132     } break;
0133   }
0134 }
0135 
0136 // get logic flag for conditions, same type of trigger objects,
0137 // and with spatial correlations
0138 const bool GlobalCondition::wsc() const {
0139   if (m_condType == l1t::Type2wsc) {
0140     return true;
0141   }
0142 
0143   return false;
0144 }
0145 
0146 // get logic flag for conditions, different type of trigger objects,
0147 // and with spatial correlations
0148 const bool GlobalCondition::corr() const {
0149   if (m_condType == l1t::Type2cor) {
0150     return true;
0151   }
0152 
0153   return false;
0154 }
0155 
0156 // get logic flag for conditions, trigger objects are muons
0157 const bool GlobalCondition::corrThree() const {
0158   if (m_condType == l1t::Type3s) {
0159     return true;
0160   }
0161 
0162   return false;
0163 }
0164 
0165 // print condition
0166 void GlobalCondition::print(std::ostream& myCout) const {
0167   myCout << "\n  Condition name:     " << m_condName << std::endl;
0168 
0169   switch (m_condCategory) {
0170     case l1t::CondNull: {
0171       myCout << "  Condition category: "
0172              << "l1t::CondNull"
0173              << " - it means not defined!" << std::endl;
0174     }
0175 
0176     break;
0177     case l1t::CondMuon: {
0178       myCout << "  Condition category: "
0179              << "l1t::CondMuon" << std::endl;
0180     }
0181 
0182     break;
0183     case l1t::CondMuonShower: {
0184       myCout << "  Condition category: "
0185              << "l1t::CondMuonShower" << std::endl;
0186     }
0187 
0188     break;
0189     case l1t::CondCalo: {
0190       myCout << "  Condition category: "
0191              << "l1t::CondCalo" << std::endl;
0192     }
0193 
0194     break;
0195     case l1t::CondEnergySum: {
0196       myCout << "  Condition category: "
0197              << "CondEnergySum" << std::endl;
0198     }
0199 
0200     break;
0201     case l1t::CondCorrelation: {
0202       myCout << "  Condition category: "
0203              << "CondCorrelation" << std::endl;
0204     }
0205 
0206     break;
0207     case l1t::CondCorrelationThreeBody: {
0208       myCout << "  Condition category: "
0209              << "CondCorrelationThreeBody" << std::endl;
0210     }
0211 
0212     break;
0213     case l1t::CondCorrelationWithOverlapRemoval: {
0214       myCout << "  Condition category: "
0215              << "CondCorrelationWithOverlapRemoval" << std::endl;
0216     }
0217 
0218     break;
0219     case l1t::CondExternal: {
0220       myCout << "  Condition category: "
0221              << "CondExternal" << std::endl;
0222     }
0223 
0224     break;
0225     default: {
0226       myCout << "  Condition category: " << m_condCategory
0227              << "  - no such category defined. Check l1t::GtConditionCategory enum." << std::endl;
0228 
0229     } break;
0230   }
0231 
0232   switch (m_condType) {
0233     case l1t::TypeNull: {
0234       myCout << "  Condition type:     "
0235              << "l1t::TypeNull"
0236              << " - it means not defined!" << std::endl;
0237     }
0238 
0239     break;
0240     case l1t::Type1s: {
0241       myCout << "  Condition type:     "
0242              << "l1t::Type1s" << std::endl;
0243     }
0244 
0245     break;
0246     case l1t::Type2s: {
0247       myCout << "  Condition type:     "
0248              << "l1t::Type2s" << std::endl;
0249     }
0250 
0251     break;
0252     case l1t::Type2corWithOverlapRemoval: {
0253       myCout << "  Condition type:     "
0254              << "l1t::Type2corWithOverlapRemoval" << std::endl;
0255     }
0256 
0257     break;
0258     case l1t::Type2wsc: {
0259       myCout << "  Condition type:     "
0260              << "l1t::Type2wsc" << std::endl;
0261     }
0262 
0263     break;
0264     case l1t::Type2cor: {
0265       myCout << "  Condition type:     "
0266              << "l1t::Type2cor" << std::endl;
0267     }
0268 
0269     break;
0270     case l1t::Type3s: {
0271       myCout << "  Condition type:     "
0272              << "l1t::Type3s" << std::endl;
0273     }
0274 
0275     break;
0276     case l1t::Type4s: {
0277       myCout << "  Condition type:     "
0278              << "l1t::Type4s" << std::endl;
0279     }
0280 
0281     break;
0282     case l1t::TypeETM: {
0283       myCout << "  Condition type:     "
0284              << "TypeETM" << std::endl;
0285     }
0286 
0287     break;
0288     case l1t::TypeETT: {
0289       myCout << "  Condition type:     "
0290              << "TypeETT" << std::endl;
0291     }
0292 
0293     break;
0294     case l1t::TypeHTT: {
0295       myCout << "  Condition type:     "
0296              << "TypeHTT" << std::endl;
0297     }
0298 
0299     break;
0300     case l1t::TypeHTM: {
0301       myCout << "  Condition type:     "
0302              << "TypeHTM" << std::endl;
0303     }
0304 
0305     break;
0306     case l1t::TypeETMHF: {
0307       myCout << "  Condition type:     "
0308              << "TypeETMHF" << std::endl;
0309     }
0310 
0311     break;
0312     case l1t::TypeTowerCount: {
0313       myCout << "  Condition type:     "
0314              << "TypeTowerCount" << std::endl;
0315     }
0316 
0317     break;
0318     case l1t::TypeMinBiasHFP0: {
0319       myCout << "  Condition type:     "
0320              << "TypeMinBiasHFP0" << std::endl;
0321     }
0322 
0323     break;
0324     case l1t::TypeMinBiasHFM0: {
0325       myCout << "  Condition type:     "
0326              << "TypeMinBiasHFM0" << std::endl;
0327     }
0328 
0329     break;
0330     case l1t::TypeMinBiasHFP1: {
0331       myCout << "  Condition type:     "
0332              << "TypeMinBiasHFP1" << std::endl;
0333     }
0334 
0335     break;
0336     case l1t::TypeMinBiasHFM1: {
0337       myCout << "  Condition type:     "
0338              << "TypeMinBiasHFM1" << std::endl;
0339     }
0340 
0341     break;
0342     case l1t::TypeETTem: {
0343       myCout << "  Condition type:     "
0344              << "TypeETTem" << std::endl;
0345     }
0346 
0347     break;
0348     case l1t::TypeAsymEt: {
0349       myCout << "  Condition type:     "
0350              << "TypeAsymEt" << std::endl;
0351     }
0352 
0353     break;
0354     case l1t::TypeAsymHt: {
0355       myCout << "  Condition type:     "
0356              << "TypeAsymHt" << std::endl;
0357     }
0358 
0359     break;
0360     case l1t::TypeAsymEtHF: {
0361       myCout << "  Condition type:     "
0362              << "TypeAsymEtHF" << std::endl;
0363     }
0364 
0365     break;
0366     case l1t::TypeAsymHtHF: {
0367       myCout << "  Condition type:     "
0368              << "TypeAsymHtHF" << std::endl;
0369     }
0370 
0371     break;
0372     case l1t::TypeCent0: {
0373       myCout << "  Condition type:     "
0374              << "TypeCent0" << std::endl;
0375     }
0376 
0377     break;
0378     case l1t::TypeCent1: {
0379       myCout << "  Condition type:     "
0380              << "TypeCent1" << std::endl;
0381     }
0382 
0383     break;
0384     case l1t::TypeCent2: {
0385       myCout << "  Condition type:     "
0386              << "TypeCent2" << std::endl;
0387     }
0388 
0389     break;
0390     case l1t::TypeCent3: {
0391       myCout << "  Condition type:     "
0392              << "TypeCent3" << std::endl;
0393     }
0394 
0395     break;
0396     case l1t::TypeCent4: {
0397       myCout << "  Condition type:     "
0398              << "TypeCent4" << std::endl;
0399     }
0400 
0401     break;
0402     case l1t::TypeCent5: {
0403       myCout << "  Condition type:     "
0404              << "TypeCent5" << std::endl;
0405     }
0406 
0407     break;
0408     case l1t::TypeCent6: {
0409       myCout << "  Condition type:     "
0410              << "TypeCent6" << std::endl;
0411     }
0412 
0413     break;
0414     case l1t::TypeCent7: {
0415       myCout << "  Condition type:     "
0416              << "TypeCent7" << std::endl;
0417     }
0418 
0419     break;
0420     case l1t::TypeExternal: {
0421       myCout << "  Condition type:     "
0422              << "TypeExternal" << std::endl;
0423     }
0424 
0425     break;
0426     default: {
0427       myCout << "  Condition type:     " << m_condType << " - no such type defined. Check l1t::GtConditionType enum."
0428              << std::endl;
0429     } break;
0430   }
0431 
0432   myCout << "  Object types:      ";
0433 
0434   for (unsigned int i = 0; i < m_objectType.size(); ++i) {
0435     switch (m_objectType[i]) {
0436       case l1t::gtMu: {
0437         myCout << " Mu ";
0438       }
0439 
0440       break;
0441       case l1t::gtMuShower: {
0442         myCout << " MuShower ";
0443       }
0444 
0445       break;
0446       case l1t::gtEG: {
0447         myCout << " EG ";
0448       }
0449 
0450       break;
0451 
0452       case l1t::gtJet: {
0453         myCout << " Jet ";
0454       }
0455 
0456       break;
0457 
0458       case l1t::gtTau: {
0459         myCout << " Tau ";
0460       }
0461 
0462       break;
0463       case l1t::gtETM: {
0464         myCout << " ETM ";
0465       }
0466 
0467       break;
0468       case l1t::gtETT: {
0469         myCout << " ETT ";
0470       }
0471 
0472       break;
0473       case l1t::gtHTT: {
0474         myCout << " HTT ";
0475       }
0476 
0477       break;
0478       case l1t::gtHTM: {
0479         myCout << " HTM ";
0480       }
0481 
0482       break;
0483 
0484       case l1t::gtETMHF: {
0485         myCout << " ETMHF ";
0486       }
0487 
0488       break;
0489       case l1t::gtTowerCount: {
0490         myCout << " TowerCount ";
0491       }
0492 
0493       break;
0494       case l1t::gtMinBiasHFP0: {
0495         myCout << " MinBiasHFP0 ";
0496       }
0497 
0498       break;
0499       case l1t::gtMinBiasHFM0: {
0500         myCout << " MinBiasHFM0 ";
0501       }
0502 
0503       break;
0504       case l1t::gtMinBiasHFP1: {
0505         myCout << " MinBiasHFP1 ";
0506       }
0507 
0508       break;
0509       case l1t::gtMinBiasHFM1: {
0510         myCout << " MinBiasHFM1 ";
0511       }
0512 
0513       break;
0514       case l1t::gtETTem: {
0515         myCout << " ETTem ";
0516       }
0517 
0518       break;
0519       case l1t::gtAsymmetryEt: {
0520         myCout << " AsymmetryEt ";
0521       }
0522 
0523       break;
0524       case l1t::gtAsymmetryHt: {
0525         myCout << " AsymmetryHt ";
0526       }
0527 
0528       break;
0529       case l1t::gtAsymmetryEtHF: {
0530         myCout << " AsymmetryEtHF ";
0531       }
0532 
0533       break;
0534       case l1t::gtAsymmetryHtHF: {
0535         myCout << " AsymmetryHtHF ";
0536       }
0537 
0538       break;
0539       case l1t::gtCentrality0: {
0540         myCout << " Centrality0 ";
0541       }
0542 
0543       break;
0544       case l1t::gtCentrality1: {
0545         myCout << " Centrality1 ";
0546       }
0547 
0548       break;
0549       case l1t::gtCentrality2: {
0550         myCout << " Centrality2 ";
0551       }
0552 
0553       break;
0554       case l1t::gtCentrality3: {
0555         myCout << " Centrality3 ";
0556       }
0557 
0558       break;
0559       case l1t::gtCentrality4: {
0560         myCout << " Centrality4 ";
0561       }
0562 
0563       break;
0564       case l1t::gtCentrality5: {
0565         myCout << " Centrality5 ";
0566       }
0567 
0568       break;
0569       case l1t::gtCentrality6: {
0570         myCout << " Centrality6 ";
0571       }
0572 
0573       break;
0574       case l1t::gtCentrality7: {
0575         myCout << " Centrality7 ";
0576       }
0577 
0578       break;
0579 
0580       case l1t::gtExternal: {
0581         myCout << " External ";
0582       }
0583 
0584       break;
0585       default: {
0586         myCout << " Unknown type " << m_objectType[i];
0587       } break;
0588     }
0589   }
0590 
0591   myCout << std::endl;
0592 
0593   myCout << "  \" >= \" flag:        " << m_condGEq << std::endl;
0594 
0595   myCout << "  Condition chip:     " << m_condChipNr;
0596 
0597   if (m_condChipNr < 0) {
0598     myCout << "   - not properly initialized! ";
0599   }
0600 
0601   myCout << std::endl;
0602 
0603   myCout << "  Relative BX:     " << m_condRelativeBx << std::endl;
0604 }
0605 
0606 // output stream operator
0607 std::ostream& operator<<(std::ostream& os, const GlobalCondition& result) {
0608   result.print(os);
0609   return os;
0610 }