DigiVtxPosCorrHistogramMaker

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
#ifndef DPGAnalysis_SiStripTools_DigiVtxPosCorrHistogramMaker_H
#define DPGAnalysis_SiStripTools_DigiVtxPosCorrHistogramMaker_H

#include <string>
#include <map>
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"

namespace edm {
  class ParameterSet;
  class Event;
}  // namespace edm
class TH2F;
class TProfile;
class TFileDirectory;

class DigiVtxPosCorrHistogramMaker {
public:
  DigiVtxPosCorrHistogramMaker(edm::ConsumesCollector&& iC);
  DigiVtxPosCorrHistogramMaker(const edm::ParameterSet& iConfig, edm::ConsumesCollector&& iC);

  ~DigiVtxPosCorrHistogramMaker();

  void book(const std::string dirname, const std::map<unsigned int, std::string>& labels);
  void book(const std::string dirname);
  void beginRun(const unsigned int nrun);
  void fill(const edm::Event& iEvent, const std::map<unsigned int, int>& ndigi);

private:
  edm::EDGetTokenT<edm::HepMCProduct> m_mcvtxcollectionToken;
  std::string m_hitname;
  const int m_nbins;
  const int m_scalefact;
  std::map<unsigned int, int> m_binmax;
  std::map<unsigned int, std::string> m_labels;

  std::map<unsigned int, TH2F*> m_nmultvsvtxpos;
  std::map<unsigned int, TProfile*> m_nmultvsvtxposprof;
  std::map<unsigned int, TFileDirectory*> m_subdirs;
};

#endif  //  DPGAnalysis_SiStripTools_DigiVtxPosCorrHistogramMaker_H