CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/HLTrigger/HLTcore/plugins/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        const unsigned int nL1HfRings(handle->l1hfringsSlice(iFO).second-
00103                                     handle->l1hfringsSlice(iFO).first);
00104        if (nL1HfRings>0) cout << " L1HfRings: " << nL1HfRings;
00105 
00106        const unsigned int nPFJets(handle->pfjetSlice(iFO).second-
00107                                 handle->pfjetSlice(iFO).first);
00108        if (nPFJets>0) cout << " PFJets: " << nPFJets;
00109 
00110        const unsigned int nPFTaus(handle->pftauSlice(iFO).second-
00111                                 handle->pftauSlice(iFO).first);
00112        if (nPFTaus>0) cout << " PFTaus: " << nPFTaus;
00113 
00114        cout << endl;
00115      }
00116      cout << "Elements in linearised collections of Refs: " << endl;
00117      cout << "  Photons:    " << handle->photonSize()    << endl;
00118      cout << "  Electrons:  " << handle->electronSize()  << endl;
00119      cout << "  Muons:      " << handle->muonSize()      << endl;
00120      cout << "  Jets:       " << handle->jetSize()       << endl;
00121      cout << "  Composites: " << handle->compositeSize() << endl;
00122      cout << "  BaseMETs:   " << handle->basemetSize()   << endl;
00123      cout << "  CaloMETs:   " << handle->calometSize()   << endl;
00124      cout << "  Pixtracks:  " << handle->pixtrackSize()  << endl;
00125      cout << "  L1EM:       " << handle->l1emSize()      << endl;
00126      cout << "  L1Muon:     " << handle->l1muonSize()    << endl;
00127      cout << "  L1Jet:      " << handle->l1jetSize()     << endl;
00128      cout << "  L1EtMiss:   " << handle->l1etmissSize()  << endl;
00129      cout << "  L1HfRings:  " << handle->l1hfringsSize() << endl;
00130      cout << "  PFJets:     " << handle->pfjetSize()     << endl;
00131      cout << "  PFTaus:     " << handle->pftauSize()     << endl;
00132    } else {
00133      cout << "Handle invalid! Check InputTag provided." << endl;
00134    }
00135    cout << endl;
00136    
00137    return;
00138 }