File indexing completed on 2024-04-06 12:11:24
0001 #ifndef FastSimulation_TrackingRecHitProducer_PixelResolutionHistograms_h
0002 #define FastSimulation_TrackingRecHitProducer_PixelResolutionHistograms_h 1
0003
0004 class TFile;
0005 class TH1F;
0006 class TH2F;
0007 class TAxis;
0008 class RandomEngineAndDistribution;
0009 class SimpleHistogramGenerator;
0010
0011 #include <memory>
0012 #include <string>
0013
0014
0015
0016
0017
0018 static constexpr unsigned int COTBETA_HIST_MAX = 30;
0019 static constexpr unsigned int COTALPHA_HIST_MAX = 20;
0020 static constexpr unsigned int QBIN_HIST_MAX = 4;
0021
0022 class PixelResolutionHistograms {
0023 public:
0024
0025
0026
0027
0028 PixelResolutionHistograms(std::string filename,
0029 std::string rootdir,
0030 std::string descTitle,
0031 unsigned int detType,
0032 double cotbetaBinWidth,
0033 double cotbetaLowEdge,
0034 int cotbetaBins,
0035 double cotalphaBinWidth,
0036 double cotalphaLowEdge,
0037 int cotalphaBins);
0038
0039
0040
0041
0042
0043
0044
0045
0046 PixelResolutionHistograms(std::string filename,
0047 std::string rootdir = "",
0048 int detType = -1,
0049 bool ignore_multi = false,
0050 bool ignore_single = false,
0051 bool ignore_qBin = false);
0052
0053
0054 virtual ~PixelResolutionHistograms();
0055
0056
0057
0058 inline int status() { return status_; }
0059
0060
0061 int Fill(double dx,
0062 double dy,
0063 double cotalpha,
0064 double cotbeta,
0065 int qbin,
0066 int nxpix,
0067 int nypix);
0068
0069
0070 const SimpleHistogramGenerator* getGeneratorX(double cotalpha, double cotbeta, int qbin, bool singlex);
0071
0072 const SimpleHistogramGenerator* getGeneratorY(double cotalpha, double cotbeta, int qbin, bool singley);
0073
0074 private:
0075
0076 bool weOwnHistograms_;
0077
0078
0079 unsigned int detType_;
0080
0081
0082 double cotbetaBinWidth_;
0083 double cotbetaLowEdge_;
0084 int cotbetaBins_;
0085 double cotalphaBinWidth_;
0086 double cotalphaLowEdge_;
0087 int cotalphaBins_;
0088 int qbinWidth_;
0089 int qbins_;
0090
0091
0092 TH2F* binningHisto_;
0093 TAxis* cotbetaAxis_;
0094 TAxis* cotalphaAxis_;
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108 TH1F* resMultiPixelXHist_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX][QBIN_HIST_MAX];
0109 TH1F* resSinglePixelXHist_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX];
0110 TH1F* resMultiPixelYHist_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX][QBIN_HIST_MAX];
0111 TH1F* resSinglePixelYHist_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX];
0112 TH1F* qbinHist_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX];
0113
0114
0115 std::unique_ptr<TFile> file_;
0116
0117
0118 int status_;
0119
0120
0121 SimpleHistogramGenerator* resMultiPixelXGen_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX][QBIN_HIST_MAX];
0122 SimpleHistogramGenerator* resSinglePixelXGen_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX];
0123 SimpleHistogramGenerator* resMultiPixelYGen_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX][QBIN_HIST_MAX];
0124 SimpleHistogramGenerator* resSinglePixelYGen_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX];
0125 SimpleHistogramGenerator* qbinGen_[COTBETA_HIST_MAX][COTALPHA_HIST_MAX];
0126 };
0127 #endif