CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SimCalorimetry/HcalSimProducers/interface/HcalDigitizer.h

Go to the documentation of this file.
00001 #ifndef HcalSimProducers_HcalDigitizer_h
00002 #define HcalSimProducers_HcalDigitizer_h
00003 
00004 #include "SimCalorimetry/HcalSimAlgos/interface/HcalDigitizerTraits.h"
00005 #include "SimCalorimetry/CaloSimAlgos/interface/CaloTDigitizer.h"
00006 #include "SimCalorimetry/HcalSimAlgos/interface/HcalUpgradeTraits.h"
00007 #include "SimCalorimetry/HcalSimAlgos/interface/HBHEHitFilter.h"
00008 #include "SimCalorimetry/HcalSimAlgos/interface/HFHitFilter.h"
00009 #include "SimCalorimetry/HcalSimAlgos/interface/HOHitFilter.h"
00010 #include "SimCalorimetry/HcalSimAlgos/interface/HcalHitFilter.h"
00011 #include "SimCalorimetry/HcalSimAlgos/interface/ZDCHitFilter.h"
00012 #include "SimCalorimetry/HcalSimProducers/interface/HcalHitRelabeller.h"
00013 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00014 #include "DataFormats/DetId/interface/DetId.h"
00015 #include "FWCore/Framework/interface/Frameworkfwd.h"
00016 
00017 #include <vector>
00018 
00019 class CaloHitResponse;
00020 class HcalSimParameterMap;
00021 class HcalAmplifier;
00022 class HPDIonFeedbackSim;
00023 class HcalCoderFactory;
00024 class HcalElectronicsSim;
00025 class HcalHitCorrection;
00026 class HcalTimeSlewSim;
00027 class HcalBaseSignalGenerator;
00028 class HcalShapes;
00029 class PCaloHit;
00030 class PileUpEventPrincipal;
00031 
00032 class HcalDigitizer
00033 {
00034 public:
00035 
00036   explicit HcalDigitizer(const edm::ParameterSet& ps);
00037   virtual ~HcalDigitizer();
00038 
00040   void initializeEvent(edm::Event const& e, edm::EventSetup const& c);
00041   void accumulate(edm::Event const& e, edm::EventSetup const& c);
00042   void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c);
00043   void finalizeEvent(edm::Event& e, edm::EventSetup const& c);
00044   void beginRun(const edm::EventSetup & es);
00045   void endRun();
00046   
00047   void setHBHENoiseSignalGenerator(HcalBaseSignalGenerator * noiseGenerator);
00048   void setHFNoiseSignalGenerator(HcalBaseSignalGenerator * noiseGenerator);
00049   void setHONoiseSignalGenerator(HcalBaseSignalGenerator * noiseGenerator);
00050   void setZDCNoiseSignalGenerator(HcalBaseSignalGenerator * noiseGenerator);
00051 
00052 private:
00053   void accumulateCaloHits(edm::Handle<std::vector<PCaloHit> > const& hcalHits, edm::Handle<std::vector<PCaloHit> > const& zdcHits, int bunchCrossing);
00054 
00056   void fillFakeHits();
00059   void checkGeometry(const edm::EventSetup& eventSetup);
00060   const CaloGeometry * theGeometry;
00061   void updateGeometry(const edm::EventSetup& eventSetup);
00062 
00063   void buildHOSiPMCells(const std::vector<DetId>& allCells, const edm::EventSetup& eventSetup);
00064 
00066   typedef CaloTDigitizer<HBHEDigitizerTraits> HBHEDigitizer;
00067   typedef CaloTDigitizer<HODigitizerTraits>   HODigitizer;
00068   typedef CaloTDigitizer<HFDigitizerTraits>   HFDigitizer;
00069   typedef CaloTDigitizer<ZDCDigitizerTraits>  ZDCDigitizer;
00070   typedef CaloTDigitizer<HcalUpgradeDigitizerTraits> UpgradeDigitizer;
00071 
00072   HcalSimParameterMap * theParameterMap;
00073   HcalShapes * theShapes;
00074 
00075   CaloHitResponse * theHBHEResponse;
00076   CaloHitResponse * theHBHESiPMResponse;
00077   CaloHitResponse * theHOResponse;
00078   CaloHitResponse * theHOSiPMResponse;
00079   CaloHitResponse * theHFResponse;
00080   CaloHitResponse * theZDCResponse;
00081 
00082   // we need separate amplifiers (and electronicssims)
00083   // because they might have separate noise generators
00084   HcalAmplifier * theHBHEAmplifier;
00085   HcalAmplifier * theHFAmplifier;
00086   HcalAmplifier * theHOAmplifier;
00087   HcalAmplifier * theZDCAmplifier;
00088 
00089   HPDIonFeedbackSim * theIonFeedback;
00090   HcalCoderFactory * theCoderFactory;
00091   HcalCoderFactory * theUpgradeCoderFactory;
00092 
00093   HcalElectronicsSim * theHBHEElectronicsSim;
00094   HcalElectronicsSim * theHFElectronicsSim;
00095   HcalElectronicsSim * theHOElectronicsSim;
00096   HcalElectronicsSim * theZDCElectronicsSim;
00097   HcalElectronicsSim * theUpgradeHBHEElectronicsSim;
00098   HcalElectronicsSim * theUpgradeHFElectronicsSim;
00099 
00100   HBHEHitFilter theHBHEHitFilter;
00101   HFHitFilter   theHFHitFilter;
00102   HOHitFilter   theHOHitFilter;
00103   HcalHitFilter theHOSiPMHitFilter;
00104   ZDCHitFilter  theZDCHitFilter;
00105 
00106   HcalHitCorrection * theHitCorrection;
00107   HcalTimeSlewSim * theTimeSlewSim;
00108   CaloVNoiseSignalGenerator * theNoiseGenerator;
00109   CaloVNoiseHitGenerator * theNoiseHitGenerator;
00110 
00111   HBHEDigitizer * theHBHEDigitizer;
00112   HBHEDigitizer * theHBHESiPMDigitizer;
00113   HODigitizer* theHODigitizer;
00114   HODigitizer* theHOSiPMDigitizer;
00115   HFDigitizer* theHFDigitizer;
00116   ZDCDigitizer* theZDCDigitizer;
00117   UpgradeDigitizer * theHBHEUpgradeDigitizer;
00118   UpgradeDigitizer * theHFUpgradeDigitizer;
00119   HcalHitRelabeller* theRelabeller;
00120 
00121   // need to cache some DetIds for the digitizers,
00122   // if they don't come straight from the geometry
00123   std::vector<DetId> theHBHEDetIds;
00124   std::vector<DetId> theHOHPDDetIds;
00125   std::vector<DetId> theHOSiPMDetIds;
00126 
00127   bool isZDC,isHCAL,zdcgeo,hbhegeo,hogeo,hfgeo;
00128   bool relabel_;
00129 
00130   std::string hitsProducer_;
00131 
00132   int theHOSiPMCode;
00133 };
00134 
00135 #endif
00136 
00137 
00138