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;
66 
67 private:
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 
104  unsigned int sliding_;
105  unsigned int sampleMax_;
108  unsigned int nSample_;
109  unsigned int complement2_;
117  unsigned int FG_lut_EB_;
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
EcalTPGParamBuilder::FG_lowRatio_EB_
double FG_lowRatio_EB_
Definition: EcalTPGParamBuilder.h:116
EcalTPGParamBuilder::weight_timeShift_
double weight_timeShift_
Definition: EcalTPGParamBuilder.h:106
EcalTPGParamBuilder::Transparency_Corr_
std::string Transparency_Corr_
Definition: EcalTPGParamBuilder.h:127
EcalTPGParamBuilder::db_
EcalTPGDBApp * db_
Definition: EcalTPGParamBuilder.h:145
EcalTPGParamBuilder::create_header
void create_header()
Definition: EcalTPGParamBuilder.cc:2274
EcalElectronicsMapping
Definition: EcalElectronicsMapping.h:28
EcalTPGParamBuilder::xtal_LSB_EB_
double xtal_LSB_EB_
Definition: EcalTPGParamBuilder.h:102
EcalTPGParamBuilder::SFGVB_lut_
unsigned int SFGVB_lut_
Definition: EcalTPGParamBuilder.h:122
EcalTPGParamBuilder::getGCTRegionPhi
int getGCTRegionPhi(int ttphi)
Definition: EcalTPGParamBuilder.cc:2770
EcalTPGParamBuilder::geomFile_
std::ofstream * geomFile_
Definition: EcalTPGParamBuilder.h:144
EcalTPGParamBuilder::m_write_bxt
int m_write_bxt
Definition: EcalTPGParamBuilder.h:172
ecaldqm::tccId
unsigned tccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:56
EcalPedestals.h
EcalTPGParamBuilder::spi_conf_id_
int spi_conf_id_
Definition: EcalTPGParamBuilder.h:157
EcalTPGParamBuilder::useInterCalibration_
bool useInterCalibration_
Definition: EcalTPGParamBuilder.h:124
EcalTPGParamBuilder::theEndcapGeometry_
const CaloSubdetectorGeometry * theEndcapGeometry_
Definition: EcalTPGParamBuilder.h:96
EcalTPGParamBuilder::nSample_
unsigned int nSample_
Definition: EcalTPGParamBuilder.h:108
EcalTPGParamBuilder::fgr_conf_id_
int fgr_conf_id_
Definition: EcalTPGParamBuilder.h:154
ESHandle.h
EcalTPGParamBuilder::phases_EE_
std::map< int, std::vector< int > > phases_EE_
Definition: EcalTPGParamBuilder.h:138
EcalIntercalibConstants.h
EcalTPGParamBuilder::checkIfOK
bool checkIfOK(EcalPedestals::Item item)
Definition: EcalTPGParamBuilder.cc:358
EcalTPGParamBuilder::writeToDB_
bool writeToDB_
Definition: EcalTPGParamBuilder.h:146
EcalTPGParamBuilder::version_
int version_
Definition: EcalTPGParamBuilder.h:163
EcalTPGParamBuilder::bxt_conf_id_
int bxt_conf_id_
Definition: EcalTPGParamBuilder.h:159
EcalTPGParamBuilder::m_write_spi
int m_write_spi
Definition: EcalTPGParamBuilder.h:170
EcalTPGParamBuilder::SFGVB_Threshold_
unsigned int SFGVB_Threshold_
Definition: EcalTPGParamBuilder.h:122
linStruc::shift_
int shift_[3]
Definition: EcalTPGParamBuilder.h:56
EcalTPGParamBuilder::SFGVB_SpikeKillingThreshold_
int SFGVB_SpikeKillingThreshold_
Definition: EcalTPGParamBuilder.h:123
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
EcalTPGParamBuilder::pedestal_offset_
unsigned int pedestal_offset_
Definition: EcalTPGParamBuilder.h:122
EcalTPGParamBuilder::beginJob
void beginJob() override
Definition: EcalTPGParamBuilder.cc:2202
EDAnalyzer.h
linStruc
Definition: EcalTPGParamBuilder.h:51
EcalTPGParamBuilder::FG_highThreshold_EB_
double FG_highThreshold_EB_
Definition: EcalTPGParamBuilder.h:116
EcalTPGParamBuilder::LUT_constant_EE_
double LUT_constant_EE_
Definition: EcalTPGParamBuilder.h:113
EcalCondObjectContainer< EcalMGPAGainRatio >
parallelization.uint
uint
Definition: parallelization.py:124
EcalTPGParamBuilder::xtal_LSB_EE_
double xtal_LSB_EE_
Definition: EcalTPGParamBuilder.h:102
edm::EDAnalyzer
Definition: EDAnalyzer.h:29
linStruc::linStruc
linStruc()
Definition: EcalTPGParamBuilder.h:53
EcalTPGParamBuilder::useTransverseEnergy_
bool useTransverseEnergy_
Definition: EcalTPGParamBuilder.h:101
EcalTPGParamBuilder::LUT_threshold_EB_
double LUT_threshold_EB_
Definition: EcalTPGParamBuilder.h:111
EcalTPGParamBuilder::useDBShape_
bool useDBShape_
Definition: EcalTPGParamBuilder.h:180
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
coeffStruc::calibCoeff_
double calibCoeff_
Definition: EcalTPGParamBuilder.h:46
MakerMacros.h
EcalTPGParamBuilder::FG_highRatio_EB_
double FG_highRatio_EB_
Definition: EcalTPGParamBuilder.h:116
EcalTPGParamBuilder::EcalTPGParamBuilder
EcalTPGParamBuilder(edm::ParameterSet const &pSet)
Definition: EcalTPGParamBuilder.cc:57
EcalTPGParamBuilder::delays_EB_
std::map< int, std::vector< int > > delays_EB_
Definition: EcalTPGParamBuilder.h:135
EcalTPGParamBuilder::LUT_noise_EB_
double LUT_noise_EB_
Definition: EcalTPGParamBuilder.h:112
EcalTPGParamBuilder::getGCTRegionEta
int getGCTRegionEta(int tteta)
Definition: EcalTPGParamBuilder.cc:2780
EcalShapeBase
Definition: EcalShapeBase.h:24
EcalTPGParamBuilder::del_conf_id_
int del_conf_id_
Definition: EcalTPGParamBuilder.h:158
EcalTPGParamBuilder::DBEE_
bool DBEE_
Definition: EcalTPGParamBuilder.h:149
EcalTPGParamBuilder::getEtaSlice
int getEtaSlice(int tccId, int towerInTCC)
Definition: EcalTPGParamBuilder.cc:375
EcalTPGParamBuilder::out_file_
std::ofstream * out_file_
Definition: EcalTPGParamBuilder.h:143
EcalTPGParamBuilder::TimingPhases_EE_
std::string TimingPhases_EE_
Definition: EcalTPGParamBuilder.h:134
edm::ESHandle< EcalTrigTowerConstituentsMap >
EcalLogicID
Definition: EcalLogicID.h:7
EcalTPGParamBuilder::m_write_lut
int m_write_lut
Definition: EcalTPGParamBuilder.h:166
EcalTPGParamBuilder::complement2_
unsigned int complement2_
Definition: EcalTPGParamBuilder.h:109
coeffStruc::gainRatio_
double gainRatio_[3]
Definition: EcalTPGParamBuilder.h:47
EcalTPGParamBuilder::writeToFiles_
bool writeToFiles_
Definition: EcalTPGParamBuilder.h:147
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
EcalTPGParamBuilder::m_write_wei
int m_write_wei
Definition: EcalTPGParamBuilder.h:167
EcalTPGParamBuilder::useTransparencyCorr_
bool useTransparencyCorr_
Definition: EcalTPGParamBuilder.h:128
EcalTPGParamBuilder::Et_sat_EB_
double Et_sat_EB_
Definition: EcalTPGParamBuilder.h:103
EcalTPGParamBuilder::m_write_sli
int m_write_sli
Definition: EcalTPGParamBuilder.h:169
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTPGParamBuilder::Et_sat_EE_
double Et_sat_EE_
Definition: EcalTPGParamBuilder.h:103
EcalTPGParamBuilder::LUT_option_
std::string LUT_option_
Definition: EcalTPGParamBuilder.h:110
EcalTPGParamBuilder::m_write_bst
int m_write_bst
Definition: EcalTPGParamBuilder.h:174
EcalTPGParamBuilder::phases_EB_
std::map< int, std::vector< int > > phases_EB_
Definition: EcalTPGParamBuilder.h:136
EcalTPGParamBuilder::LUT_threshold_EE_
double LUT_threshold_EE_
Definition: EcalTPGParamBuilder.h:111
all_monitoring_types.h
EcalTPGParamBuilder::FG_lowThreshold_EB_
double FG_lowThreshold_EB_
Definition: EcalTPGParamBuilder.h:116
EcalTPGParamBuilder::forcedPedestalValue_
int forcedPedestalValue_
Definition: EcalTPGParamBuilder.h:120
edm::ParameterSet
Definition: ParameterSet.h:36
EcalTPGParamBuilder::computeFineGrainEBParameters
void computeFineGrainEBParameters(uint &lowRatio, uint &highRatio, uint &lowThreshold, uint &highThreshold, uint &lut)
Definition: EcalTPGParamBuilder.cc:2701
EcalLaserAlphas.h
EcalTPGParamBuilder::delays_EE_
std::map< int, std::vector< int > > delays_EE_
Definition: EcalTPGParamBuilder.h:137
Event.h
EcalTPGParamBuilder::sli_conf_id_
int sli_conf_id_
Definition: EcalTPGParamBuilder.h:155
EcalCondObjectContainer< EcalPedestal >::Item
EcalPedestal Item
Definition: EcalCondObjectContainer.h:15
coeffStruc::coeffStruc
coeffStruc()
Definition: EcalTPGParamBuilder.h:45
EcalTPGParamBuilder::computeLinearizerParam
bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int &mult, int &shift)
Definition: EcalTPGParamBuilder.cc:2228
EcalShapeBase.h
EcalTPGParamBuilder::lin_conf_id_
int lin_conf_id_
Definition: EcalTPGParamBuilder.h:152
EcalTPGParamBuilder::m_write_ped
int m_write_ped
Definition: EcalTPGParamBuilder.h:164
EcalTPGParamBuilder::weight_unbias_recovery_
bool weight_unbias_recovery_
Definition: EcalTPGParamBuilder.h:107
EcalTPGParamBuilder::wei_conf_id_
int wei_conf_id_
Definition: EcalTPGParamBuilder.h:156
EcalTPGParamBuilder::ntupleDet_
Char_t ntupleDet_[10]
Definition: EcalTPGParamBuilder.h:177
EcalTPGParamBuilder::TTF_highThreshold_EE_
double TTF_highThreshold_EE_
Definition: EcalTPGParamBuilder.h:115
EcalTPGParamBuilder::eTTmap_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
Definition: EcalTPGParamBuilder.h:98
EcalTPGParamBuilder::btt_conf_id_
int btt_conf_id_
Definition: EcalTPGParamBuilder.h:160
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::EventSetup
Definition: EventSetup.h:57
EcalTPGParamBuilder::uncodeWeight
int uncodeWeight(double weight, int complement2=7)
Definition: EcalTPGParamBuilder.cc:2367
EcalTPGParamBuilder::lut_conf_id_
int lut_conf_id_
Definition: EcalTPGParamBuilder.h:153
EcalTPGParamBuilder::getCrate
std::pair< std::string, int > getCrate(int tcc)
Definition: EcalTPGParamBuilder.cc:2827
EcalTPGParamBuilder::TimingDelays_EB_
std::string TimingDelays_EB_
Definition: EcalTPGParamBuilder.h:131
EcalTPGParamBuilder::analyze
void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override
Definition: EcalTPGParamBuilder.cc:394
EcalTPGParamBuilder::computeWeights
std::vector< unsigned int > computeWeights(EcalShapeBase &shape, TH1F *histo)
Definition: EcalTPGParamBuilder.cc:2386
EcalTPGParamBuilder::m_write_lin
int m_write_lin
Definition: EcalTPGParamBuilder.h:165
EcalGainRatios.h
linStruc::mult_
int mult_[3]
Definition: EcalTPGParamBuilder.h:55
EcalTPGParamBuilder::m_write_fgr
int m_write_fgr
Definition: EcalTPGParamBuilder.h:168
EcalTPGParamBuilder::TTF_lowThreshold_EE_
double TTF_lowThreshold_EE_
Definition: EcalTPGParamBuilder.h:115
coeffStruc::pedestals_
int pedestals_[3]
Definition: EcalTPGParamBuilder.h:48
linStruc::pedestal_
int pedestal_[3]
Definition: EcalTPGParamBuilder.h:54
EcalTPGParamBuilder::TTF_lowThreshold_EB_
double TTF_lowThreshold_EB_
Definition: EcalTPGParamBuilder.h:114
EcalTPGParamBuilder::~EcalTPGParamBuilder
~EcalTPGParamBuilder() override
Definition: EcalTPGParamBuilder.cc:350
EcalTPGParamBuilder::m_write_del
int m_write_del
Definition: EcalTPGParamBuilder.h:171
EcalTrigTowerConstituentsMap.h
EcalTPGParamBuilder::m_write_btt
int m_write_btt
Definition: EcalTPGParamBuilder.h:173
EcalTPGParamBuilder::H2_
bool H2_
Definition: EcalTPGParamBuilder.h:124
EcalTPGParamBuilder::ntupleInts_
Int_t * ntupleInts_
Definition: EcalTPGParamBuilder.h:176
EcalTPGParamBuilder::FG_lut_strip_EE_
unsigned int FG_lut_strip_EE_
Definition: EcalTPGParamBuilder.h:119
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
EcalTPGParamBuilder::Transparency_Correction_
std::map< int, double > Transparency_Correction_
Definition: EcalTPGParamBuilder.h:141
EcalTPGParamBuilder::realignBaseline
bool realignBaseline(linStruc &lin, float forceBase12)
Definition: EcalTPGParamBuilder.cc:2745
Frameworkfwd.h
EcalTPGParamBuilder::theBarrelGeometry_
const CaloSubdetectorGeometry * theBarrelGeometry_
Definition: EcalTPGParamBuilder.h:97
EcalTPGParamBuilder::theMapping_
const EcalElectronicsMapping * theMapping_
Definition: EcalTPGParamBuilder.h:99
EcalTPGParamBuilder
Definition: EcalTPGParamBuilder.h:59
EcalTPGParamBuilder::FG_lut_EB_
unsigned int FG_lut_EB_
Definition: EcalTPGParamBuilder.h:117
EcalTPGParamBuilder::LUT_noise_EE_
double LUT_noise_EE_
Definition: EcalTPGParamBuilder.h:113
EventSetup.h
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
VarParsing.mult
mult
Definition: VarParsing.py:659
EcalTPGParamBuilder::TimingPhases_EB_
std::string TimingPhases_EB_
Definition: EcalTPGParamBuilder.h:133
EcalTPGParamBuilder::FG_Threshold_EE_
double FG_Threshold_EE_
Definition: EcalTPGParamBuilder.h:118
EcalTPGParamBuilder::LUT_stochastic_EB_
double LUT_stochastic_EB_
Definition: EcalTPGParamBuilder.h:112
ParameterSet.h
EcalTPGParamBuilder::LUT_constant_EB_
double LUT_constant_EB_
Definition: EcalTPGParamBuilder.h:112
EcalTPGParamBuilder::bst_conf_id_
int bst_conf_id_
Definition: EcalTPGParamBuilder.h:161
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
edm::Event
Definition: Event.h:73
EcalTPGParamBuilder::sampleMax_
unsigned int sampleMax_
Definition: EcalTPGParamBuilder.h:105
EcalTPGParamBuilder::LUT_stochastic_EE_
double LUT_stochastic_EE_
Definition: EcalTPGParamBuilder.h:113
EcalTPGParamBuilder::forceEtaSlice_
bool forceEtaSlice_
Definition: EcalTPGParamBuilder.h:121
EcalTPGParamBuilder::TTF_highThreshold_EB_
double TTF_highThreshold_EB_
Definition: EcalTPGParamBuilder.h:114
EcalTPGParamBuilder::computeFineGrainEEParameters
void computeFineGrainEEParameters(uint &threshold, uint &lut_strip, uint &lut_tower)
Definition: EcalTPGParamBuilder.cc:2735
EcalTPGParamBuilder::FG_lut_tower_EE_
unsigned int FG_lut_tower_EE_
Definition: EcalTPGParamBuilder.h:119
EcalTPGParamBuilder::computeLUT
void computeLUT(int *lut, std::string det="EB")
Definition: EcalTPGParamBuilder.cc:2505
EcalTPGParamBuilder::TimingDelays_EE_
std::string TimingDelays_EE_
Definition: EcalTPGParamBuilder.h:132
EcalTPGParamBuilder::getDet
std::string getDet(int tcc)
Definition: EcalTPGParamBuilder.cc:2789
EcalTPGParamBuilder::tag_
std::string tag_
Definition: EcalTPGParamBuilder.h:162
weight
Definition: weight.py:1
EcalTPGParamBuilder::getCoeff
void getCoeff(coeffStruc &coeff, const EcalGainRatioMap &gainMap, uint rawId)
coeffStruc
Definition: EcalTPGParamBuilder.h:43
all_fe_config_types.h
EcalTPGParamBuilder::sliding_
unsigned int sliding_
Definition: EcalTPGParamBuilder.h:104
EcalTPGParamBuilder::ntupleCrate_
Char_t ntupleCrate_[10]
Definition: EcalTPGParamBuilder.h:178
EcalTPGDBApp
Definition: EcalTPGDBApp.h:16
EcalTPGParamBuilder::DBrunNb_
unsigned int DBrunNb_
Definition: EcalTPGParamBuilder.h:148
EcalTPGParamBuilder::ped_conf_id_
int ped_conf_id_
Definition: EcalTPGParamBuilder.h:151