Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:31

0001 #ifndef EcalSimAlgos_EcalDigitizerTraits_h
0002 #define EcalSimAlgos_EcalDigitizerTraits_h
0003 
0004 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0005 #include "SimCalorimetry/EcalSimAlgos/interface/EcalCoder.h"
0006 #include "SimCalorimetry/EcalSimAlgos/interface/EcalLiteDTUCoder.h"
0007 #include "SimCalorimetry/EcalSimAlgos/interface/EcalElectronicsSim.h"
0008 #include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSimFast.h"
0009 #include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSim.h"
0010 #include "CalibFormats/CaloObjects/interface/CaloTSamples.h"
0011 
0012 #include "DataFormats/EcalDigi/interface/EcalDataFrame.h"
0013 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
0014 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
0015 #include "DataFormats/EcalDigi/interface/EcalDataFrame_Ph2.h"
0016 
0017 class EcalHitResponse;
0018 
0019 class EBDigitizerTraits {
0020 public:
0021   /// the digis collection
0022   typedef EBDigiCollection DigiCollection;
0023   /// the dataframes
0024   typedef EBDataFrame Digi;
0025   /// the electronics simulation
0026   typedef CaloTSamples<float, 10> EcalSamples;
0027   typedef EcalElectronicsSim<EcalCoder, EcalSamples, EcalDataFrame> ElectronicsSim;
0028 
0029   static void fix(Digi& digi, edm::DataFrame df){};
0030 };
0031 
0032 class EEDigitizerTraits {
0033 public:
0034   /// the digis collection
0035   typedef EEDigiCollection DigiCollection;
0036   /// the dataframes
0037   typedef EEDataFrame Digi;
0038   /// the electronics simulation
0039   typedef CaloTSamples<float, 10> EcalSamples;
0040   typedef EcalElectronicsSim<EcalCoder, EcalSamples, EcalDataFrame> ElectronicsSim;
0041 
0042   static void fix(Digi& digi, edm::DataFrame df) {}
0043 };
0044 
0045 class ESDigitizerTraits {
0046 public:
0047   /// the digis collection
0048   typedef ESDigiCollection DigiCollection;
0049   /// the dataframes
0050   typedef ESDataFrame Digi;
0051   /// the electronics simulation
0052   typedef ESElectronicsSimFast ElectronicsSim;
0053 
0054   typedef CaloTSamples<float, 3> EcalSamples;
0055 
0056   static void fix(Digi& digi, edm::DataFrame df) {
0057     for (unsigned int i(0); i != 3; ++i) {
0058       static const int offset(65536);  // for int16 to uint16
0059       const int16_t dshort(digi[i].raw());
0060       const int dint((int)dshort +  // add offset for uint16 conversion
0061                      ((int16_t)0 > dshort ? offset : (int)0));
0062       df[i] = dint;
0063     }
0064   }
0065 };
0066 
0067 class ESOldDigitizerTraits {
0068 public:
0069   /// the digis collection
0070   typedef ESDigiCollection DigiCollection;
0071   /// the dataframes
0072   typedef ESDataFrame Digi;
0073   /// the electronics simulation
0074   typedef ESElectronicsSim ElectronicsSim;
0075 
0076   //      typedef CaloTSamples<float,3> EcalSamples ;
0077 };
0078 
0079 class EBDigitizerTraits_Ph2 {
0080 public:
0081   /// the digis collection
0082   typedef EBDigiCollectionPh2 DigiCollection;
0083   /// the dataframes
0084   typedef EcalDataFrame_Ph2 Digi;
0085   /// the electronics simulation
0086   typedef CaloTSamples<float, ecalPh2::sampleSize> EcalSamples;
0087   typedef EcalElectronicsSim<EcalLiteDTUCoder, EcalSamples, Digi> ElectronicsSim;
0088 
0089   static void fix(Digi& digi, edm::DataFrame df){};
0090 };
0091 
0092 #endif