CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/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 }