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 class CaloGeometry;
00012 class RandomEngine;
00013 class HcalSimParameterMap;
00014 class HcalDbService;
00015 class HcalRespCorrs;
00016 class HcalTopology;
00017
00018 namespace edm {
00019 class Event;
00020 class EventSetup;
00021 class ParameterSet;
00022 }
00023
00024 class HcalRecHitsMaker
00025 {
00026 public:
00027 HcalRecHitsMaker(edm::ParameterSet const & p,int,const RandomEngine* random);
00028 ~HcalRecHitsMaker();
00029
00030 void loadHcalRecHits(edm::Event &iEvent, const HcalTopology&, HBHERecHitCollection& hbheHits, HBHEDigiCollection& hbheDigis);
00031 void loadHcalRecHits(edm::Event &iEvent, const HcalTopology&, HORecHitCollection &ho, HODigiCollection & hoDigis);
00032 void loadHcalRecHits(edm::Event &iEvent, const HcalTopology&, HFRecHitCollection &hfHits, HFDigiCollection& hfDigis);
00033 void init(const edm::EventSetup &es,bool dodigis,bool domiscalib);
00034
00035 private:
00036 unsigned createVectorsOfCells(const edm::EventSetup &es);
00037 unsigned createVectorOfSubdetectorCells( const CaloGeometry&,const HcalTopology&, int subdetn,std::vector<int>&);
00038 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);
00039
00040
00041 void noisify();
00042 double noiseInfCfromDB(const HcalDbService * conditions,const HcalDetId & detId);
00043 void Fill(int id,float energy, std::vector<int> & myHits,float noise,float correctionfactor);
00044 void loadPCaloHits(const edm::Event & iEvent, const HcalTopology&);
00045
00046 void clean();
00047 void cleanSubDet(std::vector<float>& hits,std::vector<int>& cells);
00048
00049 int fCtoAdc(double fc) const;
00050 double fractionOOT(int time_slice);
00051
00052 private:
00053 unsigned det_;
00054 std::vector<double> threshold_;
00055 std::vector<double> noise_;
00056 std::vector<double> corrfac_;
00057 std::vector<double> hcalHotFraction_;
00058 unsigned nnoise_;
00059
00060
00061 edm::InputTag inputCol_;
00062 static bool initialized_;
00063 static bool initializedHB_;
00064 static bool initializedHE_;
00065 static bool initializedHO_;
00066 static bool initializedHF_;
00067 bool doDigis_;
00068 bool doMiscalib_;
00069 bool doSaturation_;
00070 std::vector<bool> noiseFromDb_;
00071 double refactor_;
00072 double refactor_mean_;
00073 std::string hcalfileinpath_;
00074
00075 std::vector<float> hcalRecHits_;
00076
00077 std::vector<int> firedCells_;
00078
00079 static std::vector<HcalDetId> theDetIds_;
00080 static std::vector<float> miscalib_;
00081
00082
00083 static std::vector<int> fctoadc_;
00084
00085 static std::vector<float> peds_;
00086 static std::vector<float> gains_;
00087 static std::vector<float> sat_;
00088 static std::vector<float> noisesigma_;
00089 static std::vector<float> TPGFactor_;
00090
00091
00092 static unsigned maxIndex_;
00093 static std::vector<int> hbhi_;
00094 static std::vector<int> hehi_;
00095 static std::vector<int> hohi_;
00096 static std::vector<int> hfhi_;
00097 unsigned nhbcells_,nhecells_,nhocells_,nhfcells_;
00098
00099 const RandomEngine* random_;
00100 std::vector<GaussianTail*> myGaussianTailGenerators_;
00101
00102
00103
00104
00105
00106 const HcalRespCorrs* myRespCorr;
00107 };
00108
00109 #endif