CMS 3D CMS Logo

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 TypeCastor: {
00077                 return 0;
00078             }
00079 
00080             break;
00081         case Type1s: {
00082                 return 1;
00083             }
00084 
00085             break;
00086         case Type2s:
00087         case Type2wsc:
00088         case Type2cor: {
00089                 return 2;
00090             }
00091 
00092             break;
00093         case Type3s: {
00094                 return 3;
00095             }
00096 
00097             break;
00098         case Type4s: {
00099                 return 4;
00100             }
00101 
00102             break;
00103         case TypeETT:
00104         case TypeETM:
00105         case TypeHTT:
00106         case TypeJetCounts:
00107         case TypeHfBitCounts:
00108         case TypeHfRingEtSums: {
00109                 return 1;
00110             }
00111 
00112             break;
00113         default: {
00114                 // TODO no such type, throw exception?
00115                 return 0;
00116             }
00117             break;
00118     }
00119 
00120 }
00121 
00122 // get logic flag for conditions, same type of trigger objects,
00123 // and with spatial correlations
00124 const bool L1GtCondition::wsc() const
00125 {
00126 
00127     if (m_condType == Type2wsc) {
00128         return true;
00129     }
00130 
00131     return false;
00132 }
00133 
00134 // get logic flag for conditions, different type of trigger objects,
00135 // and with spatial correlations
00136 const bool L1GtCondition::corr() const
00137 {
00138 
00139     if (m_condType == Type2cor) {
00140         return true;
00141     }
00142 
00143     return false;
00144 }
00145 
00146 // print condition
00147 void L1GtCondition::print(std::ostream& myCout) const
00148 {
00149 
00150     myCout << "\n  Condition name:     " << m_condName << std::endl;
00151 
00152     switch (m_condCategory) {
00153         case CondNull: {
00154                 myCout << "  Condition category: " << "CondNull"
00155                 << " - it means not defined!"
00156                 << std::endl;
00157             }
00158 
00159             break;
00160         case CondMuon: {
00161                 myCout << "  Condition category: " << "CondMuon"  << std::endl;
00162             }
00163 
00164             break;
00165         case CondCalo: {
00166                 myCout << "  Condition category: " << "CondCalo"  << std::endl;
00167             }
00168 
00169             break;
00170         case CondEnergySum: {
00171                 myCout << "  Condition category: " << "CondEnergySum"  << std::endl;
00172             }
00173 
00174             break;
00175         case CondJetCounts: {
00176                 myCout << "  Condition category: " << "CondJetCounts"  << std::endl;
00177             }
00178 
00179             break;
00180         case CondCorrelation: {
00181                 myCout << "  Condition category: " << "CondCorrelation"  << std::endl;
00182             }
00183 
00184             break;
00185         case CondCastor: {
00186                 myCout << "  Condition category: " << "CondCastor"  << std::endl;
00187             }
00188 
00189             break;
00190         case CondHfBitCounts: {
00191                 myCout << "  Condition category: " << "CondHfBitCounts"  << std::endl;
00192             }
00193 
00194             break;
00195         case CondHfRingEtSums: {
00196                 myCout << "  Condition category: " << "CondHfRingEtSums"  << std::endl;
00197             }
00198 
00199             break;
00200         default: {
00201                 myCout << "  Condition category: " << m_condCategory
00202                 << "  - no such category defined. Check L1GtConditionCategory enum."
00203                 << std::endl;
00204 
00205             }
00206             break;
00207     }
00208 
00209     switch (m_condType) {
00210 
00211         case TypeNull: {
00212                 myCout << "  Condition type:     " << "TypeNull"
00213                 << " - it means not defined!"
00214                 << std::endl;
00215             }
00216 
00217             break;
00218         case Type1s: {
00219                 myCout << "  Condition type:     " << "Type1s"  << std::endl;
00220             }
00221 
00222             break;
00223         case Type2s: {
00224                 myCout << "  Condition type:     " << "Type2s"  << std::endl;
00225             }
00226 
00227             break;
00228         case Type2wsc: {
00229                 myCout << "  Condition type:     " << "Type2wsc"  << std::endl;
00230             }
00231 
00232             break;
00233         case Type2cor: {
00234                 myCout << "  Condition type:     " << "Type2cor"  << std::endl;
00235             }
00236 
00237             break;
00238         case Type3s: {
00239                 myCout << "  Condition type:     " << "Type3s"  << std::endl;
00240             }
00241 
00242             break;
00243         case Type4s: {
00244                 myCout << "  Condition type:     " << "Type4s"  << std::endl;
00245             }
00246 
00247             break;
00248         case TypeETM: {
00249                 myCout << "  Condition type:     " << "TypeETM"  << std::endl;
00250             }
00251 
00252             break;
00253         case TypeETT: {
00254                 myCout << "  Condition type:     " << "TypeETT"  << std::endl;
00255             }
00256 
00257             break;
00258         case TypeHTT: {
00259                 myCout << "  Condition type:     " << "TypeHTT"  << std::endl;
00260             }
00261 
00262             break;
00263         case TypeJetCounts: {
00264                 myCout << "  Condition type:     " << "TypeJetCounts"  << std::endl;
00265             }
00266 
00267             break;
00268         case TypeCastor: {
00269                 myCout << "  Condition type:     " << "TypeCastor"  << std::endl;
00270             }
00271 
00272             break;
00273         case TypeHfBitCounts: {
00274                 myCout << "  Condition type:     " << "TypeHfBitCounts"  << std::endl;
00275             }
00276 
00277             break;
00278         case TypeHfRingEtSums: {
00279                 myCout << "  Condition type:     " << "TypeHfRingEtSums"  << std::endl;
00280             }
00281 
00282             break;
00283         default: {
00284                 myCout << "  Condition type:     " << m_condType
00285                 << " - no such type defined. Check L1GtConditionType enum."
00286                 << std::endl;
00287             }
00288             break;
00289     }
00290 
00291 
00292     myCout << "  Object types:      ";
00293 
00294     for (unsigned int i = 0; i < m_objectType.size(); ++i) {
00295 
00296         switch (m_objectType[i]) {
00297             case Mu: {
00298                     myCout << " Mu ";
00299                 }
00300 
00301                 break;
00302             case NoIsoEG: {
00303                     myCout << " NoIsoEG ";
00304                 }
00305 
00306                 break;
00307             case IsoEG: {
00308                     myCout << " IsoEG ";
00309                 }
00310 
00311                 break;
00312             case CenJet: {
00313                     myCout << " CenJet ";
00314                 }
00315 
00316                 break;
00317             case ForJet: {
00318                     myCout << " ForJet ";
00319                 }
00320 
00321                 break;
00322             case TauJet: {
00323                     myCout << " TauJet ";
00324                 }
00325 
00326                 break;
00327             case ETM: {
00328                     myCout << " ETM ";
00329                 }
00330 
00331                 break;
00332             case ETT: {
00333                     myCout << " ETT ";
00334                 }
00335 
00336                 break;
00337             case HTT: {
00338                     myCout << " HTT ";
00339                 }
00340 
00341                 break;
00342             case JetCounts: {
00343                     myCout << " JetCounts ";
00344                 }
00345 
00346                 break;
00347             case HfBitCounts: {
00348                     myCout << " HfBitCounts ";
00349                 }
00350 
00351                 break;
00352             case HfRingEtSums: {
00353                     myCout << " HfRingEtSums ";
00354                 }
00355 
00356                 break;
00357             default: {
00358                     myCout << " Unknown type " << m_objectType[i];
00359                 }
00360                 break;
00361         }
00362     }
00363 
00364     myCout << std::endl;
00365 
00366     myCout << "  \" >= \" flag:        " << m_condGEq << std::endl;
00367 
00368     myCout << "  Condition chip:     " << m_condChipNr;
00369 
00370     if (m_condChipNr < 0) {
00371         myCout << "   - not properly initialized! ";
00372     }
00373 
00374     myCout << std::endl;
00375 
00376 }

Generated on Tue Jun 9 17:26:38 2009 for CMSSW by  doxygen 1.5.4