CMS 3D CMS Logo

EcalTPGParamBuilder.h
Go to the documentation of this file.
1 #ifndef ECALTPGPARAMBUILDER_H
2 #define ECALTPGPARAMBUILDER_H
3 
4 //Author: Pascal Paganini - LLR
5 //Date: 2006/07/10 15:58:06 $
6 
7 // system include files
8 #include <memory>
9 
10 // user include files
18 
20 
26 
27 //modif-alex-27-july-2015
29 
31 
32 #include <TH1F.h>
33 
34 #include <vector>
35 #include <string>
36 #include <map>
37 #include <iostream>
38 
41 class EcalTPGDBApp ;
42 
43 class coeffStruc {
44  public:
45  coeffStruc() { }
46  double calibCoeff_ ;
47  double gainRatio_[3] ;
48  int pedestals_[3] ;
49 };
50 
51 class linStruc {
52  public:
53  linStruc() { }
54  int pedestal_[3] ;
55  int mult_[3] ;
56  int shift_[3] ;
57 };
58 
60 
61  public:
62  explicit EcalTPGParamBuilder(edm::ParameterSet const& pSet) ;
63  ~EcalTPGParamBuilder() override ;
64  void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override ;
65  void beginJob() override ;
66  bool checkIfOK (EcalPedestals::Item item) ;
67 
68  private:
69  bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int & mult , int & shift) ;
70  void create_header() ;
71  int uncodeWeight(double weight, int complement2 = 7) ;
72  double uncodeWeight(int iweight, int complement2 = 7) ;
73  std::vector<unsigned int> computeWeights(EcalShapeBase & shape, TH1F * histo) ;
74  void computeLUT(int * lut, std::string det="EB") ;
75  //void getCoeff(coeffStruc & coeff, const EcalIntercalibConstantMap & calibMap, uint rawId) ; //modif-alex-27-july-2015 uncomment to go back
76  void getCoeff(coeffStruc & coeff, const EcalGainRatioMap & gainMap, uint rawId) ;
77  void getCoeff(coeffStruc & coeff, const EcalPedestalsMap & pedMap, uint rawId) ;
78  void getCoeff(coeffStruc & coeff, const std::map<EcalLogicID, MonPedestalsDat> & pedMap, const EcalLogicID & logicId) ;
79 
80  //modif-alex-27-july-2015
81  void getCoeff(coeffStruc & coeff, const EcalIntercalibConstantMap & calibMap, const EcalLaserAlphaMap& laserAlphaMap, uint rawId, std::string & ss) ;
82 
83  void computeFineGrainEBParameters(uint & lowRatio, uint & highRatio,
84  uint & lowThreshold, uint & highThreshold, uint & lut) ;
85  void computeFineGrainEEParameters(uint & threshold, uint & lut_strip, uint & lut_tower) ;
86  int getEtaSlice(int tccId, int towerInTCC) ;
87  bool realignBaseline(linStruc & lin, float forceBase12) ;
88  int getGCTRegionPhi(int ttphi) ;
89  int getGCTRegionEta(int tteta) ;
90  std::string getDet(int tcc) ;
91  std::pair < std::string, int > getCrate(int tcc) ;
92 
97 
99  double xtal_LSB_EB_ , xtal_LSB_EE_ ;
100  double Et_sat_EB_, Et_sat_EE_ ;
101  unsigned int sliding_ ;
102  unsigned int sampleMax_ ;
105  unsigned int nSample_ ;
106  unsigned int complement2_ ;
108  double LUT_threshold_EB_, LUT_threshold_EE_ ;
109  double LUT_stochastic_EB_, LUT_noise_EB_, LUT_constant_EB_ ;
110  double LUT_stochastic_EE_, LUT_noise_EE_, LUT_constant_EE_ ;
111  double TTF_lowThreshold_EB_, TTF_highThreshold_EB_ ;
112  double TTF_lowThreshold_EE_, TTF_highThreshold_EE_ ;
113  double FG_lowThreshold_EB_, FG_highThreshold_EB_, FG_lowRatio_EB_, FG_highRatio_EB_ ;
114  unsigned int FG_lut_EB_ ;
116  unsigned int FG_lut_strip_EE_, FG_lut_tower_EE_ ;
119  unsigned int SFGVB_Threshold_, SFGVB_lut_, pedestal_offset_ ;
120  int SFGVB_SpikeKillingThreshold_; //modif-alex 01/21/11
122 
123  //modif-alex-30/01/2012
126 
127  //modif-alex-02/02/11
132  std::map<int, std::vector<int> > delays_EB_ ;
133  std::map<int, std::vector<int> > phases_EB_ ;
134  std::map<int, std::vector<int> > delays_EE_ ;
135  std::map<int, std::vector<int> > phases_EE_ ;
136 
137  //modif-alex 30/01/2012
138  std::map<int, double > Transparency_Correction_;
139 
140  std::ofstream * out_file_ ;
141  std::ofstream * geomFile_ ;
143  bool writeToDB_ ;
145  unsigned int DBrunNb_ ;
146  bool DBEE_ ;
147 
154  int spi_conf_id_; //modif-alex 21/01.11
155  int del_conf_id_; //modif-alex 21/01.11
160  int version_;
167  int m_write_spi; //modif-alex 21/01/11
168  int m_write_del; //modif-alex 21/01/11
172 
173  Int_t * ntupleInts_ ;
174  Char_t ntupleDet_[10] ;
175  Char_t ntupleCrate_[10] ;
176 
177 };
178 #endif
std::map< int, std::vector< int > > phases_EB_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
double gainRatio_[3]
Geom::Theta< T > theta() const
unsigned tccId(DetId const &)
Definition: weight.py:1
std::map< int, double > Transparency_Correction_
const CaloSubdetectorGeometry * theEndcapGeometry_
std::ofstream * out_file_
std::map< int, std::vector< int > > delays_EB_
void beginJob()
Definition: Breakpoints.cc:15
std::map< int, std::vector< int > > delays_EE_
const EcalElectronicsMapping * theMapping_
std::ofstream * geomFile_
const CaloSubdetectorGeometry * theBarrelGeometry_
static unsigned int const shift
std::map< int, std::vector< int > > phases_EE_