Go to the documentation of this file.00001 #ifndef FastSimulation__EcalEndcapRecHitsMaker__h
00002 #define FastSimulation__EcalEndcapRecHitsMaker__h
00003
00004 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00005 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00006 #include "FWCore/Utilities/interface/InputTag.h"
00007 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
00008
00009
00010 class RandomEngine;
00011 class EcalTrigTowerConstituentsMap;
00012 class GaussianTail;
00013
00014 namespace edm {
00015 class ParameterSet;
00016 class Event;
00017 class EventSetup;
00018 }
00019
00020 class EcalEndcapRecHitsMaker
00021 {
00022 public:
00023 EcalEndcapRecHitsMaker(edm::ParameterSet const & p,const RandomEngine* random);
00024 ~EcalEndcapRecHitsMaker();
00025
00026 void loadEcalEndcapRecHits(edm::Event &iEvent, EERecHitCollection & ecalHits,EEDigiCollection & ecalDigis);
00027 void init(const edm::EventSetup &es,bool dodigis,bool domiscalib);
00028
00029 private:
00030 void clean();
00031 void loadPCaloHits(const edm::Event & iEvent);
00032 void geVtoGainAdc(float e,unsigned & gain, unsigned &adc) const;
00033
00034 inline int TThashedIndexforEE(int originalhi) const {return originalhi-2448;}
00035 inline int TThashedIndexforEE(const EcalTrigTowerDetId &detid) const {return detid.hashedIndex()-2448;}
00036
00037
00038 inline int SChashedIndex(int SC,int z) const {return SC+(z+1)*158;}
00039 inline int SChashedIndex(const EEDetId& detid) const {
00040
00041 return detid.isc()+(detid.zside()+1)*158;}
00042 inline int towerOf(const EEDetId& detid) const {return towerOf_[detid.hashedIndex()];}
00043 inline int towerOf(int hid) const {return towerOf_[hid];}
00044 void noisifyTriggerTowers();
00045 void noisifySuperCrystals(int tthi);
00046 void randomNoisifier();
00047 bool isHighInterest(const EEDetId & icell);
00048
00049 private:
00050 edm::InputTag inputCol_;
00051 bool doDigis_;
00052 bool doMisCalib_;
00053 double refactor_;
00054 double refactor_mean_;
00055
00056 double threshold_;
00057 double noise_;
00058 double calibfactor_;
00059 double EEHotFraction_ ;
00060 const RandomEngine* random_;
00061 const GaussianTail * myGaussianTailGenerator_;
00062 bool noisified_;
00063
00064
00065 std::vector<float> theCalorimeterHits_;
00066
00067 std::vector<int> theFiredCells_;
00068
00069 std::vector<int> applyZSCells_;
00070
00071
00072 std::vector<float> theCalibConstants_;
00073
00074
00075 std::vector<uint32_t> endcapRawId_;
00076
00077
00078
00079 float adcToGeV_;
00080 float geVToAdc1_,geVToAdc2_,geVToAdc3_;
00081 unsigned minAdc_;
00082 unsigned maxAdc_;
00083 float t1_,t2_,sat_;
00084
00085 const EcalTrigTowerConstituentsMap* eTTmap_;
00086
00087
00088
00089 std::vector<int> towerOf_;
00090
00091 std::vector<EcalTrigTowerDetId> theTTDetIds_;
00092
00093 std::vector<std::vector<int> > SCofTT_;
00094
00095 std::vector<std::vector<int> > TTofSC_;
00096
00097 std::vector<bool> treatedSC_;
00098 std::vector<int> SCHighInterest_;
00099
00100 std::vector<int> theFiredSC_;
00101
00102 std::vector<int> theFiredTTs_;
00103
00104 std::vector<float> TTTEnergy_;
00105
00106 std::vector<std::vector<int> > CrystalsinSC_;
00107
00108 std::vector<float> sinTheta_;
00109
00110
00111 std::vector<float> noisesigma_;
00112 double meanNoiseSigmaEt_ ;
00113
00114 double noiseADC_;
00115
00116 float SRThreshold_;
00117
00118 const std::vector<float> * ICMC_;
00119
00120
00121
00122 std::vector<double> highNoiseParameters_ ;
00123 bool doCustomHighNoise_;
00124 };
00125
00126 #endif