dEdxAnalyzer

dEdxMEs

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
// -*- C++ -*-
//
//
/**\class dEdxAnalyzer dEdxAnalyzer.cc 
Monitoring source for general quantities related to track dEdx.
*/
// Original Author: Loic Quertenmont 2012/07/25

#include <memory>
#include <fstream>

#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DataFormats/TrackReco/interface/DeDxData.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/EDGetToken.h"

class GenericTriggerEventFlag;

class dEdxAnalyzer : public DQMEDAnalyzer {
public:
  explicit dEdxAnalyzer(const edm::ParameterSet&);
  ~dEdxAnalyzer() override;

  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

  void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
  double mass(double P, double I);

  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;

private:
  // ----------member data ---------------------------
  DQMStore* dqmStore_;
  edm::ParameterSet fullconf_;
  edm::ParameterSet conf_;

  bool doAllPlots_;
  bool doDeDxPlots_;

  struct dEdxMEs {
    MonitorElement* ME_MipDeDx;
    MonitorElement* ME_MipDeDxNHits;
    MonitorElement* ME_MipDeDxNSatHits;
    MonitorElement* ME_MipDeDxMass;
    MonitorElement* ME_HipDeDxMass;
    MonitorElement* ME_MipHighPtDeDx;
    MonitorElement* ME_MipHighPtDeDxNHits;

    dEdxMEs()
        : ME_MipDeDx(nullptr),
          ME_MipDeDxNHits(nullptr),
          ME_MipDeDxNSatHits(nullptr),
          ME_MipDeDxMass(nullptr),
          ME_HipDeDxMass(nullptr),
          ME_MipHighPtDeDx(nullptr),
          ME_MipHighPtDeDxNHits(nullptr) {}
  };

  double TrackHitMin, HIPdEdxMin, HighPtThreshold;
  double dEdxK, dEdxC;

  edm::InputTag trackInputTag_;
  edm::EDGetTokenT<reco::TrackCollection> trackToken_;

  std::vector<std::string> dEdxInputList_;
  std::vector<edm::EDGetTokenT<reco::DeDxDataValueMap> > dEdxTokenList_;

  std::string TrackName;
  std::vector<std::string> AlgoNames;
  std::vector<dEdxMEs> dEdxMEsVector;
  std::string histname;  //for naming the histograms according to algorithm used

  GenericTriggerEventFlag* genTriggerEventFlag_;
};