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:
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 public:
61  explicit EcalTPGParamBuilder(edm::ParameterSet const& pSet);
62  ~EcalTPGParamBuilder() override;
63  void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override;
64  void beginJob() override;
65  bool checkIfOK(EcalPedestals::Item item);
66 
67 private:
68  bool computeLinearizerParam(
69  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,
82  const EcalIntercalibConstantMap& calibMap,
83  const EcalLaserAlphaMap& laserAlphaMap,
84  uint rawId,
85  std::string& ss);
86 
87  void computeFineGrainEBParameters(uint& lowRatio, uint& highRatio, uint& lowThreshold, uint& highThreshold, uint& lut);
88  void computeFineGrainEEParameters(uint& threshold, uint& lut_strip, uint& lut_tower);
89  int getEtaSlice(int tccId, int towerInTCC);
90  bool realignBaseline(linStruc& lin, float forceBase12);
91  int getGCTRegionPhi(int ttphi);
92  int getGCTRegionEta(int tteta);
93  std::string getDet(int tcc);
94  std::pair<std::string, int> getCrate(int tcc);
95 
100 
102  double xtal_LSB_EB_, xtal_LSB_EE_;
103  double Et_sat_EB_, Et_sat_EE_;
104  unsigned int sliding_;
105  unsigned int sampleMax_;
108  unsigned int nSample_;
109  unsigned int complement2_;
111  double LUT_threshold_EB_, LUT_threshold_EE_;
112  double LUT_stochastic_EB_, LUT_noise_EB_, LUT_constant_EB_;
113  double LUT_stochastic_EE_, LUT_noise_EE_, LUT_constant_EE_;
114  double TTF_lowThreshold_EB_, TTF_highThreshold_EB_;
115  double TTF_lowThreshold_EE_, TTF_highThreshold_EE_;
116  double FG_lowThreshold_EB_, FG_highThreshold_EB_, FG_lowRatio_EB_, FG_highRatio_EB_;
117  unsigned int FG_lut_EB_;
119  unsigned int FG_lut_strip_EE_, FG_lut_tower_EE_;
122  unsigned int SFGVB_Threshold_, SFGVB_lut_, pedestal_offset_;
123  int SFGVB_SpikeKillingThreshold_; //modif-alex 01/21/11
125 
126  //modif-alex-30/01/2012
129 
130  //modif-alex-02/02/11
135  std::map<int, std::vector<int> > delays_EB_;
136  std::map<int, std::vector<int> > phases_EB_;
137  std::map<int, std::vector<int> > delays_EE_;
138  std::map<int, std::vector<int> > phases_EE_;
139 
140  //modif-alex 30/01/2012
141  std::map<int, double> Transparency_Correction_;
142 
143  std::ofstream* out_file_;
144  std::ofstream* geomFile_;
148  unsigned int DBrunNb_;
149  bool DBEE_;
150 
157  int spi_conf_id_; //modif-alex 21/01.11
158  int del_conf_id_; //modif-alex 21/01.11
163  int version_;
170  int m_write_spi; //modif-alex 21/01/11
171  int m_write_del; //modif-alex 21/01/11
175 
176  Int_t* ntupleInts_;
177  Char_t ntupleDet_[10];
178  Char_t ntupleCrate_[10];
179 
181 };
182 #endif
std::map< int, std::vector< int > > phases_EB_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
double gainRatio_[3]
Geom::Theta< T > theta() const
unsigned tccId(DetId const &)
Definition: weight.py:1
const CaloSubdetectorGeometry * theEndcapGeometry_
std::ofstream * out_file_
std::map< int, std::vector< int > > delays_EB_
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void beginJob()
Definition: Breakpoints.cc:14
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, double > Transparency_Correction_
std::map< int, std::vector< int > > phases_EE_