CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalEndcapRecHitsMaker.h
Go to the documentation of this file.
1 #ifndef FastSimulation__EcalEndcapRecHitsMaker__h
2 #define FastSimulation__EcalEndcapRecHitsMaker__h
3 
8 //#include <boost/cstdint.hpp>
9 
12 class GaussianTail;
13 
14 namespace edm {
15  class ParameterSet;
16  class Event;
17  class EventSetup;
18 }
19 
21 {
22  public:
25 
28  void init(const edm::EventSetup &es,bool dodigis,bool domiscalib);
29 
30  private:
31  void clean();
32  void loadPCaloHits(const edm::Event & iEvent, RandomEngineAndDistribution const*);
33  void geVtoGainAdc(float e,unsigned & gain, unsigned &adc) const;
34  // there are 2448 TT in the barrel.
35  inline int TThashedIndexforEE(int originalhi) const {return originalhi-2448;}
36  inline int TThashedIndexforEE(const EcalTrigTowerDetId &detid) const {return detid.hashedIndex()-2448;}
37  // the number of the SuperCrystals goes from 1 to 316 (with some holes) in each EE
38  // z should -1 or 1
39  inline int SChashedIndex(int SC,int z) const {return SC+(z+1)*158;}
40  inline int SChashedIndex(const EEDetId& detid) const {
41  // std::cout << "In SC hashedIndex " << detid.isc() << " " << detid.zside() << " " << detid.isc()+(detid.zside()+1)*158 << std::endl;
42  return detid.isc()+(detid.zside()+1)*158;}
43  inline int towerOf(const EEDetId& detid) const {return towerOf_[detid.hashedIndex()];}
44  inline int towerOf(int hid) const {return towerOf_[hid];}
48  bool isHighInterest(const EEDetId & icell);
49 
50  private:
52  bool doDigis_;
54  double refactor_;
56  // poor-man Selective Readout
57  double threshold_;
58  double noise_;
59  double calibfactor_;
60  double EEHotFraction_ ;
62  bool noisified_;
63 
64  // array (size = 20000) of the energy in the barrel
65  std::vector<float> theCalorimeterHits_;
66  // array of the hashedindices in the previous array of the cells that received a hit
67  std::vector<int> theFiredCells_;
68  // array of the hashedindices in the previous array of the cells that received a hit
69  std::vector<int> applyZSCells_;
70 
71  // equivalent of the EcalIntercalibConstants from RecoLocalCalo/EcalRecProducers/src/EcalRecHitProduer.cc
72  std::vector<float> theCalibConstants_;
73 
74  //array conversion hashedIndex rawId
75  std::vector<uint32_t> endcapRawId_;
76 
77 
78  // digitization
79  float adcToGeV_;
81  unsigned minAdc_;
82  unsigned maxAdc_;
83  float t1_,t2_,sat_;
84 
86 
87  // arraws for the selective readout emulation
88  // fast EEDetId -> TT hashedindex conversion
89  std::vector<int> towerOf_;
90  // vector of the original DetId if needed
91  std::vector<EcalTrigTowerDetId> theTTDetIds_;
92  // list of SC "contained" in a TT.
93  std::vector<std::vector<int> > SCofTT_;
94  // list of TT of a given sc
95  std::vector<std::vector<int> > TTofSC_;
96  // status of each SC
97  std::vector<bool> treatedSC_;
98  std::vector<int> SCHighInterest_;
99  // list of fired SC
100  std::vector<int> theFiredSC_;
101  // the list of fired TT
102  std::vector<int> theFiredTTs_;
103  // the energy in the TT
104  std::vector<float> TTTEnergy_;
105  // the cells in each SC
106  std::vector<std::vector<int> > CrystalsinSC_;
107  // the sin(theta) of the cell
108  std::vector<float> sinTheta_;
109 
110  // the cell-dependant noise sigma
111  std::vector<float> noisesigma_;
113  // noise in ADC counts
114  double noiseADC_;
115  // selective readout threshold
117  // need to keep the address of ICMC
118  const std::vector<float> * ICMC_;
119  // vector of parameter for custom noise simulation (size =4 : 0 & 1 define the gaussian shape
120  // of the noise ; 2 & 3 define the sigma and threshold in ADC counts of the *OFFLINE* amplitude
121 
122  std::vector<double> highNoiseParameters_ ;
124 };
125 
126 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< bool > treatedSC_
bool isHighInterest(const EEDetId &icell)
void geVtoGainAdc(float e, unsigned &gain, unsigned &adc) const
int towerOf(int hid) const
int TThashedIndexforEE(int originalhi) const
std::vector< std::vector< int > > TTofSC_
int isc() const
Definition: EEDetId.cc:285
std::vector< int > SCHighInterest_
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
std::vector< int > theFiredSC_
std::vector< std::vector< int > > SCofTT_
const GaussianTail * myGaussianTailGenerator_
float float float z
const EcalTrigTowerConstituentsMap * eTTmap_
int SChashedIndex(int SC, int z) const
int iEvent
Definition: GenABIO.cc:243
std::vector< float > TTTEnergy_
std::vector< float > theCalibConstants_
void loadEcalEndcapRecHits(edm::Event &iEvent, EERecHitCollection &ecalHits, EEDigiCollection &ecalDigis, RandomEngineAndDistribution const *)
void noisifyTriggerTowers(RandomEngineAndDistribution const *)
const std::vector< float > * ICMC_
int TThashedIndexforEE(const EcalTrigTowerDetId &detid) const
std::vector< float > theCalorimeterHits_
int zside() const
Definition: EEDetId.h:70
int SChashedIndex(const EEDetId &detid) const
std::vector< float > sinTheta_
int towerOf(const EEDetId &detid) const
void loadPCaloHits(const edm::Event &iEvent, RandomEngineAndDistribution const *)
std::vector< float > noisesigma_
int hashedIndex() const
Definition: EEDetId.h:182
EcalEndcapRecHitsMaker(edm::ParameterSet const &p)
void init(const edm::EventSetup &es, bool dodigis, bool domiscalib)
std::vector< int > applyZSCells_
void randomNoisifier(RandomEngineAndDistribution const *)
std::vector< std::vector< int > > CrystalsinSC_
std::vector< int > theFiredTTs_
std::vector< int > theFiredCells_
std::vector< uint32_t > endcapRawId_
std::vector< EcalTrigTowerDetId > theTTDetIds_
std::vector< double > highNoiseParameters_
void noisifySuperCrystals(int tthi, RandomEngineAndDistribution const *)