File indexing completed on 2024-04-06 12:29:31
0001 #ifndef HcalSimAlgos_HcalDigitizerTraits_h
0002 #define HcalSimAlgos_HcalDigitizerTraits_h
0003 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0004 #include "SimCalorimetry/HcalSimAlgos/interface/HcalElectronicsSim.h"
0005
0006 class HBHEDigitizerTraits {
0007 public:
0008 typedef HBHEDigiCollection DigiCollection;
0009 typedef HBHEDataFrame Digi;
0010 typedef HcalElectronicsSim ElectronicsSim;
0011 static constexpr double PreMixFactor = 10.0;
0012 static const unsigned PreMixBits = 126;
0013 };
0014
0015 class HODigitizerTraits {
0016 public:
0017 typedef HODigiCollection DigiCollection;
0018 typedef HODataFrame Digi;
0019 typedef HcalElectronicsSim ElectronicsSim;
0020 static constexpr double PreMixFactor = 10.0;
0021 static const unsigned PreMixBits = 126;
0022 };
0023
0024 class HFDigitizerTraits {
0025 public:
0026 typedef HFDigiCollection DigiCollection;
0027 typedef HFDataFrame Digi;
0028 typedef HcalElectronicsSim ElectronicsSim;
0029 static constexpr double PreMixFactor = 10.0;
0030 static const unsigned PreMixBits = 126;
0031 };
0032
0033 class ZDCDigitizerTraits {
0034 public:
0035 typedef ZDCDigiCollection DigiCollection;
0036 typedef ZDCDataFrame Digi;
0037 typedef HcalElectronicsSim ElectronicsSim;
0038 static constexpr double PreMixFactor = 10.0;
0039 static const unsigned PreMixBits = 126;
0040 };
0041
0042 template <class Traits>
0043 class CaloTDigitizerQIE8Run {
0044 public:
0045 typedef typename Traits::ElectronicsSim ElectronicsSim;
0046 typedef typename Traits::Digi Digi;
0047 typedef typename Traits::DigiCollection DigiCollection;
0048
0049 void operator()(DigiCollection& output,
0050 CLHEP::HepRandomEngine* engine,
0051 CaloSamples* analogSignal,
0052 std::vector<DetId>::const_iterator idItr,
0053 ElectronicsSim* theElectronicsSim) {
0054 Digi digi(*idItr);
0055 theElectronicsSim->analogToDigital(engine, *analogSignal, digi, Traits::PreMixFactor, Traits::PreMixBits);
0056 output.push_back(std::move(digi));
0057 }
0058 };
0059
0060 #endif