File indexing completed on 2024-09-07 04:38:07
0001 #ifndef simcalorimetry_hgcalsimalgos_hgcalscinoisemap
0002 #define simcalorimetry_hgcalsimalgos_hgcalscinoisemap
0003
0004 #include "SimCalorimetry/HGCalSimAlgos/interface/HGCalRadiationMap.h"
0005 #include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
0006 #include "Geometry/HGCalGeometry/interface/HGCalGeometry.h"
0007 #include <string>
0008 #include <array>
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 class HGCalSciNoiseMap : public HGCalRadiationMap {
0025 public:
0026 enum TileType_t { CAST, MOULDED, TILETYPE_N };
0027 enum GainRange_t { GAIN_2, GAIN_4, AUTO, GAINRANGE_N };
0028 enum NoiseMapAlgoBits_t {
0029 IGNORE_SIPMAREA,
0030 OVERRIDE_SIPMAREA,
0031 IGNORE_TILEAREA,
0032 IGNORE_DOSESCALE,
0033 IGNORE_FLUENCESCALE,
0034 IGNORE_NOISE,
0035 IGNORE_TILETYPE,
0036 IGNORE_AUTO_PEDESTALSUB
0037 };
0038
0039 struct SiPMonTileCharacteristics {
0040 SiPMonTileCharacteristics() : s(0.), lySF(0.), n(0.), xtalk(0), gain(0), thrADC(0), ntotalPE(0) {}
0041 float s, lySF, n, xtalk;
0042 unsigned short gain, thrADC, ntotalPE;
0043 };
0044
0045 HGCalSciNoiseMap();
0046 ~HGCalSciNoiseMap() {}
0047
0048
0049
0050
0051 double scaleByTileArea(const HGCScintillatorDetId &, const double);
0052 std::pair<double, GainRange_t> scaleBySipmArea(const HGCScintillatorDetId &, const double, const GainRange_t &);
0053 SiPMonTileCharacteristics scaleByDose(const HGCScintillatorDetId &,
0054 const double,
0055 const int aimMIPtoADC = 15,
0056 const GainRange_t gainPreChoice = GainRange_t::AUTO);
0057
0058 void setDoseMap(const std::string &, const unsigned int);
0059 void setSipmMap(const std::string &);
0060 void setReferenceDarkCurrent(double idark);
0061 void setReferenceCrossTalk(double xtalk) { refXtalk_ = xtalk; }
0062 void setNpePerMIP(float npePerMIP);
0063 std::array<double, GAINRANGE_N> getLSBPerGain() { return lsbPerGain_; }
0064 std::array<double, GAINRANGE_N> getMaxADCPerGain() { return fscADCPerGain_; }
0065 std::array<double, TILETYPE_N> getNpePerMIP() { return nPEperMIP_; }
0066 float getNPeInSiPM() { return maxSiPMPE_; }
0067 bool ignoreAutoPedestalSubtraction() { return ignoreAutoPedestalSub_; }
0068
0069 private:
0070
0071
0072
0073 std::unordered_map<int, float> readSipmPars(const std::string &);
0074
0075
0076 std::array<double, TILETYPE_N> nPEperMIP_;
0077
0078
0079 std::array<double, GAINRANGE_N> lsbPerGain_, fscADCPerGain_;
0080
0081
0082 const double refEdge_;
0083
0084
0085 bool ignoreSiPMarea_, overrideSiPMarea_, ignoreTileArea_, ignoreDoseScale_, ignoreFluenceScale_, ignoreNoise_,
0086 ignoreTileType_, ignoreAutoPedestalSub_;
0087
0088
0089 double refDarkCurrent_;
0090
0091
0092 double refXtalk_;
0093
0094
0095 int aimMIPtoADC_;
0096
0097
0098 float maxSiPMPE_;
0099
0100
0101 std::unordered_map<int, float> sipmMap_;
0102 };
0103
0104 #endif