CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/SimCalorimetry/EcalSimAlgos/interface/EcalDigitizerTraits.h

Go to the documentation of this file.
00001 #ifndef EcalSimAlgos_EcalDigitizerTraits_h
00002 #define EcalSimAlgos_EcalDigitizerTraits_h
00003 
00004 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00005 #include "SimCalorimetry/EcalSimAlgos/interface/EcalElectronicsSim.h"
00006 #include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSimFast.h"
00007 #include "SimCalorimetry/EcalSimAlgos/interface/ESElectronicsSim.h"
00008 #include "CalibFormats/CaloObjects/interface/CaloTSamples.h"
00009 
00010 #include "DataFormats/EcalDigi/interface/EcalDataFrame.h"
00011 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
00012 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
00013 
00014 class EcalHitResponse ;
00015 
00016 class EBDigitizerTraits 
00017 {
00018    public:
00020       typedef EBDigiCollection DigiCollection;
00022       typedef EBDataFrame Digi;
00024       typedef EcalElectronicsSim ElectronicsSim;
00025 
00026       typedef CaloTSamples<float,10> EcalSamples ;
00027 
00028       static void fix( Digi& digi, edm::DataFrame df ) {};
00029 };
00030 
00031 class EEDigitizerTraits 
00032 {
00033    public:
00035       typedef EEDigiCollection DigiCollection;
00037       typedef EEDataFrame Digi;
00039       typedef EcalElectronicsSim ElectronicsSim;
00040 
00041       typedef CaloTSamples<float,10> EcalSamples ;
00042 
00043       static void fix( Digi& digi, edm::DataFrame df ) {}
00044 };
00045 
00046 class ESDigitizerTraits 
00047 {
00048    public:
00050       typedef ESDigiCollection DigiCollection ;
00052       typedef ESDataFrame Digi ;
00054       typedef ESElectronicsSimFast ElectronicsSim ;
00055 
00056       typedef CaloTSamples<float,3> EcalSamples ;
00057 
00058       static void fix( Digi& digi, edm::DataFrame df ) {
00059          for( unsigned int i ( 0 ) ; i != 3; ++i )
00060          {
00061             static const int offset ( 65536 ) ; // for int16 to uint16
00062             const int16_t dshort ( digi[i].raw() ) ;
00063             const int     dint   ( (int) dshort + // add offset for uint16 conversion
00064                                    ( (int16_t) 0 > dshort ? 
00065                                      offset : (int) 0 ) ) ;
00066             df[i] = dint ;
00067          }
00068       }
00069 };
00070 
00071 class ESOldDigitizerTraits 
00072 {
00073    public:
00075       typedef ESDigiCollection DigiCollection ;
00077       typedef ESDataFrame Digi ;
00079       typedef ESElectronicsSim ElectronicsSim ;
00080 
00081 //      typedef CaloTSamples<float,3> EcalSamples ;
00082 };
00083 
00084 
00085 #endif
00086