CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/FastSimulation/CaloRecHitsProducer/interface/EcalBarrelRecHitsMaker.h

Go to the documentation of this file.
00001 #ifndef FastSimulation__EcalBarrelRecHitsMaker__h
00002 #define FastSimulation__EcalBarrelRecHitsMaker__h
00003 
00004 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00005 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00006 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
00007 #include "FWCore/Utilities/interface/InputTag.h"
00008 //#include <boost/cstdint.hpp>
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 EcalBarrelRecHitsMaker
00021 {
00022  public:
00023   EcalBarrelRecHitsMaker(edm::ParameterSet const & p, const RandomEngine* );
00024   ~EcalBarrelRecHitsMaker();
00025 
00026   void loadEcalBarrelRecHits(edm::Event &iEvent, EBRecHitCollection & ecalHits,EBDigiCollection & 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   void noisifyTriggerTowers();
00034   bool noisifyTriggerTower(unsigned tthi);
00035   void randomNoisifier();
00036   bool isHighInterest(int tthi);
00037 
00038 
00039  private:
00040   bool doDigis_;
00041   bool doMisCalib_;
00042   double refactor_;
00043   double refactor_mean_;
00044   // poor-man Selective Readout
00045   double threshold_;
00046   double noise_;
00047   double calibfactor_;
00048   double EBHotFraction_ ;
00049   const RandomEngine* random_;
00050   const GaussianTail* myGaussianTailGenerator_;
00051 
00052   bool noisified_;
00053   edm::InputTag inputCol_;
00054   // array (size = 62000) of the energy in the barrel
00055   std::vector<float> theCalorimeterHits_;
00056   // array of the hashedindices in the previous array of the cells that received a hit
00057   std::vector<int> theFiredCells_;
00058   // array of the hashedindices in the previous array of the cells that have a high noise fluctuation
00059   std::vector<int> applyZSCells_;  
00060   // equivalent of the EcalIntercalibConstants from RecoLocalCalo/EcalRecProducers/src/EcalRecHitProduer.cc
00061   std::vector<float> theCalibConstants_;
00062 
00063   //array conversion hashedIndex rawId
00064   std::vector<uint32_t> barrelRawId_;
00065   float adcToGeV_;
00066   float geVToAdc1_,geVToAdc2_,geVToAdc3_;
00067   unsigned minAdc_;
00068   unsigned maxAdc_;
00069   float t1_,t2_,sat_;
00070 
00071   const EcalTrigTowerConstituentsMap* eTTmap_;  
00072   // Array of the DetIds
00073   std::vector<EcalTrigTowerDetId> theTTDetIds_;
00074   // Transverse Energy of the TT
00075   std::vector<float> TTTEnergy_;
00076   // shot TTs
00077   std::vector<unsigned> theFiredTTs_;
00078   // treated TTs
00079   std::vector<bool> treatedTTs_;
00080   // neighboring TT DetIds
00081   std::vector<std::vector<int> > neighboringTTs_;
00082   // the crystals in a given TT 
00083   std::vector<std::vector<int> > crystalsinTT_;
00084   // the towers which have been looked at 
00085   std::vector<int> theTTofHighInterest_;
00086   // the status of the towers. A tower is of high interest if it or one of its neighbour is above the threshold
00087   std::vector<int> TTHighInterest_;
00088   // vector of parameter for custom noise simulation (size =4 : 0 & 1 define the gaussian shape
00089   // of the noise ; 2 & 3 define the sigma and threshold in ADC counts of the *OFFLINE* amplitude
00090                  
00091   std::vector<double> highNoiseParameters_ ;
00092   bool doCustomHighNoise_;
00093 
00094   // selective readout threshold
00095   float SRThreshold_;
00096   int SREtaSize_;
00097   int SRPhiSize_;
00098   // theta of the ieta 
00099   std::vector<float> sinTheta_;
00100   // the cell-dependant noise sigma 
00101   std::vector<float> noisesigma_;
00102   double meanNoiseSigmaEt_ ;
00103   // noise in ADC counts
00104   double noiseADC_;
00105   // need to keep the address of ICMC
00106   const std::vector<float> * ICMC_;
00107 
00108 };
00109 
00110 #endif