File indexing completed on 2024-04-06 12:29:45
0001 #ifndef __SimFastTiming_FastTimingCommon_BTLElectronicsSim_h__
0002 #define __SimFastTiming_FastTimingCommon_BTLElectronicsSim_h__
0003
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
0009
0010 #include "DataFormats/FTLDigi/interface/FTLDigiCollections.h"
0011 #include "SimFastTiming/FastTimingCommon/interface/MTDDigitizerTypes.h"
0012
0013 #include "SimFastTiming/FastTimingCommon/interface/BTLPulseShape.h"
0014
0015 namespace mtd = mtd_digitizer;
0016
0017 namespace CLHEP {
0018 class HepRandomEngine;
0019 }
0020
0021 class BTLElectronicsSim {
0022 public:
0023 BTLElectronicsSim(const edm::ParameterSet& pset, edm::ConsumesCollector iC);
0024
0025 void getEvent(const edm::Event& evt) {}
0026
0027 void getEventSetup(const edm::EventSetup& evt) {}
0028
0029 void run(const mtd::MTDSimHitDataAccumulator& input, BTLDigiCollection& output, CLHEP::HepRandomEngine* hre) const;
0030
0031 void runTrivialShaper(BTLDataFrame& dataFrame,
0032 const mtd::MTDSimHitData& chargeColl,
0033 const mtd::MTDSimHitData& toa1,
0034 const mtd::MTDSimHitData& toa2,
0035 const uint8_t row,
0036 const uint8_t col) const;
0037
0038 void updateOutput(BTLDigiCollection& coll, const BTLDataFrame& rawDataFrame) const;
0039
0040 static constexpr int dfSIZE = 2;
0041
0042 private:
0043 float sigma2_pe(const float& Q, const float& R) const;
0044
0045 float sigma_stochastic(const float& npe) const;
0046
0047 float sigma2_DCR(const float& npe) const;
0048
0049 float sigma2_electronics(const float npe) const;
0050
0051 const bool debug_;
0052
0053 const float bxTime_;
0054 const float testBeamMIPTimeRes_;
0055 const float ScintillatorRiseTime_;
0056 const float ScintillatorDecayTime_;
0057 const float ChannelTimeOffset_;
0058 const float smearChannelTimeOffset_;
0059
0060 const float EnergyThreshold_;
0061 const float TimeThreshold1_;
0062 const float TimeThreshold2_;
0063 const float ReferencePulseNpe_;
0064
0065 const float SinglePhotonTimeResolution_;
0066 const float DarkCountRate_;
0067 const float SigmaElectronicNoise_;
0068 const float SigmaClock_;
0069 const bool smearTimeForOOTtails_;
0070 const float Npe_to_pC_;
0071 const float Npe_to_V_;
0072 const std::vector<double> sigmaRelTOFHIRenergy_;
0073
0074
0075 const uint32_t adcNbits_, tdcNbits_;
0076
0077
0078 const float adcSaturation_MIP_;
0079 const uint32_t adcBitSaturation_;
0080 const float adcLSB_MIP_;
0081 const float adcThreshold_MIP_;
0082 const float toaLSB_ns_;
0083 const uint32_t tdcBitSaturation_;
0084
0085 const float CorrCoeff_;
0086 const float cosPhi_;
0087 const float sinPhi_;
0088
0089 const float ScintillatorDecayTime2_;
0090 const float ScintillatorDecayTimeInv_;
0091 const float SPTR2_;
0092 const float DCRxRiseTime_;
0093 const float SigmaElectronicNoise2_;
0094 const float SigmaClock2_;
0095
0096 const BTLPulseShape btlPulseShape_;
0097 };
0098
0099 #endif