CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalTPGParamBuilder Class Reference

#include <EcalTPGParamBuilder.h>

Inheritance diagram for EcalTPGParamBuilder:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup) override
 
void beginJob () override
 
 EcalTPGParamBuilder (edm::ParameterSet const &pSet)
 
 ~EcalTPGParamBuilder () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool checkIfOK (EcalPedestals::Item item)
 
void computeFineGrainEBParameters (uint &lowRatio, uint &highRatio, uint &lowThreshold, uint &highThreshold, uint &lut)
 
void computeFineGrainEEParameters (uint &threshold, uint &lut_strip, uint &lut_tower)
 
bool computeLinearizerParam (double theta, double gainRatio, double calibCoeff, std::string subdet, int &mult, int &shift)
 
void computeLUT (int *lut, std::string det="EB")
 
std::vector< unsigned int > computeWeights (EcalShapeBase &shape, TH1F *histo)
 
void create_header ()
 
void getCoeff (coeffStruc &coeff, const EcalGainRatioMap &gainMap, uint rawId)
 
void getCoeff (coeffStruc &coeff, const EcalIntercalibConstantMap &calibMap, const EcalLaserAlphaMap &laserAlphaMap, uint rawId, std::string &ss)
 
void getCoeff (coeffStruc &coeff, const EcalPedestalsMap &pedMap, uint rawId)
 
void getCoeff (coeffStruc &coeff, const std::map< EcalLogicID, MonPedestalsDat > &pedMap, const EcalLogicID &logicId)
 
std::pair< std::string, int > getCrate (int tcc)
 
std::string getDet (int tcc)
 
int getEtaSlice (int tccId, int towerInTCC)
 
int getGCTRegionEta (int tteta)
 
int getGCTRegionPhi (int ttphi)
 
bool realignBaseline (linStruc &lin, float forceBase12)
 
int uncodeWeight (double weight, int complement2=7)
 
double uncodeWeight (int iweight, int complement2=7)
 

Private Attributes

int bst_conf_id_
 
int btt_conf_id_
 
int bxt_conf_id_
 
unsigned int complement2_
 
EcalTPGDBAppdb_
 
bool DBEE_
 
unsigned int DBrunNb_
 
int del_conf_id_
 
std::map< int, std::vector< int > > delays_EB_
 
std::map< int, std::vector< int > > delays_EE_
 
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcdecalADCToGeVConstantToken_
 
edm::ESGetToken< EcalGainRatios, EcalGainRatiosRcdecalGainRatiosToken_
 
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcdecalIntercalibConstantsToken_
 
edm::ESGetToken< EcalLaserAlphas, EcalLaserAlphasRcdecalLaserAlphasToken_
 
edm::ESGetToken< EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcdecalLaserAPDPNRatiosToken_
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdecalmappingToken_
 
edm::ESGetToken< EcalPedestals, EcalPedestalsRcdecalPedestalsToken_
 
double Et_sat_EB_
 
double Et_sat_EE_
 
const EcalTrigTowerConstituentsMapeTTmap_
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordeTTmapToken_
 
double FG_highRatio_EB_
 
double FG_highThreshold_EB_
 
double FG_lowRatio_EB_
 
double FG_lowThreshold_EB_
 
unsigned int FG_lut_EB_
 
unsigned int FG_lut_strip_EE_
 
unsigned int FG_lut_tower_EE_
 
double FG_Threshold_EE_
 
int fgr_conf_id_
 
int forcedPedestalValue_
 
bool forceEtaSlice_
 
std::ofstream * geomFile_
 
bool H2_
 
int lin_conf_id_
 
int lut_conf_id_
 
double LUT_constant_EB_
 
double LUT_constant_EE_
 
double LUT_noise_EB_
 
double LUT_noise_EE_
 
std::string LUT_option_
 
double LUT_stochastic_EB_
 
double LUT_stochastic_EE_
 
double LUT_threshold_EB_
 
double LUT_threshold_EE_
 
int m_write_bst
 
int m_write_btt
 
int m_write_bxt
 
int m_write_del
 
int m_write_fgr
 
int m_write_lin
 
int m_write_lut
 
int m_write_ped
 
int m_write_sli
 
int m_write_spi
 
int m_write_wei
 
unsigned int nSample_
 
Char_t ntupleCrate_ [10]
 
Char_t ntupleDet_ [10]
 
Int_t * ntupleInts_
 
std::ofstream * out_file_
 
int ped_conf_id_
 
unsigned int pedestal_offset_
 
std::map< int, std::vector< int > > phases_EB_
 
std::map< int, std::vector< int > > phases_EE_
 
unsigned int sampleMax_
 
unsigned int SFGVB_lut_
 
int SFGVB_SpikeKillingThreshold_
 
unsigned int SFGVB_Threshold_
 
int sli_conf_id_
 
unsigned int sliding_
 
int spi_conf_id_
 
std::string tag_
 
const CaloSubdetectorGeometrytheBarrelGeometry_
 
edm::ESGetToken< CaloSubdetectorGeometry, EcalBarrelGeometryRecordtheBarrelGeometryToken_
 
const CaloSubdetectorGeometrytheEndcapGeometry_
 
edm::ESGetToken< CaloSubdetectorGeometry, EcalEndcapGeometryRecordtheEndcapGeometryToken_
 
const EcalElectronicsMappingtheMapping_
 
std::string TimingDelays_EB_
 
std::string TimingDelays_EE_
 
std::string TimingPhases_EB_
 
std::string TimingPhases_EE_
 
std::string Transparency_Corr_
 
std::map< int, double > Transparency_Correction_
 
double TTF_highThreshold_EB_
 
double TTF_highThreshold_EE_
 
double TTF_lowThreshold_EB_
 
double TTF_lowThreshold_EE_
 
bool useDBShape_
 
bool useInterCalibration_
 
bool useTransparencyCorr_
 
bool useTransverseEnergy_
 
int version_
 
int wei_conf_id_
 
double weight_timeShift_
 
bool weight_unbias_recovery_
 
bool writeToDB_
 
bool writeToFiles_
 
double xtal_LSB_EB_
 
double xtal_LSB_EE_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 70 of file EcalTPGParamBuilder.h.

Constructor & Destructor Documentation

◆ EcalTPGParamBuilder()

EcalTPGParamBuilder::EcalTPGParamBuilder ( edm::ParameterSet const &  pSet)
explicit

Definition at line 41 of file EcalTPGParamBuilder.cc.

52  xtal_LSB_EB_(0),
53  xtal_LSB_EE_(0),
54  nSample_(5),
55  complement2_(7),
56  useDBShape_(true) {
57  ped_conf_id_ = 0;
58  lin_conf_id_ = 0;
59  lut_conf_id_ = 0;
60  wei_conf_id_ = 0;
61  fgr_conf_id_ = 0;
62  sli_conf_id_ = 0;
63  spi_conf_id_ = 0; //modif-alex 21/01/11
64  del_conf_id_ = 0; //modif-alex 21/01/11
65  bxt_conf_id_ = 0;
66  btt_conf_id_ = 0;
67  bst_conf_id_ = 0;
68  tag_ = "";
69  version_ = 0;
70 
71  m_write_ped = 1;
72  m_write_lin = 1;
73  m_write_lut = 1;
74  m_write_wei = 1;
75  m_write_fgr = 1;
76  m_write_sli = 1;
77  m_write_spi = 1; //modif-alex 21/01/11
78  m_write_del = 1; //modif-alex 21/01/11
79  m_write_bxt = 1;
80  m_write_btt = 1;
81  m_write_bst = 1;
82 
83  writeToDB_ = pSet.getParameter<bool>("writeToDB");
84  DBEE_ = pSet.getParameter<bool>("allowDBEE");
85  string DBsid = pSet.getParameter<std::string>("DBsid");
86  string DBuser = pSet.getParameter<std::string>("DBuser");
87  string DBpass = pSet.getParameter<std::string>("DBpass");
88  //uint32_t DBport = pSet.getParameter<unsigned int>("DBport") ;
89 
90  tag_ = pSet.getParameter<std::string>("TPGtag");
91  version_ = pSet.getParameter<unsigned int>("TPGversion");
92 
93  m_write_ped = pSet.getParameter<unsigned int>("TPGWritePed");
94  m_write_lin = pSet.getParameter<unsigned int>("TPGWriteLin");
95  m_write_lut = pSet.getParameter<unsigned int>("TPGWriteLut");
96  m_write_wei = pSet.getParameter<unsigned int>("TPGWriteWei");
97  m_write_fgr = pSet.getParameter<unsigned int>("TPGWriteFgr");
98  m_write_sli = pSet.getParameter<unsigned int>("TPGWriteSli");
99  m_write_spi = pSet.getParameter<unsigned int>("TPGWriteSpi"); //modif-alex 21/01/11
100  m_write_del = pSet.getParameter<unsigned int>("TPGWriteDel"); //modif-alex 21/01/11
101  m_write_bxt = pSet.getParameter<unsigned int>("TPGWriteBxt");
102  m_write_btt = pSet.getParameter<unsigned int>("TPGWriteBtt");
103  m_write_bst = pSet.getParameter<unsigned int>("TPGWriteBst");
104 
108 
109  if (m_write_ped != 0 && m_write_ped != 1)
111 
112  if (writeToDB_)
113  edm::LogInfo("TopInfo") << "data will be saved with tag and version=" << tag_ << ".version" << version_ << "\n";
114  db_ = new EcalTPGDBApp(DBsid, DBuser, DBpass);
115 
116  writeToFiles_ = pSet.getParameter<bool>("writeToFiles");
117  if (writeToFiles_) {
118  std::string outFile = pSet.getParameter<std::string>("outFile");
119  out_file_ = new std::ofstream(outFile.c_str(), std::ios::out);
120  }
121  geomFile_ = new std::ofstream("geomFile.txt", std::ios::out);
122 
123  useTransverseEnergy_ = pSet.getParameter<bool>("useTransverseEnergy");
124 
125  Et_sat_EB_ = pSet.getParameter<double>("Et_sat_EB");
126  Et_sat_EE_ = pSet.getParameter<double>("Et_sat_EE");
127  sliding_ = pSet.getParameter<unsigned int>("sliding");
128  weight_timeShift_ = pSet.getParameter<double>("weight_timeShift");
129  sampleMax_ = pSet.getParameter<unsigned int>("weight_sampleMax");
130  weight_unbias_recovery_ = pSet.getParameter<bool>("weight_unbias_recovery");
131 
132  forcedPedestalValue_ = pSet.getParameter<int>("forcedPedestalValue");
133  forceEtaSlice_ = pSet.getParameter<bool>("forceEtaSlice");
134 
135  LUT_option_ = pSet.getParameter<std::string>("LUT_option");
136  LUT_threshold_EB_ = pSet.getParameter<double>("LUT_threshold_EB");
137  LUT_threshold_EE_ = pSet.getParameter<double>("LUT_threshold_EE");
138  LUT_stochastic_EB_ = pSet.getParameter<double>("LUT_stochastic_EB");
139  LUT_noise_EB_ = pSet.getParameter<double>("LUT_noise_EB");
140  LUT_constant_EB_ = pSet.getParameter<double>("LUT_constant_EB");
141  LUT_stochastic_EE_ = pSet.getParameter<double>("LUT_stochastic_EE");
142  LUT_noise_EE_ = pSet.getParameter<double>("LUT_noise_EE");
143  LUT_constant_EE_ = pSet.getParameter<double>("LUT_constant_EE");
144 
145  TTF_lowThreshold_EB_ = pSet.getParameter<double>("TTF_lowThreshold_EB");
146  TTF_highThreshold_EB_ = pSet.getParameter<double>("TTF_highThreshold_EB");
147  TTF_lowThreshold_EE_ = pSet.getParameter<double>("TTF_lowThreshold_EE");
148  TTF_highThreshold_EE_ = pSet.getParameter<double>("TTF_highThreshold_EE");
149 
150  FG_lowThreshold_EB_ = pSet.getParameter<double>("FG_lowThreshold_EB");
151  FG_highThreshold_EB_ = pSet.getParameter<double>("FG_highThreshold_EB");
152  FG_lowRatio_EB_ = pSet.getParameter<double>("FG_lowRatio_EB");
153  FG_highRatio_EB_ = pSet.getParameter<double>("FG_highRatio_EB");
154  FG_lut_EB_ = pSet.getParameter<unsigned int>("FG_lut_EB");
155  FG_Threshold_EE_ = pSet.getParameter<double>("FG_Threshold_EE");
156  FG_lut_strip_EE_ = pSet.getParameter<unsigned int>("FG_lut_strip_EE");
157  FG_lut_tower_EE_ = pSet.getParameter<unsigned int>("FG_lut_tower_EE");
158  SFGVB_Threshold_ = pSet.getParameter<unsigned int>("SFGVB_Threshold");
159  SFGVB_lut_ = pSet.getParameter<unsigned int>("SFGVB_lut");
160  SFGVB_SpikeKillingThreshold_ = pSet.getParameter<int>("SFGVB_SpikeKillingThreshold"); //modif-alex 21/01/11
161  pedestal_offset_ = pSet.getParameter<unsigned int>("pedestal_offset");
162 
163  useInterCalibration_ = pSet.getParameter<bool>("useInterCalibration");
164  H2_ = pSet.getUntrackedParameter<bool>("H2", false);
165 
166  useTransparencyCorr_ = false;
167  useTransparencyCorr_ = pSet.getParameter<bool>("useTransparencyCorr"); //modif-alex-25/04/2012
168  Transparency_Corr_ = pSet.getParameter<std::string>("transparency_corrections"); //modif-alex-30/01/2012
169 
170  //modif-alex-23/02/2011
171  //convert the spike killing first from GeV to ADC (10 bits)
172  //depending on the saturation scale: Et_sat_EB_
174  SFGVB_SpikeKillingThreshold_ = 1023; //nokilling
175  else
177  edm::LogInfo("TopInfo") << "INFO:SPIKE KILLING THRESHOLD (ADC)=" << SFGVB_SpikeKillingThreshold_ << "\n";
178 
179  //modif-alex-02/02/11
180  //TIMING information
181  TimingDelays_EB_ = pSet.getParameter<std::string>("timing_delays_EB");
182  TimingDelays_EE_ = pSet.getParameter<std::string>("timing_delays_EE");
183  TimingPhases_EB_ = pSet.getParameter<std::string>("timing_phases_EB");
184  TimingPhases_EE_ = pSet.getParameter<std::string>("timing_phases_EE");
185 
186  std::ostringstream ss;
187  // edm::LogInfo("TopInfo") << "INFO: READING timing files" << "\n";
188  ss << "INFO: READING timing files\n";
189  std::ifstream delay_eb(TimingDelays_EB_.c_str());
190  if (!delay_eb)
191  edm::LogError("TopInfo") << "ERROR: File " << TimingDelays_EB_.c_str() << " could not be opened"
192  << "\n";
193  std::ifstream delay_ee(TimingDelays_EE_.c_str());
194  if (!delay_ee)
195  edm::LogError("TopInfo") << "ERROR: File " << TimingDelays_EE_.c_str() << " could not be opened"
196  << "\n";
197  std::ifstream phase_eb(TimingPhases_EB_.c_str());
198  if (!phase_eb)
199  edm::LogError("TopInfo") << "ERROR: File " << TimingPhases_EB_.c_str() << " could not be opened"
200  << "\n";
201  std::ifstream phase_ee(TimingPhases_EE_.c_str());
202  if (!phase_ee)
203  edm::LogError("TopInfo") << "ERROR: File " << TimingPhases_EE_.c_str() << " could not be opened"
204  << "\n";
205 
206  char buf[1024];
207  //READING DELAYS EB
208  delay_eb.getline(buf, sizeof(buf), '\n');
209  while (delay_eb) {
210  std::stringstream sin(buf);
211 
212  int tcc;
213  sin >> tcc;
214 
215  vector<int> vec_delays_eb;
216  for (int ieb = 0; ieb < 68; ++ieb) {
217  int time_delay = -1;
218  sin >> time_delay;
219  vec_delays_eb.push_back(time_delay);
220  if (time_delay == -1)
221  edm::LogError("TopInfo") << "ERROR:Barrel timing delay -1, check file"
222  << "\n";
223  }
224 
225  if (vec_delays_eb.size() != 68)
226  edm::LogError("TopInfo") << "ERROR:Barrel timing delay wrong, not enough towers, check file"
227  << "\n";
228 
229  if (delays_EB_.find(tcc) == delays_EB_.end())
230  delays_EB_.insert(make_pair(tcc, vec_delays_eb));
231 
232  // edm::LogInfo("TopInfo") << tcc << "\n";
233  ss << tcc;
234  for (unsigned int ieb = 0; ieb < vec_delays_eb.size(); ++ieb)
235  // edm::LogInfo("TopInfo") << vec_delays_eb[ieb] << "\n";
236  ss << " " << vec_delays_eb[ieb];
237  delay_eb.getline(buf, sizeof(buf), '\n');
238  ss << "\n";
239  } //loop delay file EB
240  delay_eb.close();
241 
242  //READING PHASES EB
243  phase_eb.getline(buf, sizeof(buf), '\n');
244  while (phase_eb) {
245  std::stringstream sin(buf);
246  int tcc;
247  sin >> tcc;
248 
249  vector<int> vec_phases_eb;
250  for (unsigned int ieb = 0; ieb < 68; ++ieb) {
251  int time_phase = -1;
252  sin >> time_phase;
253  vec_phases_eb.push_back(time_phase);
254  if (time_phase == -1)
255  edm::LogError("TopInfo") << "ERROR:Barrel timing phase -1, check file"
256  << "\n";
257  }
258 
259  if (vec_phases_eb.size() != 68)
260  edm::LogError("TopInfo") << "ERROR:Barrel timing phase wrong, not enough towers, check file"
261  << "\n";
262 
263  if (phases_EB_.find(tcc) == phases_EB_.end())
264  phases_EB_.insert(make_pair(tcc, vec_phases_eb));
265 
266  // edm::LogInfo("TopInfo") << tcc << "\n";
267  ss << tcc;
268  for (unsigned int ieb = 0; ieb < vec_phases_eb.size(); ++ieb)
269  // edm::LogInfo("TopInfo") << vec_phases_eb[ieb] << "\n";
270  ss << " " << vec_phases_eb[ieb];
271  phase_eb.getline(buf, sizeof(buf), '\n');
272  ss << "\n";
273  } //loop phase file EB
274  phase_eb.close();
275 
276  //READING DELAYS EE//------------------------------------------------
277  delay_ee.getline(buf, sizeof(buf), '\n');
278  while (delay_ee) {
279  std::stringstream sin(buf);
280  int tcc;
281  sin >> tcc;
282 
283  vector<int> vec_delays_ee;
284  for (unsigned int iee = 0; iee < 48; ++iee) {
285  int time_delay = -1;
286  sin >> time_delay;
287  vec_delays_ee.push_back(time_delay);
288  if (time_delay == -1)
289  edm::LogError("TopInfo") << "ERROR:EE timing delay -1, check file"
290  << "\n";
291  }
292 
293  if (vec_delays_ee.size() != 48)
294  edm::LogError("TopInfo") << "ERROR:EE timing delay wrong, not enough towers, check file"
295  << "\n";
296 
297  if (delays_EE_.find(tcc) == delays_EE_.end())
298  delays_EE_.insert(make_pair(tcc, vec_delays_ee));
299 
300  // edm::LogInfo("TopInfo") << tcc << "\n";
301  ss << tcc;
302  for (unsigned int iee = 0; iee < vec_delays_ee.size(); ++iee)
303  // edm::LogInfo("TopInfo") << vec_delays_ee[iee] << "\n";
304  ss << " " << vec_delays_ee[iee];
305  ss << "\n";
306  delay_ee.getline(buf, sizeof(buf), '\n');
307  } //loop delay file EE
308  delay_ee.close();
309 
310  //READING PHASES EE
311  phase_ee.getline(buf, sizeof(buf), '\n');
312  while (phase_ee) {
313  std::stringstream sin(buf);
314  int tcc;
315  sin >> tcc;
316 
317  vector<int> vec_phases_ee;
318  for (unsigned int iee = 0; iee < 48; ++iee) {
319  int time_phase = -1;
320  sin >> time_phase;
321  vec_phases_ee.push_back(time_phase);
322  if (time_phase == -1)
323  edm::LogError("TopInfo") << "ERROR:EE timing phase -1, check file"
324  << "\n";
325  }
326 
327  if (vec_phases_ee.size() != 48)
328  edm::LogError("TopInfo") << "ERROR:EE timing phase wrong, not enough towers, check file"
329  << "\n";
330 
331  if (phases_EE_.find(tcc) == phases_EE_.end())
332  phases_EE_.insert(make_pair(tcc, vec_phases_ee));
333  // edm::LogInfo("TopInfo") << tcc << "\n";
334  ss << tcc;
335  for (unsigned int iee = 0; iee < vec_phases_ee.size(); ++iee)
336  // edm::LogInfo("TopInfo") << vec_phases_ee[iee] << "\n";
337  ss << " " << vec_phases_ee[iee];
338  ss << "\n";
339  phase_ee.getline(buf, sizeof(buf), '\n');
340  } //loop phase file EE
341  phase_ee.close();
342 
343  // edm::LogInfo("TopInfo") << "INFO: DONE reading timing files for EB and EE" << "\n";
344  ss << "INFO: DONE reading timing files for EB and EE\n";
345  edm::LogInfo("TopInfo") << ss.str();
346 }

References bst_conf_id_, btt_conf_id_, visDQMUpload::buf, bxt_conf_id_, db_, DBEE_, del_conf_id_, delays_EB_, delays_EE_, Et_sat_EB_, Et_sat_EE_, FG_highRatio_EB_, FG_highThreshold_EB_, FG_lowRatio_EB_, FG_lowThreshold_EB_, FG_lut_EB_, FG_lut_strip_EE_, FG_lut_tower_EE_, FG_Threshold_EE_, fgr_conf_id_, forcedPedestalValue_, forceEtaSlice_, geomFile_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), H2_, createfilelist::int, lin_conf_id_, lut_conf_id_, LUT_constant_EB_, LUT_constant_EE_, LUT_noise_EB_, LUT_noise_EE_, LUT_option_, LUT_stochastic_EB_, LUT_stochastic_EE_, LUT_threshold_EB_, LUT_threshold_EE_, m_write_bst, m_write_btt, m_write_bxt, m_write_del, m_write_fgr, m_write_lin, m_write_lut, m_write_ped, m_write_sli, m_write_spi, m_write_wei, MillePedeFileConverter_cfg::out, out_file_, L1TdeCSCTF_cfi::outFile, ped_conf_id_, pedestal_offset_, phases_EB_, phases_EE_, sampleMax_, SFGVB_lut_, SFGVB_SpikeKillingThreshold_, SFGVB_Threshold_, funct::sin(), sli_conf_id_, sliding_, spi_conf_id_, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, tag_, TimingDelays_EB_, TimingDelays_EE_, TimingPhases_EB_, TimingPhases_EE_, Transparency_Corr_, TTF_highThreshold_EB_, TTF_highThreshold_EE_, TTF_lowThreshold_EB_, TTF_lowThreshold_EE_, useInterCalibration_, useTransparencyCorr_, useTransverseEnergy_, version_, wei_conf_id_, weight_timeShift_, weight_unbias_recovery_, writeToDB_, and writeToFiles_.

◆ ~EcalTPGParamBuilder()

EcalTPGParamBuilder::~EcalTPGParamBuilder ( )
override

Definition at line 348 of file EcalTPGParamBuilder.cc.

348  {
349  if (writeToFiles_) {
350  (*out_file_) << "EOF" << std::endl;
351  out_file_->close();
352  delete out_file_;
353  }
354 }

References out_file_, and writeToFiles_.

Member Function Documentation

◆ analyze()

void EcalTPGParamBuilder::analyze ( const edm::Event evt,
const edm::EventSetup evtSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 392 of file EcalTPGParamBuilder.cc.

392  {
393  using namespace edm;
394  using namespace std;
395 
396  // geometry
397  eTTmap_ = &evtSetup.getData(eTTmapToken_);
400 
401  // electronics mapping
403 
404  // get record for alpha
405  std::ostringstream ss;
406  ss << "EcalLaserDbAnalyzer::analyze\n";
407  const EcalLaserAlphaMap& laserAlphaMap = evtSetup.getData(ecalLaserAlphasToken_).getMap(); // map of apdpns
408  ss << "EcalLaserDbAnalyzer::analyze-> got EcalLaserDbRecord: \n";
409 
410  //modif-alex-27-july-2015-+ Jean june 2016 beg
411  // use alpha to check
413  int cnt = 0;
414  // Barrel loop
415  for (italpha = laserAlphaMap.barrelItems().begin(); italpha != laserAlphaMap.barrelItems().end(); ++italpha) {
416  if (cnt % 1000 == 0) {
417  EBDetId ebdetid = EBDetId::unhashIndex(cnt);
418  ss << " Barrel ALPHA = " << (*italpha) << " cmsswId " << ebdetid.rawId() << "\n";
419  }
420  cnt++;
421  }
422  ss << "Number of barrel Alpha parameters : " << cnt << "\n";
423  // Endcap loop
424  cnt = 0;
425  for (italpha = laserAlphaMap.endcapItems().begin(); italpha != laserAlphaMap.endcapItems().end(); ++italpha) {
426  if (cnt % 1000 == 0) {
427  EEDetId eedetid = EEDetId::unhashIndex(cnt);
428  ss << "EndCap ALPHA = " << (*italpha) << " cmsswId " << eedetid.rawId() << "\n";
429  }
430  cnt++;
431  }
432  ss << "Number of Endcap Alpha parameters : " << cnt << "\n";
433  edm::LogInfo("TopInfo") << ss.str();
434  ss.str("");
435  //modif-alex-27-july-2015 +-Jean june 2016-end
436 
437  //modif-alex-30/01/2012 displaced in analyze Jean 2018
438  ss.str("");
439  if (useTransparencyCorr_) {
440  if (Transparency_Corr_ != "tag") { // Jean 2018
441  edm::LogInfo("TopInfo") << "INFO: READING transparency correction files"
442  << "\n";
443  ss << "INFO: READING transparency correction files\n";
444  std::ifstream transparency(Transparency_Corr_.c_str());
445  if (!transparency)
446  edm::LogError("TopInfo") << "ERROR: File " << Transparency_Corr_.c_str() << " could not be opened"
447  << "\n";
448 
449  char buf[1024];
450  transparency.getline(buf, sizeof(buf), '\n');
451  int xtalcounter = 0;
452  while (transparency) {
453  std::stringstream sin(buf);
454 
455  int raw_xtal_id;
456  sin >> raw_xtal_id;
457 
458  double xtal_trans_corr;
459  sin >> xtal_trans_corr;
460 
461  // edm::LogInfo("TopInfo") << raw_xtal_id << " " << xtal_trans_corr << "\n";
462  ss << raw_xtal_id << " " << xtal_trans_corr << "\n";
463 
464  Transparency_Correction_.insert(make_pair(raw_xtal_id, xtal_trans_corr));
465 
466  xtalcounter++;
467  transparency.getline(buf, sizeof(buf), '\n');
468  } //loop transparency
469  transparency.close();
470  ss << "INFO: DONE transparency correction files " << xtalcounter << "\n";
471  edm::LogInfo("TopInfo") << ss.str();
472  ss.str("");
473  } // file
474  else { // Jean 2018
475  edm::LogInfo("TopInfo") << "INFO: READING transparency correction tag"
476  << "\n";
477  // std::cout << "new feature, read a tag" << std::endl;
478  const EcalLaserAPDPNRatios* lratio = &evtSetup.getData(ecalLaserAPDPNRatiosToken_);
479  // std::cout << " laser map size " << lratio->getLaserMap().size() << std::endl;
480 
482  // Barrel loop
483  for (int ib = 0; ib < 61200; ib++) {
484  EBDetId ebdetid = EBDetId::unhashIndex(ib);
485  itratio = lratio->getLaserMap().find(ebdetid.rawId());
486  // std::cout << ib << " " << ebdetid.rawId() << " Barrel APDPNRatios = " << (*itratio).p1 << " " << (*itratio).p2 << " " << (*itratio).p3 << std::endl;
487  Transparency_Correction_.insert(make_pair(ebdetid.rawId(), (*itratio).p2));
488  }
489  // Endcap loop
490  for (int ie = 0; ie < 14648; ie++) {
491  EEDetId eedetid = EEDetId::unhashIndex(ie);
492  itratio = lratio->getLaserMap().find(eedetid.rawId());
493  // std::cout << ie << " " << eedetid.rawId() << " Endcap APDPNRatios = " << (*itratio).p1 << " " << (*itratio).p2 << " " << (*itratio).p3 << std::endl;
494  Transparency_Correction_.insert(make_pair(eedetid.rawId(), (*itratio).p2));
495  }
496  ss << "INFO: DONE transparency correction tag\n";
497  edm::LogInfo("TopInfo") << ss.str();
498  ss.str("");
499  } // Jean 2018
500  } //if transparency
501 
502  // histo
503  TFile saving("EcalTPGParam.root", "recreate");
504  saving.cd();
505  TH2F* ICEB = new TH2F("ICEB", "IC: Barrel", 360, 1, 361, 172, -86, 86);
506  ICEB->GetYaxis()->SetTitle("eta index");
507  ICEB->GetXaxis()->SetTitle("phi index");
508  TH2F* tpgFactorEB = new TH2F("tpgFactorEB", "tpgFactor: Barrel", 360, 1, 361, 172, -86, 86);
509  tpgFactorEB->GetYaxis()->SetTitle("eta index");
510  tpgFactorEB->GetXaxis()->SetTitle("phi index");
511 
512  TH2F* ICEEPlus = new TH2F("ICEEPlus", "IC: Plus Endcap", 120, -9, 111, 120, -9, 111);
513  ICEEPlus->GetYaxis()->SetTitle("y index");
514  ICEEPlus->GetXaxis()->SetTitle("x index");
515  TH2F* tpgFactorEEPlus = new TH2F("tpgFactorEEPlus", "tpgFactor: Plus Endcap", 120, -9, 111, 120, -9, 111);
516  tpgFactorEEPlus->GetYaxis()->SetTitle("y index");
517  tpgFactorEEPlus->GetXaxis()->SetTitle("x index");
518  TH2F* ICEEMinus = new TH2F("ICEEMinus", "IC: Minus Endcap", 120, -9, 111, 120, -9, 111);
519  ICEEMinus->GetYaxis()->SetTitle("y index");
520  ICEEMinus->GetXaxis()->SetTitle("x index");
521  TH2F* tpgFactorEEMinus = new TH2F("tpgFactorEEMinus", "tpgFactor: Minus Endcap", 120, -9, 111, 120, -9, 111);
522  tpgFactorEEMinus->GetYaxis()->SetTitle("y index");
523  tpgFactorEEMinus->GetXaxis()->SetTitle("x index");
524 
525  TH2F* IC = new TH2F("IC", "IC", 720, -acos(-1.), acos(-1.), 600, -3., 3.);
526  IC->GetYaxis()->SetTitle("eta");
527  IC->GetXaxis()->SetTitle("phi");
528  TH2F* tpgFactor = new TH2F("tpgFactor", "tpgFactor", 720, -acos(-1.), acos(-1.), 600, -3., 3.);
529  tpgFactor->GetYaxis()->SetTitle("eta");
530  tpgFactor->GetXaxis()->SetTitle("phi");
531 
532  TH1F* hshapeEB = new TH1F("shapeEB", "shapeEB", 250, 0., 10.);
533  TH1F* hshapeEE = new TH1F("shapeEE", "shapeEE", 250, 0., 10.);
534 
535  TTree* ntuple = new TTree("tpgmap", "TPG geometry map");
536  const std::string branchFloat[26] = {
537  "fed", "tcc", "tower", "stripInTower", "xtalInStrip", "CCU", "VFE", "xtalInVFE", "xtalInCCU",
538  "ieta", "iphi", "ix", "iy", "iz", "hashedId", "ic", "cmsswId", "dbId",
539  "ietaTT", "iphiTT", "TCCch", "TCCslot", "SLBch", "SLBslot", "ietaGCT", "iphiGCT"};
540  ntupleInts_ = new Int_t[26];
541  for (int i = 0; i < 26; i++)
542  ntuple->Branch(branchFloat[i].c_str(), &ntupleInts_[i], (branchFloat[i] + string("/I")).c_str());
543  ntuple->Branch("det", ntupleDet_, "det/C");
544  ntuple->Branch("crate", ntupleCrate_, "crate/C");
545 
546  TNtuple* ntupleSpike = new TNtuple("spikeParam", "Spike parameters", "gainId:theta:G:g:ped:pedLin");
547 
549  // Initialization section //
551  list<uint32_t> towerListEB;
552  list<uint32_t> stripListEB;
553  list<uint32_t> towerListEE;
554  list<uint32_t> stripListEE;
555  list<uint32_t>::iterator itList;
556 
557  map<int, uint32_t> stripMapEB; // <EcalLogicId.hashed, strip elec id>
558  map<uint32_t, uint32_t> stripMapEBsintheta; // <strip elec id, sintheta>
559 
560  // Pedestals
561 
562  EcalPedestalsMap pedMap;
563 
564  if (m_write_ped == 1) {
565  ss << "Getting the pedestals from offline DB...\n";
566 
567  pedMap = evtSetup.getData(ecalPedestalsToken_).getMap();
568 
569  const auto& pedMapEB = pedMap.barrelItems();
570  const auto& pedMapEE = pedMap.endcapItems();
571  EcalPedestalsMapIterator pedIter;
572  int nPed = 0;
573  for (pedIter = pedMapEB.begin(); pedIter != pedMapEB.end() && nPed < 10; ++pedIter, ++nPed) {
574  const auto aped = (*pedIter);
575  ss << aped.mean_x12 << ", " << aped.mean_x6 << ", " << aped.mean_x1 << "\n";
576  }
577  for (pedIter = pedMapEE.begin(); pedIter != pedMapEE.end() && nPed < 10; ++pedIter, ++nPed) {
578  const auto aped = (*pedIter);
579  ss << aped.mean_x12 << ", " << aped.mean_x6 << ", " << aped.mean_x1 << "\n";
580  }
581  } else if (m_write_ped == 0) {
582  ss << "Getting the pedestals from previous configuration\n";
583 
584  EcalPedestals peds;
585 
586  FEConfigMainInfo fe_main_info;
587  fe_main_info.setConfigTag(tag_);
588  ss << "trying to read previous tag if it exists tag=" << tag_ << ".version" << version_ << "\n";
589  db_->fetchConfigSet(&fe_main_info);
590  if (fe_main_info.getPedId() > 0)
591  ped_conf_id_ = fe_main_info.getPedId();
592 
593  FEConfigPedInfo fe_ped_info;
594  fe_ped_info.setId(ped_conf_id_);
595  db_->fetchConfigSet(&fe_ped_info);
596  std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
597  db_->fetchDataSet(&dataset_TpgPed, &fe_ped_info);
598 
599  typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
600  EcalLogicID ecid_xt;
601  FEConfigPedDat rd_ped;
602  int icells = 0;
603  for (CIfeped p = dataset_TpgPed.begin(); p != dataset_TpgPed.end(); p++) {
604  ecid_xt = p->first;
605  rd_ped = p->second;
606 
607  std::string ecid_name = ecid_xt.getName();
608 
609  // EB data
610  if (ecid_name == "EB_crystal_number") {
611  int sm_num = ecid_xt.getID1();
612  int xt_num = ecid_xt.getID2();
613 
614  EBDetId ebdetid(sm_num, xt_num, EBDetId::SMCRYSTALMODE);
616  item.mean_x1 = rd_ped.getPedMeanG1();
617  item.mean_x6 = rd_ped.getPedMeanG6();
618  item.mean_x12 = rd_ped.getPedMeanG12();
619  item.rms_x1 = 0.5;
620  item.rms_x6 = 1.;
621  item.rms_x12 = 1.2;
622 
623  if (icells < 10)
624  ss << " copy the EB data "
625  << " ped = " << item.mean_x12 << "\n";
626 
627  peds.insert(std::make_pair(ebdetid.rawId(), item));
628 
629  ++icells;
630  } else if (ecid_name == "EE_crystal_number") {
631  // EE data
632  int z = ecid_xt.getID1();
633  int x = ecid_xt.getID2();
634  int y = ecid_xt.getID3();
635  EEDetId eedetid(x, y, z, EEDetId::XYMODE);
637  item.mean_x1 = rd_ped.getPedMeanG1();
638  item.mean_x6 = rd_ped.getPedMeanG6();
639  item.mean_x12 = rd_ped.getPedMeanG12();
640  item.rms_x1 = 0.5;
641  item.rms_x6 = 1.;
642  item.rms_x12 = 1.2;
643 
644  peds.insert(std::make_pair(eedetid.rawId(), item));
645  ++icells;
646  }
647  }
648 
649  pedMap = peds.getMap();
650 
651  const auto& pedMapEB = pedMap.barrelItems();
652  const auto& pedMapEE = pedMap.endcapItems();
653  EcalPedestalsMapIterator pedIter;
654  int nPed = 0;
655  for (pedIter = pedMapEB.begin(); pedIter != pedMapEB.end() && nPed < 10; ++pedIter, ++nPed) {
656  const auto aped = (*pedIter);
657  ss << aped.mean_x12 << ", " << aped.mean_x6 << ", " << aped.mean_x1 << "\n";
658  }
659  for (pedIter = pedMapEE.begin(); pedIter != pedMapEE.end() && nPed < 10; ++pedIter, ++nPed) {
660  const auto aped = (*pedIter);
661  ss << aped.mean_x12 << ", " << aped.mean_x6 << ", " << aped.mean_x1 << "\n";
662  }
663 
664  } else if (m_write_ped > 1) {
665  ss << "Getting the pedestals from configuration number" << m_write_ped << "\n";
666 
667  EcalPedestals peds;
668 
669  FEConfigPedInfo fe_ped_info;
670  fe_ped_info.setId(m_write_ped);
671  db_->fetchConfigSet(&fe_ped_info);
672  std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
673  db_->fetchDataSet(&dataset_TpgPed, &fe_ped_info);
674 
675  typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
676  EcalLogicID ecid_xt;
677  FEConfigPedDat rd_ped;
678  int icells = 0;
679  for (CIfeped p = dataset_TpgPed.begin(); p != dataset_TpgPed.end(); p++) {
680  ecid_xt = p->first;
681  rd_ped = p->second;
682 
683  std::string ecid_name = ecid_xt.getName();
684 
685  // EB data
686  if (ecid_name == "EB_crystal_number") {
687  if (icells < 10)
688  edm::LogInfo("TopInfo") << " copy the EB data "
689  << " icells = " << icells << "\n";
690  int sm_num = ecid_xt.getID1();
691  int xt_num = ecid_xt.getID2();
692 
693  EBDetId ebdetid(sm_num, xt_num, EBDetId::SMCRYSTALMODE);
695  item.mean_x1 = (unsigned int)rd_ped.getPedMeanG1();
696  item.mean_x6 = (unsigned int)rd_ped.getPedMeanG6();
697  item.mean_x12 = (unsigned int)rd_ped.getPedMeanG12();
698  item.rms_x1 = 0.5;
699  item.rms_x6 = 1.;
700  item.rms_x12 = 1.2;
701 
702  peds.insert(std::make_pair(ebdetid.rawId(), item));
703  ++icells;
704  } else if (ecid_name == "EE_crystal_number") {
705  // EE data
706  int z = ecid_xt.getID1();
707  int x = ecid_xt.getID2();
708  int y = ecid_xt.getID3();
709  EEDetId eedetid(x, y, z, EEDetId::XYMODE);
711  item.mean_x1 = (unsigned int)rd_ped.getPedMeanG1();
712  item.mean_x6 = (unsigned int)rd_ped.getPedMeanG6();
713  item.mean_x12 = (unsigned int)rd_ped.getPedMeanG12();
714  item.rms_x1 = 0.5;
715  item.rms_x6 = 1.;
716  item.rms_x12 = 1.2;
717 
718  peds.insert(std::make_pair(eedetid.rawId(), item));
719  ++icells;
720  }
721  }
722 
723  pedMap = peds.getMap();
724 
725  const auto& pedMapEB = pedMap.barrelItems();
726  const auto& pedMapEE = pedMap.endcapItems();
727  EcalPedestalsMapIterator pedIter;
728  int nPed = 0;
729  for (pedIter = pedMapEB.begin(); pedIter != pedMapEB.end() && nPed < 10; ++pedIter, ++nPed) {
730  const auto aped = (*pedIter);
731  ss << aped.mean_x12 << ", " << aped.mean_x6 << ", " << aped.mean_x1 << "\n";
732  }
733  for (pedIter = pedMapEE.begin(); pedIter != pedMapEE.end() && nPed < 10; ++pedIter, ++nPed) {
734  const auto aped = (*pedIter);
735  ss << aped.mean_x12 << ", " << aped.mean_x6 << ", " << aped.mean_x1 << "\n";
736  }
737  }
738 
739  edm::LogInfo("TopInfo") << ss.str();
740  ss.str("");
741 
742  // Intercalib constants
743  ss << "Getting intercalib from offline DB...\n";
744  const EcalIntercalibConstants* intercalib = &evtSetup.getData(ecalIntercalibConstantsToken_);
745  const EcalIntercalibConstantMap& calibMap = intercalib->getMap();
746  const auto& calibMapEB = calibMap.barrelItems();
747  const auto& calibMapEE = calibMap.endcapItems();
749  int nCal = 0;
750  for (calIter = calibMapEB.begin(); calIter != calibMapEB.end() && nCal < 10; ++calIter, ++nCal) {
751  ss << (*calIter) << "\n";
752  }
753  for (calIter = calibMapEE.begin(); calIter != calibMapEE.end() && nCal < 10; ++calIter, ++nCal) {
754  ss << (*calIter) << "\n";
755  }
756  edm::LogInfo("TopInfo") << ss.str();
757  ss.str("");
758  float calibvec[1700];
759  if (H2_) {
760  edm::LogInfo("TopInfo") << "H2: overwriting IC coef with file"
761  << "\n";
762  std::ifstream calibfile("calib_sm36.txt", std::ios::out);
763  int idata, icry;
764  float fdata, fcali;
765  std::string strdata;
766  if (calibfile.is_open()) {
767  calibfile >> strdata >> strdata >> strdata >> strdata >> strdata;
768  while (!calibfile.eof()) {
769  calibfile >> idata >> icry >> fcali >> fdata >> fdata;
770  calibvec[icry - 1] = fcali;
771  if (calibfile.eof()) {
772  break; // avoid last line duplication
773  }
774  }
775  }
776  }
777 
778  // Gain Ratios
779  ss << "Getting the gain ratios from offline DB...\n";
780  const EcalGainRatioMap& gainMap = evtSetup.getData(ecalGainRatiosToken_).getMap();
781  const auto& gainMapEB = gainMap.barrelItems();
782  const auto& gainMapEE = gainMap.endcapItems();
784  int nGain = 0;
785  for (gainIter = gainMapEB.begin(); gainIter != gainMapEB.end() && nGain < 10; ++gainIter, ++nGain) {
786  const auto aGain = (*gainIter);
787  ss << aGain.gain12Over6() << ", " << aGain.gain6Over1() * aGain.gain12Over6() << "\n";
788  }
789  for (gainIter = gainMapEE.begin(); gainIter != gainMapEE.end() && nGain < 10; ++gainIter, ++nGain) {
790  const auto aGain = (*gainIter);
791  ss << aGain.gain12Over6() << ", " << aGain.gain6Over1() * aGain.gain12Over6() << "\n";
792  }
793  edm::LogInfo("TopInfo") << ss.str();
794  ss.str("");
795 
796  // ADCtoGeV
797  ss << "Getting the ADC to GeV from offline DB...\n";
798  const EcalADCToGeVConstant* ADCToGeV = &evtSetup.getData(ecalADCToGeVConstantToken_);
799  xtal_LSB_EB_ = ADCToGeV->getEBValue();
800  xtal_LSB_EE_ = ADCToGeV->getEEValue();
801  ss << "xtal_LSB_EB_ = " << xtal_LSB_EB_ << "\n";
802  ss << "xtal_LSB_EE_ = " << xtal_LSB_EE_ << "\n";
803 
804  vector<EcalLogicID> my_EcalLogicId;
805  vector<EcalLogicID> my_TTEcalLogicId;
806  vector<EcalLogicID> my_StripEcalLogicId;
807  EcalLogicID my_EcalLogicId_EB;
808  // Endcap identifiers
809  EcalLogicID my_EcalLogicId_EE;
810  vector<EcalLogicID> my_TTEcalLogicId_EE;
811  vector<EcalLogicID> my_RTEcalLogicId_EE;
812  vector<EcalLogicID> my_StripEcalLogicId1_EE;
813  vector<EcalLogicID> my_StripEcalLogicId2_EE;
814  vector<EcalLogicID> my_CrystalEcalLogicId_EE;
815  vector<EcalLogicID> my_TTEcalLogicId_EB_by_TCC;
816  vector<EcalLogicID> my_StripEcalLogicId_EE_strips_by_TCC;
817 
820  my_EcalLogicId = db_->getEcalLogicIDSetOrdered(
821  "EB_crystal_number", 1, 36, 1, 1700, EcalLogicID::NULLID, EcalLogicID::NULLID, "EB_crystal_number", 12);
822  my_TTEcalLogicId = db_->getEcalLogicIDSetOrdered(
823  "EB_trigger_tower", 1, 36, 1, 68, EcalLogicID::NULLID, EcalLogicID::NULLID, "EB_trigger_tower", 12);
824  my_StripEcalLogicId = db_->getEcalLogicIDSetOrdered(
825  "EB_VFE", 1, 36, 1, 68, 1, 5, "EB_VFE", 123); //last digi means ordered 1st by SM,then TT, then strip
826  ss << "got the 3 ecal barrel logic id set\n";
827 
828  // EE crystals identifiers
829  my_CrystalEcalLogicId_EE =
830  db_->getEcalLogicIDSetOrdered("EE_crystal_number", -1, 1, 0, 200, 0, 200, "EE_crystal_number", 123);
831 
832  // EE Strip identifiers
833  // DCC=601-609 TT = ~40 EEstrip = 5
834  my_StripEcalLogicId1_EE =
835  db_->getEcalLogicIDSetOrdered("ECAL_readout_strip", 601, 609, 1, 100, 0, 5, "ECAL_readout_strip", 123);
836  // EE Strip identifiers
837  // DCC=646-654 TT = ~40 EEstrip = 5
838  my_StripEcalLogicId2_EE =
839  db_->getEcalLogicIDSetOrdered("ECAL_readout_strip", 646, 654, 1, 100, 0, 5, "ECAL_readout_strip", 123);
840  // ----> modif here 31/1/2011
841  // EE Strip identifiers by TCC tower strip
842  // TCC=1-108 TT = ~40 EEstrip = 1-5
843  my_StripEcalLogicId_EE_strips_by_TCC =
844  db_->getEcalLogicIDSetOrdered("EE_trigger_strip", 1, 108, 1, 100, 1, 5, "EE_trigger_strip", 123);
845 
846  // ----> modif here 31/1/2011
847  // ECAL Barrel trigger towers by TCC/tower identifiers
848  // TTC=38-72 TT = 1-68
849  my_TTEcalLogicId_EB_by_TCC = db_->getEcalLogicIDSetOrdered(
850  "ECAL_trigger_tower", 1, 108, 1, 68, EcalLogicID::NULLID, EcalLogicID::NULLID, "ECAL_trigger_tower", 12);
851 
852  // EE TT identifiers
853  // TTC=72 TT = 1440
854  my_TTEcalLogicId_EE = db_->getEcalLogicIDSetOrdered(
855  "EE_trigger_tower", 1, 108, 1, 40, EcalLogicID::NULLID, EcalLogicID::NULLID, "EE_trigger_tower", 12);
856 
857  // EE TT identifiers
858  // TTC=72 TT = 1440
859  my_RTEcalLogicId_EE = db_->getEcalLogicIDSetOrdered(
860  "EE_readout_tower", 1, 1000, 1, 100, EcalLogicID::NULLID, EcalLogicID::NULLID, "EE_readout_tower", 12);
861  edm::LogInfo("TopInfo") << ss.str();
862  ss.str("");
863 
864  if (writeToDB_) {
865  ss << "Getting the latest ids for this tag (latest version) "
866  << "\n";
867 
868  FEConfigMainInfo fe_main_info;
869  fe_main_info.setConfigTag(tag_);
870 
871  ss << "trying to read previous tag if it exists tag=" << tag_ << ".version" << version_ << "\n";
872 
873  db_->fetchConfigSet(&fe_main_info);
874  if (fe_main_info.getPedId() > 0 && ped_conf_id_ == 0)
875  ped_conf_id_ = fe_main_info.getPedId();
876  lin_conf_id_ = fe_main_info.getLinId();
877  lut_conf_id_ = fe_main_info.getLUTId();
878  wei_conf_id_ = fe_main_info.getWeiId();
879  fgr_conf_id_ = fe_main_info.getFgrId();
880  sli_conf_id_ = fe_main_info.getSliId();
881  spi_conf_id_ = fe_main_info.getSpiId(); //modif-alex 21/01/11
882  del_conf_id_ = fe_main_info.getTimId(); //modif-alex 21/01/11
883  if (fe_main_info.getBxtId() > 0 && bxt_conf_id_ == 0)
884  bxt_conf_id_ = fe_main_info.getBxtId();
885  if (fe_main_info.getBttId() > 0 && btt_conf_id_ == 0)
886  btt_conf_id_ = fe_main_info.getBttId();
887  if (fe_main_info.getBstId() > 0 && bst_conf_id_ == 0)
888  bst_conf_id_ = fe_main_info.getBstId();
889  // those that are not written specifically in this program are propagated
890  // from the previous record with the same tag and the highest version
891  }
892 
894  // Compute linearization coeff section //
896 
897  map<EcalLogicID, FEConfigPedDat> pedset;
898  map<EcalLogicID, FEConfigLinDat> linset;
899  map<EcalLogicID, FEConfigLinParamDat> linparamset;
900  map<EcalLogicID, FEConfigLUTParamDat> lutparamset;
901  map<EcalLogicID, FEConfigFgrParamDat> fgrparamset;
902 
903  map<int, linStruc> linEtaSlice;
904  map<vector<int>, linStruc> linMap;
905 
906  // count number of strip per tower
907  int NbOfStripPerTCC[108][68];
908  for (int i = 0; i < 108; i++)
909  for (int j = 0; j < 68; j++)
910  NbOfStripPerTCC[i][j] = 0;
911  const std::vector<DetId>& ebCells = theBarrelGeometry_->getValidDetIds(DetId::Ecal, EcalBarrel);
912  const std::vector<DetId>& eeCells = theEndcapGeometry_->getValidDetIds(DetId::Ecal, EcalEndcap);
913  for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
914  EBDetId id(*it);
915  const EcalTrigTowerDetId towid = id.tower();
917  int tccNb = theMapping_->TCCid(towid);
918  int towerInTCC = theMapping_->iTT(towid);
919  int stripInTower = elId.pseudoStripId();
920  if (stripInTower > NbOfStripPerTCC[tccNb - 1][towerInTCC - 1])
921  NbOfStripPerTCC[tccNb - 1][towerInTCC - 1] = stripInTower;
922  }
923  for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
924  EEDetId id(*it);
925  const EcalTrigTowerDetId towid = (*eTTmap_).towerOf(id);
927  int tccNb = theMapping_->TCCid(towid);
928  int towerInTCC = theMapping_->iTT(towid);
929  int stripInTower = elId.pseudoStripId();
930  if (stripInTower > NbOfStripPerTCC[tccNb - 1][towerInTCC - 1])
931  NbOfStripPerTCC[tccNb - 1][towerInTCC - 1] = stripInTower;
932  }
933 
934  // loop on EB xtals
935  if (writeToFiles_)
936  (*out_file_) << "COMMENT ====== barrel crystals ====== " << std::endl;
937 
938  // special case of eta slices
939  for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
940  EBDetId id(*it);
941  double theta = theBarrelGeometry_->getGeometry(id)->getPosition().theta();
943  theta = acos(0.);
944  const EcalTrigTowerDetId towid = id.tower();
946  int dccNb = theMapping_->DCCid(towid);
947  int tccNb = theMapping_->TCCid(towid);
948  int towerInTCC = theMapping_->iTT(towid); // from 1 to 68 (EB)
949  int stripInTower = elId.pseudoStripId(); // from 1 to 5
950  int xtalInStrip = elId.channelId(); // from 1 to 5
952  int CCUid = Id.towerId();
953  int VFEid = Id.stripId();
954  int xtalInVFE = Id.xtalId();
955  int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1; // Evgueni expects [0,24]
956 
957  (*geomFile_) << "dccNb = " << dccNb << " tccNb = " << tccNb << " towerInTCC = " << towerInTCC
958  << " stripInTower = " << stripInTower << " xtalInStrip = " << xtalInStrip << " CCUid = " << CCUid
959  << " VFEid = " << VFEid << " xtalInVFE = " << xtalInVFE << " xtalWithinCCUid = " << xtalWithinCCUid
960  << " ieta = " << id.ieta() << " iphi = " << id.iphi() << " xtalhashedId = " << id.hashedIndex()
961  << " xtalNb = " << id.ic() << " ietaTT = " << towid.ieta() << " iphiTT = " << towid.iphi() << endl;
962 
963  int TCCch = towerInTCC;
964  int SLBslot = int((towerInTCC - 1) / 8.) + 1;
965  int SLBch = (towerInTCC - 1) % 8 + 1;
966  int cmsswId = id.rawId();
967  int ixtal = (id.ism() - 1) * 1700 + (id.ic() - 1);
968  EcalLogicID logicId = my_EcalLogicId[ixtal];
969  int dbId = logicId.getLogicID();
970  int val[] = {dccNb + 600,
971  tccNb,
972  towerInTCC,
973  stripInTower,
974  xtalInStrip,
975  CCUid,
976  VFEid,
977  xtalInVFE,
978  xtalWithinCCUid,
979  id.ieta(),
980  id.iphi(),
981  -999,
982  -999,
983  towid.ieta() / abs(towid.ieta()),
984  id.hashedIndex(),
985  id.ic(),
986  cmsswId,
987  dbId,
988  towid.ieta(),
989  towid.iphi(),
990  TCCch,
991  getCrate(tccNb).second,
992  SLBch,
993  SLBslot,
994  getGCTRegionEta(towid.ieta()),
995  getGCTRegionPhi(towid.iphi())};
996  for (int i = 0; i < 26; i++)
997  ntupleInts_[i] = val[i];
998 
999  strcpy(ntupleDet_, getDet(tccNb).c_str());
1000  strcpy(ntupleCrate_, getCrate(tccNb).first.c_str());
1001  ntuple->Fill();
1002 
1003  if (tccNb == 37 && stripInTower == 3 && xtalInStrip == 3 && (towerInTCC - 1) % 4 == 0) {
1004  int etaSlice = towid.ietaAbs();
1005  coeffStruc coeff;
1006  //getCoeff(coeff, calibMap, id.rawId()) ;
1007  //modif-alex-27-july-2015
1008  string str;
1009  getCoeff(coeff, calibMap, laserAlphaMap, id.rawId(), str);
1010  ss << str;
1011  getCoeff(coeff, gainMap, id.rawId());
1012  getCoeff(coeff, pedMap, id.rawId());
1013  linStruc lin;
1014  for (int i = 0; i < 3; i++) {
1015  int mult, shift;
1016  bool ok = computeLinearizerParam(theta, coeff.gainRatio_[i], coeff.calibCoeff_, "EB", mult, shift);
1017  if (!ok)
1018  edm::LogError("TopInfo") << "unable to compute the parameters for SM=" << id.ism() << " xt=" << id.ic() << " "
1019  << dec << id.rawId() << "\n";
1020  else {
1021  lin.pedestal_[i] = coeff.pedestals_[i];
1022  lin.mult_[i] = mult;
1023  lin.shift_[i] = shift;
1024  }
1025  }
1026 
1027  bool ok(true);
1028  if (forcedPedestalValue_ == -2)
1029  ok = realignBaseline(lin, 0);
1030  if (!ok)
1031  ss << "SM=" << id.ism() << " xt=" << id.ic() << " " << dec << id.rawId() << "\n";
1032  linEtaSlice[etaSlice] = lin;
1033  }
1034  }
1035 
1036  // general case
1037  for (vector<DetId>::const_iterator it = ebCells.begin(); it != ebCells.end(); ++it) {
1038  EBDetId id(*it);
1039  double theta = theBarrelGeometry_->getGeometry(id)->getPosition().theta();
1040  if (!useTransverseEnergy_)
1041  theta = acos(0.);
1042  const EcalTrigTowerDetId towid = id.tower();
1043  towerListEB.push_back(towid.rawId());
1045  stripListEB.push_back(elId.rawId() & 0xfffffff8);
1046  int dccNb = theMapping_->DCCid(towid);
1047  //int tccNb = theMapping_->TCCid(towid) ;
1048  int towerInTCC = theMapping_->iTT(towid); // from 1 to 68 (EB)
1049  //int stripInTower = elId.pseudoStripId() ; // from 1 to 5
1050  //int xtalInStrip = elId.channelId() ; // from 1 to 5
1052  int CCUid = Id.towerId();
1053  int VFEid = Id.stripId();
1054  int xtalInVFE = Id.xtalId();
1055  int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1; // Evgueni expects [0,24]
1056  int etaSlice = towid.ietaAbs();
1057 
1058  // hashed index of strip EcalLogicID:
1059  int hashedStripLogicID = 68 * 5 * (id.ism() - 1) + 5 * (towerInTCC - 1) + (VFEid - 1);
1060  stripMapEB[hashedStripLogicID] = elId.rawId() & 0xfffffff8;
1061  stripMapEBsintheta[elId.rawId() & 0xfffffff8] = SFGVB_Threshold_ + abs(int(sin(theta) * pedestal_offset_));
1062 
1063  //modif-debug
1064  /*
1065  FEConfigFgrEEStripDat stripdebug;
1066  EcalLogicID thestrip_debug = my_StripEcalLogicId[hashedStripLogicID] ;
1067  if(towid.ieta() == 6 && towid.iphi() == 7){
1068  std::cout << "xtal info=" << id << " VFE=" << VFEid << std::endl;
1069  std::cout << "TOWER DEBUG ieta=" << towid.ieta() << " iphi=" << towid.iphi() << " SFGVB=" << SFGVB_Threshold_ + abs(int(sin(theta)*pedestal_offset_))
1070  << " dbId=" << (elId.rawId() & 0xfffffff8) << " " << hashedStripLogicID << " " << thestrip_debug.getLogicID() << std::endl; //modif-debug
1071  }//EB+3 TT24
1072  */
1073  //std::cout<<std::dec<<SFGVB_Threshold_ + abs(int(sin(theta)*pedestal_offset_))<<" "<<SFGVB_Threshold_<<" "<<abs(int(sin(theta)*pedestal_offset_))<<std::endl ;
1074 
1075  FEConfigPedDat pedDB;
1076  FEConfigLinDat linDB;
1077  if (writeToFiles_)
1078  (*out_file_) << "CRYSTAL " << dec << id.rawId() << std::endl;
1079  // if (writeToDB_) logicId = db_->getEcalLogicID ("EB_crystal_number", id.ism(), id.ic()) ;
1080 
1081  coeffStruc coeff;
1082  //getCoeff(coeff, calibMap, id.rawId()) ;
1083  //modif-alex-27-july-2015
1084  std::string str;
1085  getCoeff(coeff, calibMap, laserAlphaMap, id.rawId(), str);
1086  ss << str;
1087 
1088  if (H2_)
1089  coeff.calibCoeff_ = calibvec[id.ic() - 1];
1090  getCoeff(coeff, gainMap, id.rawId());
1091  getCoeff(coeff, pedMap, id.rawId());
1092  ICEB->Fill(id.iphi(), id.ieta(), coeff.calibCoeff_);
1093  IC->Fill(theBarrelGeometry_->getGeometry(id)->getPosition().phi(),
1094  theBarrelGeometry_->getGeometry(id)->getPosition().eta(),
1095  coeff.calibCoeff_);
1096 
1097  vector<int> xtalCCU;
1098  xtalCCU.push_back(dccNb + 600);
1099  xtalCCU.push_back(CCUid);
1100  xtalCCU.push_back(xtalWithinCCUid);
1101  xtalCCU.push_back(id.rawId());
1102 
1103  // compute and fill linearization parameters
1104  // case of eta slice
1105  if (forceEtaSlice_) {
1106  map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1107  if (itLin != linEtaSlice.end()) {
1108  linMap[xtalCCU] = itLin->second;
1109  if (writeToFiles_) {
1110  for (int i = 0; i < 3; i++)
1111  (*out_file_) << hex << " 0x" << itLin->second.pedestal_[i] << " 0x" << itLin->second.mult_[i] << " 0x"
1112  << itLin->second.shift_[i] << std::endl;
1113  }
1114  if (writeToDB_) {
1115  for (int i = 0; i < 3; i++) {
1116  if (i == 0) {
1117  pedDB.setPedMeanG12(itLin->second.pedestal_[i]);
1118  linDB.setMultX12(itLin->second.mult_[i]);
1119  linDB.setShift12(itLin->second.shift_[i]);
1120  } else if (i == 1) {
1121  pedDB.setPedMeanG6(itLin->second.pedestal_[i]);
1122  linDB.setMultX6(itLin->second.mult_[i]);
1123  linDB.setShift6(itLin->second.shift_[i]);
1124  } else if (i == 2) {
1125  pedDB.setPedMeanG1(itLin->second.pedestal_[i]);
1126  linDB.setMultX1(itLin->second.mult_[i]);
1127  linDB.setShift1(itLin->second.shift_[i]);
1128  }
1129  }
1130  }
1131  float factor = float(itLin->second.mult_[0]) * pow(2., -itLin->second.shift_[0]) / xtal_LSB_EB_;
1132  tpgFactorEB->Fill(id.iphi(), id.ieta(), factor);
1133  tpgFactor->Fill(theBarrelGeometry_->getGeometry(id)->getPosition().phi(),
1134  theBarrelGeometry_->getGeometry(id)->getPosition().eta(),
1135  factor);
1136  } else
1137  ss << "current EtaSlice = " << etaSlice << " not found in the EtaSlice map"
1138  << "\n";
1139  } else {
1140  // general case
1141  linStruc lin;
1142  int forceBase12 = 0;
1143  double invSinTheta = 1. / sin(theta);
1144  for (int i = 0; i < 3; i++) {
1145  int mult, shift;
1146  bool ok = computeLinearizerParam(theta, coeff.gainRatio_[i], coeff.calibCoeff_, "EB", mult, shift);
1147  if (!ok)
1148  edm::LogError("TopInfo") << "unable to compute the parameters for SM=" << id.ism() << " xt=" << id.ic() << " "
1149  << dec << id.rawId() << "\n";
1150  else {
1151  //PP begin
1152  // mult = 0 ; shift = 0 ;
1153  // if (CCUid==1 && xtalWithinCCUid==21) {
1154  // if (i==0) {mult = 0x80 ; shift = 0x3 ;}
1155  // if (i==1) {mult = 0x80 ; shift = 0x2 ;}
1156  // if (i==2) {mult = 0xc0 ; shift = 0x0 ;}
1157  // }
1158  //PP end
1159  if (forcedPedestalValue_ == -3 && i == 0) {
1160  double G = mult * pow(2.0, -(shift + 2));
1161  double g = G * invSinTheta;
1162  double base = double(coeff.pedestals_[i]) - pedestal_offset_ / g;
1163  if (base < 0.)
1164  base = 0;
1165  forceBase12 = int(base);
1166  }
1167  lin.pedestal_[i] = coeff.pedestals_[i];
1168  lin.mult_[i] = mult;
1169  lin.shift_[i] = shift;
1170 
1171  // if (xtalWithinCCUid != 14) {
1172  // forceBase12 = 0 ;
1173  // lin.pedestal_[i] = 0 ;
1174  // lin.mult_[i] = 0 ;
1175  // lin.shift_[i] = 0 ;
1176  // }
1177  }
1178  }
1179 
1180  bool ok(true);
1181  if (forcedPedestalValue_ == -2)
1182  ok = realignBaseline(lin, 0);
1183  else if (forcedPedestalValue_ == -3)
1184  ok = realignBaseline(lin, forceBase12);
1185  if (!ok)
1186  ss << "SM=" << id.ism() << " xt=" << id.ic() << " " << dec << id.rawId() << "\n";
1187 
1188  for (int i = 0; i < 3; i++) {
1189  if (writeToFiles_)
1190  (*out_file_) << hex << " 0x" << lin.pedestal_[i] << " 0x" << lin.mult_[i] << " 0x" << lin.shift_[i]
1191  << std::endl;
1192  if (writeToDB_) {
1193  if (i == 0) {
1194  pedDB.setPedMeanG12(lin.pedestal_[i]);
1195  linDB.setMultX12(lin.mult_[i]);
1196  linDB.setShift12(lin.shift_[i]);
1197  } else if (i == 1) {
1198  pedDB.setPedMeanG6(lin.pedestal_[i]);
1199  linDB.setMultX6(lin.mult_[i]);
1200  linDB.setShift6(lin.shift_[i]);
1201  } else if (i == 2) {
1202  pedDB.setPedMeanG1(lin.pedestal_[i]);
1203  linDB.setMultX1(lin.mult_[i]);
1204  linDB.setShift1(lin.shift_[i]);
1205  }
1206  }
1207  if (i == 0) {
1208  float factor = float(lin.mult_[i]) * pow(2., -lin.shift_[i]) / xtal_LSB_EB_;
1209  tpgFactorEB->Fill(id.iphi(), id.ieta(), factor);
1210  tpgFactor->Fill(theBarrelGeometry_->getGeometry(id)->getPosition().phi(),
1211  theBarrelGeometry_->getGeometry(id)->getPosition().eta(),
1212  factor);
1213  }
1214  double G = lin.mult_[i] * pow(2.0, -(lin.shift_[i] + 2));
1215  double g = G * invSinTheta;
1216  float val[] = {float(i),
1217  float(theta),
1218  float(G),
1219  float(g),
1220  float(coeff.pedestals_[i]),
1221  float(lin.pedestal_[i])}; // first arg = gainId (0 means gain12)
1222  ntupleSpike->Fill(val);
1223  }
1224  linMap[xtalCCU] = lin;
1225  }
1226  if (writeToDB_) {
1227  // 1700 crystals/SM in the ECAL barrel
1228  int ixtal = (id.ism() - 1) * 1700 + (id.ic() - 1);
1229  EcalLogicID logicId = my_EcalLogicId[ixtal];
1230  pedset[logicId] = pedDB;
1231  linset[logicId] = linDB;
1232  }
1233  } //ebCells
1234 
1235  if (writeToDB_) {
1236  // EcalLogicID of the whole barrel is: my_EcalLogicId_EB
1237  FEConfigLinParamDat linparam;
1238  linparam.setETSat(Et_sat_EB_);
1239  linparamset[my_EcalLogicId_EB] = linparam;
1240 
1241  FEConfigFgrParamDat fgrparam;
1244  fgrparam.setFGlowratio(FG_lowRatio_EB_);
1245  fgrparam.setFGhighratio(FG_highRatio_EB_);
1246  fgrparamset[my_EcalLogicId_EB] = fgrparam;
1247 
1248  FEConfigLUTParamDat lutparam;
1249  lutparam.setETSat(Et_sat_EB_);
1252  lutparamset[my_EcalLogicId_EB] = lutparam;
1253  }
1254 
1255  // loop on EE xtals
1256  if (writeToFiles_)
1257  (*out_file_) << "COMMENT ====== endcap crystals ====== " << std::endl;
1258 
1259  // special case of eta slices
1260  for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1261  EEDetId id(*it);
1262  double theta = theEndcapGeometry_->getGeometry(id)->getPosition().theta();
1263  if (!useTransverseEnergy_)
1264  theta = acos(0.);
1265  const EcalTrigTowerDetId towid = (*eTTmap_).towerOf(id);
1268  int dccNb = Id.dccId();
1269  int tccNb = theMapping_->TCCid(towid);
1270  int towerInTCC = theMapping_->iTT(towid);
1271  int stripInTower = elId.pseudoStripId();
1272  int xtalInStrip = elId.channelId();
1273  int CCUid = Id.towerId();
1274  int VFEid = Id.stripId();
1275  int xtalInVFE = Id.xtalId();
1276  int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1; // Evgueni expects [0,24]
1277 
1278  (*geomFile_) << "dccNb = " << dccNb << " tccNb = " << tccNb << " towerInTCC = " << towerInTCC
1279  << " stripInTower = " << stripInTower << " xtalInStrip = " << xtalInStrip << " CCUid = " << CCUid
1280  << " VFEid = " << VFEid << " xtalInVFE = " << xtalInVFE << " xtalWithinCCUid = " << xtalWithinCCUid
1281  << " ix = " << id.ix() << " iy = " << id.iy() << " xtalhashedId = " << id.hashedIndex()
1282  << " xtalNb = " << id.isc() << " ietaTT = " << towid.ieta() << " iphiTT = " << towid.iphi() << endl;
1283 
1284  int TCCch = stripInTower;
1285  int SLBslot, SLBch;
1286  if (towerInTCC < 5) {
1287  SLBslot = 1;
1288  SLBch = 4 + towerInTCC;
1289  } else {
1290  SLBslot = int((towerInTCC - 5) / 8.) + 2;
1291  SLBch = (towerInTCC - 5) % 8 + 1;
1292  }
1293  for (int j = 0; j < towerInTCC - 1; j++)
1294  TCCch += NbOfStripPerTCC[tccNb - 1][j];
1295 
1296  int cmsswId = id.rawId();
1297  EcalLogicID logicId;
1298  int iz = id.positiveZ();
1299  if (iz == 0)
1300  iz = -1;
1301  for (int k = 0; k < (int)my_CrystalEcalLogicId_EE.size(); k++) {
1302  int z = my_CrystalEcalLogicId_EE[k].getID1();
1303  int x = my_CrystalEcalLogicId_EE[k].getID2();
1304  int y = my_CrystalEcalLogicId_EE[k].getID3();
1305  if (id.ix() == x && id.iy() == y && iz == z)
1306  logicId = my_CrystalEcalLogicId_EE[k];
1307  }
1308  int dbId = logicId.getLogicID();
1309 
1310  int val[] = {dccNb + 600,
1311  tccNb,
1312  towerInTCC,
1313  stripInTower,
1314  xtalInStrip,
1315  CCUid,
1316  VFEid,
1317  xtalInVFE,
1318  xtalWithinCCUid,
1319  -999,
1320  -999,
1321  id.ix(),
1322  id.iy(),
1323  towid.ieta() / abs(towid.ieta()),
1324  id.hashedIndex(),
1325  id.ic(),
1326  cmsswId,
1327  dbId,
1328  towid.ieta(),
1329  towid.iphi(),
1330  TCCch,
1331  getCrate(tccNb).second,
1332  SLBch,
1333  SLBslot,
1334  getGCTRegionEta(towid.ieta()),
1335  getGCTRegionPhi(towid.iphi())};
1336  for (int i = 0; i < 26; i++)
1337  ntupleInts_[i] = val[i];
1338  strcpy(ntupleDet_, getDet(tccNb).c_str());
1339  strcpy(ntupleCrate_, getCrate(tccNb).first.c_str());
1340  ntuple->Fill();
1341 
1342  if ((tccNb == 76 || tccNb == 94) && stripInTower == 1 && xtalInStrip == 3 && (towerInTCC - 1) % 4 == 0) {
1343  int etaSlice = towid.ietaAbs();
1344  coeffStruc coeff;
1345  //getCoeff(coeff, calibMap, id.rawId()) ;
1346  //modif-alex-27-july-2015
1347  std::string str;
1348  getCoeff(coeff, calibMap, laserAlphaMap, id.rawId(), str);
1349  ss << str;
1350  getCoeff(coeff, gainMap, id.rawId());
1351  getCoeff(coeff, pedMap, id.rawId());
1352  linStruc lin;
1353  for (int i = 0; i < 3; i++) {
1354  int mult, shift;
1355  bool ok = computeLinearizerParam(theta, coeff.gainRatio_[i], coeff.calibCoeff_, "EE", mult, shift);
1356  if (!ok)
1357  edm::LogError("TopInfo") << "unable to compute the parameters for Quadrant=" << id.iquadrant()
1358  << " xt=" << id.ic() << " " << dec << id.rawId() << "\n";
1359  else {
1360  lin.pedestal_[i] = coeff.pedestals_[i];
1361  lin.mult_[i] = mult;
1362  lin.shift_[i] = shift;
1363  }
1364  }
1365 
1366  bool ok(true);
1367  if (forcedPedestalValue_ == -2 || forcedPedestalValue_ == -3)
1368  ok = realignBaseline(lin, 0);
1369  if (!ok)
1370  ss << "Quadrant=" << id.iquadrant() << " xt=" << id.ic() << " " << dec << id.rawId() << "\n";
1371 
1372  linEtaSlice[etaSlice] = lin;
1373  }
1374  }
1375 
1376  // general case
1377  for (vector<DetId>::const_iterator it = eeCells.begin(); it != eeCells.end(); ++it) {
1378  EEDetId id(*it);
1379  double theta = theEndcapGeometry_->getGeometry(id)->getPosition().theta();
1380  if (!useTransverseEnergy_)
1381  theta = acos(0.);
1382  const EcalTrigTowerDetId towid = (*eTTmap_).towerOf(id);
1385  towerListEE.push_back(towid.rawId());
1386  // special case of towers in inner rings of EE
1387  if (towid.ietaAbs() == 27 || towid.ietaAbs() == 28) {
1388  EcalTrigTowerDetId additionalTower(towid.zside(), towid.subDet(), towid.ietaAbs(), towid.iphi() + 1);
1389  towerListEE.push_back(additionalTower.rawId());
1390  }
1391  stripListEE.push_back(elId.rawId() & 0xfffffff8);
1392  int dccNb = Id.dccId();
1393  //int tccNb = theMapping_->TCCid(towid) ;
1394  //int towerInTCC = theMapping_->iTT(towid) ;
1395  //int stripInTower = elId.pseudoStripId() ;
1396  //int xtalInStrip = elId.channelId() ;
1397  int CCUid = Id.towerId();
1398  int VFEid = Id.stripId();
1399  int xtalInVFE = Id.xtalId();
1400  int xtalWithinCCUid = 5 * (VFEid - 1) + xtalInVFE - 1; // Evgueni expects [0,24]
1401  int etaSlice = towid.ietaAbs();
1402 
1403  EcalLogicID logicId;
1404  FEConfigPedDat pedDB;
1405  FEConfigLinDat linDB;
1406  if (writeToFiles_)
1407  (*out_file_) << "CRYSTAL " << dec << id.rawId() << std::endl;
1408  if (writeToDB_ && DBEE_) {
1409  int iz = id.positiveZ();
1410  if (iz == 0)
1411  iz = -1;
1412  for (int k = 0; k < (int)my_CrystalEcalLogicId_EE.size(); k++) {
1413  int z = my_CrystalEcalLogicId_EE[k].getID1();
1414  int x = my_CrystalEcalLogicId_EE[k].getID2();
1415  int y = my_CrystalEcalLogicId_EE[k].getID3();
1416  if (id.ix() == x && id.iy() == y && iz == z)
1417  logicId = my_CrystalEcalLogicId_EE[k];
1418  }
1419  }
1420 
1421  coeffStruc coeff;
1422  //getCoeff(coeff, calibMap, id.rawId()) ;
1423  //modif-alex-27-july-2015
1424  string str;
1425  getCoeff(coeff, calibMap, laserAlphaMap, id.rawId(), str);
1426  ss << str;
1427  getCoeff(coeff, gainMap, id.rawId());
1428  getCoeff(coeff, pedMap, id.rawId());
1429  if (id.zside() > 0)
1430  ICEEPlus->Fill(id.ix(), id.iy(), coeff.calibCoeff_);
1431  else
1432  ICEEMinus->Fill(id.ix(), id.iy(), coeff.calibCoeff_);
1433  IC->Fill(theEndcapGeometry_->getGeometry(id)->getPosition().phi(),
1434  theEndcapGeometry_->getGeometry(id)->getPosition().eta(),
1435  coeff.calibCoeff_);
1436 
1437  vector<int> xtalCCU;
1438  xtalCCU.push_back(dccNb + 600);
1439  xtalCCU.push_back(CCUid);
1440  xtalCCU.push_back(xtalWithinCCUid);
1441  xtalCCU.push_back(id.rawId());
1442 
1443  // compute and fill linearization parameters
1444  // case of eta slice
1445  if (forceEtaSlice_) {
1446  map<int, linStruc>::const_iterator itLin = linEtaSlice.find(etaSlice);
1447  if (itLin != linEtaSlice.end()) {
1448  linMap[xtalCCU] = itLin->second;
1449  if (writeToFiles_) {
1450  for (int i = 0; i < 3; i++)
1451  (*out_file_) << hex << " 0x" << itLin->second.pedestal_[i] << " 0x" << itLin->second.mult_[i] << " 0x"
1452  << itLin->second.shift_[i] << std::endl;
1453  }
1454  if (writeToDB_ && DBEE_) {
1455  for (int i = 0; i < 3; i++) {
1456  if (i == 0) {
1457  pedDB.setPedMeanG12(itLin->second.pedestal_[i]);
1458  linDB.setMultX12(itLin->second.mult_[i]);
1459  linDB.setShift12(itLin->second.shift_[i]);
1460  } else if (i == 1) {
1461  pedDB.setPedMeanG6(itLin->second.pedestal_[i]);
1462  linDB.setMultX6(itLin->second.mult_[i]);
1463  linDB.setShift6(itLin->second.shift_[i]);
1464  } else if (i == 2) {
1465  pedDB.setPedMeanG1(itLin->second.pedestal_[i]);
1466  linDB.setMultX1(itLin->second.mult_[i]);
1467  linDB.setShift1(itLin->second.shift_[i]);
1468  }
1469  }
1470  }
1471  float factor = float(itLin->second.mult_[0]) * pow(2., -itLin->second.shift_[0]) / xtal_LSB_EE_;
1472  if (id.zside() > 0)
1473  tpgFactorEEPlus->Fill(id.ix(), id.iy(), factor);
1474  else
1475  tpgFactorEEMinus->Fill(id.ix(), id.iy(), factor);
1476  tpgFactor->Fill(theEndcapGeometry_->getGeometry(id)->getPosition().phi(),
1477  theEndcapGeometry_->getGeometry(id)->getPosition().eta(),
1478  factor);
1479  } else
1480  ss << "current EtaSlice = " << etaSlice << " not found in the EtaSlice map"
1481  << "\n";
1482  } else {
1483  // general case
1484  linStruc lin;
1485  for (int i = 0; i < 3; i++) {
1486  int mult, shift;
1487  bool ok = computeLinearizerParam(theta, coeff.gainRatio_[i], coeff.calibCoeff_, "EE", mult, shift);
1488  if (!ok)
1489  edm::LogError("TopInfo") << "unable to compute the parameters for " << dec << id.rawId() << "\n";
1490  else {
1491  lin.pedestal_[i] = coeff.pedestals_[i];
1492  lin.mult_[i] = mult;
1493  lin.shift_[i] = shift;
1494  }
1495  }
1496 
1497  bool ok(true);
1498  if (forcedPedestalValue_ == -2 || forcedPedestalValue_ == -3)
1499  ok = realignBaseline(lin, 0);
1500  if (!ok)
1501  ss << "Quadrant=" << id.iquadrant() << " xt=" << id.ic() << " " << dec << id.rawId() << "\n";
1502 
1503  for (int i = 0; i < 3; i++) {
1504  if (writeToFiles_)
1505  (*out_file_) << hex << " 0x" << lin.pedestal_[i] << " 0x" << lin.mult_[i] << " 0x" << lin.shift_[i]
1506  << std::endl;
1507  if (writeToDB_ && DBEE_) {
1508  if (i == 0) {
1509  pedDB.setPedMeanG12(lin.pedestal_[i]);
1510  linDB.setMultX12(lin.mult_[i]);
1511  linDB.setShift12(lin.shift_[i]);
1512  } else if (i == 1) {
1513  pedDB.setPedMeanG6(lin.pedestal_[i]);
1514  linDB.setMultX6(lin.mult_[i]);
1515  linDB.setShift6(lin.shift_[i]);
1516  } else if (i == 2) {
1517  pedDB.setPedMeanG1(lin.pedestal_[i]);
1518  linDB.setMultX1(lin.mult_[i]);
1519  linDB.setShift1(lin.shift_[i]);
1520  }
1521  }
1522  if (i == 0) {
1523  float factor = float(lin.mult_[i]) * pow(2., -lin.shift_[i]) / xtal_LSB_EE_;
1524  if (id.zside() > 0)
1525  tpgFactorEEPlus->Fill(id.ix(), id.iy(), factor);
1526  else
1527  tpgFactorEEMinus->Fill(id.ix(), id.iy(), factor);
1528  tpgFactor->Fill(theEndcapGeometry_->getGeometry(id)->getPosition().phi(),
1529  theEndcapGeometry_->getGeometry(id)->getPosition().eta(),
1530  factor);
1531  }
1532  }
1533  linMap[xtalCCU] = lin;
1534  }
1535  if (writeToDB_ && DBEE_) {
1536  pedset[logicId] = pedDB;
1537  linset[logicId] = linDB;
1538  }
1539  } //eeCells
1540  edm::LogInfo("TopInfo") << ss.str();
1541  ss.str("");
1542 
1543  if (writeToDB_) {
1544  // EcalLogicID of the whole barrel is: my_EcalLogicId_EB
1545  FEConfigLinParamDat linparam;
1546  linparam.setETSat(Et_sat_EE_);
1547  linparamset[my_EcalLogicId_EE] = linparam;
1548 
1549  FEConfigLUTParamDat lutparam;
1550  lutparam.setETSat(Et_sat_EE_);
1553  lutparamset[my_EcalLogicId_EE] = lutparam;
1554 
1555  FEConfigFgrParamDat fgrparam;
1556  fgrparam.setFGlowthresh(FG_Threshold_EE_);
1558  fgrparamset[my_EcalLogicId_EE] = fgrparam;
1559  }
1560 
1561  if (writeToDB_) {
1562  ostringstream ltag;
1563  ltag.str("EB_");
1564  ltag << Et_sat_EB_ << "_EE_" << Et_sat_EE_;
1565  std::string lin_tag = ltag.str();
1566  ss << " LIN tag " << lin_tag << "\n";
1567 
1568  if (m_write_ped == 1) {
1569  ped_conf_id_ = db_->writeToConfDB_TPGPedestals(pedset, 1, "from_OfflineDB");
1570  } else {
1571  ss << "the ped id =" << ped_conf_id_ << " will be used for the pedestals "
1572  << "\n";
1573  }
1574 
1575  if (m_write_lin == 1)
1576  lin_conf_id_ = db_->writeToConfDB_TPGLinearCoef(linset, linparamset, 1, lin_tag);
1577  }
1578 
1580  // Evgueni interface
1582  std::ofstream evgueni("TPG_hardcoded.hh", std::ios::out);
1583  evgueni << "void getLinParamTPG_hardcoded(int fed, int ccu, int xtal," << endl;
1584  evgueni << " int & mult12, int & shift12, int & base12," << endl;
1585  evgueni << " int & mult6, int & shift6, int & base6," << endl;
1586  evgueni << " int & mult1, int & shift1, int & base1)" << endl;
1587  evgueni << "{" << endl;
1588  evgueni << " mult12 = 0 ; shift12 = 0 ; base12 = 0 ; mult6 = 0 ; shift6 = 0 ; base6 = 0 ; mult1 = 0 ; shift1 = 0 ; "
1589  "base1 = 0 ;"
1590  << endl;
1591  map<vector<int>, linStruc>::const_iterator itLinMap;
1592  for (itLinMap = linMap.begin(); itLinMap != linMap.end(); itLinMap++) {
1593  vector<int> xtalInCCU = itLinMap->first;
1594  evgueni << " if (fed==" << xtalInCCU[0] << " && ccu==" << xtalInCCU[1] << " && xtal==" << xtalInCCU[2] << ") {";
1595  evgueni << " mult12 = " << itLinMap->second.mult_[0] << " ; shift12 = " << itLinMap->second.shift_[0]
1596  << " ; base12 = " << itLinMap->second.pedestal_[0] << " ; ";
1597  evgueni << " mult6 = " << itLinMap->second.mult_[1] << " ; shift6 = " << itLinMap->second.shift_[1]
1598  << " ; base6 = " << itLinMap->second.pedestal_[1] << " ; ";
1599  evgueni << " mult1 = " << itLinMap->second.mult_[2] << " ; shift1 = " << itLinMap->second.shift_[2]
1600  << " ; base1 = " << itLinMap->second.pedestal_[2] << " ; ";
1601  evgueni << " return ;}" << endl;
1602  }
1603  evgueni << "}" << endl;
1604  evgueni.close();
1605 
1607  // Compute weights section //
1609 
1610  const int NWEIGROUPS = 2;
1611  std::vector<unsigned int> weights[NWEIGROUPS];
1612 
1613  bool useDBShape = useDBShape_;
1614  EBShape shapeEB(useDBShape);
1615  shapeEB.setEventSetup(evtSetup); // EBShape, EEShape are fetched now from DB (2018.05.22 K. Theofilatos)
1616  EEShape shapeEE(useDBShape);
1617  shapeEE.setEventSetup(evtSetup); //
1618  weights[0] = computeWeights(shapeEB, hshapeEB);
1619  weights[1] = computeWeights(shapeEE, hshapeEE);
1620 
1621  map<EcalLogicID, FEConfigWeightGroupDat> dataset;
1622 
1623  for (int igrp = 0; igrp < NWEIGROUPS; igrp++) {
1624  if (weights[igrp].size() == 5) {
1625  if (writeToFiles_) {
1626  (*out_file_) << std::endl;
1627  (*out_file_) << "WEIGHT " << igrp << endl;
1628  for (unsigned int sample = 0; sample < 5; sample++)
1629  (*out_file_) << "0x" << hex << weights[igrp][sample] << " ";
1630  (*out_file_) << std::endl;
1631  (*out_file_) << std::endl;
1632  }
1633  if (writeToDB_) {
1634  ss << "going to write the weights for groupe:" << igrp << "\n";
1636  gut.setWeightGroupId(igrp);
1637  //PP WARNING: weights order is reverted when stored in the DB
1638  gut.setWeight0(weights[igrp][4]);
1639  gut.setWeight1(weights[igrp][3] +
1640  0x80); //0x80 to identify the max of the pulse in the FENIX (doesn't exist in emulator)
1641  gut.setWeight2(weights[igrp][2]);
1642  gut.setWeight3(weights[igrp][1]);
1643  gut.setWeight4(weights[igrp][0]);
1644  EcalLogicID ecid = EcalLogicID("DUMMY", igrp, igrp); //1 dummy ID per group
1645  // Fill the dataset
1646  dataset[ecid] = gut;
1647  }
1648  }
1649  }
1650 
1651  if (writeToDB_) {
1652  // now we store in the DB the correspondence btw channels and groups
1653  map<EcalLogicID, FEConfigWeightDat> dataset2;
1654 
1655  // EB loop
1656  for (int ich = 0; ich < (int)my_StripEcalLogicId.size(); ich++) {
1657  FEConfigWeightDat wut;
1658  int igroup = 0; // this group is for EB
1659  wut.setWeightGroupId(igroup);
1660  dataset2[my_StripEcalLogicId[ich]] = wut;
1661  }
1662 
1663  // EE loop
1664  for (int ich = 0; ich < (int)my_StripEcalLogicId1_EE.size(); ich++) {
1665  FEConfigWeightDat wut;
1666  int igroup = 1; // this group is for EE
1667  wut.setWeightGroupId(igroup);
1668  // Fill the dataset
1669  dataset2[my_StripEcalLogicId1_EE[ich]] = wut;
1670  }
1671  // EE loop 2 (we had to split the ids of EE in 2 vectors to avoid crash!)
1672  for (int ich = 0; ich < (int)my_StripEcalLogicId2_EE.size(); ich++) {
1673  FEConfigWeightDat wut;
1674  int igroup = 1; // this group is for EE
1675  wut.setWeightGroupId(igroup);
1676  // Fill the dataset
1677  dataset2[my_StripEcalLogicId2_EE[ich]] = wut;
1678  }
1679 
1680  // Insert the datasets
1681  ostringstream wtag;
1682  wtag.str("");
1683  wtag << "Shape_NGroups_" << NWEIGROUPS;
1684  std::string weight_tag = wtag.str();
1685  ss << " weight tag " << weight_tag << "\n";
1686  if (m_write_wei == 1)
1687  wei_conf_id_ = db_->writeToConfDB_TPGWeight(dataset, dataset2, NWEIGROUPS, weight_tag);
1688  }
1689  edm::LogInfo("TopInfo") << ss.str();
1690  ss.str("");
1691 
1693  // Compute FG section //
1695 
1696  // barrel
1697  unsigned int lowRatio, highRatio, lowThreshold, highThreshold, lutFG;
1698  computeFineGrainEBParameters(lowRatio, highRatio, lowThreshold, highThreshold, lutFG);
1699  if (writeToFiles_) {
1700  (*out_file_) << std::endl;
1701  (*out_file_) << "FG 0" << std::endl;
1702  (*out_file_) << hex << "0x" << lowThreshold << " 0x" << highThreshold << " 0x" << lowRatio << " 0x" << highRatio
1703  << " 0x" << lutFG << std::endl;
1704  }
1705 
1706  // endcap
1707  unsigned int threshold, lut_tower;
1708  unsigned int lut_strip;
1709  computeFineGrainEEParameters(threshold, lut_strip, lut_tower);
1710 
1711  // and here we store the fgr part
1712 
1713  if (writeToDB_) {
1714  ss << "going to write the fgr "
1715  << "\n";
1716  map<EcalLogicID, FEConfigFgrGroupDat> dataset;
1717  // we create 1 group
1718  int NFGRGROUPS = 1;
1719  for (int ich = 0; ich < NFGRGROUPS; ich++) {
1720  FEConfigFgrGroupDat gut;
1721  gut.setFgrGroupId(ich);
1722  gut.setThreshLow(lowRatio);
1723  gut.setThreshHigh(highRatio);
1724  gut.setRatioLow(lowThreshold);
1725  gut.setRatioHigh(highThreshold);
1726  gut.setLUTValue(lutFG);
1727  EcalLogicID ecid = EcalLogicID("DUMMY", ich, ich);
1728  // Fill the dataset
1729  dataset[ecid] = gut; // we use any logic id but different, because it is in any case ignored...
1730  }
1731 
1732  // now we store in the DB the correspondence btw channels and groups
1733  map<EcalLogicID, FEConfigFgrDat> dataset2;
1734  // in this case I decide in a stupid way which channel belongs to which group
1735  for (int ich = 0; ich < (int)my_TTEcalLogicId.size(); ich++) {
1736  FEConfigFgrDat wut;
1737  int igroup = 0;
1738  wut.setFgrGroupId(igroup);
1739  // Fill the dataset
1740  // the logic ids are ordered by SM (1,...36) and TT (1,...68)
1741  // you have to calculate the right index here
1742  dataset2[my_TTEcalLogicId[ich]] = wut;
1743  }
1744 
1745  // endcap loop
1746  for (int ich = 0; ich < (int)my_RTEcalLogicId_EE.size(); ich++) {
1747  // std::cout << " endcap FGR " << std::endl;
1748  FEConfigFgrDat wut;
1749  int igroup = 0;
1750  wut.setFgrGroupId(igroup);
1751  // Fill the dataset
1752  // the logic ids are ordered by .... ?
1753  // you have to calculate the right index here
1754  dataset2[my_RTEcalLogicId_EE[ich]] = wut;
1755  }
1756 
1757  // endcap TT loop for the FEfgr EE Tower
1758  map<EcalLogicID, FEConfigFgrEETowerDat> dataset3;
1759  for (int ich = 0; ich < (int)my_TTEcalLogicId_EE.size(); ich++) {
1760  FEConfigFgrEETowerDat fgreett;
1761  fgreett.setLutValue(lut_tower);
1762  dataset3[my_TTEcalLogicId_EE[ich]] = fgreett;
1763  }
1764 
1765  // endcap strip loop for the FEfgr EE strip
1766  // and barrel strip loop for the spike parameters (same structure than EE FGr)
1767  map<EcalLogicID, FEConfigFgrEEStripDat> dataset4;
1768  for (int ich = 0; ich < (int)my_StripEcalLogicId1_EE.size(); ich++) {
1770  zut.setThreshold(threshold);
1771  zut.setLutFgr(lut_strip);
1772  dataset4[my_StripEcalLogicId1_EE[ich]] = zut;
1773  }
1774  for (int ich = 0; ich < (int)my_StripEcalLogicId2_EE.size(); ich++) {
1776  zut.setThreshold(threshold);
1777  zut.setLutFgr(lut_strip);
1778  // Fill the dataset
1779  dataset4[my_StripEcalLogicId2_EE[ich]] = zut;
1780  }
1781  for (int ich = 0; ich < (int)my_StripEcalLogicId.size(); ich++) {
1782  // EB
1784  EcalLogicID thestrip = my_StripEcalLogicId[ich];
1785  uint32_t elStripId = stripMapEB[ich];
1786  map<uint32_t, uint32_t>::const_iterator it = stripMapEBsintheta.find(elStripId);
1787  if (it != stripMapEBsintheta.end())
1788  zut.setThreshold(it->second);
1789  else {
1790  edm::LogError("TopInfo") << "ERROR: strip SFGVB threshold parameter not found for that strip:"
1791  << thestrip.getID1() << " " << thestrip.getID3() << " " << thestrip.getID3() << "\n";
1792  edm::LogError("TopInfo") << " using value = " << SFGVB_Threshold_ + pedestal_offset_ << "\n";
1794  }
1795  zut.setLutFgr(SFGVB_lut_);
1796  // Fill the dataset
1797  dataset4[thestrip] = zut;
1798  }
1799 
1800  // Insert the dataset
1801  ostringstream wtag;
1802  wtag.str("");
1803  wtag << "FGR_" << lutFG << "_N_" << NFGRGROUPS << "_eb_" << FG_lowThreshold_EB_ << "_EB_" << FG_highThreshold_EB_;
1804  std::string weight_tag = wtag.str();
1805  ss << " weight tag " << weight_tag << "\n";
1806  if (m_write_fgr == 1)
1807  fgr_conf_id_ =
1808  db_->writeToConfDB_TPGFgr(dataset, dataset2, fgrparamset, dataset3, dataset4, NFGRGROUPS, weight_tag);
1809 
1810  //modif-alex 21/01/11
1811  map<EcalLogicID, FEConfigSpikeDat> datasetspike; //loob EB TT
1812  for (int ich = 0; ich < (int)my_TTEcalLogicId.size(); ich++) {
1813  FEConfigSpikeDat spiketh;
1815  datasetspike[my_TTEcalLogicId[ich]] = spiketh;
1816  } //loop EB TT towers
1817 
1818  //modif-alex 21/01/11
1819  ostringstream stag;
1820  stag.str("");
1821  stag << "SpikeTh" << SFGVB_SpikeKillingThreshold_;
1822  std::string spike_tag = stag.str();
1823  ss << " spike tag " << spike_tag << "\n";
1824  if (m_write_spi == 1)
1825  spi_conf_id_ = db_->writeToConfDB_Spike(datasetspike, spike_tag); //modif-alex 21/01/11
1826 
1827  //modif-alex 31/01/11
1828  //DELAYS EB
1829  map<EcalLogicID, FEConfigTimingDat>
1830  datasetdelay; // the loop goes from TCC 38 to 72 and throught the towers from 1 to 68
1831  for (int ich = 0; ich < (int)my_TTEcalLogicId_EB_by_TCC.size(); ich++) {
1833 
1834  EcalLogicID logiciddelay = my_TTEcalLogicId_EB_by_TCC[ich];
1835  int id1_tcc = my_TTEcalLogicId_EB_by_TCC[ich].getID1(); // the TCC
1836  int id2_tt = my_TTEcalLogicId_EB_by_TCC[ich].getID2(); // the tower
1837  std::map<int, vector<int> >::const_iterator ittEB = delays_EB_.find(id1_tcc);
1838  std::vector<int> TimingDelaysEB = ittEB->second;
1839 
1840  if (ittEB != delays_EB_.end()) {
1841  if (TimingDelaysEB[id2_tt - 1] == -1) {
1842  edm::LogError("TopInfo") << "ERROR: Barrel timing delay not specified, check file, putting default value 1"
1843  << "\n";
1844  delay.setTimingPar1(1);
1845  } else
1846  delay.setTimingPar1(TimingDelaysEB[id2_tt - 1]);
1847  } else {
1848  edm::LogError("TopInfo") << "ERROR:Barrel Could not find delay parameter for that trigger tower "
1849  << "\n";
1850  edm::LogError("TopInfo") << "Using default value = 1"
1851  << "\n";
1852  delay.setTimingPar1(1);
1853  }
1854 
1855  std::map<int, vector<int> >::const_iterator ittpEB = phases_EB_.find(id1_tcc);
1856  std::vector<int> TimingPhasesEB = ittpEB->second;
1857 
1858  if (ittpEB != phases_EB_.end()) {
1859  if (TimingPhasesEB[id2_tt - 1] == -1) {
1860  edm::LogError("TopInfo") << "ERROR: Barrel timing phase not specified, check file, putting default value 0"
1861  << "\n";
1862  delay.setTimingPar2(0);
1863  } else
1864  delay.setTimingPar2(TimingPhasesEB[id2_tt - 1]);
1865  } else {
1866  edm::LogError("TopInfo") << "ERROR:Barrel Could not find phase parameter for that trigger tower "
1867  << "\n";
1868  edm::LogError("TopInfo") << "Using default value = 0"
1869  << "\n";
1870  delay.setTimingPar2(0);
1871  }
1872 
1873  ss << ich << " tcc=" << id1_tcc << " TT=" << id2_tt << " logicId=" << logiciddelay.getLogicID()
1874  << " delay=" << TimingDelaysEB[id2_tt - 1] << " phase=" << TimingPhasesEB[id2_tt - 1] << "\n";
1875 
1876  //delay.setTimingPar1(1);
1877  //delay.setTimingPar2(2);
1878  datasetdelay[my_TTEcalLogicId_EB_by_TCC[ich]] = delay;
1879  } //loop EB TT towers
1880 
1881  //DELAYS EE
1882  int stripindex = 0;
1883  int tccin = 1;
1884  for (int ich = 0; ich < (int)my_StripEcalLogicId_EE_strips_by_TCC.size(); ich++) {
1886  //int id1_strip=my_StripEcalLogicId_EE_strips_by_TCC[ich].getID1(); // the TCC
1887  //int id2_strip=my_StripEcalLogicId_EE_strips_by_TCC[ich].getID2(); // the Tower
1888  //int id3_strip=my_StripEcalLogicId_EE_strips_by_TCC[ich].getID3(); // the strip
1889 
1890  EcalLogicID logiciddelay = my_StripEcalLogicId_EE_strips_by_TCC[ich];
1891  int id1_tcc = my_StripEcalLogicId_EE_strips_by_TCC[ich].getID1(); // the TCC
1892  int id2_tt = my_StripEcalLogicId_EE_strips_by_TCC[ich].getID2(); // the tower
1893  int id3_st = my_StripEcalLogicId_EE_strips_by_TCC[ich].getID3(); // the strip
1894 
1895  //reset strip counter
1896  if (id1_tcc != tccin) {
1897  tccin = id1_tcc;
1898  stripindex = 0;
1899  }
1900 
1901  std::map<int, vector<int> >::const_iterator ittEE = delays_EE_.find(id1_tcc);
1902  std::vector<int> TimingDelaysEE = ittEE->second;
1903 
1904  if (ittEE != delays_EE_.end()) {
1905  if (TimingDelaysEE[stripindex] == -1) {
1906  edm::LogError("TopInfo") << "ERROR: Endcap timing delay not specified, check file, putting default value 1"
1907  << "\n";
1908  delay.setTimingPar1(1);
1909  } else
1910  delay.setTimingPar1(TimingDelaysEE[stripindex]);
1911  } else {
1912  edm::LogError("TopInfo") << "ERROR:Endcap Could not find delay parameter for that trigger tower "
1913  << "\n";
1914  edm::LogError("TopInfo") << "Using default value = 1"
1915  << "\n";
1916  delay.setTimingPar1(1);
1917  }
1918 
1919  std::map<int, vector<int> >::const_iterator ittpEE = phases_EE_.find(id1_tcc);
1920  std::vector<int> TimingPhasesEE = ittpEE->second;
1921 
1922  if (ittpEE != phases_EE_.end()) {
1923  if (TimingPhasesEE[stripindex] == -1) {
1924  edm::LogError("TopInfo") << "ERROR: Endcap timing phase not specified, check file, putting default value 0"
1925  << "\n";
1926  delay.setTimingPar2(0);
1927  } else
1928  delay.setTimingPar2(TimingPhasesEE[stripindex]);
1929  } else {
1930  edm::LogError("TopInfo") << "ERROR:Endcap Could not find phase parameter for that trigger tower "
1931  << "\n";
1932  edm::LogError("TopInfo") << "Using default value = 0"
1933  << "\n";
1934  delay.setTimingPar2(0);
1935  }
1936 
1937  ss << ich << " stripindex=" << stripindex << " tcc=" << id1_tcc << " TT=" << id2_tt << " id3_st=" << id3_st
1938  << " logicId=" << logiciddelay.getLogicID() << " delay=" << TimingDelaysEE[stripindex]
1939  << " phase=" << TimingPhasesEE[stripindex] << "\n";
1940 
1941  //delay.setTimingPar1(1);
1942  //delay.setTimingPar2(2);
1943  datasetdelay[my_StripEcalLogicId_EE_strips_by_TCC[ich]] = delay;
1944  stripindex++;
1945  } //loop EE strip towers
1946 
1947  ostringstream de_tag;
1948  de_tag.str("");
1949  de_tag << "DelaysFromFile";
1950  std::string delay_tag = de_tag.str();
1951  ss << " delay tag " << delay_tag << "\n";
1952  if (m_write_del == 1)
1953  del_conf_id_ = db_->writeToConfDB_Delay(datasetdelay, delay_tag); //modif-alex 31/01/11
1954 
1955  } //write to DB
1956 
1957  if (writeToDB_) {
1958  ss << "going to write the sliding "
1959  << "\n";
1960  map<EcalLogicID, FEConfigSlidingDat> dataset;
1961  // in this case I decide in a stupid way which channel belongs to which group
1962  for (int ich = 0; ich < (int)my_StripEcalLogicId.size(); ich++) {
1963  FEConfigSlidingDat wut;
1964  wut.setSliding(sliding_);
1965  // Fill the dataset
1966  // the logic ids are ordered by SM (1,...36) , TT (1,...68) and strip (1..5)
1967  // you have to calculate the right index here
1968  dataset[my_StripEcalLogicId[ich]] = wut;
1969  }
1970 
1971  // endcap loop
1972  for (int ich = 0; ich < (int)my_StripEcalLogicId1_EE.size(); ich++) {
1973  FEConfigSlidingDat wut;
1974  wut.setSliding(sliding_);
1975  // Fill the dataset
1976  // the logic ids are ordered by fed tower strip
1977  // you have to calculate the right index here
1978  dataset[my_StripEcalLogicId1_EE[ich]] = wut;
1979  }
1980  for (int ich = 0; ich < (int)my_StripEcalLogicId2_EE.size(); ich++) {
1981  FEConfigSlidingDat wut;
1982  wut.setSliding(sliding_);
1983  // Fill the dataset
1984  // the logic ids are ordered by ... ?
1985  // you have to calculate the right index here
1986  dataset[my_StripEcalLogicId2_EE[ich]] = wut;
1987  }
1988 
1989  // Insert the dataset
1990  ostringstream wtag;
1991  wtag.str("");
1992  wtag << "Sliding_" << sliding_;
1993  std::string justatag = wtag.str();
1994  ss << " sliding tag " << justatag << "\n";
1995  int iov_id = 0; // just a parameter ...
1996  if (m_write_sli == 1)
1997  sli_conf_id_ = db_->writeToConfDB_TPGSliding(dataset, iov_id, justatag);
1998  }
1999 
2001  // Compute LUT section //
2003 
2004  int lut_EB[1024], lut_EE[1024];
2005 
2006  // barrel
2007  computeLUT(lut_EB, "EB");
2008  if (writeToFiles_) {
2009  (*out_file_) << std::endl;
2010  (*out_file_) << "LUT 0" << std::endl;
2011  for (int i = 0; i < 1024; i++)
2012  (*out_file_) << "0x" << hex << lut_EB[i] << endl;
2013  (*out_file_) << endl;
2014  }
2015 
2016  // endcap
2017  computeLUT(lut_EE, "EE");
2018  // check first if lut_EB and lut_EE are the same
2019  bool newLUT(false);
2020  for (int i = 0; i < 1024; i++)
2021  if (lut_EE[i] != lut_EB[i])
2022  newLUT = true;
2023  if (newLUT && writeToFiles_) {
2024  (*out_file_) << std::endl;
2025  (*out_file_) << "LUT 1" << std::endl;
2026  for (int i = 0; i < 1024; i++)
2027  (*out_file_) << "0x" << hex << lut_EE[i] << endl;
2028  (*out_file_) << endl;
2029  }
2030 
2031  if (writeToDB_) {
2032  map<EcalLogicID, FEConfigLUTGroupDat> dataset;
2033  // we create 1 LUT group
2034  int NLUTGROUPS = 0;
2035  int ich = 0;
2036  FEConfigLUTGroupDat lut;
2037  lut.setLUTGroupId(ich);
2038  for (int i = 0; i < 1024; i++) {
2039  lut.setLUTValue(i, lut_EB[i]);
2040  }
2041  EcalLogicID ecid = EcalLogicID("DUMMY", ich, ich);
2042  // Fill the dataset
2043  dataset[ecid] = lut; // we use any logic id but different, because it is in any case ignored...
2044 
2045  ich++;
2046 
2047  FEConfigLUTGroupDat lute;
2048  lute.setLUTGroupId(ich);
2049  for (int i = 0; i < 1024; i++) {
2050  lute.setLUTValue(i, lut_EE[i]);
2051  }
2052  EcalLogicID ecide = EcalLogicID("DUMMY", ich, ich);
2053  // Fill the dataset
2054  dataset[ecide] = lute; // we use any logic id but different, because it is in any case ignored...
2055 
2056  ich++;
2057 
2058  NLUTGROUPS = ich;
2059 
2060  // now we store in the DB the correspondence btw channels and LUT groups
2061  map<EcalLogicID, FEConfigLUTDat> dataset2;
2062  // in this case I decide in a stupid way which channel belongs to which group
2063  for (int ich = 0; ich < (int)my_TTEcalLogicId.size(); ich++) {
2064  FEConfigLUTDat lut;
2065  int igroup = 0;
2066  lut.setLUTGroupId(igroup);
2067  // calculate the right TT - in the vector they are ordered by SM and by TT
2068  // Fill the dataset
2069  dataset2[my_TTEcalLogicId[ich]] = lut;
2070  }
2071 
2072  // endcap loop
2073  for (int ich = 0; ich < (int)my_TTEcalLogicId_EE.size(); ich++) {
2074  FEConfigLUTDat lut;
2075  int igroup = 1;
2076  lut.setLUTGroupId(igroup);
2077  // calculate the right TT
2078  // Fill the dataset
2079  dataset2[my_TTEcalLogicId_EE[ich]] = lut;
2080  }
2081 
2082  // Insert the dataset
2083  ostringstream ltag;
2084  ltag.str("");
2085  ltag << LUT_option_ << "_NGroups_" << NLUTGROUPS;
2086  std::string lut_tag = ltag.str();
2087  ss << " LUT tag " << lut_tag << "\n";
2088  if (m_write_lut == 1)
2089  lut_conf_id_ = db_->writeToConfDB_TPGLUT(dataset, dataset2, lutparamset, NLUTGROUPS, lut_tag);
2090  }
2091 
2092  // last we insert the FE_CONFIG_MAIN table
2093  if (writeToDB_) {
2094  //int conf_id_=db_->writeToConfDB_TPGMain(ped_conf_id_,lin_conf_id_, lut_conf_id_, fgr_conf_id_,
2095  // sli_conf_id_, wei_conf_id_, bxt_conf_id_, btt_conf_id_, tag_, version_) ;
2096  int conf_id_ = db_->writeToConfDB_TPGMain(ped_conf_id_,
2097  lin_conf_id_,
2098  lut_conf_id_,
2099  fgr_conf_id_,
2100  sli_conf_id_,
2101  wei_conf_id_,
2102  spi_conf_id_,
2103  del_conf_id_,
2104  bxt_conf_id_,
2105  btt_conf_id_,
2106  bst_conf_id_,
2107  tag_,
2108  version_); //modif-alex 21/01/11
2109 
2110  ss << "\n Conf ID = " << conf_id_ << "\n";
2111  }
2112 
2114  // loop on strips and associate them with values //
2116 
2117  // Barrel
2118  stripListEB.sort();
2119  stripListEB.unique();
2120  ss << "Number of EB strips=" << dec << stripListEB.size() << "\n";
2121  if (writeToFiles_) {
2122  (*out_file_) << std::endl;
2123  for (itList = stripListEB.begin(); itList != stripListEB.end(); itList++) {
2124  (*out_file_) << "STRIP_EB " << dec << (*itList) << endl;
2125  (*out_file_) << hex << "0x" << sliding_ << std::endl;
2126  (*out_file_) << "0" << std::endl;
2127  (*out_file_) << "0x" << stripMapEBsintheta[(*itList)] << " 0x" << SFGVB_lut_ << std::endl;
2128  }
2129  }
2130 
2131  // Endcap
2132  stripListEE.sort();
2133  stripListEE.unique();
2134  ss << "Number of EE strips=" << dec << stripListEE.size() << "\n";
2135  if (writeToFiles_) {
2136  (*out_file_) << std::endl;
2137  for (itList = stripListEE.begin(); itList != stripListEE.end(); itList++) {
2138  (*out_file_) << "STRIP_EE " << dec << (*itList) << endl;
2139  (*out_file_) << hex << "0x" << sliding_ << std::endl;
2140  //(*out_file_) <<" 0" << std::endl ;
2141  (*out_file_) << " 1" << std::endl; //modif-debug to get the correct EE TPG
2142  (*out_file_) << hex << "0x" << threshold << " 0x" << lut_strip << std::endl;
2143  }
2144  }
2145  edm::LogInfo("TopInfo") << ss.str();
2146  ss.str("");
2147 
2149  // loop on towers and associate them with default values //
2151 
2152  // Barrel
2153  towerListEB.sort();
2154  towerListEB.unique();
2155  ss << "Number of EB towers=" << dec << towerListEB.size() << "\n";
2156  if (writeToFiles_) {
2157  (*out_file_) << std::endl;
2158  for (itList = towerListEB.begin(); itList != towerListEB.end(); itList++) {
2159  (*out_file_) << "TOWER_EB " << dec << (*itList) << endl;
2160  (*out_file_) << " 0\n 0\n";
2161  (*out_file_) << " " << SFGVB_SpikeKillingThreshold_ << std::endl; //modif-alex
2162  }
2163  }
2164 
2165  // Endcap
2166  towerListEE.sort();
2167  towerListEE.unique();
2168  ss << "Number of EE towers=" << dec << towerListEE.size() << "\n";
2169  if (writeToFiles_) {
2170  (*out_file_) << std::endl;
2171  for (itList = towerListEE.begin(); itList != towerListEE.end(); itList++) {
2172  (*out_file_) << "TOWER_EE " << dec << (*itList) << endl;
2173  if (newLUT)
2174  (*out_file_) << " 1\n";
2175  else
2176  (*out_file_) << " 0\n";
2177  (*out_file_) << hex << "0x" << lut_tower << std::endl;
2178  }
2179  }
2180  edm::LogInfo("TopInfo") << ss.str();
2181  ss.str("");
2182 
2184  // store control histos //
2186  ICEB->Write();
2187  tpgFactorEB->Write();
2188  ICEEPlus->Write();
2189  tpgFactorEEPlus->Write();
2190  ICEEMinus->Write();
2191  tpgFactorEEMinus->Write();
2192  IC->Write();
2193  tpgFactor->Write();
2194  hshapeEB->Write();
2195  hshapeEE->Write();
2196  ntuple->Write();
2197  ntupleSpike->Write();
2198  saving.Close();
2199 }

References funct::abs(), EcalCondObjectContainer< T >::barrelItems(), newFWLiteAna::base, bst_conf_id_, btt_conf_id_, visDQMUpload::buf, bxt_conf_id_, coeffStruc::calibCoeff_, EcalTriggerElectronicsId::channelId(), computeFineGrainEBParameters(), computeFineGrainEEParameters(), computeLinearizerParam(), computeLUT(), computeWeights(), writedatasetfile::dataset, db_, DBEE_, EcalElectronicsId::dccId(), EcalElectronicsMapping::DCCid(), TauDecayModes::dec, del_conf_id_, phase2TrackerDigitizer_cfi::delay, delays_EB_, delays_EE_, DetId::Ecal, ecalADCToGeVConstantToken_, EcalBarrel, EcalEndcap, ecalGainRatiosToken_, ecalIntercalibConstantsToken_, ecalLaserAlphasToken_, ecalLaserAPDPNRatiosToken_, ecalmappingToken_, ecalPedestalsToken_, EcalCondObjectContainer< T >::endcapItems(), Et_sat_EB_, Et_sat_EE_, eTTmap_, eTTmapToken_, DQMScaleToClient_cfi::factor, EcalCondDBInterface::fetchConfigSet(), EcalCondDBInterface::fetchDataSet(), FG_highRatio_EB_, FG_highThreshold_EB_, FG_lowRatio_EB_, FG_lowThreshold_EB_, FG_Threshold_EE_, fgr_conf_id_, EcalCondObjectContainer< T >::find(), first, dqmMemoryStats::float, forcedPedestalValue_, forceEtaSlice_, g, cmssw_cycle_finder::G, coeffStruc::gainRatio_, FEConfigMainInfo::getBstId(), FEConfigMainInfo::getBttId(), FEConfigMainInfo::getBxtId(), getCoeff(), getCrate(), edm::EventSetup::getData(), getDet(), EcalADCToGeVConstant::getEBValue(), EcalCondDBInterface::getEcalLogicID(), EcalCondDBInterface::getEcalLogicIDSetOrdered(), EcalADCToGeVConstant::getEEValue(), EcalElectronicsMapping::getElectronicsId(), FEConfigMainInfo::getFgrId(), getGCTRegionEta(), getGCTRegionPhi(), CaloSubdetectorGeometry::getGeometry(), EcalLogicID::getID1(), EcalLogicID::getID2(), EcalLogicID::getID3(), EcalLaserAPDPNRatios::getLaserMap(), FEConfigMainInfo::getLinId(), EcalLogicID::getLogicID(), FEConfigMainInfo::getLUTId(), EcalCondObjectContainer< T >::getMap(), EcalLogicID::getName(), FEConfigMainInfo::getPedId(), FEConfigPedDat::getPedMeanG1(), FEConfigPedDat::getPedMeanG12(), FEConfigPedDat::getPedMeanG6(), FEConfigMainInfo::getSliId(), FEConfigMainInfo::getSpiId(), FEConfigMainInfo::getTimId(), EcalElectronicsMapping::getTriggerElectronicsId(), CaloSubdetectorGeometry::getValidDetIds(), FEConfigMainInfo::getWeiId(), H2_, ecalpyutils::hashedIndex(), mps_fire::i, cuy::ib, triggerObjects_cff::id, EcalTrigTowerDetId::ieta(), LEDCalibrationChannels::ieta, EcalTrigTowerDetId::ietaAbs(), EcalCondObjectContainer< T >::insert(), createfilelist::int, EcalTrigTowerDetId::iphi(), LEDCalibrationChannels::iphi, B2GTnPMonitor_cfi::item, EcalElectronicsMapping::iTT(), dqmiolumiharvest::j, dqmdumpme::k, lin_conf_id_, lut_conf_id_, LUT_option_, m_write_del, m_write_fgr, m_write_lin, m_write_lut, m_write_ped, m_write_sli, m_write_spi, m_write_wei, VarParsing::mult, linStruc::mult_, ntupleCrate_, ntupleDet_, ntupleInts_, EcalLogicID::NULLID, convertSQLiteXML::ok, MillePedeFileConverter_cfg::out, out_file_, AlCaHLTBitMon_ParallelJobs::p, ped_conf_id_, linStruc::pedestal_, pedestal_offset_, coeffStruc::pedestals_, phases_EB_, phases_EE_, funct::pow(), EcalTriggerElectronicsId::pseudoStripId(), EcalTriggerElectronicsId::rawId(), DetId::rawId(), realignBaseline(), simplePhotonAnalyzer_cfi::sample, IODConfig::setConfigTag(), FEConfigLinParamDat::setETSat(), FEConfigLUTParamDat::setETSat(), EcalShapeBase::setEventSetup(), FEConfigFgrParamDat::setFGhighratio(), FEConfigFgrParamDat::setFGhighthresh(), FEConfigFgrParamDat::setFGlowratio(), FEConfigFgrParamDat::setFGlowthresh(), FEConfigFgrGroupDat::setFgrGroupId(), FEConfigFgrDat::setFgrGroupId(), FEConfigPedInfo::setId(), FEConfigFgrEEStripDat::setLutFgr(), FEConfigLUTGroupDat::setLUTGroupId(), FEConfigLUTDat::setLUTGroupId(), FEConfigFgrEETowerDat::setLutValue(), FEConfigLUTGroupDat::setLUTValue(), FEConfigFgrGroupDat::setLUTValue(), FEConfigLinDat::setMultX1(), FEConfigLinDat::setMultX12(), FEConfigLinDat::setMultX6(), FEConfigPedDat::setPedMeanG1(), FEConfigPedDat::setPedMeanG12(), FEConfigPedDat::setPedMeanG6(), FEConfigFgrGroupDat::setRatioHigh(), FEConfigFgrGroupDat::setRatioLow(), FEConfigLinDat::setShift1(), FEConfigLinDat::setShift12(), FEConfigLinDat::setShift6(), FEConfigSlidingDat::setSliding(), FEConfigSpikeDat::setSpikeThreshold(), FEConfigFgrGroupDat::setThreshHigh(), FEConfigFgrGroupDat::setThreshLow(), FEConfigFgrEEStripDat::setThreshold(), FEConfigLUTParamDat::setTTThreshhigh(), FEConfigLUTParamDat::setTTThreshlow(), FEConfigWeightGroupDat::setWeight0(), FEConfigWeightGroupDat::setWeight1(), FEConfigWeightGroupDat::setWeight2(), FEConfigWeightGroupDat::setWeight3(), FEConfigWeightGroupDat::setWeight4(), FEConfigWeightDat::setWeightGroupId(), FEConfigWeightGroupDat::setWeightGroupId(), SFGVB_lut_, SFGVB_SpikeKillingThreshold_, SFGVB_Threshold_, edm::shift, linStruc::shift_, funct::sin(), findQualityFiles::size, sli_conf_id_, sliding_, EBDetId::SMCRYSTALMODE, spi_conf_id_, contentValuesCheck::ss, str, AlCaHLTBitMon_QueryRunRegistry::string, EcalElectronicsId::stripId(), EcalTrigTowerDetId::subDet(), tag_, EcalElectronicsMapping::TCCid(), theBarrelGeometry_, theBarrelGeometryToken_, theEndcapGeometry_, theEndcapGeometryToken_, theMapping_, theta(), remoteMonitoring_LED_IterMethod_cfg::threshold, EcalElectronicsId::towerId(), Transparency_Corr_, Transparency_Correction_, TTF_highThreshold_EB_, TTF_highThreshold_EE_, TTF_lowThreshold_EB_, TTF_lowThreshold_EE_, EBDetId::unhashIndex(), EEDetId::unhashIndex(), useDBShape_, useTransparencyCorr_, useTransverseEnergy_, heppy_batch::val, version_, wei_conf_id_, HLT_FULL_cff::weights, EcalTPGDBApp::writeToConfDB_Delay(), EcalTPGDBApp::writeToConfDB_Spike(), EcalTPGDBApp::writeToConfDB_TPGFgr(), EcalTPGDBApp::writeToConfDB_TPGLinearCoef(), EcalTPGDBApp::writeToConfDB_TPGLUT(), EcalTPGDBApp::writeToConfDB_TPGMain(), EcalTPGDBApp::writeToConfDB_TPGPedestals(), EcalTPGDBApp::writeToConfDB_TPGSliding(), EcalTPGDBApp::writeToConfDB_TPGWeight(), writeToDB_, writeToFiles_, x, xtal_LSB_EB_, xtal_LSB_EE_, EcalElectronicsId::xtalId(), EEDetId::XYMODE, y, z, EcalTrigTowerDetId::zside(), and ecaldqm::zside().

◆ beginJob()

void EcalTPGParamBuilder::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 2201 of file EcalTPGParamBuilder.cc.

2201  {
2202  using namespace edm;
2203  using namespace std;
2204 
2205  edm::LogInfo("TopInfo") << "we are in beginJob\n";
2206 
2207  create_header();
2208 
2211 
2212  if (writeToFiles_) {
2213  (*out_file_) << "PHYSICS_EB " << dec << eb.rawId() << std::endl;
2214  (*out_file_) << Et_sat_EB_ << " " << TTF_lowThreshold_EB_ << " " << TTF_highThreshold_EB_ << std::endl;
2215  (*out_file_) << FG_lowThreshold_EB_ << " " << FG_highThreshold_EB_ << " " << FG_lowRatio_EB_ << " "
2216  << FG_highRatio_EB_ << std::endl;
2217  //(*out_file_) << SFGVB_SpikeKillingThreshold_ << std::endl; //modif-alex02/02/2011
2218  (*out_file_) << std::endl;
2219 
2220  (*out_file_) << "PHYSICS_EE " << dec << ee.rawId() << std::endl;
2221  (*out_file_) << Et_sat_EE_ << " " << TTF_lowThreshold_EE_ << " " << TTF_highThreshold_EE_ << std::endl;
2222  (*out_file_) << FG_Threshold_EE_ << " " << -1 << " " << -1 << " " << -1 << std::endl;
2223  (*out_file_) << std::endl;
2224  }
2225 }

References create_header(), TauDecayModes::dec, DetId::Ecal, EcalBarrel, EcalEndcap, Et_sat_EB_, Et_sat_EE_, FG_highRatio_EB_, FG_highThreshold_EB_, FG_lowRatio_EB_, FG_lowThreshold_EB_, FG_Threshold_EE_, DetId::rawId(), TTF_highThreshold_EB_, TTF_highThreshold_EE_, TTF_lowThreshold_EB_, TTF_lowThreshold_EE_, and writeToFiles_.

◆ checkIfOK()

bool EcalTPGParamBuilder::checkIfOK ( EcalPedestals::Item  item)
private

Definition at line 356 of file EcalTPGParamBuilder.cc.

356  {
357  bool result = true;
358  if (item.mean_x1 < 150. || item.mean_x1 > 250)
359  result = false;
360  if (item.mean_x6 < 150. || item.mean_x6 > 250)
361  result = false;
362  if (item.mean_x12 < 150. || item.mean_x12 > 250)
363  result = false;
364  if (item.rms_x1 < 0 || item.rms_x1 > 2)
365  result = false;
366  if (item.rms_x6 < 0 || item.rms_x6 > 3)
367  result = false;
368  if (item.rms_x12 < 0 || item.rms_x12 > 5)
369  result = false;
370  return result;
371 }

References B2GTnPMonitor_cfi::item, and mps_fire::result.

◆ computeFineGrainEBParameters()

void EcalTPGParamBuilder::computeFineGrainEBParameters ( uint &  lowRatio,
uint &  highRatio,
uint &  lowThreshold,
uint &  highThreshold,
uint &  lut 
)
private

Definition at line 2700 of file EcalTPGParamBuilder.cc.

2704  {
2705  lowRatio = int(0x80 * FG_lowRatio_EB_ + 0.5);
2706  if (lowRatio > 0x7f)
2707  lowRatio = 0x7f;
2708  highRatio = int(0x80 * FG_highRatio_EB_ + 0.5);
2709  if (highRatio > 0x7f)
2710  highRatio = 0x7f;
2711 
2712  // lsb at the stage of the FG calculation is:
2713  double lsb_FG = Et_sat_EB_ / 1024. / 4;
2714  lowThreshold = int(FG_lowThreshold_EB_ / lsb_FG + 0.5);
2715  if (lowThreshold > 0xff)
2716  lowThreshold = 0xff;
2717  highThreshold = int(FG_highThreshold_EB_ / lsb_FG + 0.5);
2718  if (highThreshold > 0xff)
2719  highThreshold = 0xff;
2720 
2721  // FG lut: FGVB response is LUT(adress) where adress is:
2722  // bit3: maxof2/ET >= lowRatio, bit2: maxof2/ET >= highRatio, bit1: ET >= lowThreshold, bit0: ET >= highThreshold
2723  // FGVB =1 if jet-like (veto active), =0 if E.M.-like
2724  // the condition for jet-like is: ET>Threshold and maxof2/ET < Ratio (only TT with enough energy are vetoed)
2725 
2726  // With the following lut, what matters is only max(TLow, Thigh) and max(Elow, Ehigh)
2727  // So, jet-like if maxof2/ettot<max(TLow, Thigh) && ettot >= max(Elow, Ehigh)
2728  if (FG_lut_EB_ == 0)
2729  lut = 0x0888;
2730  else
2731  lut = FG_lut_EB_; // let's use the users value (hope he/she knows what he/she does!)
2732 }

References Et_sat_EB_, FG_highRatio_EB_, FG_highThreshold_EB_, FG_lowRatio_EB_, FG_lowThreshold_EB_, FG_lut_EB_, and createfilelist::int.

Referenced by analyze().

◆ computeFineGrainEEParameters()

void EcalTPGParamBuilder::computeFineGrainEEParameters ( uint &  threshold,
uint &  lut_strip,
uint &  lut_tower 
)
private

Definition at line 2734 of file EcalTPGParamBuilder.cc.

2736  {
2737  // lsb for EE:
2738  double lsb_FG = Et_sat_EE_ / 1024.; // FIXME is it true????
2739  threshold = int(FG_Threshold_EE_ / lsb_FG + 0.5);
2740  lut_strip = FG_lut_strip_EE_;
2741  lut_tower = FG_lut_tower_EE_;
2742 }

References Et_sat_EE_, FG_lut_strip_EE_, FG_lut_tower_EE_, FG_Threshold_EE_, createfilelist::int, and remoteMonitoring_LED_IterMethod_cfg::threshold.

Referenced by analyze().

◆ computeLinearizerParam()

bool EcalTPGParamBuilder::computeLinearizerParam ( double  theta,
double  gainRatio,
double  calibCoeff,
std::string  subdet,
int &  mult,
int &  shift 
)
private

Definition at line 2227 of file EcalTPGParamBuilder.cc.

2228  {
2229  /*
2230  Linearization coefficient are determined in order to satisfy:
2231  tpg(ADC_sat) = 1024
2232  where:
2233  tpg() is a model of the linearized tpg response on 10b
2234  ADC_sat is the number of ADC count corresponding the Et_sat, the maximum scale of the transverse energy
2235 
2236  Since we have:
2237  Et_sat = xtal_LSB * ADC_sat * gainRatio * calibCoeff * sin(theta)
2238  and a simple model of tpg() being given by:
2239  tpg(X) = [ (X*mult) >> (shift+2) ] >> (sliding+shiftDet)
2240  we must satisfy:
2241  [ (Et_sat/(xtal_LSB * gainRatio * calibCoeff * sin(theta)) * mult) >> (shift+2) ] >> (sliding+shiftDet) = 1024
2242  that is:
2243  mult = 1024/Et_sat * xtal_LSB * gainRatio * calibCoeff * sin(theta) * 2^-(sliding+shiftDet+2) * 2^-shift
2244  mult = factor * 2^-shift
2245  */
2246 
2247  // case barrel:
2248  int shiftDet = 2; //fixed, due to FE FENIX TCP format
2249  double ratio = xtal_LSB_EB_ / Et_sat_EB_;
2250  // case endcap:
2251  if (subdet == "EE") {
2252  shiftDet = 2; //applied in TCC-EE and not in FE FENIX TCP... This parameters is setable in the TCC-EE
2253  //shiftDet = 0 ; //was like this before with FE bug
2255  }
2256 
2257  //modif-alex-30/01/2012
2258  //std::cout << "calibCoeff="<<calibCoeff<<endl;
2259 
2260  double factor = 1024 * ratio * gainRatio * calibCoeff * sin(theta) * (1 << (sliding_ + shiftDet + 2));
2261  // Let's try first with shift = 0 (trivial solution)
2262  mult = (int)(factor + 0.5);
2263  for (shift = 0; shift < 15; shift++) {
2264  if (mult >= 128 && mult < 256)
2265  return true;
2266  factor *= 2;
2267  mult = (int)(factor + 0.5);
2268  }
2269  edm::LogError("TopInfo") << "too bad we did not manage to calculate the factor for calib=" << calibCoeff << "\n";
2270  return false;
2271 }

References Et_sat_EB_, Et_sat_EE_, DQMScaleToClient_cfi::factor, createfilelist::int, VarParsing::mult, particleFlowDisplacedVertex_cfi::ratio, edm::shift, funct::sin(), sliding_, theta(), xtal_LSB_EB_, and xtal_LSB_EE_.

Referenced by analyze().

◆ computeLUT()

void EcalTPGParamBuilder::computeLUT ( int *  lut,
std::string  det = "EB" 
)
private

Definition at line 2504 of file EcalTPGParamBuilder.cc.

2504  {
2505  double Et_sat = Et_sat_EB_;
2506  double LUT_threshold = LUT_threshold_EB_;
2507  double LUT_stochastic = LUT_stochastic_EB_;
2508  double LUT_noise = LUT_noise_EB_;
2509  double LUT_constant = LUT_constant_EB_;
2510  double TTF_lowThreshold = TTF_lowThreshold_EB_;
2511  double TTF_highThreshold = TTF_highThreshold_EB_;
2512  if (det == "EE") {
2513  Et_sat = Et_sat_EE_;
2514  LUT_threshold = LUT_threshold_EE_;
2515  LUT_stochastic = LUT_stochastic_EE_;
2516  LUT_noise = LUT_noise_EE_;
2517  LUT_constant = LUT_constant_EE_;
2518  TTF_lowThreshold = TTF_lowThreshold_EE_;
2519  TTF_highThreshold = TTF_highThreshold_EE_;
2520  }
2521 
2522  // initialisation with identity
2523  for (int i = 0; i < 1024; i++) {
2524  lut[i] = i;
2525  if (lut[i] > 0xff)
2526  lut[i] = 0xff;
2527  }
2528 
2529  // case linear LUT
2530  if (LUT_option_ == "Linear") {
2531  int mylut = 0;
2532  for (int i = 0; i < 1024; i++) {
2533  lut[i] = mylut;
2534  if ((i + 1) % 4 == 0)
2535  mylut++;
2536  //if ((i+1)%8 == 0 ) mylut++ ;//modif-alex 16/12/2010 LSB==500MeV ONLY USED FOR BEAMV4 key
2537  }
2538  }
2539 
2540  // case LUT following Ecal resolution
2541  if (LUT_option_ == "EcalResolution") {
2542  TF1* func = new TF1("func", oneOverEtResolEt, 0., Et_sat, 3);
2543  func->SetParameters(LUT_stochastic, LUT_noise, LUT_constant);
2544  double norm = func->Integral(0., Et_sat);
2545  for (int i = 0; i < 1024; i++) {
2546  double Et = i * Et_sat / 1024.;
2547  lut[i] = int(0xff * func->Integral(0., Et) / norm + 0.5);
2548  }
2549  }
2550 
2551  // Now, add TTF thresholds to LUT and apply LUT threshold if needed
2552  for (int j = 0; j < 1024; j++) {
2553  double Et_GeV = Et_sat / 1024 * (j + 0.5);
2554  if (Et_GeV <= LUT_threshold)
2555  lut[j] = 0; // LUT threshold
2556  int ttf = 0x0;
2557  if (Et_GeV >= TTF_highThreshold)
2558  ttf = 3;
2559  if (Et_GeV >= TTF_lowThreshold && Et_GeV < TTF_highThreshold)
2560  ttf = 1;
2561  ttf = ttf << 8;
2562  lut[j] += ttf;
2563  }
2564 }

References Et_sat_EB_, Et_sat_EE_, TrackCollections2monitor_cff::func, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, LUT_constant_EB_, LUT_constant_EE_, LUT_noise_EB_, LUT_noise_EE_, LUT_option_, LUT_stochastic_EB_, LUT_stochastic_EE_, LUT_threshold_EB_, LUT_threshold_EE_, oneOverEtResolEt(), TTF_highThreshold_EB_, TTF_highThreshold_EE_, TTF_lowThreshold_EB_, and TTF_lowThreshold_EE_.

Referenced by analyze().

◆ computeWeights()

std::vector< unsigned int > EcalTPGParamBuilder::computeWeights ( EcalShapeBase shape,
TH1F *  histo 
)
private

Definition at line 2385 of file EcalTPGParamBuilder.cc.

2385  {
2386  std::ostringstream ss;
2387  ss << "Computing Weights...\n";
2388  double timeMax = shape.timeOfMax() - shape.timeOfThr(); // timeMax w.r.t begining of pulse
2389  double max = shape(timeMax);
2390 
2391  double sumf = 0.;
2392  double sumf2 = 0.;
2393  for (unsigned int sample = 0; sample < nSample_; sample++) {
2394  double time = timeMax - ((double)sampleMax_ - (double)sample) * 25.;
2396  sumf += shape(time) / max;
2397  sumf2 += shape(time) / max * shape(time) / max;
2398  for (int subtime = 0; subtime < 25; subtime++)
2399  histo->Fill(float(sample * 25. + subtime) / 25., shape(time + subtime));
2400  }
2401  double lambda = 1. / (sumf2 - sumf * sumf / nSample_);
2402  double gamma = -lambda * sumf / nSample_;
2403  double* weight = new double[nSample_];
2404  for (unsigned int sample = 0; sample < nSample_; sample++) {
2405  double time = timeMax - ((double)sampleMax_ - (double)sample) * 25.;
2407  weight[sample] = lambda * shape(time) / max + gamma;
2408  }
2409 
2410  int* iweight = new int[nSample_];
2411  for (unsigned int sample = 0; sample < nSample_; sample++)
2413 
2414  // Let's check:
2415  int isumw = 0;
2416  for (unsigned int sample = 0; sample < nSample_; sample++)
2417  isumw += iweight[sample];
2418  unsigned int imax = (unsigned int)(pow(2., int(complement2_)) - 1);
2419  isumw = (isumw & imax);
2420 
2421  double ampl = 0.;
2422  double sumw = 0.;
2423  for (unsigned int sample = 0; sample < nSample_; sample++) {
2424  double time = timeMax - ((double)sampleMax_ - (double)sample) * 25.;
2426  ampl += weight[sample] * shape(time);
2427  sumw += weight[sample];
2428  ss << "weight=" << weight[sample] << " shape=" << shape(time) << "\n";
2429  }
2430  ss << "Weights: sum=" << isumw << " in float =" << uncodeWeight(isumw, complement2_) << " sum of floats =" << sumw
2431  << "\n";
2432  ss << "Weights: sum (weight*shape) = " << ampl << "\n";
2433 
2434  // Let's correct for bias if any
2436  int count = 0;
2437  while (isumw != 0 && count < 10) {
2438  double min = 99.;
2439  unsigned int index = 0;
2440  if ((isumw & (1 << (complement2_ - 1))) != 0) {
2441  // add 1:
2442  ss << "Correcting for bias: adding 1\n";
2443  for (unsigned int sample = 0; sample < nSample_; sample++) {
2444  int new_iweight = iweight[sample] + 1;
2445  double new_weight = uncodeWeight(new_iweight, complement2_);
2446  if (fabs(new_weight - weight[sample]) < min) {
2447  min = fabs(new_weight - weight[sample]);
2448  index = sample;
2449  }
2450  }
2451  iweight[index]++;
2452  } else {
2453  // Sub 1:
2454  ss << "Correcting for bias: subtracting 1\n";
2455  for (unsigned int sample = 0; sample < nSample_; sample++) {
2456  int new_iweight = iweight[sample] - 1;
2457  double new_weight = uncodeWeight(new_iweight, complement2_);
2458  if (fabs(new_weight - weight[sample]) < min) {
2459  min = fabs(new_weight - weight[sample]);
2460  index = sample;
2461  }
2462  }
2463  iweight[index]--;
2464  }
2465  isumw = 0;
2466  for (unsigned int sample = 0; sample < nSample_; sample++)
2467  isumw += iweight[sample];
2468  imax = (unsigned int)(pow(2., int(complement2_)) - 1);
2469  isumw = (isumw & imax);
2470  ss << "Correcting weight number: " << index << " sum weights = " << isumw << "\n";
2471  count++;
2472  }
2473  }
2474 
2475  // let's check again
2476  isumw = 0;
2477  for (unsigned int sample = 0; sample < nSample_; sample++)
2478  isumw += iweight[sample];
2479  imax = (unsigned int)(pow(2., int(complement2_)) - 1);
2480  isumw = (isumw & imax);
2481  ampl = 0.;
2482  for (unsigned int sample = 0; sample < nSample_; sample++) {
2483  double time = timeMax - ((double)sampleMax_ - (double)sample) * 25.;
2485  double new_weight = uncodeWeight(iweight[sample], complement2_);
2486  sumw += uncodeWeight(iweight[sample], complement2_);
2487  ampl += new_weight * shape(time);
2488  ss << "weight unbiased after integer conversion=" << new_weight << " shape=" << shape(time) << "\n";
2489  }
2490  ss << "Weights: sum=" << isumw << " in float =" << uncodeWeight(isumw, complement2_) << " sum of floats =" << sumw
2491  << "\n";
2492  ss << "Weights: sum (weight*shape) = " << ampl << "\n";
2493  edm::LogInfo("TopInfo") << ss.str();
2494 
2495  std::vector<unsigned int> theWeights;
2496  for (unsigned int sample = 0; sample < nSample_; sample++)
2497  theWeights.push_back(iweight[sample]);
2498 
2499  delete[] weight;
2500  delete[] iweight;
2501  return theWeights;
2502 }

References complement2_, submitPVResolutionJobs::count, CustomPhysics_cfi::gamma, timingPdfMaker::histo, createfilelist::int, SiStripPI::max, min(), nSample_, funct::pow(), simplePhotonAnalyzer_cfi::sample, sampleMax_, contentValuesCheck::ss, protons_cff::time, HLT_FULL_cff::timeMax, EcalShapeBase::timeOfMax(), EcalShapeBase::timeOfThr(), uncodeWeight(), mps_merge::weight, weight_timeShift_, and weight_unbias_recovery_.

Referenced by analyze().

◆ create_header()

void EcalTPGParamBuilder::create_header ( )
private

Definition at line 2273 of file EcalTPGParamBuilder.cc.

2273  {
2274  if (!writeToFiles_)
2275  return;
2276  (*out_file_) << "COMMENT put your comments here" << std::endl;
2277 
2278  (*out_file_) << "COMMENT =================================" << std::endl;
2279  (*out_file_) << "COMMENT physics EB structure" << std::endl;
2280  (*out_file_) << "COMMENT" << std::endl;
2281  (*out_file_) << "COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)" << std::endl;
2282  (*out_file_) << "COMMENT FG_lowThreshold (GeV), FG_highThreshold (GeV), FG_lowRatio, FG_highRatio" << std::endl;
2283  //(*out_file_) <<"COMMENT SFGVB_SpikeKillingThreshold (GeV)"<<std::endl ; //modif-alex-02/02/2011
2284  (*out_file_) << "COMMENT =================================" << std::endl;
2285  (*out_file_) << "COMMENT" << std::endl;
2286 
2287  (*out_file_) << "COMMENT =================================" << std::endl;
2288  (*out_file_) << "COMMENT physics EE structure" << std::endl;
2289  (*out_file_) << "COMMENT" << std::endl;
2290  (*out_file_) << "COMMENT EtSaturation (GeV), ttf_threshold_Low (GeV), ttf_threshold_High (GeV)" << std::endl;
2291  (*out_file_) << "COMMENT FG_Threshold (GeV), dummy, dummy, dummy" << std::endl;
2292  (*out_file_) << "COMMENT =================================" << std::endl;
2293  (*out_file_) << "COMMENT" << std::endl;
2294 
2295  (*out_file_) << "COMMENT =================================" << std::endl;
2296  (*out_file_) << "COMMENT crystal structure (same for EB and EE)" << std::endl;
2297  (*out_file_) << "COMMENT" << std::endl;
2298  (*out_file_) << "COMMENT ped, mult, shift [gain12]" << std::endl;
2299  (*out_file_) << "COMMENT ped, mult, shift [gain6]" << std::endl;
2300  (*out_file_) << "COMMENT ped, mult, shift [gain1]" << std::endl;
2301  (*out_file_) << "COMMENT =================================" << std::endl;
2302  (*out_file_) << "COMMENT" << std::endl;
2303 
2304  (*out_file_) << "COMMENT =================================" << std::endl;
2305  (*out_file_) << "COMMENT strip EB structure" << std::endl;
2306  (*out_file_) << "COMMENT" << std::endl;
2307  (*out_file_) << "COMMENT sliding_window" << std::endl;
2308  (*out_file_) << "COMMENT weightGroupId" << std::endl;
2309  (*out_file_) << "COMMENT threshold_sfg lut_sfg" << std::endl;
2310  (*out_file_) << "COMMENT =================================" << std::endl;
2311  (*out_file_) << "COMMENT" << std::endl;
2312 
2313  (*out_file_) << "COMMENT =================================" << std::endl;
2314  (*out_file_) << "COMMENT strip EE structure" << std::endl;
2315  (*out_file_) << "COMMENT" << std::endl;
2316  (*out_file_) << "COMMENT sliding_window" << std::endl;
2317  (*out_file_) << "COMMENT weightGroupId" << std::endl;
2318  (*out_file_) << "COMMENT threshold_fg lut_fg" << std::endl;
2319  (*out_file_) << "COMMENT =================================" << std::endl;
2320  (*out_file_) << "COMMENT" << std::endl;
2321 
2322  (*out_file_) << "COMMENT =================================" << std::endl;
2323  (*out_file_) << "COMMENT tower EB structure" << std::endl;
2324  (*out_file_) << "COMMENT" << std::endl;
2325  (*out_file_) << "COMMENT LUTGroupId" << std::endl;
2326  (*out_file_) << "COMMENT FgGroupId" << std::endl;
2327  (*out_file_) << "COMMENT spike_killing_threshold" << std::endl; //modif alex
2328  (*out_file_) << "COMMENT =================================" << std::endl;
2329  (*out_file_) << "COMMENT" << std::endl;
2330 
2331  (*out_file_) << "COMMENT =================================" << std::endl;
2332  (*out_file_) << "COMMENT tower EE structure" << std::endl;
2333  (*out_file_) << "COMMENT" << std::endl;
2334  (*out_file_) << "COMMENT LUTGroupId" << std::endl;
2335  (*out_file_) << "COMMENT tower_lut_fg" << std::endl;
2336  (*out_file_) << "COMMENT =================================" << std::endl;
2337  (*out_file_) << "COMMENT" << std::endl;
2338 
2339  (*out_file_) << "COMMENT =================================" << std::endl;
2340  (*out_file_) << "COMMENT Weight structure" << std::endl;
2341  (*out_file_) << "COMMENT" << std::endl;
2342  (*out_file_) << "COMMENT weightGroupId" << std::endl;
2343  (*out_file_) << "COMMENT w0, w1, w2, w3, w4" << std::endl;
2344  (*out_file_) << "COMMENT =================================" << std::endl;
2345  (*out_file_) << "COMMENT" << std::endl;
2346 
2347  (*out_file_) << "COMMENT =================================" << std::endl;
2348  (*out_file_) << "COMMENT lut structure" << std::endl;
2349  (*out_file_) << "COMMENT" << std::endl;
2350  (*out_file_) << "COMMENT LUTGroupId" << std::endl;
2351  (*out_file_) << "COMMENT LUT[1-1024]" << std::endl;
2352  (*out_file_) << "COMMENT =================================" << std::endl;
2353  (*out_file_) << "COMMENT" << std::endl;
2354 
2355  (*out_file_) << "COMMENT =================================" << std::endl;
2356  (*out_file_) << "COMMENT fg EB structure" << std::endl;
2357  (*out_file_) << "COMMENT" << std::endl;
2358  (*out_file_) << "COMMENT FgGroupId" << std::endl;
2359  (*out_file_) << "COMMENT el, eh, tl, th, lut_fg" << std::endl;
2360  (*out_file_) << "COMMENT =================================" << std::endl;
2361  (*out_file_) << "COMMENT" << std::endl;
2362 
2363  (*out_file_) << std::endl;
2364 }

References writeToFiles_.

Referenced by beginJob().

◆ getCoeff() [1/4]

void EcalTPGParamBuilder::getCoeff ( coeffStruc coeff,
const EcalGainRatioMap gainMap,
uint  rawId 
)
private

Referenced by analyze().

◆ getCoeff() [2/4]

void EcalTPGParamBuilder::getCoeff ( coeffStruc coeff,
const EcalIntercalibConstantMap calibMap,
const EcalLaserAlphaMap laserAlphaMap,
uint  rawId,
std::string &  ss 
)
private

Definition at line 2566 of file EcalTPGParamBuilder.cc.

2570  {
2571  // get current intercalibration coeff
2572  coeff.calibCoeff_ = 1.;
2573  if (!useInterCalibration_)
2574  return;
2575  EcalIntercalibConstantMap::const_iterator icalit = calibMap.find(rawId);
2576 
2577  //modif-alex-30/01/2012
2578  std::map<int, double>::const_iterator itCorr = Transparency_Correction_.find(rawId);
2579  double icorr = 1.0;
2580  double alpha_factor = 1.0;
2581 
2582  if (useTransparencyCorr_) {
2583  icorr = itCorr->second;
2584  if (itCorr != Transparency_Correction_.end()) {
2585  stringstream ss;
2586  ss << rawId;
2587  stringstream ss1;
2588  ss1 << icorr;
2589  stringstream ss2;
2590  ss2 << (*icalit);
2591  st = "Transparency correction found for xtal " + ss.str() + " corr=" + ss1.str() + " intercalib=" + ss2.str() +
2592  "\n";
2593  } else
2594  edm::LogError("TopInfo") << "ERROR = Transparency correction not found for xtal " << rawId << "\n";
2595 
2596  //modif-alex-27-july-2015
2597  DetId ECALdetid(rawId);
2598  // ss << "DETID=" << ECALdetid.subdetId() << "\n";
2599  stringstream ss;
2600  ss << ECALdetid.subdetId();
2601  st += "DETID=" + ss.str() + "\n";
2602  if (ECALdetid.subdetId() == 1) { //ECAL BARREL
2603  EBDetId barrel_detid(rawId);
2604  EcalLaserAlphaMap::const_iterator italpha = laserAlphaMap.find(barrel_detid);
2605  if (italpha != laserAlphaMap.end())
2606  alpha_factor = (*italpha);
2607  else
2608  edm::LogError("TopInfo") << "ERROR:LaserAlphe parameter note found!!"
2609  << "\n";
2610  }
2611  if (ECALdetid.subdetId() == 2) { //ECAL ENDCAP
2612  EEDetId endcap_detid(rawId);
2613  EcalLaserAlphaMap::const_iterator italpha = laserAlphaMap.find(endcap_detid);
2614  if (italpha != laserAlphaMap.end())
2615  alpha_factor = (*italpha);
2616  else
2617  edm::LogError("TopInfo") << "ERROR:LaserAlphe parameter note found!!"
2618  << "\n";
2619  }
2620 
2621  } //transparency corrections applied
2622 
2623  //if( icalit != calibMap.end() ) coeff.calibCoeff_ = (*icalit) ;
2624  //if( icalit != calibMap.end() ) coeff.calibCoeff_ = (*icalit)/icorr; //modif-alex-30/01/2010 tansparency corrections
2625  // ss << "rawId " << (*icalit) << " " << icorr << " " << alpha_factor << "\n";
2626  stringstream ss;
2627  ss << (*icalit);
2628  stringstream ss1;
2629  ss1 << icorr;
2630  stringstream ss2;
2631  ss2 << alpha_factor;
2632  st += "rawId " + ss.str() + " " + ss1.str() + " " + ss2.str() + "\n";
2633  if (icalit != calibMap.end())
2634  coeff.calibCoeff_ =
2635  (*icalit) /
2636  std::pow(icorr, alpha_factor); //modif-alex-27/07/2015 tansparency corrections with alpha parameters
2637 
2638  else
2639  edm::LogError("TopInfo") << "getCoeff: " << rawId << " not found in EcalIntercalibConstantMap"
2640  << "\n";
2641 }

References coeffStruc::calibCoeff_, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), funct::pow(), contentValuesCheck::ss, DetId::subdetId(), Transparency_Correction_, useInterCalibration_, and useTransparencyCorr_.

◆ getCoeff() [3/4]

void EcalTPGParamBuilder::getCoeff ( coeffStruc coeff,
const EcalPedestalsMap pedMap,
uint  rawId 
)
private

◆ getCoeff() [4/4]

void EcalTPGParamBuilder::getCoeff ( coeffStruc coeff,
const std::map< EcalLogicID, MonPedestalsDat > &  pedMap,
const EcalLogicID logicId 
)
private

Definition at line 2681 of file EcalTPGParamBuilder.cc.

2683  {
2684  // get current pedestal
2685  coeff.pedestals_[0] = 0;
2686  coeff.pedestals_[1] = 0;
2687  coeff.pedestals_[2] = 0;
2688 
2689  map<EcalLogicID, MonPedestalsDat>::const_iterator it = pedMap.find(logicId);
2690  if (it != pedMap.end()) {
2691  MonPedestalsDat ped = it->second;
2692  coeff.pedestals_[0] = int(ped.getPedMeanG12() + 0.5);
2693  coeff.pedestals_[1] = int(ped.getPedMeanG6() + 0.5);
2694  coeff.pedestals_[2] = int(ped.getPedMeanG1() + 0.5);
2695  } else
2696  edm::LogError("TopInfo") << "getCoeff: " << logicId.getID1() << ", " << logicId.getID2() << ", " << logicId.getID3()
2697  << " not found in map<EcalLogicID, MonPedestalsDat\n";
2698 }

References EcalLogicID::getID1(), EcalLogicID::getID2(), EcalLogicID::getID3(), MonPedestalsDat::getPedMeanG1(), MonPedestalsDat::getPedMeanG12(), MonPedestalsDat::getPedMeanG6(), createfilelist::int, and coeffStruc::pedestals_.

◆ getCrate()

std::pair< std::string, int > EcalTPGParamBuilder::getCrate ( int  tcc)
private

Definition at line 2826 of file EcalTPGParamBuilder.cc.

2826  {
2827  std::stringstream crate;
2828  std::string pos;
2829  int slot = 0;
2830 
2831  crate << "S2D";
2832  if (tcc >= 40 && tcc <= 42) {
2833  crate << "02d";
2834  slot = 5 + (tcc - 40) * 6;
2835  }
2836  if (tcc >= 43 && tcc <= 45) {
2837  crate << "03d";
2838  slot = 5 + (tcc - 43) * 6;
2839  }
2840  if (tcc >= 37 && tcc <= 39) {
2841  crate << "04d";
2842  slot = 5 + (tcc - 37) * 6;
2843  }
2844  if (tcc >= 52 && tcc <= 54) {
2845  crate << "06d";
2846  slot = 5 + (tcc - 52) * 6;
2847  }
2848  if (tcc >= 46 && tcc <= 48) {
2849  crate << "07d";
2850  slot = 5 + (tcc - 46) * 6;
2851  }
2852  if (tcc >= 49 && tcc <= 51) {
2853  crate << "08d";
2854  slot = 5 + (tcc - 49) * 6;
2855  }
2856  if (tcc >= 58 && tcc <= 60) {
2857  crate << "02h";
2858  slot = 5 + (tcc - 58) * 6;
2859  }
2860  if (tcc >= 61 && tcc <= 63) {
2861  crate << "03h";
2862  slot = 5 + (tcc - 61) * 6;
2863  }
2864  if (tcc >= 55 && tcc <= 57) {
2865  crate << "04h";
2866  slot = 5 + (tcc - 55) * 6;
2867  }
2868  if (tcc >= 70 && tcc <= 72) {
2869  crate << "06h";
2870  slot = 5 + (tcc - 70) * 6;
2871  }
2872  if (tcc >= 64 && tcc <= 66) {
2873  crate << "07h";
2874  slot = 5 + (tcc - 64) * 6;
2875  }
2876  if (tcc >= 67 && tcc <= 69) {
2877  crate << "08h";
2878  slot = 5 + (tcc - 67) * 6;
2879  }
2880 
2881  if (tcc >= 76 && tcc <= 81) {
2882  crate << "02l";
2883  if (tcc % 2 == 0)
2884  slot = 2 + (tcc - 76) * 3;
2885  else
2886  slot = 4 + (tcc - 77) * 3;
2887  }
2888  if (tcc >= 94 && tcc <= 99) {
2889  crate << "02l";
2890  if (tcc % 2 == 0)
2891  slot = 3 + (tcc - 94) * 3;
2892  else
2893  slot = 5 + (tcc - 95) * 3;
2894  }
2895 
2896  if (tcc >= 22 && tcc <= 27) {
2897  crate << "03l";
2898  if (tcc % 2 == 0)
2899  slot = 2 + (tcc - 22) * 3;
2900  else
2901  slot = 4 + (tcc - 23) * 3;
2902  }
2903  if (tcc >= 4 && tcc <= 9) {
2904  crate << "03l";
2905  if (tcc % 2 == 0)
2906  slot = 3 + (tcc - 4) * 3;
2907  else
2908  slot = 5 + (tcc - 5) * 3;
2909  }
2910 
2911  if (tcc >= 82 && tcc <= 87) {
2912  crate << "07l";
2913  if (tcc % 2 == 0)
2914  slot = 2 + (tcc - 82) * 3;
2915  else
2916  slot = 4 + (tcc - 83) * 3;
2917  }
2918  if (tcc >= 100 && tcc <= 105) {
2919  crate << "07l";
2920  if (tcc % 2 == 0)
2921  slot = 3 + (tcc - 100) * 3;
2922  else
2923  slot = 5 + (tcc - 101) * 3;
2924  }
2925 
2926  if (tcc >= 28 && tcc <= 33) {
2927  crate << "08l";
2928  if (tcc % 2 == 0)
2929  slot = 2 + (tcc - 28) * 3;
2930  else
2931  slot = 4 + (tcc - 29) * 3;
2932  }
2933  if (tcc >= 10 && tcc <= 15) {
2934  crate << "08l";
2935  if (tcc % 2 == 0)
2936  slot = 3 + (tcc - 10) * 3;
2937  else
2938  slot = 5 + (tcc - 11) * 3;
2939  }
2940 
2941  if (tcc == 34) {
2942  crate << "04l";
2943  slot = 2;
2944  }
2945  if (tcc == 16) {
2946  crate << "04l";
2947  slot = 3;
2948  }
2949  if (tcc == 35) {
2950  crate << "04l";
2951  slot = 4;
2952  }
2953  if (tcc == 17) {
2954  crate << "04l";
2955  slot = 5;
2956  }
2957  if (tcc == 36) {
2958  crate << "04l";
2959  slot = 8;
2960  }
2961  if (tcc == 18) {
2962  crate << "04l";
2963  slot = 9;
2964  }
2965  if (tcc == 19) {
2966  crate << "04l";
2967  slot = 10;
2968  }
2969  if (tcc == 1) {
2970  crate << "04l";
2971  slot = 11;
2972  }
2973  if (tcc == 20) {
2974  crate << "04l";
2975  slot = 14;
2976  }
2977  if (tcc == 2) {
2978  crate << "04l";
2979  slot = 15;
2980  }
2981  if (tcc == 21) {
2982  crate << "04l";
2983  slot = 16;
2984  }
2985  if (tcc == 3) {
2986  crate << "04l";
2987  slot = 17;
2988  }
2989 
2990  if (tcc == 88) {
2991  crate << "06l";
2992  slot = 2;
2993  }
2994  if (tcc == 106) {
2995  crate << "06l";
2996  slot = 3;
2997  }
2998  if (tcc == 89) {
2999  crate << "06l";
3000  slot = 4;
3001  }
3002  if (tcc == 107) {
3003  crate << "06l";
3004  slot = 5;
3005  }
3006  if (tcc == 90) {
3007  crate << "06l";
3008  slot = 8;
3009  }
3010  if (tcc == 108) {
3011  crate << "06l";
3012  slot = 9;
3013  }
3014  if (tcc == 73) {
3015  crate << "06l";
3016  slot = 10;
3017  }
3018  if (tcc == 91) {
3019  crate << "06l";
3020  slot = 11;
3021  }
3022  if (tcc == 74) {
3023  crate << "06l";
3024  slot = 14;
3025  }
3026  if (tcc == 92) {
3027  crate << "06l";
3028  slot = 15;
3029  }
3030  if (tcc == 75) {
3031  crate << "06l";
3032  slot = 16;
3033  }
3034  if (tcc == 93) {
3035  crate << "06l";
3036  slot = 17;
3037  }
3038 
3039  return std::pair<std::string, int>(crate.str(), slot);
3040 }

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

◆ getDet()

std::string EcalTPGParamBuilder::getDet ( int  tcc)
private

Definition at line 2788 of file EcalTPGParamBuilder.cc.

2788  {
2789  std::stringstream sdet;
2790 
2791  if (tcc > 36 && tcc < 55)
2792  sdet << "EB-" << tcc - 36;
2793  else if (tcc >= 55 && tcc < 73)
2794  sdet << "EB+" << tcc - 54;
2795  else if (tcc <= 36)
2796  sdet << "EE-";
2797  else
2798  sdet << "EE+";
2799 
2800  if (tcc <= 36 || tcc >= 73) {
2801  if (tcc >= 73)
2802  tcc -= 72;
2803  if (tcc == 1 || tcc == 18 || tcc == 19 || tcc == 36)
2804  sdet << 7;
2805  else if (tcc == 2 || tcc == 3 || tcc == 20 || tcc == 21)
2806  sdet << 8;
2807  else if (tcc == 4 || tcc == 5 || tcc == 22 || tcc == 23)
2808  sdet << 9;
2809  else if (tcc == 6 || tcc == 7 || tcc == 24 || tcc == 25)
2810  sdet << 1;
2811  else if (tcc == 8 || tcc == 9 || tcc == 26 || tcc == 27)
2812  sdet << 2;
2813  else if (tcc == 10 || tcc == 11 || tcc == 28 || tcc == 29)
2814  sdet << 3;
2815  else if (tcc == 12 || tcc == 13 || tcc == 30 || tcc == 31)
2816  sdet << 4;
2817  else if (tcc == 14 || tcc == 15 || tcc == 32 || tcc == 33)
2818  sdet << 5;
2819  else if (tcc == 16 || tcc == 17 || tcc == 34 || tcc == 35)
2820  sdet << 6;
2821  }
2822 
2823  return sdet.str();
2824 }

Referenced by analyze().

◆ getEtaSlice()

int EcalTPGParamBuilder::getEtaSlice ( int  tccId,
int  towerInTCC 
)
private

Definition at line 373 of file EcalTPGParamBuilder.cc.

373  {
374  int etaSlice = (towerInTCC - 1) / 4 + 1;
375  // barrel
376  if (tccId > 36 && tccId < 73)
377  return etaSlice;
378  //endcap
379  else {
380  if (tccId >= 1 && tccId <= 18)
381  etaSlice += 21; // inner -
382  else if (tccId >= 19 && tccId <= 36)
383  etaSlice += 17; // outer -
384  else if (tccId >= 91 && tccId <= 108)
385  etaSlice += 21; // inner +
386  else if (tccId >= 73 && tccId <= 90)
387  etaSlice += 17; // outer +
388  }
389  return etaSlice;
390 }

References ecaldqm::tccId().

◆ getGCTRegionEta()

int EcalTPGParamBuilder::getGCTRegionEta ( int  tteta)
private

Definition at line 2779 of file EcalTPGParamBuilder.cc.

2779  {
2780  int gcteta = 0;
2781  if (tteta > 0)
2782  gcteta = (tteta - 1) / 4 + 11;
2783  else if (tteta < 0)
2784  gcteta = (tteta + 1) / 4 + 10;
2785  return gcteta;
2786 }

Referenced by analyze().

◆ getGCTRegionPhi()

int EcalTPGParamBuilder::getGCTRegionPhi ( int  ttphi)
private

Definition at line 2769 of file EcalTPGParamBuilder.cc.

2769  {
2770  int gctphi = 0;
2771  gctphi = (ttphi + 1) / 4;
2772  if (ttphi <= 2)
2773  gctphi = 0;
2774  if (ttphi >= 71)
2775  gctphi = 0;
2776  return gctphi;
2777 }

Referenced by analyze().

◆ realignBaseline()

bool EcalTPGParamBuilder::realignBaseline ( linStruc lin,
float  forceBase12 
)
private

Definition at line 2744 of file EcalTPGParamBuilder.cc.

2744  {
2745  bool ok(true);
2746  float base[3] = {forceBase12, float(lin.pedestal_[1]), float(lin.pedestal_[2])};
2747  for (int i = 1; i < 3; i++) {
2748  if (lin.mult_[i] > 0) {
2749  base[i] = float(lin.pedestal_[i]) - float(lin.mult_[0]) / float(lin.mult_[i]) *
2750  pow(2., -(lin.shift_[0] - lin.shift_[i])) * (lin.pedestal_[0] - base[0]);
2751  } else
2752  base[i] = 0;
2753  }
2754 
2755  for (int i = 0; i < 3; i++) {
2756  lin.pedestal_[i] = base[i];
2757  //cout<<lin.pedestal_[i]<<" "<<base[i]<<endl ;
2758  if (base[i] < 0 || lin.pedestal_[i] > 1000) {
2759  edm::LogError("TopInfo") << "WARNING: base= " << base[i] << ", " << lin.pedestal_[i] << " for gainId[0-2]=" << i
2760  << " ==> forcing at 0"
2761  << "\n";
2762  lin.pedestal_[i] = 0;
2763  ok = false;
2764  }
2765  }
2766  return ok;
2767 }

References newFWLiteAna::base, dqmMemoryStats::float, mps_fire::i, linStruc::mult_, convertSQLiteXML::ok, linStruc::pedestal_, funct::pow(), and linStruc::shift_.

Referenced by analyze().

◆ uncodeWeight() [1/2]

int EcalTPGParamBuilder::uncodeWeight ( double  weight,
int  complement2 = 7 
)
private

Definition at line 2366 of file EcalTPGParamBuilder.cc.

2366  {
2367  int iweight;
2368  unsigned int max = (unsigned int)(pow(2., complement2) - 1);
2369  if (weight > 0)
2370  iweight = int((1 << 6) * weight + 0.5); // +0.5 for rounding pb
2371  else
2372  iweight = max - int(-weight * (1 << 6) + 0.5) + 1;
2373  iweight = iweight & max;
2374  return iweight;
2375 }

References createfilelist::int, SiStripPI::max, and funct::pow().

Referenced by computeWeights().

◆ uncodeWeight() [2/2]

double EcalTPGParamBuilder::uncodeWeight ( int  iweight,
int  complement2 = 7 
)
private

Definition at line 2377 of file EcalTPGParamBuilder.cc.

2377  {
2378  double weight = double(iweight) / pow(2., 6.);
2379  // test if negative weight:
2380  if ((iweight & (1 << (complement2 - 1))) != 0)
2381  weight = (double(iweight) - pow(2., complement2)) / pow(2., 6.);
2382  return weight;
2383 }

References funct::pow(), and mps_merge::weight.

Member Data Documentation

◆ bst_conf_id_

int EcalTPGParamBuilder::bst_conf_id_
private

Definition at line 183 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ btt_conf_id_

int EcalTPGParamBuilder::btt_conf_id_
private

Definition at line 182 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ bxt_conf_id_

int EcalTPGParamBuilder::bxt_conf_id_
private

Definition at line 181 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ complement2_

unsigned int EcalTPGParamBuilder::complement2_
private

Definition at line 131 of file EcalTPGParamBuilder.h.

Referenced by computeWeights().

◆ db_

EcalTPGDBApp* EcalTPGParamBuilder::db_
private

Definition at line 167 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ DBEE_

bool EcalTPGParamBuilder::DBEE_
private

Definition at line 171 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ DBrunNb_

unsigned int EcalTPGParamBuilder::DBrunNb_
private

Definition at line 170 of file EcalTPGParamBuilder.h.

◆ del_conf_id_

int EcalTPGParamBuilder::del_conf_id_
private

Definition at line 180 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ delays_EB_

std::map<int, std::vector<int> > EcalTPGParamBuilder::delays_EB_
private

Definition at line 157 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ delays_EE_

std::map<int, std::vector<int> > EcalTPGParamBuilder::delays_EE_
private

Definition at line 159 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ ecalADCToGeVConstantToken_

edm::ESGetToken<EcalADCToGeVConstant, EcalADCToGeVConstantRcd> EcalTPGParamBuilder::ecalADCToGeVConstantToken_
private

Definition at line 121 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ecalGainRatiosToken_

edm::ESGetToken<EcalGainRatios, EcalGainRatiosRcd> EcalTPGParamBuilder::ecalGainRatiosToken_
private

Definition at line 120 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ecalIntercalibConstantsToken_

edm::ESGetToken<EcalIntercalibConstants, EcalIntercalibConstantsRcd> EcalTPGParamBuilder::ecalIntercalibConstantsToken_
private

Definition at line 119 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ecalLaserAlphasToken_

edm::ESGetToken<EcalLaserAlphas, EcalLaserAlphasRcd> EcalTPGParamBuilder::ecalLaserAlphasToken_
private

Definition at line 116 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ecalLaserAPDPNRatiosToken_

edm::ESGetToken<EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcd> EcalTPGParamBuilder::ecalLaserAPDPNRatiosToken_
private

Definition at line 117 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ecalmappingToken_

edm::ESGetToken<EcalElectronicsMapping, EcalMappingRcd> EcalTPGParamBuilder::ecalmappingToken_
private

Definition at line 113 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ecalPedestalsToken_

edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> EcalTPGParamBuilder::ecalPedestalsToken_
private

Definition at line 118 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ Et_sat_EB_

double EcalTPGParamBuilder::Et_sat_EB_
private

◆ Et_sat_EE_

double EcalTPGParamBuilder::Et_sat_EE_
private

◆ eTTmap_

const EcalTrigTowerConstituentsMap* EcalTPGParamBuilder::eTTmap_
private

Definition at line 112 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ eTTmapToken_

edm::ESGetToken<EcalTrigTowerConstituentsMap, IdealGeometryRecord> EcalTPGParamBuilder::eTTmapToken_
private

Definition at line 111 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ FG_highRatio_EB_

double EcalTPGParamBuilder::FG_highRatio_EB_
private

◆ FG_highThreshold_EB_

double EcalTPGParamBuilder::FG_highThreshold_EB_
private

◆ FG_lowRatio_EB_

double EcalTPGParamBuilder::FG_lowRatio_EB_
private

◆ FG_lowThreshold_EB_

double EcalTPGParamBuilder::FG_lowThreshold_EB_
private

◆ FG_lut_EB_

unsigned int EcalTPGParamBuilder::FG_lut_EB_
private

Definition at line 139 of file EcalTPGParamBuilder.h.

Referenced by computeFineGrainEBParameters(), and EcalTPGParamBuilder().

◆ FG_lut_strip_EE_

unsigned int EcalTPGParamBuilder::FG_lut_strip_EE_
private

Definition at line 141 of file EcalTPGParamBuilder.h.

Referenced by computeFineGrainEEParameters(), and EcalTPGParamBuilder().

◆ FG_lut_tower_EE_

unsigned int EcalTPGParamBuilder::FG_lut_tower_EE_
private

Definition at line 141 of file EcalTPGParamBuilder.h.

Referenced by computeFineGrainEEParameters(), and EcalTPGParamBuilder().

◆ FG_Threshold_EE_

double EcalTPGParamBuilder::FG_Threshold_EE_
private

◆ fgr_conf_id_

int EcalTPGParamBuilder::fgr_conf_id_
private

Definition at line 176 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ forcedPedestalValue_

int EcalTPGParamBuilder::forcedPedestalValue_
private

Definition at line 142 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ forceEtaSlice_

bool EcalTPGParamBuilder::forceEtaSlice_
private

Definition at line 143 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ geomFile_

std::ofstream* EcalTPGParamBuilder::geomFile_
private

Definition at line 166 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ H2_

bool EcalTPGParamBuilder::H2_
private

Definition at line 146 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ lin_conf_id_

int EcalTPGParamBuilder::lin_conf_id_
private

Definition at line 174 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ lut_conf_id_

int EcalTPGParamBuilder::lut_conf_id_
private

Definition at line 175 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ LUT_constant_EB_

double EcalTPGParamBuilder::LUT_constant_EB_
private

Definition at line 134 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ LUT_constant_EE_

double EcalTPGParamBuilder::LUT_constant_EE_
private

Definition at line 135 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ LUT_noise_EB_

double EcalTPGParamBuilder::LUT_noise_EB_
private

Definition at line 134 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ LUT_noise_EE_

double EcalTPGParamBuilder::LUT_noise_EE_
private

Definition at line 135 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ LUT_option_

std::string EcalTPGParamBuilder::LUT_option_
private

Definition at line 132 of file EcalTPGParamBuilder.h.

Referenced by analyze(), computeLUT(), and EcalTPGParamBuilder().

◆ LUT_stochastic_EB_

double EcalTPGParamBuilder::LUT_stochastic_EB_
private

Definition at line 134 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ LUT_stochastic_EE_

double EcalTPGParamBuilder::LUT_stochastic_EE_
private

Definition at line 135 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ LUT_threshold_EB_

double EcalTPGParamBuilder::LUT_threshold_EB_
private

Definition at line 133 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ LUT_threshold_EE_

double EcalTPGParamBuilder::LUT_threshold_EE_
private

Definition at line 133 of file EcalTPGParamBuilder.h.

Referenced by computeLUT(), and EcalTPGParamBuilder().

◆ m_write_bst

int EcalTPGParamBuilder::m_write_bst
private

Definition at line 196 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ m_write_btt

int EcalTPGParamBuilder::m_write_btt
private

Definition at line 195 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ m_write_bxt

int EcalTPGParamBuilder::m_write_bxt
private

Definition at line 194 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ m_write_del

int EcalTPGParamBuilder::m_write_del
private

Definition at line 193 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ m_write_fgr

int EcalTPGParamBuilder::m_write_fgr
private

Definition at line 190 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ m_write_lin

int EcalTPGParamBuilder::m_write_lin
private

Definition at line 187 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ m_write_lut

int EcalTPGParamBuilder::m_write_lut
private

Definition at line 188 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ m_write_ped

int EcalTPGParamBuilder::m_write_ped
private

Definition at line 186 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ m_write_sli

int EcalTPGParamBuilder::m_write_sli
private

Definition at line 191 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ m_write_spi

int EcalTPGParamBuilder::m_write_spi
private

Definition at line 192 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ m_write_wei

int EcalTPGParamBuilder::m_write_wei
private

Definition at line 189 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ nSample_

unsigned int EcalTPGParamBuilder::nSample_
private

Definition at line 130 of file EcalTPGParamBuilder.h.

Referenced by computeWeights().

◆ ntupleCrate_

Char_t EcalTPGParamBuilder::ntupleCrate_[10]
private

Definition at line 200 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ntupleDet_

Char_t EcalTPGParamBuilder::ntupleDet_[10]
private

Definition at line 199 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ ntupleInts_

Int_t* EcalTPGParamBuilder::ntupleInts_
private

Definition at line 198 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ out_file_

std::ofstream* EcalTPGParamBuilder::out_file_
private

Definition at line 165 of file EcalTPGParamBuilder.h.

Referenced by analyze(), EcalTPGParamBuilder(), and ~EcalTPGParamBuilder().

◆ ped_conf_id_

int EcalTPGParamBuilder::ped_conf_id_
private

Definition at line 173 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ pedestal_offset_

unsigned int EcalTPGParamBuilder::pedestal_offset_
private

Definition at line 144 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ phases_EB_

std::map<int, std::vector<int> > EcalTPGParamBuilder::phases_EB_
private

Definition at line 158 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ phases_EE_

std::map<int, std::vector<int> > EcalTPGParamBuilder::phases_EE_
private

Definition at line 160 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ sampleMax_

unsigned int EcalTPGParamBuilder::sampleMax_
private

Definition at line 127 of file EcalTPGParamBuilder.h.

Referenced by computeWeights(), and EcalTPGParamBuilder().

◆ SFGVB_lut_

unsigned int EcalTPGParamBuilder::SFGVB_lut_
private

Definition at line 144 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ SFGVB_SpikeKillingThreshold_

int EcalTPGParamBuilder::SFGVB_SpikeKillingThreshold_
private

Definition at line 145 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ SFGVB_Threshold_

unsigned int EcalTPGParamBuilder::SFGVB_Threshold_
private

Definition at line 144 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ sli_conf_id_

int EcalTPGParamBuilder::sli_conf_id_
private

Definition at line 177 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ sliding_

unsigned int EcalTPGParamBuilder::sliding_
private

Definition at line 126 of file EcalTPGParamBuilder.h.

Referenced by analyze(), computeLinearizerParam(), and EcalTPGParamBuilder().

◆ spi_conf_id_

int EcalTPGParamBuilder::spi_conf_id_
private

Definition at line 179 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ tag_

std::string EcalTPGParamBuilder::tag_
private

Definition at line 184 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ theBarrelGeometry_

const CaloSubdetectorGeometry* EcalTPGParamBuilder::theBarrelGeometry_
private

Definition at line 110 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ theBarrelGeometryToken_

edm::ESGetToken<CaloSubdetectorGeometry, EcalBarrelGeometryRecord> EcalTPGParamBuilder::theBarrelGeometryToken_
private

Definition at line 108 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ theEndcapGeometry_

const CaloSubdetectorGeometry* EcalTPGParamBuilder::theEndcapGeometry_
private

Definition at line 109 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ theEndcapGeometryToken_

edm::ESGetToken<CaloSubdetectorGeometry, EcalEndcapGeometryRecord> EcalTPGParamBuilder::theEndcapGeometryToken_
private

Definition at line 107 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ theMapping_

const EcalElectronicsMapping* EcalTPGParamBuilder::theMapping_
private

Definition at line 114 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ TimingDelays_EB_

std::string EcalTPGParamBuilder::TimingDelays_EB_
private

Definition at line 153 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ TimingDelays_EE_

std::string EcalTPGParamBuilder::TimingDelays_EE_
private

Definition at line 154 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ TimingPhases_EB_

std::string EcalTPGParamBuilder::TimingPhases_EB_
private

Definition at line 155 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ TimingPhases_EE_

std::string EcalTPGParamBuilder::TimingPhases_EE_
private

Definition at line 156 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder().

◆ Transparency_Corr_

std::string EcalTPGParamBuilder::Transparency_Corr_
private

Definition at line 149 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ Transparency_Correction_

std::map<int, double> EcalTPGParamBuilder::Transparency_Correction_
private

Definition at line 163 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and getCoeff().

◆ TTF_highThreshold_EB_

double EcalTPGParamBuilder::TTF_highThreshold_EB_
private

Definition at line 136 of file EcalTPGParamBuilder.h.

Referenced by analyze(), beginJob(), computeLUT(), and EcalTPGParamBuilder().

◆ TTF_highThreshold_EE_

double EcalTPGParamBuilder::TTF_highThreshold_EE_
private

Definition at line 137 of file EcalTPGParamBuilder.h.

Referenced by analyze(), beginJob(), computeLUT(), and EcalTPGParamBuilder().

◆ TTF_lowThreshold_EB_

double EcalTPGParamBuilder::TTF_lowThreshold_EB_
private

Definition at line 136 of file EcalTPGParamBuilder.h.

Referenced by analyze(), beginJob(), computeLUT(), and EcalTPGParamBuilder().

◆ TTF_lowThreshold_EE_

double EcalTPGParamBuilder::TTF_lowThreshold_EE_
private

Definition at line 137 of file EcalTPGParamBuilder.h.

Referenced by analyze(), beginJob(), computeLUT(), and EcalTPGParamBuilder().

◆ useDBShape_

bool EcalTPGParamBuilder::useDBShape_
private

Definition at line 202 of file EcalTPGParamBuilder.h.

Referenced by analyze().

◆ useInterCalibration_

bool EcalTPGParamBuilder::useInterCalibration_
private

Definition at line 146 of file EcalTPGParamBuilder.h.

Referenced by EcalTPGParamBuilder(), and getCoeff().

◆ useTransparencyCorr_

bool EcalTPGParamBuilder::useTransparencyCorr_
private

Definition at line 150 of file EcalTPGParamBuilder.h.

Referenced by analyze(), EcalTPGParamBuilder(), and getCoeff().

◆ useTransverseEnergy_

bool EcalTPGParamBuilder::useTransverseEnergy_
private

Definition at line 123 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ version_

int EcalTPGParamBuilder::version_
private

Definition at line 185 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ wei_conf_id_

int EcalTPGParamBuilder::wei_conf_id_
private

Definition at line 178 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ weight_timeShift_

double EcalTPGParamBuilder::weight_timeShift_
private

Definition at line 128 of file EcalTPGParamBuilder.h.

Referenced by computeWeights(), and EcalTPGParamBuilder().

◆ weight_unbias_recovery_

bool EcalTPGParamBuilder::weight_unbias_recovery_
private

Definition at line 129 of file EcalTPGParamBuilder.h.

Referenced by computeWeights(), and EcalTPGParamBuilder().

◆ writeToDB_

bool EcalTPGParamBuilder::writeToDB_
private

Definition at line 168 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and EcalTPGParamBuilder().

◆ writeToFiles_

bool EcalTPGParamBuilder::writeToFiles_
private

◆ xtal_LSB_EB_

double EcalTPGParamBuilder::xtal_LSB_EB_
private

Definition at line 124 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and computeLinearizerParam().

◆ xtal_LSB_EE_

double EcalTPGParamBuilder::xtal_LSB_EE_
private

Definition at line 124 of file EcalTPGParamBuilder.h.

Referenced by analyze(), and computeLinearizerParam().

EcalTPGParamBuilder::FG_lowRatio_EB_
double FG_lowRatio_EB_
Definition: EcalTPGParamBuilder.h:138
EcalCondObjectContainer::getMap
const self & getMap() const
Definition: EcalCondObjectContainer.h:78
EcalTPGParamBuilder::weight_timeShift_
double weight_timeShift_
Definition: EcalTPGParamBuilder.h:128
EcalTPGParamBuilder::Transparency_Corr_
std::string Transparency_Corr_
Definition: EcalTPGParamBuilder.h:149
FEConfigMainInfo::getSpiId
int getSpiId() const
Definition: FEConfigMainInfo.h:52
EcalCondObjectContainer::end
const_iterator end() const
Definition: EcalCondObjectContainer.h:74
EcalTPGParamBuilder::db_
EcalTPGDBApp * db_
Definition: EcalTPGParamBuilder.h:167
FEConfigFgrDat
Definition: FEConfigFgrDat.h:11
EcalTPGParamBuilder::create_header
void create_header()
Definition: EcalTPGParamBuilder.cc:2273
MonPedestalsDat::getPedMeanG1
float getPedMeanG1() const
Definition: MonPedestalsDat.h:21
EcalTPGParamBuilder::xtal_LSB_EB_
double xtal_LSB_EB_
Definition: EcalTPGParamBuilder.h:124
DDAxes::y
EcalTPGParamBuilder::SFGVB_lut_
unsigned int SFGVB_lut_
Definition: EcalTPGParamBuilder.h:144
EcalTPGParamBuilder::getGCTRegionPhi
int getGCTRegionPhi(int ttphi)
Definition: EcalTPGParamBuilder.cc:2769
FEConfigFgrGroupDat
Definition: FEConfigFgrGroupDat.h:11
EcalTPGParamBuilder::geomFile_
std::ofstream * geomFile_
Definition: EcalTPGParamBuilder.h:166
EcalTPGParamBuilder::m_write_bxt
int m_write_bxt
Definition: EcalTPGParamBuilder.h:194
EcalTPGParamBuilder::ecalmappingToken_
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalmappingToken_
Definition: EcalTPGParamBuilder.h:113
FEConfigLUTParamDat
Definition: FEConfigLUTParamDat.h:11
mps_fire.i
i
Definition: mps_fire.py:428
EcalTrigTowerDetId::iphi
int iphi() const
get the tower iphi
Definition: EcalTrigTowerDetId.h:52
edm::ESInputTag
Definition: ESInputTag.h:87
oneOverEtResolEt
double oneOverEtResolEt(double *x, double *par)
Definition: EcalTPGParamBuilder.cc:32
FEConfigLUTParamDat::setTTThreshlow
void setTTThreshlow(float x)
Definition: FEConfigLUTParamDat.h:21
FEConfigWeightGroupDat::setWeight4
void setWeight4(float x)
Definition: FEConfigWeightGroupDat.h:31
EcalTPGParamBuilder::spi_conf_id_
int spi_conf_id_
Definition: EcalTPGParamBuilder.h:179
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
EcalTPGParamBuilder::useInterCalibration_
bool useInterCalibration_
Definition: EcalTPGParamBuilder.h:146
FEConfigFgrGroupDat::setThreshHigh
void setThreshHigh(float x)
Definition: FEConfigFgrGroupDat.h:25
EcalTPGParamBuilder::theEndcapGeometry_
const CaloSubdetectorGeometry * theEndcapGeometry_
Definition: EcalTPGParamBuilder.h:109
EcalCondObjectContainer::endcapItems
const Items & endcapItems() const
Definition: EcalCondObjectContainer.h:32
FEConfigPedDat::setPedMeanG6
void setPedMeanG6(float mean)
Definition: FEConfigPedDat.h:26
EcalTPGParamBuilder::theEndcapGeometryToken_
edm::ESGetToken< CaloSubdetectorGeometry, EcalEndcapGeometryRecord > theEndcapGeometryToken_
Definition: EcalTPGParamBuilder.h:107
EcalTPGParamBuilder::nSample_
unsigned int nSample_
Definition: EcalTPGParamBuilder.h:130
FEConfigLinDat::setMultX12
void setMultX12(int x)
Definition: FEConfigLinDat.h:20
EcalTPGParamBuilder::fgr_conf_id_
int fgr_conf_id_
Definition: EcalTPGParamBuilder.h:176
EcalTriggerElectronicsId
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
Definition: EcalTriggerElectronicsId.h:18
EcalTPGParamBuilder::phases_EE_
std::map< int, std::vector< int > > phases_EE_
Definition: EcalTPGParamBuilder.h:160
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
FEConfigWeightDat
Definition: FEConfigWeightDat.h:11
EcalTrigTowerDetId::ietaAbs
int ietaAbs() const
get the absolute value of the tower ieta
Definition: EcalTrigTowerDetId.h:36
EBShape
Definition: EBShape.h:6
EcalTPGParamBuilder::writeToDB_
bool writeToDB_
Definition: EcalTPGParamBuilder.h:168
min
T min(T a, T b)
Definition: MathUtil.h:58
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
EcalElectronicsMapping::iTT
int iTT(const EcalTrigTowerDetId &id) const
returns the index of a Trigger Tower within its TCC.
Definition: EcalElectronicsMapping.cc:102
EcalTPGParamBuilder::version_
int version_
Definition: EcalTPGParamBuilder.h:185
EcalTPGParamBuilder::bxt_conf_id_
int bxt_conf_id_
Definition: EcalTPGParamBuilder.h:181
EcalTPGDBApp::writeToConfDB_Spike
int writeToConfDB_Spike(const std::map< EcalLogicID, FEConfigSpikeDat > &spikegroupset, std::string tag)
Definition: EcalTPGDBApp.cc:324
EBDetId
Definition: EBDetId.h:17
EcalTPGParamBuilder::m_write_spi
int m_write_spi
Definition: EcalTPGParamBuilder.h:192
FEConfigMainInfo::getLinId
int getLinId() const
Definition: FEConfigMainInfo.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalShapeBase::timeOfThr
double timeOfThr() const
Definition: EcalShapeBase.cc:21
EcalTPGParamBuilder::SFGVB_Threshold_
unsigned int SFGVB_Threshold_
Definition: EcalTPGParamBuilder.h:144
mps_merge.weight
weight
Definition: mps_merge.py:88
EEDetId::unhashIndex
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
linStruc::shift_
int shift_[3]
Definition: EcalTPGParamBuilder.h:67
FEConfigLUTGroupDat::setLUTValue
void setLUTValue(int i, int x)
Definition: FEConfigLUTGroupDat.h:23
FEConfigLinParamDat::setETSat
void setETSat(float x)
Definition: FEConfigLinParamDat.h:20
EcalCondDBInterface::fetchConfigSet
void fetchConfigSet(ICONF *iconf) noexcept(false)
Definition: EcalCondDBInterface.h:387
EcalTPGParamBuilder::SFGVB_SpikeKillingThreshold_
int SFGVB_SpikeKillingThreshold_
Definition: EcalTPGParamBuilder.h:145
pos
Definition: PixelAliasList.h:18
MonPedestalsDat
Definition: MonPedestalsDat.h:11
EcalLogicID::getName
std::string getName() const
Definition: EcalLogicID.cc:26
FEConfigMainInfo
Definition: FEConfigMainInfo.h:14
FEConfigPedDat::getPedMeanG12
float getPedMeanG12() const
Definition: FEConfigPedDat.h:30
EBDetId::unhashIndex
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
FEConfigLinDat::setShift1
void setShift1(int x)
Definition: FEConfigLinDat.h:25
FEConfigFgrEEStripDat::setLutFgr
void setLutFgr(unsigned int mean)
Definition: FEConfigFgrEEStripDat.h:26
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:278
CustomPhysics_cfi.gamma
gamma
Definition: CustomPhysics_cfi.py:17
protons_cff.time
time
Definition: protons_cff.py:35
FEConfigFgrGroupDat::setThreshLow
void setThreshLow(float x)
Definition: FEConfigFgrGroupDat.h:23
EcalTPGParamBuilder::pedestal_offset_
unsigned int pedestal_offset_
Definition: EcalTPGParamBuilder.h:144
EcalADCToGeVConstant
Definition: EcalADCToGeVConstant.h:13
EcalShapeBase::timeOfMax
double timeOfMax() const
Definition: EcalShapeBase.cc:23
FEConfigSpikeDat::setSpikeThreshold
void setSpikeThreshold(int x)
Definition: FEConfigSpikeDat.h:20
DDAxes::x
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EcalElectronicsId::dccId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
Definition: EcalElectronicsId.h:31
linStruc
Definition: EcalTPGParamBuilder.h:62
FEConfigPedDat::setPedMeanG1
void setPedMeanG1(float mean)
Definition: FEConfigPedDat.h:23
EcalLogicID::getID1
int getID1() const
Definition: EcalLogicID.cc:30
EcalTPGParamBuilder::FG_highThreshold_EB_
double FG_highThreshold_EB_
Definition: EcalTPGParamBuilder.h:138
EcalTPGParamBuilder::LUT_constant_EE_
double LUT_constant_EE_
Definition: EcalTPGParamBuilder.h:135
EcalLogicID::getLogicID
int getLogicID() const
Definition: EcalLogicID.cc:28
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EcalTrigTowerDetId::zside
int zside() const
get the z-side of the tower (1/-1)
Definition: EcalTrigTowerDetId.h:30
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
EcalTPGParamBuilder::xtal_LSB_EE_
double xtal_LSB_EE_
Definition: EcalTPGParamBuilder.h:124
FEConfigLinParamDat
Definition: FEConfigLinParamDat.h:11
EcalBarrel
Definition: EcalSubdetector.h:10
FEConfigMainInfo::getFgrId
int getFgrId() const
Definition: FEConfigMainInfo.h:43
EcalTPGParamBuilder::eTTmap_
const EcalTrigTowerConstituentsMap * eTTmap_
Definition: EcalTPGParamBuilder.h:112
FEConfigLUTParamDat::setETSat
void setETSat(float x)
Definition: FEConfigLUTParamDat.h:20
FEConfigMainInfo::getBttId
int getBttId() const
Definition: FEConfigMainInfo.h:61
EcalTPGParamBuilder::theBarrelGeometryToken_
edm::ESGetToken< CaloSubdetectorGeometry, EcalBarrelGeometryRecord > theBarrelGeometryToken_
Definition: EcalTPGParamBuilder.h:108
EcalTPGParamBuilder::useTransverseEnergy_
bool useTransverseEnergy_
Definition: EcalTPGParamBuilder.h:123
EcalTPGParamBuilder::LUT_threshold_EB_
double LUT_threshold_EB_
Definition: EcalTPGParamBuilder.h:133
EcalElectronicsId::towerId
int towerId() const
get the tower id
Definition: EcalElectronicsId.h:33
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
EcalTPGParamBuilder::ecalPedestalsToken_
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > ecalPedestalsToken_
Definition: EcalTPGParamBuilder.h:118
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
EcalLogicID::getID2
int getID2() const
Definition: EcalLogicID.cc:32
EcalTPGParamBuilder::useDBShape_
bool useDBShape_
Definition: EcalTPGParamBuilder.h:202
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DetId
Definition: DetId.h:17
coeffStruc::calibCoeff_
double calibCoeff_
Definition: EcalTPGParamBuilder.h:57
EcalTPGParamBuilder::FG_highRatio_EB_
double FG_highRatio_EB_
Definition: EcalTPGParamBuilder.h:138
EcalTPGDBApp::writeToConfDB_TPGWeight
int writeToConfDB_TPGWeight(const std::map< EcalLogicID, FEConfigWeightGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigWeightDat > &lutdat, int iovId, std::string tag)
Definition: EcalTPGDBApp.cc:254
EcalLaserAPDPNRatios::getLaserMap
const EcalLaserAPDPNRatiosMap & getLaserMap() const
Definition: EcalLaserAPDPNRatios.h:40
EcalTPGParamBuilder::delays_EB_
std::map< int, std::vector< int > > delays_EB_
Definition: EcalTPGParamBuilder.h:157
FEConfigLinDat::setShift6
void setShift6(int x)
Definition: FEConfigLinDat.h:24
EcalTPGParamBuilder::LUT_noise_EB_
double LUT_noise_EB_
Definition: EcalTPGParamBuilder.h:134
FEConfigLinDat::setMultX6
void setMultX6(int x)
Definition: FEConfigLinDat.h:21
FEConfigFgrDat::setFgrGroupId
void setFgrGroupId(int x)
Definition: FEConfigFgrDat.h:20
EcalTPGParamBuilder::getGCTRegionEta
int getGCTRegionEta(int tteta)
Definition: EcalTPGParamBuilder.cc:2779
FEConfigLUTGroupDat::setLUTGroupId
void setLUTGroupId(int x)
Definition: FEConfigLUTGroupDat.h:20
FEConfigSpikeDat
Definition: FEConfigSpikeDat.h:11
EcalTPGParamBuilder::eTTmapToken_
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > eTTmapToken_
Definition: EcalTPGParamBuilder.h:111
EcalTPGParamBuilder::del_conf_id_
int del_conf_id_
Definition: EcalTPGParamBuilder.h:180
FEConfigPedDat::getPedMeanG1
float getPedMeanG1() const
Definition: FEConfigPedDat.h:24
FEConfigFgrGroupDat::setRatioHigh
void setRatioHigh(float x)
Definition: FEConfigFgrGroupDat.h:29
HLT_FULL_cff.weights
weights
Definition: HLT_FULL_cff.py:99207
EcalTPGParamBuilder::DBEE_
bool DBEE_
Definition: EcalTPGParamBuilder.h:171
MonPedestalsDat::getPedMeanG6
float getPedMeanG6() const
Definition: MonPedestalsDat.h:24
EcalTPGParamBuilder::out_file_
std::ofstream * out_file_
Definition: EcalTPGParamBuilder.h:165
DDAxes::z
EcalTPGParamBuilder::TimingPhases_EE_
std::string TimingPhases_EE_
Definition: EcalTPGParamBuilder.h:156
str
#define str(s)
Definition: TestProcessor.cc:53
EcalElectronicsMapping::getElectronicsId
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
Definition: EcalElectronicsMapping.cc:324
FEConfigFgrParamDat::setFGhighthresh
void setFGhighthresh(float x)
Definition: FEConfigFgrParamDat.h:21
EcalLogicID
Definition: EcalLogicID.h:7
EcalTPGParamBuilder::m_write_lut
int m_write_lut
Definition: EcalTPGParamBuilder.h:188
EcalTPGParamBuilder::complement2_
unsigned int complement2_
Definition: EcalTPGParamBuilder.h:131
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
EcalCondObjectContainer::find
const_iterator find(uint32_t rawId) const
Definition: EcalCondObjectContainer.h:53
coeffStruc::gainRatio_
double gainRatio_[3]
Definition: EcalTPGParamBuilder.h:58
EcalTPGParamBuilder::writeToFiles_
bool writeToFiles_
Definition: EcalTPGParamBuilder.h:169
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
FEConfigPedDat::getPedMeanG6
float getPedMeanG6() const
Definition: FEConfigPedDat.h:27
EcalTPGParamBuilder::m_write_wei
int m_write_wei
Definition: EcalTPGParamBuilder.h:189
EcalTPGParamBuilder::useTransparencyCorr_
bool useTransparencyCorr_
Definition: EcalTPGParamBuilder.h:150
dqmdumpme.k
k
Definition: dqmdumpme.py:60
FEConfigMainInfo::getBxtId
int getBxtId() const
Definition: FEConfigMainInfo.h:58
EcalTPGParamBuilder::Et_sat_EB_
double Et_sat_EB_
Definition: EcalTPGParamBuilder.h:125
EcalTPGParamBuilder::ecalLaserAPDPNRatiosToken_
edm::ESGetToken< EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcd > ecalLaserAPDPNRatiosToken_
Definition: EcalTPGParamBuilder.h:117
EEShape
Definition: EEShape.h:6
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
CaloSubdetectorGeometry::getValidDetIds
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
Definition: CaloSubdetectorGeometry.cc:32
FEConfigFgrParamDat::setFGhighratio
void setFGhighratio(float x)
Definition: FEConfigFgrParamDat.h:23
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
EcalCondObjectContainer::barrelItems
const Items & barrelItems() const
Definition: EcalCondObjectContainer.h:30
particleFlowDisplacedVertex_cfi.ratio
ratio
Definition: particleFlowDisplacedVertex_cfi.py:93
EEDetId
Definition: EEDetId.h:14
EcalTPGParamBuilder::m_write_sli
int m_write_sli
Definition: EcalTPGParamBuilder.h:191
L1TdeCSCTF_cfi.outFile
outFile
Definition: L1TdeCSCTF_cfi.py:5
EcalTPGParamBuilder::ecalLaserAlphasToken_
edm::ESGetToken< EcalLaserAlphas, EcalLaserAlphasRcd > ecalLaserAlphasToken_
Definition: EcalTPGParamBuilder.h:116
FEConfigLUTDat
Definition: FEConfigLUTDat.h:11
EcalTPGParamBuilder::Et_sat_EE_
double Et_sat_EE_
Definition: EcalTPGParamBuilder.h:125
EcalTPGParamBuilder::LUT_option_
std::string LUT_option_
Definition: EcalTPGParamBuilder.h:132
EcalEndcap
Definition: EcalSubdetector.h:10
FEConfigMainInfo::getWeiId
int getWeiId() const
Definition: FEConfigMainInfo.h:49
EcalTPGParamBuilder::m_write_bst
int m_write_bst
Definition: EcalTPGParamBuilder.h:196
EcalTPGParamBuilder::phases_EB_
std::map< int, std::vector< int > > phases_EB_
Definition: EcalTPGParamBuilder.h:158
EcalTPGParamBuilder::LUT_threshold_EE_
double LUT_threshold_EE_
Definition: EcalTPGParamBuilder.h:133
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
EcalTPGParamBuilder::FG_lowThreshold_EB_
double FG_lowThreshold_EB_
Definition: EcalTPGParamBuilder.h:138
EcalTPGParamBuilder::forcedPedestalValue_
int forcedPedestalValue_
Definition: EcalTPGParamBuilder.h:142
EcalADCToGeVConstant::getEEValue
float getEEValue() const
Definition: EcalADCToGeVConstant.h:21
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalTPGParamBuilder::computeFineGrainEBParameters
void computeFineGrainEBParameters(uint &lowRatio, uint &highRatio, uint &lowThreshold, uint &highThreshold, uint &lut)
Definition: EcalTPGParamBuilder.cc:2700
EcalTPGParamBuilder::delays_EE_
std::map< int, std::vector< int > > delays_EE_
Definition: EcalTPGParamBuilder.h:159
EcalTPGParamBuilder::sli_conf_id_
int sli_conf_id_
Definition: EcalTPGParamBuilder.h:177
FEConfigWeightGroupDat
Definition: FEConfigWeightGroupDat.h:11
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
EcalCondObjectContainer::Item
T Item
Definition: EcalCondObjectContainer.h:15
FEConfigFgrEEStripDat
Definition: FEConfigFgrEEStripDat.h:11
EcalTriggerElectronicsId::pseudoStripId
int pseudoStripId() const
get the tower id
Definition: EcalTriggerElectronicsId.h:35
FEConfigSlidingDat
Definition: FEConfigSlidingDat.h:11
EcalTPGDBApp::writeToConfDB_TPGLinearCoef
int writeToConfDB_TPGLinearCoef(const std::map< EcalLogicID, FEConfigLinDat > &linset, const std::map< EcalLogicID, FEConfigLinParamDat > &linparamset, int iovId, std::string tag)
Definition: EcalTPGDBApp.cc:37
FEConfigWeightGroupDat::setWeightGroupId
void setWeightGroupId(int x)
Definition: FEConfigWeightGroupDat.h:20
EcalPedestalsMapIterator
EcalPedestalsMap::const_iterator EcalPedestalsMapIterator
Definition: EcalPedestals.h:49
FEConfigLinDat::setShift12
void setShift12(int x)
Definition: FEConfigLinDat.h:23
EcalTPGParamBuilder::computeLinearizerParam
bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int &mult, int &shift)
Definition: EcalTPGParamBuilder.cc:2227
createfilelist.int
int
Definition: createfilelist.py:10
EcalTPGParamBuilder::ecalIntercalibConstantsToken_
edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > ecalIntercalibConstantsToken_
Definition: EcalTPGParamBuilder.h:119
EcalTPGParamBuilder::ecalADCToGeVConstantToken_
edm::ESGetToken< EcalADCToGeVConstant, EcalADCToGeVConstantRcd > ecalADCToGeVConstantToken_
Definition: EcalTPGParamBuilder.h:121
EcalTPGDBApp::writeToConfDB_TPGLUT
int writeToConfDB_TPGLUT(const std::map< EcalLogicID, FEConfigLUTGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigLUTDat > &lutdat, const std::map< EcalLogicID, FEConfigLUTParamDat > &lutparamset, int iovId, std::string tag)
Definition: EcalTPGDBApp.cc:221
EcalTPGParamBuilder::lin_conf_id_
int lin_conf_id_
Definition: EcalTPGParamBuilder.h:174
EcalElectronicsMapping::getTriggerElectronicsId
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
Definition: EcalElectronicsMapping.cc:389
EcalTPGParamBuilder::m_write_ped
int m_write_ped
Definition: EcalTPGParamBuilder.h:186
EcalTPGParamBuilder::weight_unbias_recovery_
bool weight_unbias_recovery_
Definition: EcalTPGParamBuilder.h:129
EcalTPGParamBuilder::wei_conf_id_
int wei_conf_id_
Definition: EcalTPGParamBuilder.h:178
FEConfigFgrGroupDat::setFgrGroupId
void setFgrGroupId(int x)
Definition: FEConfigFgrGroupDat.h:20
EcalCondDBInterface::fetchDataSet
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
Definition: EcalCondDBInterface.h:495
EcalTPGParamBuilder::ntupleDet_
Char_t ntupleDet_[10]
Definition: EcalTPGParamBuilder.h:199
EcalTPGParamBuilder::TTF_highThreshold_EE_
double TTF_highThreshold_EE_
Definition: EcalTPGParamBuilder.h:137
FEConfigPedDat
Definition: FEConfigPedDat.h:11
FEConfigWeightGroupDat::setWeight2
void setWeight2(float x)
Definition: FEConfigWeightGroupDat.h:27
EcalTPGParamBuilder::btt_conf_id_
int btt_conf_id_
Definition: EcalTPGParamBuilder.h:182
FEConfigFgrParamDat::setFGlowratio
void setFGlowratio(float x)
Definition: FEConfigFgrParamDat.h:22
EcalElectronicsMapping::DCCid
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
Definition: EcalElectronicsMapping.cc:70
cuy.ib
ib
Definition: cuy.py:661
EcalTPGDBApp::writeToConfDB_TPGFgr
int writeToConfDB_TPGFgr(const std::map< EcalLogicID, FEConfigFgrGroupDat > &lutgroup, const std::map< EcalLogicID, FEConfigFgrDat > &lutdat, const std::map< EcalLogicID, FEConfigFgrParamDat > &fgrparamset, const std::map< EcalLogicID, FEConfigFgrEETowerDat > &dataset3, const std::map< EcalLogicID, FEConfigFgrEEStripDat > &dataset4, int iovId, std::string tag)
Definition: EcalTPGDBApp.cc:285
CaloSubdetectorGeometry::getGeometry
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: CaloSubdetectorGeometry.cc:36
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
EcalTriggerElectronicsId::channelId
int channelId() const
get the channel id
Definition: EcalTriggerElectronicsId.h:37
EcalTPGParamBuilder::uncodeWeight
int uncodeWeight(double weight, int complement2=7)
Definition: EcalTPGParamBuilder.cc:2366
EcalTPGParamBuilder::lut_conf_id_
int lut_conf_id_
Definition: EcalTPGParamBuilder.h:175
EcalTPGParamBuilder::getCrate
std::pair< std::string, int > getCrate(int tcc)
Definition: EcalTPGParamBuilder.cc:2826
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DetId::Ecal
Definition: DetId.h:27
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
FEConfigLUTDat::setLUTGroupId
void setLUTGroupId(int x)
Definition: FEConfigLUTDat.h:20
EcalCondDBInterface::getEcalLogicID
EcalLogicID getEcalLogicID(std::string name, int id1=EcalLogicID::NULLID, int id2=EcalLogicID::NULLID, int id3=EcalLogicID::NULLID, std::string mapsTo="") noexcept(false)
EcalTrigTowerDetId::subDet
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
Definition: EcalTrigTowerDetId.h:33
FEConfigFgrGroupDat::setRatioLow
void setRatioLow(float x)
Definition: FEConfigFgrGroupDat.h:27
EcalTPGParamBuilder::TimingDelays_EB_
std::string TimingDelays_EB_
Definition: EcalTPGParamBuilder.h:153
EcalTPGParamBuilder::computeWeights
std::vector< unsigned int > computeWeights(EcalShapeBase &shape, TH1F *histo)
Definition: EcalTPGParamBuilder.cc:2385
EcalTrigTowerDetId::ieta
int ieta() const
get the tower ieta
Definition: EcalTrigTowerDetId.h:44
EcalTPGParamBuilder::m_write_lin
int m_write_lin
Definition: EcalTPGParamBuilder.h:187
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
FEConfigSlidingDat::setSliding
void setSliding(float mean)
Definition: FEConfigSlidingDat.h:20
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FEConfigMainInfo::getSliId
int getSliId() const
Definition: FEConfigMainInfo.h:46
linStruc::mult_
int mult_[3]
Definition: EcalTPGParamBuilder.h:66
EcalTPGDBApp::writeToConfDB_TPGSliding
int writeToConfDB_TPGSliding(const std::map< EcalLogicID, FEConfigSlidingDat > &sliset, int iovId, std::string tag)
Definition: EcalTPGDBApp.cc:196
FEConfigFgrParamDat
Definition: FEConfigFgrParamDat.h:11
FEConfigFgrEETowerDat
Definition: FEConfigFgrEETowerDat.h:11
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
EcalTPGParamBuilder::m_write_fgr
int m_write_fgr
Definition: EcalTPGParamBuilder.h:190
FEConfigFgrParamDat::setFGlowthresh
void setFGlowthresh(float x)
Definition: FEConfigFgrParamDat.h:20
EcalTPGParamBuilder::TTF_lowThreshold_EE_
double TTF_lowThreshold_EE_
Definition: EcalTPGParamBuilder.h:137
coeffStruc::pedestals_
int pedestals_[3]
Definition: EcalTPGParamBuilder.h:59
linStruc::pedestal_
int pedestal_[3]
Definition: EcalTPGParamBuilder.h:65
EcalTPGParamBuilder::TTF_lowThreshold_EB_
double TTF_lowThreshold_EB_
Definition: EcalTPGParamBuilder.h:136
FEConfigWeightGroupDat::setWeight0
void setWeight0(float x)
Definition: FEConfigWeightGroupDat.h:23
EcalTPGParamBuilder::m_write_del
int m_write_del
Definition: EcalTPGParamBuilder.h:193
EcalLogicID::NULLID
static const int NULLID
Definition: EcalLogicID.h:35
EcalElectronicsMapping::TCCid
int TCCid(const EBDetId &id) const
returns the TCCid of an EBDetId
Definition: EcalElectronicsMapping.cc:86
heppy_batch.val
val
Definition: heppy_batch.py:351
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
writedatasetfile.dataset
dataset
Definition: writedatasetfile.py:19
EcalTPGParamBuilder::m_write_btt
int m_write_btt
Definition: EcalTPGParamBuilder.h:195
EcalTPGParamBuilder::H2_
bool H2_
Definition: EcalTPGParamBuilder.h:146
FEConfigWeightDat::setWeightGroupId
void setWeightGroupId(int x)
Definition: FEConfigWeightDat.h:20
EcalCondObjectContainer::insert
void insert(std::pair< uint32_t, Item > const &a)
Definition: EcalCondObjectContainer.h:38
EcalTPGParamBuilder::ntupleInts_
Int_t * ntupleInts_
Definition: EcalTPGParamBuilder.h:198
FEConfigPedInfo::setId
void setId(int id)
Definition: FEConfigPedInfo.h:24
EcalTPGDBApp::writeToConfDB_Delay
int writeToConfDB_Delay(const std::map< EcalLogicID, FEConfigTimingDat > &delaygroupset, std::string tag)
Definition: EcalTPGDBApp.cc:348
EcalTPGParamBuilder::FG_lut_strip_EE_
unsigned int FG_lut_strip_EE_
Definition: EcalTPGParamBuilder.h:141
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
EcalTPGParamBuilder::Transparency_Correction_
std::map< int, double > Transparency_Correction_
Definition: EcalTPGParamBuilder.h:163
EEDetId::XYMODE
static const int XYMODE
Definition: EEDetId.h:335
EcalTPGDBApp::writeToConfDB_TPGMain
int writeToConfDB_TPGMain(int ped, int lin, int lut, int fgr, int sli, int wei, int spi, int tim, int bxt, int btt, int bst, std::string tag, int ver)
Definition: EcalTPGDBApp.cc:64
FEConfigWeightGroupDat::setWeight1
void setWeight1(float x)
Definition: FEConfigWeightGroupDat.h:25
EcalTPGParamBuilder::realignBaseline
bool realignBaseline(linStruc &lin, float forceBase12)
Definition: EcalTPGParamBuilder.cc:2744
EcalTPGParamBuilder::theBarrelGeometry_
const CaloSubdetectorGeometry * theBarrelGeometry_
Definition: EcalTPGParamBuilder.h:110
EcalTPGParamBuilder::theMapping_
const EcalElectronicsMapping * theMapping_
Definition: EcalTPGParamBuilder.h:114
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EcalTPGParamBuilder::FG_lut_EB_
unsigned int FG_lut_EB_
Definition: EcalTPGParamBuilder.h:139
FEConfigTimingDat
Definition: FEConfigTimingDat.h:11
FEConfigLUTParamDat::setTTThreshhigh
void setTTThreshhigh(float x)
Definition: FEConfigLUTParamDat.h:22
EcalTPGParamBuilder::LUT_noise_EE_
double LUT_noise_EE_
Definition: EcalTPGParamBuilder.h:135
FEConfigLinDat
Definition: FEConfigLinDat.h:11
MonPedestalsDat::getPedMeanG12
float getPedMeanG12() const
Definition: MonPedestalsDat.h:27
EcalTPGDBApp::writeToConfDB_TPGPedestals
int writeToConfDB_TPGPedestals(const std::map< EcalLogicID, FEConfigPedDat > &pedset, int iovId, std::string tag)
Definition: EcalTPGDBApp.cc:14
EcalLogicID::getID3
int getID3() const
Definition: EcalLogicID.cc:34
VarParsing.mult
mult
Definition: VarParsing.py:658
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
FEConfigMainInfo::getPedId
int getPedId() const
Definition: FEConfigMainInfo.h:34
EcalTPGParamBuilder::TimingPhases_EB_
std::string TimingPhases_EB_
Definition: EcalTPGParamBuilder.h:155
dataset
Definition: dataset.py:1
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
EcalTPGParamBuilder::FG_Threshold_EE_
double FG_Threshold_EE_
Definition: EcalTPGParamBuilder.h:140
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
EcalCondObjectContainer::const_iterator
std::vector< Item >::const_iterator const_iterator
Definition: EcalCondObjectContainer.h:19
mps_fire.result
result
Definition: mps_fire.py:311
EcalElectronicsId::stripId
int stripId() const
get the tower id
Definition: EcalElectronicsId.h:35
phase2TrackerDigitizer_cfi.delay
delay
Definition: phase2TrackerDigitizer_cfi.py:49
EcalTPGParamBuilder::LUT_stochastic_EB_
double LUT_stochastic_EB_
Definition: EcalTPGParamBuilder.h:134
FEConfigMainInfo::getTimId
int getTimId() const
Definition: FEConfigMainInfo.h:55
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ntuple
Definition: ntuple.py:1
FEConfigLinDat::setMultX1
void setMultX1(int x)
Definition: FEConfigLinDat.h:22
ecaldqm::tccId
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:54
EcalLaserAPDPNRatios
Definition: EcalLaserAPDPNRatios.h:14
FEConfigPedDat::setPedMeanG12
void setPedMeanG12(float mean)
Definition: FEConfigPedDat.h:29
IODConfig::setConfigTag
void setConfigTag(std::string x)
Definition: IODConfig.h:29
FEConfigMainInfo::getBstId
int getBstId() const
Definition: FEConfigMainInfo.h:64
FEConfigPedInfo
Definition: FEConfigPedInfo.h:11
EcalTPGParamBuilder::LUT_constant_EB_
double LUT_constant_EB_
Definition: EcalTPGParamBuilder.h:134
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
FEConfigLUTGroupDat
Definition: FEConfigLUTGroupDat.h:11
EcalTPGParamBuilder::bst_conf_id_
int bst_conf_id_
Definition: EcalTPGParamBuilder.h:183
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
HLT_FULL_cff.timeMax
timeMax
Definition: HLT_FULL_cff.py:8398
EcalTPGParamBuilder::sampleMax_
unsigned int sampleMax_
Definition: EcalTPGParamBuilder.h:127
EcalTPGParamBuilder::LUT_stochastic_EE_
double LUT_stochastic_EE_
Definition: EcalTPGParamBuilder.h:135
EcalTPGParamBuilder::forceEtaSlice_
bool forceEtaSlice_
Definition: EcalTPGParamBuilder.h:143
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
EcalTPGParamBuilder::TTF_highThreshold_EB_
double TTF_highThreshold_EB_
Definition: EcalTPGParamBuilder.h:136
edm::Log
Definition: MessageLogger.h:70
EcalElectronicsId::xtalId
int xtalId() const
get the channel id
Definition: EcalElectronicsId.h:37
EBDetId::SMCRYSTALMODE
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
FEConfigWeightGroupDat::setWeight3
void setWeight3(float x)
Definition: FEConfigWeightGroupDat.h:29
ecalpyutils::hashedIndex
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:38
EcalADCToGeVConstant::getEBValue
float getEBValue() const
Definition: EcalADCToGeVConstant.h:20
EcalTPGParamBuilder::ecalGainRatiosToken_
edm::ESGetToken< EcalGainRatios, EcalGainRatiosRcd > ecalGainRatiosToken_
Definition: EcalTPGParamBuilder.h:120
FEConfigFgrGroupDat::setLUTValue
void setLUTValue(int x)
Definition: FEConfigFgrGroupDat.h:31
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
cmssw_cycle_finder.G
G
Definition: cmssw_cycle_finder.py:154
EcalTPGParamBuilder::computeFineGrainEEParameters
void computeFineGrainEEParameters(uint &threshold, uint &lut_strip, uint &lut_tower)
Definition: EcalTPGParamBuilder.cc:2734
EcalTPGParamBuilder::FG_lut_tower_EE_
unsigned int FG_lut_tower_EE_
Definition: EcalTPGParamBuilder.h:141
EcalTriggerElectronicsId::rawId
uint32_t rawId() const
Definition: EcalTriggerElectronicsId.h:28
EcalTPGParamBuilder::computeLUT
void computeLUT(int *lut, std::string det="EB")
Definition: EcalTPGParamBuilder.cc:2504
FEConfigFgrEEStripDat::setThreshold
void setThreshold(unsigned int mean)
Definition: FEConfigFgrEEStripDat.h:20
EcalTPGParamBuilder::TimingDelays_EE_
std::string TimingDelays_EE_
Definition: EcalTPGParamBuilder.h:154
EcalTPGParamBuilder::getDet
std::string getDet(int tcc)
Definition: EcalTPGParamBuilder.cc:2788
EcalTPGParamBuilder::tag_
std::string tag_
Definition: EcalTPGParamBuilder.h:184
weight
Definition: weight.py:1
EcalTPGParamBuilder::getCoeff
void getCoeff(coeffStruc &coeff, const EcalGainRatioMap &gainMap, uint rawId)
EcalCondDBInterface::getEcalLogicIDSetOrdered
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID) noexcept(false)
Definition: EcalCondDBInterface.cc:388
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
coeffStruc
Definition: EcalTPGParamBuilder.h:54
EcalTPGParamBuilder::sliding_
unsigned int sliding_
Definition: EcalTPGParamBuilder.h:126
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
EcalTPGParamBuilder::ntupleCrate_
Char_t ntupleCrate_[10]
Definition: EcalTPGParamBuilder.h:200
EcalTPGDBApp
Definition: EcalTPGDBApp.h:16
FEConfigMainInfo::getLUTId
int getLUTId() const
Definition: FEConfigMainInfo.h:40
EcalTPGParamBuilder::ped_conf_id_
int ped_conf_id_
Definition: EcalTPGParamBuilder.h:173
FEConfigFgrEETowerDat::setLutValue
void setLutValue(int mean)
Definition: FEConfigFgrEETowerDat.h:22