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 
10 class RandomEngine;
12 class GaussianTail;
13 
14 namespace edm {
15  class ParameterSet;
16  class Event;
17  class EventSetup;
18 }
19 
21 {
22  public:
25 
27  void init(const edm::EventSetup &es,bool dodigis,bool domiscalib);
28 
29  private:
30  void clean();
31  void loadPCaloHits(const edm::Event & iEvent);
32  void geVtoGainAdc(float e,unsigned & gain, unsigned &adc) const;
33  // there are 2448 TT in the barrel.
34  inline int TThashedIndexforEE(int originalhi) const {return originalhi-2448;}
35  inline int TThashedIndexforEE(const EcalTrigTowerDetId &detid) const {return detid.hashedIndex()-2448;}
36  // the number of the SuperCrystals goes from 1 to 316 (with some holes) in each EE
37  // z should -1 or 1
38  inline int SChashedIndex(int SC,int z) const {return SC+(z+1)*158;}
39  inline int SChashedIndex(const EEDetId& detid) const {
40  // std::cout << "In SC hashedIndex " << detid.isc() << " " << detid.zside() << " " << detid.isc()+(detid.zside()+1)*158 << std::endl;
41  return detid.isc()+(detid.zside()+1)*158;}
42  inline int towerOf(const EEDetId& detid) const {return towerOf_[detid.hashedIndex()];}
43  inline int towerOf(int hid) const {return towerOf_[hid];}
44  void noisifyTriggerTowers();
45  void noisifySuperCrystals(int tthi);
46  void randomNoisifier();
47  bool isHighInterest(const EEDetId & icell);
48 
49  private:
51  bool doDigis_;
53  double refactor_;
55  // poor-man Selective Readout
56  double threshold_;
57  double noise_;
58  double calibfactor_;
59  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
void loadEcalEndcapRecHits(edm::Event &iEvent, EERecHitCollection &ecalHits, EEDigiCollection &ecalDigis)
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_
const RandomEngine * random_
TRandom random
Definition: MVATrainer.cc:138
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_
const std::vector< float > * ICMC_
int TThashedIndexforEE(const EcalTrigTowerDetId &detid) const
std::vector< float > theCalorimeterHits_
int zside() const
Definition: EEDetId.h:71
int SChashedIndex(const EEDetId &detid) const
std::vector< float > sinTheta_
int towerOf(const EEDetId &detid) const
void loadPCaloHits(const edm::Event &iEvent)
std::vector< float > noisesigma_
int hashedIndex() const
Definition: EEDetId.h:183
EcalEndcapRecHitsMaker(edm::ParameterSet const &p, const RandomEngine *random)
void init(const edm::EventSetup &es, bool dodigis, bool domiscalib)
std::vector< int > applyZSCells_
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_