CMS 3D CMS Logo

TriggerSummaryAnalyzerRAW.cc

Go to the documentation of this file.
00001 
00012 #include "HLTrigger/HLTcore/interface/TriggerSummaryAnalyzerRAW.h"
00013 #include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
00014 
00015 //
00016 // constructors and destructor
00017 //
00018 TriggerSummaryAnalyzerRAW::TriggerSummaryAnalyzerRAW(const edm::ParameterSet& ps) : 
00019   inputTag_(ps.getParameter<edm::InputTag>("inputTag"))
00020 { }
00021 
00022 TriggerSummaryAnalyzerRAW::~TriggerSummaryAnalyzerRAW()
00023 {
00024 }
00025 
00026 //
00027 // member functions
00028 //
00029 
00030 // ------------ method called to produce the data  ------------
00031 void
00032 TriggerSummaryAnalyzerRAW::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00033 {
00034    using namespace std;
00035    using namespace edm;
00036    using namespace reco;
00037    using namespace l1extra;
00038    using namespace trigger;
00039 
00040    cout << endl;
00041    cout << "TriggerSummaryAnalyzerRAW: content of TriggerEventWithRefs: " << inputTag_.encode();
00042 
00043    Handle<TriggerEventWithRefs> handle;
00044    iEvent.getByLabel(inputTag_,handle);
00045    if (handle.isValid()) {
00046      cout << "Used Processname: " << handle->usedProcessName() << endl;
00047      const size_type nFO(handle->size());
00048      cout << "Number of TriggerFilterObjects: " << nFO << endl;
00049      cout << "The TriggerFilterObjects: #, tag" << endl;
00050      for (size_type iFO=0; iFO!=nFO; ++iFO) {
00051        cout << iFO << " " << handle->filterTag(iFO).encode() << endl;
00052        cout << "  # of objects:";
00053 
00054        const unsigned int nPhotons(handle->photonSlice(iFO).second-
00055                                    handle->photonSlice(iFO).first);
00056        if (nPhotons>0) cout << " Photons: " << nPhotons;
00057 
00058        const unsigned int nElectrons(handle->electronSlice(iFO).second-
00059                                      handle->electronSlice(iFO).first);
00060        if (nElectrons>0) cout << " Electrons: " << nElectrons;
00061 
00062        const unsigned int nMuons(handle->muonSlice(iFO).second-
00063                                  handle->muonSlice(iFO).first);
00064        if (nMuons>0) cout << " Muons: " << nMuons;
00065 
00066        const unsigned int nJets(handle->jetSlice(iFO).second-
00067                                 handle->jetSlice(iFO).first);
00068        if (nJets>0) cout << " Jets: " << nJets;
00069 
00070        const unsigned int nComposites(handle->compositeSlice(iFO).second-
00071                                       handle->compositeSlice(iFO).first);
00072        if (nComposites>0) cout << " Composites: " << nComposites;
00073 
00074        const unsigned int nBaseMETs(handle->basemetSlice(iFO).second-
00075                                     handle->basemetSlice(iFO).first);
00076        if (nBaseMETs>0) cout << " BaseMETs: " << nBaseMETs;
00077 
00078        const unsigned int nCaloMETs(handle->calometSlice(iFO).second-
00079                                     handle->calometSlice(iFO).first);
00080        if (nCaloMETs>0) cout << " CaloMETs: " << nCaloMETs;
00081 
00082        const unsigned int nPixTracks(handle->pixtrackSlice(iFO).second-
00083                                      handle->pixtrackSlice(iFO).first);
00084        if (nPixTracks>0) cout << " PixTracks: " << nPixTracks;
00085 
00086        const unsigned int nL1EM(handle->l1emSlice(iFO).second-
00087                                 handle->l1emSlice(iFO).first);
00088        if (nL1EM>0) cout << " L1EM: " << nL1EM;
00089 
00090        const unsigned int nL1Muon(handle->l1muonSlice(iFO).second-
00091                                   handle->l1muonSlice(iFO).first);
00092        if (nL1Muon>0) cout << " L1Muon: " << nL1Muon;
00093 
00094        const unsigned int nL1Jet(handle->l1jetSlice(iFO).second-
00095                                  handle->l1jetSlice(iFO).first);
00096        if (nL1Jet>0) cout << " L1Jet: " << nL1Jet;
00097 
00098        const unsigned int nL1EtMiss(handle->l1etmissSlice(iFO).second-
00099                                     handle->l1etmissSlice(iFO).first);
00100        if (nL1EtMiss>0) cout << " L1EtMiss: " << nL1EtMiss;
00101 
00102        cout << endl;
00103      }
00104      cout << "Elements in linearised collections of Refs: " << endl;
00105      cout << "  Photons:    " << handle->photonSize()    << endl;
00106      cout << "  Electrons:  " << handle->electronSize()  << endl;
00107      cout << "  Muons:      " << handle->muonSize()      << endl;
00108      cout << "  Jets:       " << handle->jetSize()       << endl;
00109      cout << "  Composites: " << handle->compositeSize() << endl;
00110      cout << "  BaseMETs:   " << handle->basemetSize()   << endl;
00111      cout << "  CaloMETs:   " << handle->calometSize()   << endl;
00112      cout << "  Pixtracks:  " << handle->pixtrackSize()  << endl;
00113      cout << "  L1EM:       " << handle->l1emSize()      << endl;
00114      cout << "  L1Muon:     " << handle->l1muonSize()    << endl;
00115      cout << "  L1Jet:      " << handle->l1jetSize()     << endl;
00116      cout << "  L1EtMiss:   " << handle->l1etmissSize()  << endl;
00117    } else {
00118      cout << "Handle invalid! Check InputTag provided." << endl;
00119    }
00120    cout << endl;
00121    
00122    return;
00123 }

Generated on Tue Jun 9 17:37:53 2009 for CMSSW by  doxygen 1.5.4