CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/HLTriggerOffline/Egamma/interface/EmDQMReco.h

Go to the documentation of this file.
00001 #ifndef HLTriggerOffline_Egamma_EmDQMReco_H
00002 #define HLTriggerOffline_Egamma_EmDQMReco_H
00003 
00004 
00005 // Base Class Headers
00006 #include "DataFormats/Common/interface/Handle.h"
00007 #include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
00008 #include "FWCore/Framework/interface/EDAnalyzer.h"
00009 #include "FWCore/Framework/interface/Frameworkfwd.h"
00010 #include "FWCore/Framework/interface/Event.h"
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 #include "FWCore/Utilities/interface/InputTag.h"
00013 #include "DataFormats/Common/interface/RefToBase.h"
00014 #include "DQMServices/Core/interface/DQMStore.h"
00015 #include "DQMServices/Core/interface/MonitorElement.h"
00016 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00017 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00018 #include <vector>
00019 #include "TDirectory.h"
00020 #include "HepMC/GenParticle.h"
00021 #include "CommonTools/Utils/interface/PtComparator.h"
00022 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00023 
00024 #include <boost/ptr_container/ptr_vector.hpp>
00025 
00026 class EmDQMReco : public edm::EDAnalyzer{
00027 
00028   //----------------------------------------
00029 
00033   class FourVectorMonitorElements
00034   {
00035 
00036   public:
00043     FourVectorMonitorElements(EmDQMReco *_parent,
00044         const std::string &histogramNameTemplate,
00045         const std::string &histogramTitleTemplate);
00046 
00047     void fill(const math::XYZTLorentzVector &momentum);
00048 
00049   private:
00051     EmDQMReco *parent;
00052 
00054     MonitorElement* etMonitorElement;
00055     MonitorElement* etaMonitorElement;
00056     MonitorElement* phiMonitorElement;
00057 
00058   };
00059   //----------------------------------------
00060 
00061 public:
00062 
00063 
00065   explicit EmDQMReco(const edm::ParameterSet& pset);
00066 
00068   ~EmDQMReco();
00069 
00070   // Operations
00071 
00072   void analyze(const edm::Event & event, const edm::EventSetup&);
00073   void beginJob();
00074   void endJob();
00075   void beginRun( const edm::Run&, const edm::EventSetup& );
00076 
00077 private:
00078   // Input from cfg file
00079 
00081   std::vector<edm::InputTag> theHLTCollectionLabels;
00082 
00083   unsigned int numOfHLTCollectionLabels;  // Will be size of above vector
00084 
00085   bool useHumanReadableHistTitles;
00086   std::vector<std::string> theHLTCollectionHumanNames; // Human-readable names for the collections
00087   edm::InputTag theL1Seed;
00088   std::vector<int> theHLTOutputTypes;
00089   std::vector<bool> plotiso;
00090   std::vector<std::vector<edm::InputTag> > isoNames; // there has to be a better solution
00091   std::vector<std::pair<double,double> > plotBounds;
00092   std::string theHltName;
00093   HLTConfigProvider hltConfig_;
00094   bool isHltConfigInitialized_;
00095 
00097   //          Read from configuration file                  //
00099   // parameters for generator study
00100   unsigned int reqNum;
00101   int   pdgGen;
00102   double recoEtaAcc;
00103   double recoEtAcc;
00104   // plotting paramters
00105   double plotEtaMax;
00106   double plotPtMin ;
00107   double plotPtMax ;
00108   double plotPhiMax;
00109 
00111   unsigned int plotBins ;
00112 
00113   // preselction cuts
00114   edm::InputTag recocutCollection_;
00115   unsigned int recocut_;
00116 
00119   std::string triggerNameRecoMonPath;
00120 
00124   std::string processNameRecoMonPath;
00125 
00129   edm::InputTag recoElectronsInputTag;
00130 
00132   //          Create Histograms                             //
00134 
00137 // std::vector<MonitorElement*> etahist;
00138 //  std::vector<MonitorElement*> ethist;
00139 //  std::vector<MonitorElement*> phiHist;
00140 
00141   boost::ptr_vector<FourVectorMonitorElements> standardHist;
00142 
00143 //  std::vector<MonitorElement*> etahistmatchreco;
00144 //  std::vector<MonitorElement*> ethistmatchreco;
00145 //  std::vector<MonitorElement*> phiHistMatchReco;
00146   boost::ptr_vector<FourVectorMonitorElements> histMatchReco;
00147 
00148 //  std::vector<MonitorElement*> etahistmatchrecomonpath;
00149 //  std::vector<MonitorElement*> ethistmatchrecomonpath;
00150 //  std::vector<MonitorElement*> phiHistMatchRecoMonPath;
00151   boost::ptr_vector<FourVectorMonitorElements> histMatchRecoMonPath;
00152 
00153 
00154 //  std::vector<MonitorElement*> histEtOfHltObjMatchToReco;
00155 //  std::vector<MonitorElement*> histEtaOfHltObjMatchToReco;
00156 //  std::vector<MonitorElement*> histPhiOfHltObjMatchToReco;
00157   boost::ptr_vector<FourVectorMonitorElements> histHltObjMatchToReco;
00158 
00163   std::vector<MonitorElement*> etahistiso;
00164   std::vector<MonitorElement*> ethistiso;
00165   std::vector<MonitorElement*> phiHistIso;
00166 
00167   std::vector<MonitorElement*> etahistisomatchreco;
00168   std::vector<MonitorElement*> ethistisomatchreco;
00169   std::vector<MonitorElement*> phiHistIsoMatchReco;
00170 
00171   std::vector<MonitorElement*> histEtIsoOfHltObjMatchToReco;
00172   std::vector<MonitorElement*> histEtaIsoOfHltObjMatchToReco;
00173   std::vector<MonitorElement*> histPhiIsoOfHltObjMatchToReco;
00178   MonitorElement* totalreco;
00179   MonitorElement* totalmatchreco;
00180 
00183 //  MonitorElement* etreco;
00184 //  MonitorElement* etareco;
00185 //  MonitorElement* phiReco;
00186   boost::scoped_ptr<FourVectorMonitorElements> histReco;
00187 
00188   //  MonitorElement* etrecomonpath;
00189   //  MonitorElement* etarecomonpath;
00190   //  MonitorElement* phiRecoMonPath;
00191   boost::scoped_ptr<FourVectorMonitorElements> histRecoMonpath;
00192 
00193   //  MonitorElement* etahistmonpath;
00194   //  MonitorElement* ethistmonpath;
00195   //  MonitorElement* phiHistMonPath;
00196   boost::scoped_ptr<FourVectorMonitorElements> histMonpath;
00199   int eventnum;
00200   // int prescale;
00201 
00202   // interface to DQM framework
00203   DQMStore * dbe;
00204   std::string dirname_;
00205 
00206   template <class T> void fillHistos(edm::Handle<trigger::TriggerEventWithRefs>&,const edm::Event& ,unsigned int, std::vector<reco::Particle>&, bool, bool);
00207   GreaterByPt<reco::Particle> pTComparator_;
00208   GreaterByPt<reco::GsfElectron> pTRecoComparator_;
00209 
00210 
00211   //----------------------------------------
00212 };
00213 #endif