Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:31

0001 #ifndef HcalSimAlgos_HcalQIE10Traits_h
0002 #define HcalSimAlgos_HcalQIE10Traits_h
0003 
0004 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0005 #include "SimCalorimetry/HcalSimAlgos/interface/HcalElectronicsSim.h"
0006 
0007 class HcalQIE10DigitizerTraits {
0008 public:
0009   typedef QIE10DigiCollection DigiCollection;
0010   typedef QIE10DataFrame Digi;
0011   typedef HcalElectronicsSim ElectronicsSim;
0012   static constexpr double PreMixFactor = 10.0;
0013   static const unsigned PreMixBits = 254;
0014 };
0015 
0016 class HcalQIE11DigitizerTraits {
0017 public:
0018   typedef QIE11DigiCollection DigiCollection;
0019   typedef QIE11DataFrame Digi;
0020   typedef HcalElectronicsSim ElectronicsSim;
0021   static constexpr double PreMixFactor = 10.0;
0022   static const unsigned PreMixBits = 254;
0023 };
0024 
0025 template <class Traits>
0026 class CaloTDigitizerQIE1011Run {
0027 public:
0028   typedef typename Traits::ElectronicsSim ElectronicsSim;
0029   typedef typename Traits::Digi Digi;
0030   typedef typename Traits::DigiCollection DigiCollection;
0031 
0032   void operator()(DigiCollection& output,
0033                   CLHEP::HepRandomEngine* engine,
0034                   CaloSamples* analogSignal,
0035                   std::vector<DetId>::const_iterator idItr,
0036                   ElectronicsSim* theElectronicsSim) {
0037     output.push_back(idItr->rawId());
0038     Digi digi(output.back());  //QIEDataFrame gets ptr to edm::DataFrame data
0039     theElectronicsSim->analogToDigital(engine, *analogSignal, digi, Traits::PreMixFactor, Traits::PreMixBits);
0040   }
0041 };
0042 
0043 #endif