CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/L1Trigger/GlobalTriggerAnalyzer/src/L1RetrieveL1Extra.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1RetrieveL1Extra.h"
00019 
00020 // system include files
00021 #include <iostream>
00022 #include <memory>
00023 #include <string>
00024 
00025 // user include files
00026 
00027 #include "FWCore/Framework/interface/MakerMacros.h"
00028 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00029 
00030 #include "boost/lexical_cast.hpp"
00031 
00032 
00033 // constructor
00034 L1RetrieveL1Extra::L1RetrieveL1Extra(const edm::ParameterSet& paramSet) :
00035     //
00036     m_tagL1ExtraMuon(paramSet.getParameter<edm::InputTag>("TagL1ExtraMuon")),
00037     m_tagL1ExtraIsoEG(paramSet.getParameter<edm::InputTag>("TagL1ExtraIsoEG")),
00038     m_tagL1ExtraNoIsoEG(paramSet.getParameter<edm::InputTag>("TagL1ExtraNoIsoEG")),
00039     m_tagL1ExtraCenJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraCenJet")),
00040     m_tagL1ExtraForJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraForJet")),
00041     m_tagL1ExtraTauJet(paramSet.getParameter<edm::InputTag>("TagL1ExtraTauJet")),
00042     m_tagL1ExtraEtMissMET(paramSet.getParameter<edm::InputTag>("TagL1ExtraEtMissMET")),
00043     m_tagL1ExtraEtMissHTM(paramSet.getParameter<edm::InputTag>("TagL1ExtraEtMissHTM")),
00044     m_tagL1ExtraHFRings(paramSet.getParameter<edm::InputTag>("TagL1ExtraHFRings")),
00045     //
00046     //
00047     m_validL1ExtraMuon(false),
00048     m_validL1ExtraIsoEG(false),
00049     m_validL1ExtraNoIsoEG(false),
00050     m_validL1ExtraCenJet(false),
00051     m_validL1ExtraForJet(false),
00052     m_validL1ExtraTauJet(false),
00053     m_validL1ExtraETT(false),
00054     m_validL1ExtraETM(false),
00055     m_validL1ExtraHTT(false),
00056     m_validL1ExtraHTM(false),
00057     m_validL1ExtraHfBitCounts(false),
00058     m_validL1ExtraHfRingEtSums(false),
00059 
00060     //
00061     m_l1ExtraMuon(0),
00062     m_l1ExtraIsoEG(0),
00063     m_l1ExtraNoIsoEG(0),
00064     m_l1ExtraCenJet(0),
00065     m_l1ExtraForJet(0),
00066     m_l1ExtraTauJet(0),
00067     m_l1ExtraETT(0),
00068     m_l1ExtraETM(0),
00069     m_l1ExtraHTT(0),
00070     m_l1ExtraHTM(0),
00071     m_l1ExtraHfBitCounts(0),
00072     m_l1ExtraHfRingEtSums(0)
00073     //
00074 
00075     {
00076 
00077     // empty
00078 }
00079 
00080 // destructor
00081 L1RetrieveL1Extra::~L1RetrieveL1Extra() {
00082 
00083     // empty
00084 
00085 }
00086 
00087 
00088 
00089 void L1RetrieveL1Extra::retrieveL1ExtraObjects(const edm::Event& iEvent,
00090         const edm::EventSetup& evSetup) {
00091 
00092     //
00093     edm::Handle<l1extra::L1MuonParticleCollection> collL1ExtraMuon;
00094     iEvent.getByLabel(m_tagL1ExtraMuon, collL1ExtraMuon);
00095 
00096     if (collL1ExtraMuon.isValid()) {
00097         m_validL1ExtraMuon = true;
00098         m_l1ExtraMuon = collL1ExtraMuon.product();
00099     } else {
00100         LogDebug("L1RetrieveL1Extra")
00101                 << "\n l1extra::L1MuonParticleCollection with input tag \n  "
00102                 << m_tagL1ExtraMuon << "\n not found in the event.\n"
00103                 << "\n Return pointer 0 and false validity tag."
00104                 << std::endl;
00105 
00106         m_validL1ExtraMuon = false;
00107         m_l1ExtraMuon = 0;
00108 
00109     }
00110 
00111     //
00112     edm::Handle<l1extra::L1EmParticleCollection> collL1ExtraIsoEG;
00113     iEvent.getByLabel(m_tagL1ExtraIsoEG, collL1ExtraIsoEG);
00114 
00115     if (collL1ExtraIsoEG.isValid()) {
00116         m_validL1ExtraIsoEG = true;
00117         m_l1ExtraIsoEG = collL1ExtraIsoEG.product();
00118     } else {
00119         LogDebug("L1RetrieveL1Extra")
00120                 << "\n l1extra::L1EmParticleCollection with input tag \n  "
00121                 << m_tagL1ExtraIsoEG << "\n not found in the event.\n"
00122                 << "\n Return pointer 0 and false validity tag."
00123                 << std::endl;
00124 
00125         m_validL1ExtraIsoEG = false;
00126         m_l1ExtraIsoEG = 0;
00127 
00128     }
00129 
00130     edm::Handle<l1extra::L1EmParticleCollection> collL1ExtraNoIsoEG;
00131     iEvent.getByLabel(m_tagL1ExtraNoIsoEG, collL1ExtraNoIsoEG);
00132 
00133     if (collL1ExtraNoIsoEG.isValid()) {
00134         m_validL1ExtraNoIsoEG = true;
00135         m_l1ExtraNoIsoEG = collL1ExtraNoIsoEG.product();
00136     } else {
00137         LogDebug("L1RetrieveL1Extra")
00138                 << "\n l1extra::L1EmParticleCollection with input tag \n  "
00139                 << m_tagL1ExtraNoIsoEG << "\n not found in the event.\n"
00140                 << "\n Return pointer 0 and false validity tag."
00141                 << std::endl;
00142 
00143         m_validL1ExtraNoIsoEG = false;
00144         m_l1ExtraNoIsoEG = 0;
00145 
00146     }
00147 
00148     //
00149     edm::Handle<l1extra::L1JetParticleCollection> collL1ExtraCenJet;
00150     iEvent.getByLabel(m_tagL1ExtraCenJet, collL1ExtraCenJet);
00151 
00152     if (collL1ExtraCenJet.isValid()) {
00153         m_validL1ExtraCenJet = true;
00154         m_l1ExtraCenJet = collL1ExtraCenJet.product();
00155     } else {
00156         LogDebug("L1RetrieveL1Extra")
00157                 << "\n l1extra::L1JetParticleCollection with input tag \n  "
00158                 << m_tagL1ExtraCenJet << "\n not found in the event.\n"
00159                 << "\n Return pointer 0 and false validity tag."
00160                 << std::endl;
00161 
00162         m_validL1ExtraCenJet = false;
00163         m_l1ExtraCenJet = 0;
00164 
00165     }
00166 
00167     edm::Handle<l1extra::L1JetParticleCollection> collL1ExtraForJet;
00168     iEvent.getByLabel(m_tagL1ExtraForJet, collL1ExtraForJet);
00169 
00170     if (collL1ExtraForJet.isValid()) {
00171         m_validL1ExtraForJet = true;
00172         m_l1ExtraForJet = collL1ExtraForJet.product();
00173     } else {
00174         LogDebug("L1RetrieveL1Extra")
00175                 << "\n l1extra::L1JetParticleCollection with input tag \n  "
00176                 << m_tagL1ExtraForJet << "\n not found in the event.\n"
00177                 << "\n Return pointer 0 and false validity tag."
00178                 << std::endl;
00179 
00180         m_validL1ExtraForJet = false;
00181         m_l1ExtraForJet = 0;
00182 
00183     }
00184 
00185     edm::Handle<l1extra::L1JetParticleCollection> collL1ExtraTauJet;
00186     iEvent.getByLabel(m_tagL1ExtraTauJet, collL1ExtraTauJet);
00187 
00188     if (collL1ExtraTauJet.isValid()) {
00189         m_validL1ExtraTauJet = true;
00190         m_l1ExtraTauJet = collL1ExtraTauJet.product();
00191     } else {
00192         LogDebug("L1RetrieveL1Extra")
00193                 << "\n l1extra::L1JetParticleCollection with input tag \n  "
00194                 << m_tagL1ExtraTauJet << "\n not found in the event.\n"
00195                 << "\n Return pointer 0 and false validity tag."
00196                 << std::endl;
00197 
00198         m_validL1ExtraTauJet = false;
00199         m_l1ExtraTauJet = 0;
00200 
00201     }
00202 
00203     //
00204     edm::Handle<l1extra::L1EtMissParticleCollection> collL1ExtraEtMissMET;
00205     iEvent.getByLabel(m_tagL1ExtraEtMissMET, collL1ExtraEtMissMET);
00206 
00207     if (collL1ExtraEtMissMET.isValid()) {
00208         m_validL1ExtraETT = true;
00209         m_validL1ExtraETM = true;
00210         m_l1ExtraETT = collL1ExtraEtMissMET.product();
00211         m_l1ExtraETM = collL1ExtraEtMissMET.product();
00212     } else {
00213         LogDebug("L1RetrieveL1Extra")
00214                 << "\n l1extra::L1EtMissParticleCollection with input tag \n  "
00215                 << m_tagL1ExtraEtMissMET << "\n not found in the event.\n"
00216                 << "\n Return pointer 0 and false validity tag."
00217                 << std::endl;
00218 
00219         m_validL1ExtraETT = false;
00220         m_validL1ExtraETM = false;
00221         m_l1ExtraETT = 0;
00222         m_l1ExtraETM = 0;
00223 
00224     }
00225 
00226     edm::Handle<l1extra::L1EtMissParticleCollection> collL1ExtraEtMissHTM;
00227     iEvent.getByLabel(m_tagL1ExtraEtMissHTM, collL1ExtraEtMissHTM);
00228 
00229     if (collL1ExtraEtMissHTM.isValid()) {
00230         m_validL1ExtraHTT = true;
00231         m_validL1ExtraHTM = true;
00232         m_l1ExtraHTT = collL1ExtraEtMissHTM.product();
00233         m_l1ExtraHTM = collL1ExtraEtMissHTM.product();
00234     } else {
00235         LogDebug("L1RetrieveL1Extra")
00236                 << "\n l1extra::L1EtMissParticleCollection with input tag \n  "
00237                 << m_tagL1ExtraEtMissHTM << "\n not found in the event.\n"
00238                 << "\n Return pointer 0 and false validity tag."
00239                 << std::endl;
00240 
00241         m_validL1ExtraHTT = false;
00242         m_validL1ExtraHTM = false;
00243         m_l1ExtraHTT = 0;
00244         m_l1ExtraHTM = 0;
00245 
00246     }
00247 
00248     //
00249     edm::Handle<l1extra::L1HFRingsCollection> collL1ExtraHFRings;
00250     iEvent.getByLabel(m_tagL1ExtraHFRings, collL1ExtraHFRings);
00251 
00252     if (collL1ExtraHFRings.isValid()) {
00253         m_validL1ExtraHfBitCounts = true;
00254         m_validL1ExtraHfRingEtSums = true;
00255         m_l1ExtraHfBitCounts = collL1ExtraHFRings.product();
00256         m_l1ExtraHfRingEtSums = collL1ExtraHFRings.product();
00257     } else {
00258         LogDebug("L1RetrieveL1Extra")
00259                 << "\n l1extra::L1HFRingsCollection with input tag \n  "
00260                 << m_tagL1ExtraHFRings << "\n not found in the event.\n"
00261                 << "\n Return pointer 0 and false validity tag."
00262                 << std::endl;
00263 
00264         m_validL1ExtraHfBitCounts = false;
00265         m_validL1ExtraHfRingEtSums = false;
00266         m_l1ExtraHfBitCounts = 0;
00267         m_l1ExtraHfRingEtSums = 0;
00268 
00269     }
00270 
00271 }
00272 
00274 const edm::InputTag L1RetrieveL1Extra::inputTagL1ExtraColl(const L1GtObject& gtObject) const {
00275 
00276     edm::InputTag emptyInputTag;
00277 
00278     switch (gtObject) {
00279 
00280         case Mu: {
00281             return m_tagL1ExtraMuon;
00282         }
00283             break;
00284 
00285         case NoIsoEG: {
00286             return m_tagL1ExtraNoIsoEG;
00287         }
00288             break;
00289 
00290         case IsoEG: {
00291             return m_tagL1ExtraIsoEG;
00292         }
00293             break;
00294 
00295         case CenJet: {
00296             return m_tagL1ExtraCenJet;
00297         }
00298             break;
00299 
00300         case ForJet: {
00301             return m_tagL1ExtraForJet;
00302         }
00303             break;
00304 
00305         case TauJet: {
00306             return m_tagL1ExtraTauJet;
00307         }
00308             break;
00309 
00310         case ETM:
00311         case ETT: {
00312             return m_tagL1ExtraEtMissMET;
00313         }
00314             break;
00315 
00316         case HTT:
00317         case HTM: {
00318             return m_tagL1ExtraEtMissHTM;
00319         }
00320             break;
00321 
00322         case JetCounts: {
00323             // TODO update when JetCounts will be available
00324             return emptyInputTag;
00325         }
00326             break;
00327 
00328         case HfBitCounts:
00329         case HfRingEtSums: {
00330             return m_tagL1ExtraHFRings;
00331         }
00332             break;
00333 
00334         case TechTrig: {
00335             return emptyInputTag;
00336         }
00337             break;
00338 
00339         case Castor: {
00340             return emptyInputTag;
00341         }
00342             break;
00343 
00344         case BPTX: {
00345             return emptyInputTag;
00346         }
00347             break;
00348 
00349         case GtExternal: {
00350             return emptyInputTag;
00351         }
00352             break;
00353 
00354         case ObjNull: {
00355             return emptyInputTag;
00356         }
00357             break;
00358 
00359         default: {
00360             edm::LogInfo("L1GtObject") << "\n  '" << gtObject
00361                     << "' is not a recognized L1GtObject. ";
00362 
00363             return emptyInputTag;
00364 
00365         }
00366             break;
00367     }
00368 
00369     return emptyInputTag;
00370 }
00371 
00372 const bool L1RetrieveL1Extra::validL1ExtraColl(const L1GtObject& gtObject) const {
00373 
00374     switch (gtObject) {
00375 
00376         case Mu: {
00377             return m_validL1ExtraMuon;
00378         }
00379             break;
00380 
00381         case NoIsoEG: {
00382             return m_validL1ExtraNoIsoEG;
00383         }
00384             break;
00385 
00386         case IsoEG: {
00387             return m_validL1ExtraIsoEG;
00388         }
00389             break;
00390 
00391         case CenJet: {
00392             return m_validL1ExtraCenJet;
00393         }
00394             break;
00395 
00396         case ForJet: {
00397             return m_validL1ExtraForJet;
00398         }
00399             break;
00400 
00401         case TauJet: {
00402             return m_validL1ExtraTauJet;
00403         }
00404             break;
00405 
00406         case ETM: {
00407             return m_validL1ExtraETM;
00408         }
00409             break;
00410 
00411         case ETT: {
00412             return m_validL1ExtraETT;
00413         }
00414             break;
00415 
00416         case HTT: {
00417             return m_validL1ExtraHTT;
00418         }
00419             break;
00420 
00421         case HTM: {
00422             return m_validL1ExtraHTM;
00423         }
00424             break;
00425 
00426         case JetCounts: {
00427             // TODO update when JetCounts will be available
00428             return false;
00429         }
00430             break;
00431 
00432         case HfBitCounts: {
00433             return m_validL1ExtraHfBitCounts;
00434         }
00435             break;
00436 
00437         case HfRingEtSums: {
00438             return m_validL1ExtraHfRingEtSums;
00439         }
00440             break;
00441 
00442         case TechTrig: {
00443             return false;
00444         }
00445             break;
00446 
00447         case Castor: {
00448             return false;
00449         }
00450             break;
00451 
00452         case BPTX: {
00453             return false;
00454         }
00455             break;
00456 
00457         case GtExternal: {
00458             return false;
00459         }
00460             break;
00461 
00462         case ObjNull: {
00463             return false;
00464         }
00465             break;
00466 
00467         default: {
00468             edm::LogInfo("L1GtObject") << "\n  '" << gtObject
00469                     << "' is not a recognized L1GtObject. ";
00470 
00471             return false;
00472 
00473         }
00474             break;
00475     }
00476 
00477     return false;
00478 }
00479 
00480 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr,
00481         const L1GtObject& gtObject, const bool checkBxInEvent,
00482         const int bxInEvent, const bool checkObjIndexInColl,
00483         const int objIndexInColl) const {
00484 
00485     if (!validL1ExtraColl(gtObject)) {
00486         oStr << "\n L1Extra collection for L1 GT object "
00487                 << l1GtObjectEnumToString(gtObject)
00488                 << " with collection input tag " << inputTagL1ExtraColl(
00489                 gtObject) << " not valid." << std::endl;
00490     }
00491 
00492     switch (gtObject) {
00493 
00494         case Mu: {
00495             oStr << "\n Mu collection\n" << std::endl;
00496 
00497             int indexInColl = -1;
00498 
00499             for (l1extra::L1MuonParticleCollection::const_iterator iterColl =
00500                     m_l1ExtraMuon->begin(); iterColl
00501                     != m_l1ExtraMuon->end(); ++iterColl) {
00502 
00503                 if (checkBxInEvent) {
00504                     if (iterColl->bx() != bxInEvent) {
00505                         continue;
00506                         oStr << "\n   BxInEvent " << bxInEvent
00507                                 << ": collection not in the event" << std::endl;
00508                     } else {
00509 
00510                         indexInColl++;
00511 
00512                         if (!checkObjIndexInColl) {
00513                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00514                                     << " indexInColl = " << indexInColl
00515                                     << " PT = " << std::right << std::setw(6) << (iterColl->pt()) << " GeV"
00516                                     << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00517                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00518                         } else {
00519                             if (objIndexInColl == indexInColl) {
00520                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00521                                         << " indexInColl = " << indexInColl
00522                                         << " PT = " << std::right << std::setw(6) << (iterColl->pt()) << " GeV"
00523                                         << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00524                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00525                             }
00526                         }
00527                     }
00528                 } else {
00529                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " PT = "
00530                             << std::right << std::setw(6) << (iterColl->pt()) << " GeV" << " eta = "
00531                             << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
00532                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00533 
00534                 }
00535 
00536             }
00537 
00538         }
00539             break;
00540 
00541         case NoIsoEG: {
00542             oStr << "\n NoIsoEG collection\n" << std::endl;
00543 
00544             int indexInColl = -1;
00545 
00546             for (l1extra::L1EmParticleCollection::const_iterator iterColl =
00547                     m_l1ExtraNoIsoEG->begin(); iterColl
00548                     != m_l1ExtraNoIsoEG->end(); ++iterColl) {
00549 
00550                 if (checkBxInEvent) {
00551                     if (iterColl->bx() != bxInEvent) {
00552                         continue;
00553                         oStr << "\n   BxInEvent " << bxInEvent
00554                                 << ": collection not in the event" << std::endl;
00555                     } else {
00556 
00557                         indexInColl++;
00558 
00559                         if (!checkObjIndexInColl) {
00560                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00561                                     << " indexInColl = " << indexInColl
00562                                     << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00563                                     << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00564                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00565                         } else {
00566                             if (objIndexInColl == indexInColl) {
00567                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00568                                         << " indexInColl = " << indexInColl
00569                                         << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00570                                         << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00571                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00572                             }
00573                         }
00574                     }
00575                 } else {
00576                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00577                             << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
00578                             << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
00579                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00580 
00581                 }
00582 
00583             }
00584         }
00585             break;
00586 
00587         case IsoEG: {
00588             oStr << "\n IsoEG collection\n" << std::endl;
00589 
00590             int indexInColl = -1;
00591 
00592             for (l1extra::L1EmParticleCollection::const_iterator iterColl =
00593                     m_l1ExtraIsoEG->begin(); iterColl != m_l1ExtraIsoEG->end(); ++iterColl) {
00594 
00595                 if (checkBxInEvent) {
00596                     if (iterColl->bx() != bxInEvent) {
00597                         continue;
00598                         oStr << "\n   BxInEvent " << bxInEvent
00599                                 << ": collection not in the event" << std::endl;
00600                     } else {
00601 
00602                         indexInColl++;
00603 
00604                         if (!checkObjIndexInColl) {
00605                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00606                                     << " indexInColl = " << indexInColl
00607                                     << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00608                                     << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00609                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00610                         } else {
00611                             if (objIndexInColl == indexInColl) {
00612                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00613                                         << " indexInColl = " << indexInColl
00614                                         << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00615                                         << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00616                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00617                             }
00618                         }
00619                     }
00620                 } else {
00621                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00622                             << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
00623                             << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
00624                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00625 
00626                 }
00627 
00628             }
00629         }
00630             break;
00631 
00632         case CenJet: {
00633             oStr << "\n CenJet collection\n" << std::endl;
00634 
00635             int indexInColl = -1;
00636 
00637             for (l1extra::L1JetParticleCollection::const_iterator iterColl =
00638                     m_l1ExtraCenJet->begin(); iterColl
00639                     != m_l1ExtraCenJet->end(); ++iterColl) {
00640 
00641                 if (checkBxInEvent) {
00642                     if (iterColl->bx() != bxInEvent) {
00643                         continue;
00644                         oStr << "\n   BxInEvent " << bxInEvent
00645                                 << ": collection not in the event" << std::endl;
00646                     } else {
00647 
00648                         indexInColl++;
00649 
00650                         if (!checkObjIndexInColl) {
00651                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00652                                     << " indexInColl = " << indexInColl
00653                                     << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00654                                     << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00655                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00656                         } else {
00657                             if (objIndexInColl == indexInColl) {
00658                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00659                                         << " indexInColl = " << indexInColl
00660                                         << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00661                                         << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00662                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00663                             }
00664                         }
00665                     }
00666                 } else {
00667                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00668                             << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
00669                             << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
00670                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00671 
00672                 }
00673 
00674             }
00675         }
00676             break;
00677 
00678         case ForJet: {
00679             oStr << "\n ForJet collection\n" << std::endl;
00680 
00681             int indexInColl = -1;
00682 
00683             for (l1extra::L1JetParticleCollection::const_iterator iterColl =
00684                     m_l1ExtraForJet->begin(); iterColl
00685                     != m_l1ExtraForJet->end(); ++iterColl) {
00686 
00687                 if (checkBxInEvent) {
00688                     if (iterColl->bx() != bxInEvent) {
00689                         continue;
00690                         oStr << "\n   BxInEvent " << bxInEvent
00691                                 << ": collection not in the event" << std::endl;
00692                     } else {
00693 
00694                         indexInColl++;
00695 
00696                         if (!checkObjIndexInColl) {
00697                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00698                                     << " indexInColl = " << indexInColl
00699                                     << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00700                                     << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00701                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00702                         } else {
00703                             if (objIndexInColl == indexInColl) {
00704                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00705                                         << " indexInColl = " << indexInColl
00706                                         << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00707                                         << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00708                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00709                             }
00710                         }
00711                     }
00712                 } else {
00713                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00714                             << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
00715                             << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
00716                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00717 
00718                 }
00719 
00720             }
00721         }
00722             break;
00723 
00724         case TauJet: {
00725             oStr << "\n TauJet collection\n" << std::endl;
00726 
00727             int indexInColl = -1;
00728 
00729             for (l1extra::L1JetParticleCollection::const_iterator iterColl =
00730                     m_l1ExtraTauJet->begin(); iterColl
00731                     != m_l1ExtraTauJet->end(); ++iterColl) {
00732 
00733                 if (checkBxInEvent) {
00734                     if (iterColl->bx() != bxInEvent) {
00735                         continue;
00736                         oStr << "\n   BxInEvent " << bxInEvent
00737                                 << ": collection not in the event" << std::endl;
00738                     } else {
00739 
00740                         indexInColl++;
00741 
00742                         if (!checkObjIndexInColl) {
00743                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00744                                     << " indexInColl = " << indexInColl
00745                                     << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00746                                     << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00747                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00748                         } else {
00749                             if (objIndexInColl == indexInColl) {
00750                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00751                                         << " indexInColl = " << indexInColl
00752                                         << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00753                                         << " eta = " << std::right << std::setw(8) << (iterColl->eta())
00754                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00755                             }
00756                         }
00757                     }
00758                 } else {
00759                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00760                             << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " eta = "
00761                             << std::right << std::setw(8) << (iterColl->eta()) << " phi = "
00762                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00763 
00764                 }
00765 
00766             }
00767         }
00768             break;
00769 
00770         case ETM: {
00771             oStr << "\n ETM collection\n" << std::endl;
00772 
00773             int indexInColl = -1;
00774 
00775             for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
00776                     m_l1ExtraETM->begin(); iterColl != m_l1ExtraETM->end(); ++iterColl) {
00777 
00778                 if (checkBxInEvent) {
00779                     if (iterColl->bx() != bxInEvent) {
00780                         continue;
00781                         oStr << "\n   BxInEvent " << bxInEvent
00782                                 << ": collection not in the event" << std::endl;
00783                     } else {
00784 
00785                         indexInColl++;
00786 
00787                         if (!checkObjIndexInColl) {
00788                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00789                                     << " indexInColl = " << indexInColl
00790                                     << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00791                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00792                         } else {
00793                             if (objIndexInColl == indexInColl) {
00794                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00795                                         << " indexInColl = " << indexInColl
00796                                         << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00797                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00798                             }
00799                         }
00800                     }
00801                 } else {
00802                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00803                             << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " phi = "
00804                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00805 
00806                 }
00807 
00808             }
00809         }
00810             break;
00811 
00812         case ETT: {
00813             oStr << "\n ETT collection\n" << std::endl;
00814 
00815             int indexInColl = -1;
00816 
00817             for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
00818                     m_l1ExtraETT->begin(); iterColl != m_l1ExtraETT->end(); ++iterColl) {
00819 
00820                 if (checkBxInEvent) {
00821                     if (iterColl->bx() != bxInEvent) {
00822                         continue;
00823                         oStr << "\n   BxInEvent " << bxInEvent
00824                                 << ": collection not in the event" << std::endl;
00825                     } else {
00826 
00827                         indexInColl++;
00828 
00829                         if (!checkObjIndexInColl) {
00830                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00831                                     << " indexInColl = " << indexInColl
00832                                     << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
00833                         } else {
00834                             if (objIndexInColl == indexInColl) {
00835                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00836                                         << " indexInColl = " << indexInColl
00837                                         << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
00838                             }
00839                         }
00840                     }
00841                 } else {
00842                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00843                             << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
00844 
00845                 }
00846 
00847             }
00848         }
00849             break;
00850 
00851         case HTT: {
00852             oStr << "\n HTT collection\n" << std::endl;
00853 
00854             int indexInColl = -1;
00855 
00856             for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
00857                     m_l1ExtraHTT->begin(); iterColl != m_l1ExtraHTT->end(); ++iterColl) {
00858 
00859                 if (checkBxInEvent) {
00860                     if (iterColl->bx() != bxInEvent) {
00861                         continue;
00862                         oStr << "\n   BxInEvent " << bxInEvent
00863                                 << ": collection not in the event" << std::endl;
00864                     } else {
00865 
00866                         indexInColl++;
00867 
00868                         if (!checkObjIndexInColl) {
00869                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00870                                     << " indexInColl = " << indexInColl
00871                                     << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
00872                         } else {
00873                             if (objIndexInColl == indexInColl) {
00874                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00875                                         << " indexInColl = " << indexInColl
00876                                         << " ET = " << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
00877                             }
00878                         }
00879                     }
00880                 } else {
00881                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00882                             << std::right << std::setw(6) <<(iterColl->etTotal()) << " GeV" << std::endl;
00883 
00884                 }
00885 
00886             }
00887         }
00888             break;
00889 
00890         case HTM: {
00891             oStr << "\n HTM collection\n" << std::endl;
00892 
00893             int indexInColl = -1;
00894 
00895             for (l1extra::L1EtMissParticleCollection::const_iterator iterColl =
00896                     m_l1ExtraHTM->begin(); iterColl != m_l1ExtraHTM->end(); ++iterColl) {
00897 
00898                 if (checkBxInEvent) {
00899                     if (iterColl->bx() != bxInEvent) {
00900                         continue;
00901                         oStr << "\n   BxInEvent " << bxInEvent
00902                                 << ": collection not in the event" << std::endl;
00903                     } else {
00904 
00905                         indexInColl++;
00906 
00907                         if (!checkObjIndexInColl) {
00908                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00909                                     << " indexInColl = " << indexInColl
00910                                     << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00911                                     << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00912                         } else {
00913                             if (objIndexInColl == indexInColl) {
00914                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00915                                         << " indexInColl = " << indexInColl
00916                                         << " ET = " << std::right << std::setw(6) << (iterColl->et()) << " GeV"
00917                                         << " phi = " << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00918                             }
00919                         }
00920                     }
00921                 } else {
00922                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx()) << " ET = "
00923                             << std::right << std::setw(6) << (iterColl->et()) << " GeV" << " phi = "
00924                             << std::right << std::setw(8) << (iterColl->phi()) << " rad" << std::endl;
00925 
00926                 }
00927 
00928             }
00929         }
00930             break;
00931 
00932         case JetCounts: {
00933             // TODO print if and when JetCounts will be available
00934         }
00935             break;
00936 
00937         case HfBitCounts: {
00938             oStr << "\n HfBitCounts collection\n" << std::endl;
00939 
00940             for (l1extra::L1HFRingsCollection::const_iterator iterColl =
00941                     m_l1ExtraHfBitCounts->begin(); iterColl
00942                     != m_l1ExtraHfBitCounts->end(); ++iterColl) {
00943 
00944                 if (checkBxInEvent) {
00945                     if (iterColl->bx() != bxInEvent) {
00946                         continue;
00947                         oStr << "\n   BxInEvent " << bxInEvent
00948                                 << ": collection not in the event" << std::endl;
00949                     } else {
00950 
00951                         if (!checkObjIndexInColl) {
00952 
00953                             for (int iCount = 0; iCount
00954                                     < l1extra::L1HFRings::kNumRings; ++iCount) {
00955                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00956                                         << " count = " << iCount << " HF counts = "
00957                                         << (iterColl->hfBitCount(
00958                                                 (l1extra::L1HFRings::HFRingLabels) iCount)) << std::endl;
00959                             }
00960 
00961                         } else {
00962                             for (int iCount = 0; iCount
00963                                     < l1extra::L1HFRings::kNumRings; ++iCount) {
00964                                 if (objIndexInColl == iCount) {
00965                                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
00966                                             << " count = " << iCount
00967                                             << " HF counts = "
00968                                             << (iterColl->hfBitCount(
00969                                                     (l1extra::L1HFRings::HFRingLabels) iCount)) << std::endl;
00970                                 }
00971                             }
00972                         }
00973                     }
00974                 } else {
00975                     for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
00976                         if (objIndexInColl == iCount) {
00977                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx())
00978                                     << " count = " << iCount << " HF counts = "
00979                                     << (iterColl->hfBitCount(
00980                                             (l1extra::L1HFRings::HFRingLabels) iCount)) << std::endl;
00981                         }
00982                     }
00983 
00984                 }
00985 
00986             }
00987         }
00988             break;
00989 
00990         case HfRingEtSums: {
00991             oStr << "\n HfRingEtSums collection\n" << std::endl;
00992 
00993             for (l1extra::L1HFRingsCollection::const_iterator iterColl =
00994                     m_l1ExtraHfRingEtSums->begin(); iterColl
00995                     != m_l1ExtraHfRingEtSums->end(); ++iterColl) {
00996 
00997                 if (checkBxInEvent) {
00998                     if (iterColl->bx() != bxInEvent) {
00999                         continue;
01000                         oStr << "\n   BxInEvent " << bxInEvent
01001                                 << ": collection not in the event" << std::endl;
01002                     } else {
01003 
01004                         if (!checkObjIndexInColl) {
01005 
01006                             for (int iCount = 0; iCount
01007                                     < l1extra::L1HFRings::kNumRings; ++iCount) {
01008                                 oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
01009                                         << " count = " << iCount
01010                                         << " HF ET sum = "
01011                                         << (iterColl->hfEtSum(
01012                                                 (l1extra::L1HFRings::HFRingLabels) iCount)) << " GeV" << std::endl;
01013                             }
01014 
01015                         } else {
01016                             for (int iCount = 0; iCount
01017                                     < l1extra::L1HFRings::kNumRings; ++iCount) {
01018                                 if (objIndexInColl == iCount) {
01019                                     oStr << "     bxInEvent = "  << std::right << std::setw(2) << bxInEvent
01020                                             << " count = " << iCount
01021                                             << " HF ET sum = "
01022                                             << (iterColl->hfEtSum(
01023                                                     (l1extra::L1HFRings::HFRingLabels) iCount)) << " GeV" << std::endl;
01024                                 }
01025                             }
01026                         }
01027                     }
01028                 } else {
01029                     for (int iCount = 0; iCount < l1extra::L1HFRings::kNumRings; ++iCount) {
01030                         if (objIndexInColl == iCount) {
01031                             oStr << "     bxInEvent = "  << std::right << std::setw(2) << (iterColl->bx())
01032                                     << " count = " << iCount << " HF ET sum = "
01033                                     << (iterColl->hfEtSum(
01034                                             (l1extra::L1HFRings::HFRingLabels) iCount)) << " GeV" << std::endl;
01035                         }
01036                     }
01037 
01038                 }
01039 
01040             }
01041         }
01042             break;
01043 
01044         case TechTrig: {
01045             // do nothing, not in L1Extra
01046         }
01047             break;
01048 
01049         case Castor: {
01050             // do nothing, not in L1Extra
01051         }
01052             break;
01053 
01054         case BPTX: {
01055             // do nothing, not in L1Extra
01056         }
01057             break;
01058 
01059         case GtExternal: {
01060             // do nothing, not in L1Extra
01061         }
01062             break;
01063 
01064         case ObjNull: {
01065             // do nothing, not in L1Extra
01066         }
01067             break;
01068 
01069         default: {
01070             edm::LogInfo("L1GtObject") << "\n  '" << gtObject
01071                     << "' is not a recognized L1GtObject. ";
01072 
01073             // do nothing
01074 
01075         }
01076             break;
01077     }
01078 
01079 }
01080 
01081 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr,
01082         const L1GtObject& gtObject, const int bxInEvent) const {
01083 
01084     bool checkBxInEvent = true;
01085     bool checkObjIndexInColl = false;
01086     int objIndexInColl = -1;
01087 
01088     printL1Extra(oStr, gtObject, checkBxInEvent, bxInEvent,
01089             checkObjIndexInColl, objIndexInColl);
01090 }
01091 
01092 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr,
01093         const L1GtObject& gtObject) const {
01094 
01095     bool checkBxInEvent = false;
01096     bool checkObjIndexInColl = false;
01097     int bxInEvent = 999;
01098     int objIndexInColl = -1;
01099 
01100     printL1Extra(oStr, gtObject, checkBxInEvent, bxInEvent,
01101             checkObjIndexInColl, objIndexInColl);
01102 }
01103 
01104 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr, const int iBxInEvent) const {
01105 
01106     printL1Extra(oStr, Mu, iBxInEvent);
01107     printL1Extra(oStr, NoIsoEG, iBxInEvent);
01108     printL1Extra(oStr, IsoEG, iBxInEvent);
01109     printL1Extra(oStr, CenJet, iBxInEvent);
01110     printL1Extra(oStr, ForJet, iBxInEvent);
01111     printL1Extra(oStr, TauJet, iBxInEvent);
01112     printL1Extra(oStr, ETM, iBxInEvent);
01113     printL1Extra(oStr, ETT, iBxInEvent);
01114     printL1Extra(oStr, HTT, iBxInEvent);
01115     printL1Extra(oStr, HTM, iBxInEvent);
01116     // printL1Extra(oStr, JetCounts, iBxInEvent);
01117     printL1Extra(oStr, HfBitCounts, iBxInEvent);
01118     printL1Extra(oStr, HfRingEtSums, iBxInEvent);
01119 }
01120 
01121 void L1RetrieveL1Extra::printL1Extra(std::ostream& oStr) const {
01122 
01123     printL1Extra(oStr, Mu);
01124     printL1Extra(oStr, NoIsoEG);
01125     printL1Extra(oStr, IsoEG);
01126     printL1Extra(oStr, CenJet);
01127     printL1Extra(oStr, ForJet);
01128     printL1Extra(oStr, TauJet);
01129     printL1Extra(oStr, ETM);
01130     printL1Extra(oStr, ETT);
01131     printL1Extra(oStr, HTT);
01132     printL1Extra(oStr, HTM);
01133     // printL1Extra(oStr, JetCounts);
01134     printL1Extra(oStr, HfBitCounts);
01135     printL1Extra(oStr, HfRingEtSums);
01136 
01137 }