CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/HLTriggerOffline/SUSYBSM/interface/TriggerValidator.h

Go to the documentation of this file.
00001 #ifndef SusyBsmTriggerPerformance_TriggerValidator_TriggerValidator_h
00002 #define SusyBsmTriggerPerformance_TriggerValidator_TriggerValidator_h
00003 
00004 // -*- C++ -*-
00005 //
00006 // Package:    TriggerValidator
00007 // Class:      TriggerValidator
00008 // 
00016 //
00017 // Original Author:  Massimiliano Chiorboli
00018 //                   Maurizio Pierini
00019 //                   Maria Spiropulu
00020 //         Created:  Wed Aug 29 15:10:56 CEST 2007
00021 // $Id: TriggerValidator.h,v 1.16 2010/12/14 17:20:35 vlimant Exp $
00022 //
00023 //
00024 
00025 // system include files
00026 #include <memory>
00027 #include <fstream>
00028 #include <iostream>
00029 
00030 // user include files
00031 #include "FWCore/Framework/interface/Frameworkfwd.h"
00032 #include "FWCore/Framework/interface/EDAnalyzer.h"
00033 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00034 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00035 
00036 #include "HLTriggerOffline/SUSYBSM/interface/RecoSelector.h"
00037 #include "HLTriggerOffline/SUSYBSM/interface/McSelector.h"
00038 
00039 //To be included in a second stage
00040 #include "HLTriggerOffline/SUSYBSM/interface/PlotMakerL1.h"
00041 #include "HLTriggerOffline/SUSYBSM/interface/PlotMakerReco.h"
00042 #include "HLTriggerOffline/SUSYBSM/interface/MuonAnalyzer.h"
00043 //#include "HLTriggerOffline/SUSYBSM/interface/TurnOnMaker.h"
00044 
00045 //included for DQM
00046 #include "DQMServices/Core/interface/DQMStore.h"
00047 #include "DQMServices/Core/interface/MonitorElement.h"
00048 #include "FWCore/ServiceRegistry/interface/Service.h"
00049 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00050 
00051 
00052 
00053 
00054 class TriggerValidator : public edm::EDAnalyzer {
00055    public:
00056       explicit TriggerValidator(const edm::ParameterSet&);
00057       ~TriggerValidator();
00058 
00059       TFile* theHistoFile;
00060 
00061    private:
00062       virtual void beginJob() ;
00063       virtual void analyze(const edm::Event&, const edm::EventSetup&);
00064       virtual void endJob() ;
00065 
00066 
00067       void beginRun(const edm::Run& run, const edm::EventSetup& c);
00068       void endRun(const edm::Run& run, const edm::EventSetup& c);
00069 
00070       
00071       std::map<int,std::string> l1NameMap;
00072       // ----------member data ---------------------------
00073       DQMStore * dbe_;
00074       std::string dirname_;
00075       HLTConfigProvider hltConfig_;
00076       // --- names of the folders in the dbe ---
00077       std::string triggerBitsDir ;
00078       std::string recoSelBitsDir ; 
00079       std::string mcSelBitsDir   ;      
00080 
00081 
00082 
00083       unsigned int nHltPaths;
00084       int nL1Bits;
00085 
00086 
00087       //RecoSelector
00088       std::vector<RecoSelector*> myRecoSelector;
00089       std::vector<McSelector*> myMcSelector;
00090       
00091       //For the moment I switch off the more complex plots
00092        PlotMakerL1* myPlotMakerL1; 
00093        PlotMakerReco* myPlotMakerReco; 
00094 /*       TurnOnMaker* myTurnOnMaker; */
00095 
00096       //Histo
00097       std::string HistoFileName;
00098       std::string StatFileName;
00099       edm::InputTag l1Label;
00100       edm::InputTag hltLabel;
00101 
00102       //McFlag
00103       bool mcFlag;
00104       bool l1Flag;
00105 
00106       //Cut parameters decided by the user
00107       std::vector<edm::ParameterSet> reco_parametersets;
00108       std::vector<edm::ParameterSet> mc_parametersets;
00109       edm::ParameterSet turnOn_params;
00110       edm::ParameterSet plotMakerL1Input;
00111       edm::ParameterSet plotMakerRecoInput;
00112 
00113       edm::InputTag muonTag_;
00114       edm::InputTag triggerTag_;
00115       std::string processName_;
00116       std::string triggerName_;
00117       // name of each L1 algorithm
00118       std::vector<std::string> l1Names_;    
00119       // name of each hlt algorithm
00120       std::vector<std::string>  hlNames_;  
00121 
00122 
00123       //Counters for L1 and HLT
00124       std::vector<int> numTotL1BitsBeforeCuts;
00125       std::vector<int> numTotHltBitsBeforeCuts;
00126       std::vector< std::vector<int> > numTotL1BitsAfterRecoCuts;
00127       std::vector< std::vector<int> > numTotHltBitsAfterRecoCuts;
00128       std::vector< std::vector<int> > numTotL1BitsAfterMcCuts;
00129       std::vector< std::vector<int> > numTotHltBitsAfterMcCuts;
00130 
00131       std::vector<double> effL1BeforeCuts;
00132       std::vector<double> effHltBeforeCuts;
00133       std::vector<double> effL1AfterRecoCuts;
00134       std::vector<double> effHltAfterRecoCuts;
00135       std::vector<double> effL1AfterMcCuts;
00136       std::vector<double> effHltAfterMcCuts;
00137       
00138       
00139 
00140       std::vector< std::vector<int> > vCorrL1;
00141       std::vector< std::vector<int> > vCorrHlt;
00142       std::vector< std::vector<double> > vCorrNormL1;
00143       std::vector< std::vector<double> > vCorrNormHlt;
00144 
00145       int nEvTot;
00146       std::vector<int> nEvRecoSelected;
00147       std::vector<int> nEvMcSelected;
00148 
00149 
00150 
00151       
00152       //Histos for L1 and HLT bits
00153       MonitorElement* hL1BitsBeforeCuts;        
00154       MonitorElement* hHltBitsBeforeCuts;       
00155       std::vector<MonitorElement*> hL1BitsAfterRecoCuts;        
00156       std::vector<MonitorElement*> hHltBitsAfterRecoCuts;  
00157       std::vector<MonitorElement*> hL1BitsAfterMcCuts;  
00158       std::vector<MonitorElement*> hHltBitsAfterMcCuts;  
00159 
00160       MonitorElement* hL1PathsBeforeCuts;
00161       MonitorElement* hHltPathsBeforeCuts;
00162       std::vector<MonitorElement*> hL1PathsAfterRecoCuts;
00163       std::vector<MonitorElement*> hHltPathsAfterRecoCuts;
00164       std::vector<MonitorElement*> hL1PathsAfterMcCuts;
00165       std::vector<MonitorElement*> hHltPathsAfterMcCuts;
00166         
00167 
00168       //if we want to keep these, probably thay have to move to the client      
00169 /*       TH2D* hL1OverlapNormToTotal; */
00170 /*       TH2D* hHltOverlapNormToTotal; */
00171 /*       TH2D* hL1OverlapNormToLargestPath; */
00172 /*       TH2D* hHltOverlapNormToLargestPath; */
00173 
00174       std::vector<int> l1bits;
00175       std::vector<int> hltbits;
00176 
00177       bool firstEvent;
00178 
00179       MuonAnalyzerSBSM* myMuonAnalyzer;
00180 };
00181 
00182 
00183 
00184 #endif