HLTExoticaPlotter

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#ifndef HLTriggerOffline_Exotica_HLTExoticaPlotter_H
#define HLTriggerOffline_Exotica_HLTExoticaPlotter_H

/** \class HLTExoticaPlotter
 *  Generate histograms for trigger efficiencies Exotica related
 *  Documentation available on the CMS TWiki:
 *  https://twiki.cern.ch/twiki/bin/view/CMS/EXOTICATriggerValidation
 *
 *  \author  Thiago R. Fernandez Perez Tomei
 *           Based and adapted from:
 *           J. Duarte Campderros code from HLTriggerOffline/Higgs
 *           J. Klukas, M. Vander Donckt and J. Alcaraz code
 *           from the HLTriggerOffline/Muon package.
 */

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/Candidate/interface/LeafCandidate.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
#include "DataFormats/EgammaCandidates/interface/Photon.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"

#include "DQMServices/Core/interface/DQMStore.h"

#include <cstring>
#include <map>
#include <set>
#include <vector>

// const unsigned int kNull = (unsigned int) - 1;

struct EVTColContainer;

class HLTExoticaPlotter {
public:
  typedef dqm::legacy::DQMStore DQMStore;
  typedef dqm::legacy::MonitorElement MonitorElement;

  HLTExoticaPlotter(const edm::ParameterSet &pset,
                    const std::string &hltPath,
                    const std::vector<unsigned int> &objectsType);
  ~HLTExoticaPlotter();
  void beginJob();
  void beginRun(const edm::Run &, const edm::EventSetup &);
  void plotterBookHistos(DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup);
  void analyze(const bool &isPassTrigger,
               const std::string &source,
               const std::vector<reco::LeafCandidate> &matches,
               std::map<int, double> theSumEt,
               std::vector<float> &dxys);

  inline const std::string gethltpath() const { return _hltPath; }

private:
  void bookHist(DQMStore::IBooker &iBooker,
                const std::string &source,
                const std::string &objType,
                const std::string &variable);
  void fillHist(const bool &passTrigger,
                const std::string &source,
                const std::string &objType,
                const std::string &var,
                const float &value);

  std::string _hltPath;
  std::string _hltProcessName;

  std::set<unsigned int> _objectsType;
  // Number of objects (elec,muons, ...) needed in the hlt path
  unsigned int _nObjects;

  std::vector<double> _parametersEta;
  std::vector<double> _parametersPhi;
  std::vector<double> _parametersTurnOn;
  std::vector<double> _parametersTurnOnSumEt;
  std::vector<double> _parametersDxy;

  // flag to switch off
  bool _drop_pt2;
  bool _drop_pt3;

  std::map<std::string, MonitorElement *> _elements;
};
#endif