Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- mode: c++ -*-
0002 #ifndef HcalSimAlgos_HcalTDC_h
0003 #define HcalSimAlgos_HcalTDC_h
0004 
0005 #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
0006 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
0007 #include "SimCalorimetry/HcalSimAlgos/interface/HcalTDCParameters.h"
0008 #include "DataFormats/HcalDigi/interface/QIE11DataFrame.h"
0009 #include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"
0010 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0011 
0012 class HcalDbService;
0013 
0014 namespace CLHEP {
0015   class HepRandomEngine;
0016 }
0017 
0018 class HcalTDC {
0019 public:
0020   HcalTDC(double threshold_currentTDC = 0.);
0021   ~HcalTDC();
0022 
0023   /// adds timing information to the digi
0024   /// template <class Digi>
0025   void timing(const CaloSamples& lf, QIE11DataFrame& digi) const;
0026   void timing(const CaloSamples& lf, QIE10DataFrame& digi) const;
0027 
0028   std::vector<int> leadingEdgeTDC(const CaloSamples& lf) const;
0029 
0030   /// the Producer will probably update this every event
0031   void setDbService(const HcalDbService* service);
0032 
0033   void setThresholdDAC(unsigned int DAC) { theDAC = DAC; }
0034   unsigned int getThresholdDAC() { return theDAC; }
0035   double getThreshold() const { return threshold_currentTDC_; };
0036 
0037 private:
0038   HcalTDCParameters theTDCParameters;
0039   const HcalDbService* theDbService;
0040 
0041   unsigned int theDAC;
0042   double threshold_currentTDC_;
0043   double const lsb;
0044 };
0045 
0046 #endif