CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DQM/DataScouting/plugins/AlphaTVarAnalyzer.cc

Go to the documentation of this file.
00001 #include "DQM/DataScouting/plugins/AlphaTVarAnalyzer.h"
00002 
00003 #include "DataFormats/JetReco/interface/CaloJet.h"
00004 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00005 
00006 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00007 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
00008 
00009 #include "DataFormats/MuonReco/interface/Muon.h"
00010 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
00011 
00012 #include <cmath>
00013 
00014 //------------------------------------------------------------------------------
00015 // A simple constructor which takes as inoput only the name of the PF jet collection
00016 AlphaTVarAnalyzer::AlphaTVarAnalyzer( const edm::ParameterSet & conf ):
00017   ScoutingAnalyzerBase(conf),
00018   m_jetCollectionTag(conf.getUntrackedParameter<edm::InputTag>("jetCollectionName",edm::InputTag("hltCaloJetIDPassed"))),
00019   m_alphaTVarCollectionTag(conf.getUntrackedParameter<edm::InputTag>("alphaTVarCollectionName")){
00020 }
00021 
00022 //------------------------------------------------------------------------------
00023 // Nothing to destroy: the DQM service thinks about everything
00024 AlphaTVarAnalyzer::~AlphaTVarAnalyzer(){}
00025 
00026 //------------------------------------------------------------------------------
00027 // Usual analyze method
00028 void AlphaTVarAnalyzer::analyze( const edm::Event & iEvent, const edm::EventSetup & c ){
00029   
00030   edm::Handle<std::vector<double> > alphaTvar_handle;
00031   iEvent.getByLabel(m_alphaTVarCollectionTag,alphaTvar_handle);
00032 
00033   if(alphaTvar_handle->size() > 1){
00034     const double AlphaT = alphaTvar_handle->at(0);
00035     const double HT = alphaTvar_handle->at(1);
00036     m_HTAlphaT->Fill(HT,AlphaT);
00037     if(AlphaT > 0.55) m_HTAlphaTg0p55->Fill(HT);
00038     if(AlphaT > 0.60) m_HTAlphaTg0p60->Fill(HT);
00039     
00040   }
00041   
00042 }
00043 
00044 void AlphaTVarAnalyzer::endRun( edm::Run const &, edm::EventSetup const & ){
00045 }
00046 
00047 //------------------------------------------------------------------------------
00048 // Function to book the Monitoring Elements.
00049 void AlphaTVarAnalyzer::bookMEs(){
00050   
00051   //the full inclusive histograms
00052   m_HTAlphaT = bookH2withSumw2("HTvsAlphaT",
00053                                "H_{T} vs #alpha_{T} (All Events)",
00054                                400,0.,4000.,
00055                                50,0.,1.,
00056                                "H_{T} [GeV]",
00057                                "#alpha_{T}");
00058   m_HTAlphaTg0p55 = bookH1withSumw2("HTvsAlphaTg0p55",
00059                                    "H_{T} (#alpha_{T} > 0.55)",
00060                                    400,0.,4000.,
00061                                    "H_{T} [GeV]");
00062 
00063   m_HTAlphaTg0p60 = bookH1withSumw2("HTvsAlphaTg0p60",
00064                                    "H_{T} (#alpha_{T} > 0.60)",
00065                                    400,0.,4000.,
00066                                    "H_{T} [GeV]");
00067 }
00068