CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/CondFormats/L1TObjects/src/L1GtCondition.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "CondFormats/L1TObjects/interface/L1GtCondition.h"
00019 
00020 // system include files
00021 
00022 // user include files
00023 
00024 // forward declarations
00025 
00026 // constructor
00027 //    empty
00028 L1GtCondition::L1GtCondition()
00029 {
00030 
00031     m_condCategory = CondNull;
00032     m_condType = TypeNull;
00033     m_condChipNr = -1;
00034 
00035     // the rest of private members are C++ initialized
00036 }
00037 
00038 //    constructor from condition name
00039 L1GtCondition::L1GtCondition(const std::string& cName)
00040 {
00041     m_condName = cName;
00042 
00043     m_condCategory = CondNull;
00044     m_condType = TypeNull;
00045     m_condChipNr = -1;
00046 }
00047 
00048 //   constructor from condition name, category and type
00049 L1GtCondition::L1GtCondition(const std::string& cName,
00050                              const L1GtConditionCategory& cCategory,
00051                              const L1GtConditionType& cType)
00052 {
00053 
00054     m_condName = cName;
00055     m_condCategory = cCategory;
00056     m_condType = cType;
00057 
00058     m_condChipNr = -1;
00059 
00060 }
00061 
00062 
00063 
00064 L1GtCondition::~L1GtCondition()
00065 {
00066     // empty
00067 }
00068 
00069 // get number of trigger objects
00070 const int L1GtCondition::nrObjects() const
00071 {
00072 
00073     switch (m_condType) {
00074 
00075         case TypeNull:
00076         case TypeExternal:
00077         case TypeCastor:
00078         case TypeBptx: {
00079                 return 0;
00080             }
00081 
00082             break;
00083         case Type1s: {
00084                 return 1;
00085             }
00086 
00087             break;
00088         case Type2s:
00089         case Type2wsc:
00090         case Type2cor: {
00091                 return 2;
00092             }
00093 
00094             break;
00095         case Type3s: {
00096                 return 3;
00097             }
00098 
00099             break;
00100         case Type4s: {
00101                 return 4;
00102             }
00103 
00104             break;
00105         case TypeETT:
00106         case TypeETM:
00107         case TypeHTT:
00108         case TypeHTM:
00109         case TypeJetCounts:
00110         case TypeHfBitCounts:
00111         case TypeHfRingEtSums: {
00112                 return 1;
00113             }
00114 
00115             break;
00116         default: {
00117                 // TODO no such type, throw exception?
00118                 return 0;
00119             }
00120             break;
00121     }
00122 
00123 }
00124 
00125 // get logic flag for conditions, same type of trigger objects,
00126 // and with spatial correlations
00127 const bool L1GtCondition::wsc() const
00128 {
00129 
00130     if (m_condType == Type2wsc) {
00131         return true;
00132     }
00133 
00134     return false;
00135 }
00136 
00137 // get logic flag for conditions, different type of trigger objects,
00138 // and with spatial correlations
00139 const bool L1GtCondition::corr() const
00140 {
00141 
00142     if (m_condType == Type2cor) {
00143         return true;
00144     }
00145 
00146     return false;
00147 }
00148 
00149 // print condition
00150 void L1GtCondition::print(std::ostream& myCout) const
00151 {
00152 
00153     myCout << "\n  Condition name:     " << m_condName << std::endl;
00154 
00155     switch (m_condCategory) {
00156         case CondNull: {
00157                 myCout << "  Condition category: " << "CondNull"
00158                 << " - it means not defined!"
00159                 << std::endl;
00160             }
00161 
00162             break;
00163         case CondMuon: {
00164                 myCout << "  Condition category: " << "CondMuon"  << std::endl;
00165             }
00166 
00167             break;
00168         case CondCalo: {
00169                 myCout << "  Condition category: " << "CondCalo"  << std::endl;
00170             }
00171 
00172             break;
00173         case CondEnergySum: {
00174                 myCout << "  Condition category: " << "CondEnergySum"  << std::endl;
00175             }
00176 
00177             break;
00178         case CondJetCounts: {
00179                 myCout << "  Condition category: " << "CondJetCounts"  << std::endl;
00180             }
00181 
00182             break;
00183         case CondCorrelation: {
00184                 myCout << "  Condition category: " << "CondCorrelation"  << std::endl;
00185             }
00186 
00187             break;
00188         case CondCastor: {
00189                 myCout << "  Condition category: " << "CondCastor"  << std::endl;
00190             }
00191 
00192             break;
00193         case CondHfBitCounts: {
00194                 myCout << "  Condition category: " << "CondHfBitCounts"  << std::endl;
00195             }
00196 
00197             break;
00198         case CondHfRingEtSums: {
00199                 myCout << "  Condition category: " << "CondHfRingEtSums"  << std::endl;
00200             }
00201 
00202             break;
00203         case CondBptx: {
00204                 myCout << "  Condition category: " << "CondBptx"  << std::endl;
00205             }
00206 
00207             break;
00208         case CondExternal: {
00209                 myCout << "  Condition category: " << "CondExternal"  << std::endl;
00210             }
00211 
00212             break;
00213         default: {
00214                 myCout << "  Condition category: " << m_condCategory
00215                 << "  - no such category defined. Check L1GtConditionCategory enum."
00216                 << std::endl;
00217 
00218             }
00219             break;
00220     }
00221 
00222     switch (m_condType) {
00223 
00224         case TypeNull: {
00225                 myCout << "  Condition type:     " << "TypeNull"
00226                 << " - it means not defined!"
00227                 << std::endl;
00228             }
00229 
00230             break;
00231         case Type1s: {
00232                 myCout << "  Condition type:     " << "Type1s"  << std::endl;
00233             }
00234 
00235             break;
00236         case Type2s: {
00237                 myCout << "  Condition type:     " << "Type2s"  << std::endl;
00238             }
00239 
00240             break;
00241         case Type2wsc: {
00242                 myCout << "  Condition type:     " << "Type2wsc"  << std::endl;
00243             }
00244 
00245             break;
00246         case Type2cor: {
00247                 myCout << "  Condition type:     " << "Type2cor"  << std::endl;
00248             }
00249 
00250             break;
00251         case Type3s: {
00252                 myCout << "  Condition type:     " << "Type3s"  << std::endl;
00253             }
00254 
00255             break;
00256         case Type4s: {
00257                 myCout << "  Condition type:     " << "Type4s"  << std::endl;
00258             }
00259 
00260             break;
00261         case TypeETM: {
00262                 myCout << "  Condition type:     " << "TypeETM"  << std::endl;
00263             }
00264 
00265             break;
00266         case TypeETT: {
00267                 myCout << "  Condition type:     " << "TypeETT"  << std::endl;
00268             }
00269 
00270             break;
00271         case TypeHTT: {
00272                 myCout << "  Condition type:     " << "TypeHTT"  << std::endl;
00273             }
00274 
00275             break;
00276         case TypeHTM: {
00277                 myCout << "  Condition type:     " << "TypeHTM"  << std::endl;
00278             }
00279 
00280             break;
00281         case TypeJetCounts: {
00282                 myCout << "  Condition type:     " << "TypeJetCounts"  << std::endl;
00283             }
00284 
00285             break;
00286         case TypeCastor: {
00287                 myCout << "  Condition type:     " << "TypeCastor"  << std::endl;
00288             }
00289 
00290             break;
00291         case TypeHfBitCounts: {
00292                 myCout << "  Condition type:     " << "TypeHfBitCounts"  << std::endl;
00293             }
00294 
00295             break;
00296         case TypeHfRingEtSums: {
00297                 myCout << "  Condition type:     " << "TypeHfRingEtSums"  << std::endl;
00298             }
00299 
00300             break;
00301         case TypeBptx: {
00302                 myCout << "  Condition type:     " << "TypeBptx"  << std::endl;
00303             }
00304 
00305             break;
00306         case TypeExternal: {
00307                 myCout << "  Condition type:     " << "TypeExternal"  << std::endl;
00308             }
00309 
00310             break;
00311         default: {
00312                 myCout << "  Condition type:     " << m_condType
00313                 << " - no such type defined. Check L1GtConditionType enum."
00314                 << std::endl;
00315             }
00316             break;
00317     }
00318 
00319 
00320     myCout << "  Object types:      ";
00321 
00322     for (unsigned int i = 0; i < m_objectType.size(); ++i) {
00323 
00324         switch (m_objectType[i]) {
00325             case Mu: {
00326                     myCout << " Mu ";
00327                 }
00328 
00329                 break;
00330             case NoIsoEG: {
00331                     myCout << " NoIsoEG ";
00332                 }
00333 
00334                 break;
00335             case IsoEG: {
00336                     myCout << " IsoEG ";
00337                 }
00338 
00339                 break;
00340             case CenJet: {
00341                     myCout << " CenJet ";
00342                 }
00343 
00344                 break;
00345             case ForJet: {
00346                     myCout << " ForJet ";
00347                 }
00348 
00349                 break;
00350             case TauJet: {
00351                     myCout << " TauJet ";
00352                 }
00353 
00354                 break;
00355             case ETM: {
00356                     myCout << " ETM ";
00357                 }
00358 
00359                 break;
00360             case ETT: {
00361                     myCout << " ETT ";
00362                 }
00363 
00364                 break;
00365             case HTT: {
00366                     myCout << " HTT ";
00367                 }
00368 
00369                 break;
00370             case HTM: {
00371                     myCout << " HTM ";
00372                 }
00373 
00374                 break;
00375             case JetCounts: {
00376                     myCout << " JetCounts ";
00377                 }
00378 
00379                 break;
00380             case HfBitCounts: {
00381                     myCout << " HfBitCounts ";
00382                 }
00383 
00384                 break;
00385             case HfRingEtSums: {
00386                     myCout << " HfRingEtSums ";
00387                 }
00388 
00389                 break;
00390             case BPTX: {
00391                     myCout << " BPTX ";
00392                 }
00393 
00394                 break;
00395             case GtExternal: {
00396                     myCout << " GtExternal ";
00397                 }
00398 
00399                 break;
00400             default: {
00401                     myCout << " Unknown type " << m_objectType[i];
00402                 }
00403                 break;
00404         }
00405     }
00406 
00407     myCout << std::endl;
00408 
00409     myCout << "  \" >= \" flag:        " << m_condGEq << std::endl;
00410 
00411     myCout << "  Condition chip:     " << m_condChipNr;
00412 
00413     if (m_condChipNr < 0) {
00414         myCout << "   - not properly initialized! ";
00415     }
00416 
00417     myCout << std::endl;
00418 
00419 }
00420 
00421 // output stream operator
00422 std::ostream& operator<<(std::ostream& os, const L1GtCondition& result)
00423 {
00424     result.print(os);
00425     return os;
00426 
00427 }
00428