CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/FastSimulation/CaloRecHitsProducer/interface/HcalRecHitsMaker.h

Go to the documentation of this file.
00001 #ifndef FastSimulation__HcalRecHitsMaker__h
00002 #define FastSimulation__HcalRecHitsMaker__h
00003 
00004 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00005 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00006 #include "FastSimulation/Utilities/interface/GaussianTail.h"
00007 #include "FWCore/Utilities/interface/InputTag.h"
00008 #include <map>
00009 #include <vector>
00010 
00011 //#include <boost/cstdint.hpp>
00012 
00013 class CaloGeometry;
00014 class RandomEngine;
00015 // class HcalTPGCoder;
00016 class HcalSimParameterMap;
00017 class HcalDbService;
00018 class HcalRespCorrs;
00019 
00020 namespace edm { 
00021   class ParameterSet;
00022   class Event;
00023   class EventSetup;
00024 }
00025 
00026 class HcalRecHitsMaker
00027 {
00028  public:
00029   HcalRecHitsMaker(edm::ParameterSet const & p,int,const RandomEngine* random);
00030   ~HcalRecHitsMaker();
00031 
00032   void loadHcalRecHits(edm::Event &iEvent, HBHERecHitCollection& hbheHits, HBHEDigiCollection& hbheDigis);
00033   void loadHcalRecHits(edm::Event &iEvent, HORecHitCollection &ho, HODigiCollection & hoDigis);
00034   void loadHcalRecHits(edm::Event &iEvent, HFRecHitCollection &hfHits, HFDigiCollection& hfDigis);
00035   void init(const edm::EventSetup &es,bool dodigis,bool domiscalib);
00036 
00037  private:
00038   unsigned createVectorsOfCells(const edm::EventSetup &es);
00039   unsigned createVectorOfSubdetectorCells( const CaloGeometry&,int subdetn,std::vector<int>&);
00040   unsigned noisifySubdet(std::vector<float >& theMap, std::vector<int>& theHits,const std::vector<int>& thecells, unsigned ncells, double  hcalHotFraction_, const GaussianTail *,double sigma,double threshold,double correctionfactor); 
00041   // Not currently used. Will probably be removed soon.
00042   //  void noisifySignal(std::map<uint32_t,std::pair<float,bool> >& theMap); 
00043   void noisify();
00044   double noiseInfCfromDB(const HcalDbService * conditions,const HcalDetId & detId);
00045   void Fill(int id,float energy, std::vector<int> & myHits,float noise,float correctionfactor);
00046   void loadPCaloHits(const edm::Event & iEvent);
00047   
00048   void clean();
00049   void cleanSubDet(std::vector<float>& hits,std::vector<int>& cells);
00050   // conversion for digitization
00051   int fCtoAdc(double fc) const;
00052   double fractionOOT(int time_slice);
00053 
00054  private:
00055   unsigned det_;
00056   std::vector<double> threshold_;
00057   std::vector<double> noise_;
00058   std::vector<double> corrfac_;
00059   std::vector<double> hcalHotFraction_;
00060   unsigned nnoise_;
00061 
00062   //  edm::ESHandle<CaloTowerConstituentsMap> calotowerMap_;
00063   edm::InputTag inputCol_;
00064   static bool initialized_;
00065   bool doDigis_;
00066   bool doMiscalib_;
00067   bool doSaturation_;
00068   bool noiseFromDb_;
00069   double refactor_;
00070   double refactor_mean_;
00071   std::string hcalfileinpath_;
00072 
00073   std::vector<float> hcalRecHits_;
00074 
00075   std::vector<int> firedCells_;
00076 
00077   static std::vector<HcalDetId> theDetIds_;
00078   static std::vector<float> miscalib_;
00079 
00080   // coefficients for fC to ADC conversion
00081   static std::vector<int> fctoadc_;
00082 
00083   static std::vector<float> peds_;
00084   static std::vector<float> gains_;
00085   static std::vector<float> sat_;
00086   static std::vector<float> noisesigma_;
00087   static std::vector<float> TPGFactor_;
00088  
00089   // the hashed indices
00090   static unsigned maxIndex_;
00091   static std::vector<int> hbhi_;
00092   static std::vector<int> hehi_;
00093   static std::vector<int> hohi_;
00094   static std::vector<int> hfhi_;
00095   unsigned nhbcells_,nhecells_,nhocells_,nhfcells_;
00096 
00097   const RandomEngine* random_;
00098   std::vector<GaussianTail*> myGaussianTailGenerators_;
00099 
00100   //  const HcalTPGCoder * myCoder_;
00101   //  HcalSimParameterMap * myHcalSimParameterMap_;
00102 
00103   // the access to the response corection factors
00104   const HcalRespCorrs* myRespCorr;
00105 };
00106 
00107 #endif