CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/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); 
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);
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 
00053  private:
00054   unsigned det_;
00055   std::vector<double> threshold_;
00056   std::vector<double> noise_;
00057   std::vector<double> hcalHotFraction_;
00058   unsigned nnoise_;
00059 
00060   //  edm::ESHandle<CaloTowerConstituentsMap> calotowerMap_;
00061   edm::InputTag inputCol_;
00062   static bool initialized_;
00063   bool doDigis_;
00064   bool doMiscalib_;
00065   bool doSaturation_;
00066   bool noiseFromDb_;
00067   double refactor_;
00068   double refactor_mean_;
00069   std::string hcalfileinpath_;
00070 
00071   std::vector<float> hcalRecHits_;
00072 
00073   std::vector<int> firedCells_;
00074 
00075   static std::vector<HcalDetId> theDetIds_;
00076   static std::vector<float> miscalib_;
00077 
00078   // coefficients for fC to ADC conversion
00079   static std::vector<int> fctoadc_;
00080 
00081   static std::vector<float> peds_;
00082   static std::vector<float> gains_;
00083   static std::vector<float> sat_;
00084   static std::vector<float> noisesigma_;
00085   static std::vector<float> TPGFactor_;
00086  
00087   // the hashed indices
00088   static unsigned maxIndex_;
00089   static std::vector<int> hbhi_;
00090   static std::vector<int> hehi_;
00091   static std::vector<int> hohi_;
00092   static std::vector<int> hfhi_;
00093   unsigned nhbcells_,nhecells_,nhocells_,nhfcells_;
00094 
00095   const RandomEngine* random_;
00096   std::vector<GaussianTail*> myGaussianTailGenerators_;
00097 
00098   //  const HcalTPGCoder * myCoder_;
00099   //  HcalSimParameterMap * myHcalSimParameterMap_;
00100 
00101   // the access to the response corection factors
00102   const HcalRespCorrs* myRespCorr;
00103 };
00104 
00105 #endif