CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HPDNoiseLibraryReader.h
Go to the documentation of this file.
1 
2 // --------------------------------------------------------
3 // A class to read HPD noise from the library.
4 // The deliverable of the class is the collection of
5 // noisy HcalDetIds with associated noise in units of fC for
6 // 10 time samples. During the library production a higher
7 // theshold is used to find a noisy HPD. A lower threshold is
8 // used to eliminate adding unnecessary quite channels to HPD
9 // noise event collection. Therefore user may not see whole 18
10 // channels for noisy HPD.
11 //
12 // Project: HPD noise library reader
13 // Author: T.Yetkin University of Iowa, Feb. 7, 2008
14 // --------------------------------------------------------
15 
16 #ifndef HcalSimAlgos_HPDNoiseLibraryReader_h
17 #define HcalSimAlgos_HPDNoiseLibraryReader_h
18 
19 #include <memory>
20 #include <utility>
21 #include <iostream>
22 #include <vector>
23 #include <string>
24 
28 // Hcal Geometry
30 // HPD Noise Data Frame
33 // CLHEP Random numbers
34 #include "TMath.h"
35 
36 namespace CLHEP {
37  class HepRandomEngine;
38 }
39 
41 
42  public:
45  // collection of noisy detIds
46  std::vector<std::pair <HcalDetId, const float* > > getNoisyHcalDetIds(CLHEP::HepRandomEngine*);
47  // collection of noisy detIds. At least one HcalDetId is alwasy noiosy
48  std::vector<std::pair <HcalDetId, const float* > > getBiasedNoisyHcalDetIds(CLHEP::HepRandomEngine*);
49 
50 
51  std::vector<std::pair <HcalDetId, const float* > > getNoisyHcalDetIds(int timeSliceId, CLHEP::HepRandomEngine*);
52  // collection of noisy detIds. At least one HcalDetId is alwasy noiosy
53  std::vector < std::pair < HcalDetId, const float *> >getBiasedNoisyHcalDetIds(int timeSliceId, CLHEP::HepRandomEngine*);
60  double getIonFeedbackNoise(HcalDetId id, double energy, double bias, CLHEP::HepRandomEngine*);
61  // to be used for standalone tests (from R. Wilkinson)
62  // taken from SimGeneral/NoiseGenerators/interface/CorrelatedNoisifier.h
63  static void initializeServices();
64  private:
65  HPDNoiseData* getNoiseData(int iphi, CLHEP::HepRandomEngine*);
66  // reads external file provided by the user in /data directrory
67  // and fill rate for each HPD.
68  void fillRates();
69  // compares noise rates for each HPD with randomly thrown numbers
70  // and returns the collection of Phis.
71  void getNoisyPhis(CLHEP::HepRandomEngine*);
72  // same as above. The only difference is that at least one phi is
73  // always noisy
74  void getBiasedNoisyPhis(CLHEP::HepRandomEngine*);
75  // check if noise is applicable the the HPD
76  bool IsNoiseApplicable(int iphi);
77 
78  //normal random number
79  void Rannor(double &a, double &b, CLHEP::HepRandomEngine*);
80 
81  // clear phi vector
82  void clearPhi();
83  // use int iphi to create HPD names
84  std::string itos(int i); // convert int to string
85 
86  void shuffleData(int timeSliceId, float* &data);
87 
88  public:
89  //members
90  std::vector<float> theDischargeNoiseRate;
91  std::vector<float> theIonFeedbackFirstPeakRate;
92  std::vector<float> theIonFeedbackSecondPeakRate;
93  std::vector<int> theNoisyPhi;
95  std::vector <std::string> theNames;
97 
98 };
99 #endif
int i
Definition: DBlmapReader.cc:9
std::vector< float > theIonFeedbackFirstPeakRate
static void initializeServices()
HPDNoiseLibraryReader(const edm::ParameterSet &)
std::vector< std::pair< HcalDetId, const float * > > getBiasedNoisyHcalDetIds(CLHEP::HepRandomEngine *)
std::vector< int > theNoisyPhi
void Rannor(double &a, double &b, CLHEP::HepRandomEngine *)
std::vector< float > theIonFeedbackSecondPeakRate
double getIonFeedbackNoise(HcalDetId id, double energy, double bias, CLHEP::HepRandomEngine *)
std::vector< std::string > theNames
void getBiasedNoisyPhis(CLHEP::HepRandomEngine *)
double b
Definition: hdecay.h:120
std::vector< float > theDischargeNoiseRate
HPDNoiseData * getNoiseData(int iphi, CLHEP::HepRandomEngine *)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double a
Definition: hdecay.h:121
void getNoisyPhis(CLHEP::HepRandomEngine *)
std::vector< std::pair< HcalDetId, const float * > > getNoisyHcalDetIds(CLHEP::HepRandomEngine *)
void shuffleData(int timeSliceId, float *&data)