ValidationHcalIsoTrackAlCaReco

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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
// -*- C++ -*-
//
// Package:    Calibration/HcalCalibAlgos/plugins
// Class:      ValidationHcalIsoTrackAlCaReco
//
/**\class ValidationHcalIsoTrackAlCaReco ValidationHcalIsoTrackAlCaReco.cc Calibration/HcalCalibAlgos/plugins/ValidationHcalIsoTrackAlCaReco.cc

 Description: <one line class summary>

 Implementation:
     <Notes on implementation>
*/
//
// Original Author:  Grigory SAFRONOV, Sergey PETRUSHANKO
//         Created:  Tue Oct  14 16:10:31 CEST 2008
//
//

// system include files
#include <memory>

// user include files

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

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

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

#include "DataFormats/HLTReco/interface/TriggerEvent.h"
#include "DataFormats/L1Trigger/interface/L1JetParticle.h"
#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"

#include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
#include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"

#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"

#include "CondFormats/L1TObjects/interface/L1GtPrescaleFactors.h"
#include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsAlgoTrigRcd.h"
#include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsTechTrigRcd.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidate.h"
#include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h"

// Sergey +

#include "SimDataFormats/Track/interface/SimTrack.h"
#include "SimDataFormats/Track/interface/SimTrackContainer.h"

// Sergey -

#include <fstream>

#include "TH1F.h"

class ValidationHcalIsoTrackAlCaReco : public edm::one::EDAnalyzer<> {
public:
  typedef dqm::legacy::MonitorElement MonitorElement;
  typedef dqm::legacy::DQMStore DQMStore;
  explicit ValidationHcalIsoTrackAlCaReco(const edm::ParameterSet&);
  ~ValidationHcalIsoTrackAlCaReco();

private:
  DQMStore* dbe_;

  virtual void beginJob();
  virtual void analyze(const edm::Event&, const edm::EventSetup&);
  virtual void endJob();

  const std::string folderName_;
  const bool saveToFile_;
  const std::string outRootFileName_;
  const edm::InputTag hltFilterTag_;
  const edm::InputTag recoTrLabel_;

  const double pThr_;
  const double heLow_;
  const double heUp_;

  const edm::EDGetTokenT<trigger::TriggerEvent> tok_hlt_;
  const edm::EDGetTokenT<reco::IsolatedPixelTrackCandidateCollection> tok_arITr_;
  const edm::EDGetTokenT<edm::SimTrackContainer> tok_simTrack_;

  MonitorElement* hl3Pt;
  MonitorElement* hl3eta;
  MonitorElement* hl3AbsEta;
  MonitorElement* hl3phi;
  MonitorElement* hOffL3TrackMatch;
  MonitorElement* hOffL3TrackPtRat;

  MonitorElement* hOffP_0005;
  MonitorElement* hOffP_0510;
  MonitorElement* hOffP_1015;
  MonitorElement* hOffP_1520;

  MonitorElement* hOffP;

  MonitorElement* hTracksSumP;
  MonitorElement* hTracksMaxP;

  MonitorElement* hDeposEcalInner;
  MonitorElement* hDeposEcalOuter;

  MonitorElement* hOffEtaFP;
  MonitorElement* hOffAbsEta;
  MonitorElement* hOffPhiFP;

  MonitorElement* hOffEta;
  MonitorElement* hOffPhi;

  MonitorElement* hOccupancyFull;
  MonitorElement* hOccupancyHighEn;

  MonitorElement* hPurityEta;
  MonitorElement* hPurityPhi;

  // Sergey +

  MonitorElement* hSimPt;
  MonitorElement* hSimPhi;
  MonitorElement* hSimEta;
  MonitorElement* hSimAbsEta;
  MonitorElement* hSimDist;
  MonitorElement* hSimPtRatOff;
  MonitorElement* hSimP;
  MonitorElement* hSimN;
  MonitorElement* hSimNN;
  MonitorElement* hSimNE;
  MonitorElement* hSimNM;

  // Sergey -

  int nTotal;
  int nHLTL3accepts;

  double getDist(double, double, double, double);

  // Sergey +

  double getDistInCM(double eta1, double phi1, double eta2, double phi2);

  // Sergey -

  std::pair<int, int> towerIndex(double eta, double phi);
};