CMS 3D CMS Logo

SiStripGainsPCLHarvester.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiStripChannelGain
4 // Class: SiStripGainsPCLHarvester
5 //
10 //
11 // Original Author: L. Quertermont (calibration algorithm)
12 // Contributors: M. Verzetti (data access)
13 // A. Di Mattia (PCL multi stream processing and monitoring)
14 // M. Delcourt (monitoring)
15 // M. Musich (migration to thread-safe DQMStore access)
16 //
17 // Created: Wed, 12 Apr 2017 14:46:48 GMT
18 //
19 
20 // CMSSW includes
37 
38 // user includes
40 
41 // ROOT includes
42 #include "TH1F.h"
43 #include "TH2S.h"
44 #include "TProfile.h"
45 #include "TF1.h"
46 
47 // System includes
48 #include <unordered_map>
49 
51 public:
52  explicit SiStripGainsPCLHarvester(const edm::ParameterSet& ps);
53  void beginRun(edm::Run const& run, edm::EventSetup const& isetup) override;
54  void endRun(edm::Run const& run, edm::EventSetup const& isetup) override;
55  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
56 
57 private:
58  virtual void checkBookAPVColls(const edm::EventSetup& setup);
59  void dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) override;
60  void gainQualityMonitor(DQMStore::IBooker& ibooker_, const MonitorElement* Charge_Vs_Index) const;
61  void storeGainsTree(const TAxis* chVsIdxXaxis) const;
62  int statCollectionFromMode(const char* tag) const;
63 
64  void algoComputeMPVandGain(const MonitorElement* Charge_Vs_Index);
65  void getPeakOfLandau(TH1* InputHisto,
66  double* FitResults,
67  double LowRange = 50,
68  double HighRange = 5400,
69  bool gaussianConvolution = false);
70  bool IsGoodLandauFit(double* FitResults);
71 
72  bool produceTagFilter(const MonitorElement* Charge_Vs_Index);
73  std::unique_ptr<SiStripApvGain> getNewObject(const MonitorElement* Charge_Vs_Index);
74 
78  unsigned int GOOD;
79  unsigned int BAD;
80  unsigned int MASKED;
81 
84 
87  double MinNrEntries;
88 
90 
93  std::vector<std::string> VChargeHisto;
95  std::vector<std::string> dqm_tag_;
96 
98 
99  const TrackerGeometry* bareTkGeomPtr_ = nullptr; // ugly hack to fill APV colls only once, but checks
100  std::unique_ptr<TrackerTopology> tTopo_;
101 
102  std::vector<std::shared_ptr<stAPVGain> > APVsCollOrdered;
103  std::unordered_map<unsigned int, std::shared_ptr<stAPVGain> > APVsColl;
104 
109 
110  // fit options
113  bool fit_dataDrivenRange_ = false;
114 };
std::unique_ptr< SiStripApvGain > getNewObject(const MonitorElement *Charge_Vs_Index)
void storeGainsTree(const TAxis *chVsIdxXaxis) const
void dqmEndJob(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_) override
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoTokenBR_
std::vector< std::string > dqm_tag_
void beginRun(edm::Run const &run, edm::EventSetup const &isetup) override
bool produceTagFilter(const MonitorElement *Charge_Vs_Index)
void algoComputeMPVandGain(const MonitorElement *Charge_Vs_Index)
SiStripGainsPCLHarvester(const edm::ParameterSet &ps)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
void gainQualityMonitor(DQMStore::IBooker &ibooker_, const MonitorElement *Charge_Vs_Index) const
void getPeakOfLandau(TH1 *InputHisto, double *FitResults, double LowRange=50, double HighRange=5400, bool gaussianConvolution=false)
std::vector< std::string > VChargeHisto
std::unique_ptr< TrackerTopology > tTopo_
bool IsGoodLandauFit(double *FitResults)
const TrackerGeometry * bareTkGeomPtr_
void endRun(edm::Run const &run, edm::EventSetup const &isetup) override
virtual void checkBookAPVColls(const edm::EventSetup &setup)
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
edm::ESGetToken< SiStripGain, SiStripGainRcd > gainToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoTokenER_
int statCollectionFromMode(const char *tag) const
Definition: Run.h:45
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
std::unordered_map< unsigned int, std::shared_ptr< stAPVGain > > APVsColl