69 std::vector<int>
getRange(
int subdet,
int smNb,
int towerNbInSm,
int stripNbInTower = 0,
int xtalNbInStrip = 0);
77 std::map<uint32_t, std::vector<uint32_t>>
mapXtal_;
78 std::map<uint32_t, std::vector<uint32_t>>
mapStrip_[2];
79 std::map<uint32_t, std::vector<uint32_t>>
mapTower_[2];
84 std::map<uint32_t, std::vector<float>>
mapPhys_;
96 std::istringstream
iss;
100 edm::LogInfo(
"EcalEBTrigPrimPhase2ESProducer") <<
" New weight file " <<
file;
103 edm::LogWarning(
"EcalEBTrigPrimPhase2ESProducer") <<
"Database file " <<
file <<
" not found!!!";
116 explicit operator bool()
const {
return ((
eof ==
true) ?
false : !
iss.fail()); }
119 template <
typename T>
121 while ((
bool)gis && !(gis.
iss >>
var)) {
135 : dbFilename_(iConfig.getUntrackedParameter<
std::
string>(
"DatabaseFile",
"")),
136 configFilename_(iConfig.getParameter<
edm::FileInPath>(
"WeightTextFile")),
137 flagPrint_(iConfig.getParameter<
bool>(
"WriteInFile")) {
165 auto prod = std::make_unique<EcalEBPhase2TPGPedestalsMap>();
167 std::map<int, std::vector<unsigned int>>::const_iterator
it;
172 ped.mean_x10 = (
it->second)[0];
173 ped.mean_x1 = (
it->second)[3];
174 prod->insert(std::make_pair(myEBDetId,
ped));
182 auto prod = std::make_unique<EcalEBPhase2TPGLinearizationConst>();
184 std::map<int, std::vector<unsigned int>>::const_iterator
it;
194 prod->setValue(
it->first, param);
202 auto prod = std::make_unique<EcalEBPhase2TPGAmplWeightIdMap>();
205 std::map<uint32_t, std::vector<uint32_t>>::const_iterator
it;
227 auto prod = std::make_unique<EcalEBPhase2TPGTimeWeightIdMap>();
230 std::map<uint32_t, std::vector<uint32_t>>::const_iterator
it;
232 weights_time.setValues((
it->second)[0],
244 prod->setValue(
it->first, weights_time);
252 auto prod = std::make_unique<EcalTPGWeightGroup>();
254 const int NGROUPS = 61200;
256 for (
int iGroup = 0; iGroup < NGROUPS; iGroup++) {
257 std::map<int, std::vector<unsigned int>>::const_iterator
it;
259 prod->setValue(
it->first,
it->second[0]);
268 auto prod = std::make_unique<EcalTPGPhysicsConst>();
272 std::map<uint32_t, std::vector<float>>::const_iterator
it;
275 item.EtSat = (
it->second)[0];
276 item.ttf_threshold_Low = (
it->second)[1];
277 item.ttf_threshold_High = (
it->second)[2];
278 item.FG_lowThreshold = (
it->second)[3];
279 item.FG_highThreshold = (
it->second)[4];
280 item.FG_lowRatio = (
it->second)[5];
281 item.FG_highRatio = (
it->second)[6];
290 auto prod = std::make_unique<EcalTPGCrystalStatus>();
293 std::map<uint32_t, std::vector<uint32_t>>::const_iterator
it;
297 prod->setValue(
it->first, badXValue);
305 std::vector<unsigned int> param;
314 finalFileName = fileInPath.
fullPath();
318 <<
"Couldnt find database file via fileinpath trying with pathname directly!!";
322 while (gis >> dataCard) {
323 if (dataCard ==
"WEIGHTAMP") {
334 gis >> std::hex >>
data;
335 param.push_back(
data);
339 std::ostringstream oss;
340 oss << std::hex <<
data;
359 if (dataCard ==
"WEIGHTTIME") {
370 gis >> std::hex >>
data;
372 param.push_back(
data);
376 std::ostringstream oss;
377 oss << std::hex <<
data;
394 if (dataCard ==
"CRYSTAL") {
404 param.push_back(
data);
407 std::ostringstream oss;
418 if (dataCard ==
"LINCONST") {
430 gis >> std::hex >>
data;
431 param.push_back(
data);
435 std::ostringstream oss;
436 oss << std::hex <<
data;
443 std::ostringstream oss;
444 oss << std::hex <<
data;
470 std::vector<unsigned int> param;
471 std::vector<float> paramF;
472 int NBstripparams[2] = {4, 4};
483 finalFileName = fileInPath.
fullPath();
486 edm::LogWarning(
"EcalTPG") <<
"Couldnt find database file via fileinpath, " 487 "trying with pathname directly!!";
493 while (gis >> dataCard) {
494 if (dataCard ==
"CRYSTAL") {
504 std::cout <<
"COMMENT ====== barrel crystals ====== " << std::endl;
507 std::cout <<
"COMMENT ====== endcap crystals ====== " << std::endl;
515 for (
int i = 0;
i < 9;
i++) {
516 gis >> std::hex >>
data;
517 param.push_back(
data);
521 std::ostringstream oss;
522 oss << std::hex <<
data;
530 }
else if (
i > 2 &&
i < 6) {
531 std::ostringstream oss;
532 oss << std::hex <<
data;
539 }
else if (
i > 5 &&
i < 9) {
540 std::ostringstream oss;
541 oss << std::hex <<
data;
562 if (dataCard ==
"STRIP_EB") {
571 for (
int i = 0;
i < NBstripparams[0];
i++) {
572 gis >> std::hex >>
data;
573 param.push_back(
data);
581 std::ostringstream oss;
583 oss <<
"0x" << std::hex <<
data;
587 std::ostringstream oss;
588 oss <<
" 0x" << std::hex <<
data;
601 if (dataCard ==
"STRIP_EE") {
611 for (
int i = 0;
i < NBstripparams[1];
i++) {
612 gis >> std::hex >>
data;
613 param.push_back(
data);
621 std::ostringstream oss;
623 oss <<
"0x" << std::hex <<
data;
627 std::ostringstream oss;
628 oss <<
" 0x" << std::hex <<
data;
641 if (dataCard ==
"TOWER_EE") {
648 for (
int i = 0;
i < 2;
i++) {
649 gis >> std::hex >>
data;
650 param.push_back(
data);
664 if (dataCard ==
"TOWER_EB") {
671 for (
int i = 0;
i < 3;
i++) {
678 param.push_back(
data);
688 int subdet,
int tccNb,
int towerNbInTcc,
int stripNbInTower,
int xtalNbInStrip) {
689 std::vector<int>
range;
704 range[1] = tccNb + 1;
706 if (towerNbInTcc > 0) {
707 range[2] = towerNbInTcc;
708 range[3] = towerNbInTcc + 1;
710 if (stripNbInTower > 0) {
711 range[4] = stripNbInTower;
712 range[5] = stripNbInTower + 1;
714 if (xtalNbInStrip > 0) {
715 range[6] = xtalNbInStrip;
716 range[7] = xtalNbInStrip + 1;
std::map< uint32_t, std::vector< uint32_t > > mapTimeWeight_
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
std::string fullPath() const
std::vector< int > getRange(int subdet, int smNb, int towerNbInSm, int stripNbInTower=0, int xtalNbInStrip=0)
This method is not used at all, however is a reminder that something alike will probably be needed on...
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
void setStatusCode(const uint16_t &val)
static const int nLinConst_
~EcalEBTrigPrimPhase2ESProducer() override
std::unique_ptr< EcalEBPhase2TPGAmplWeightIdMap > produceAmpWeight(const EcalEBPhase2TPGAmplWeightIdMapRcd &)
std::unique_ptr< EcalTPGWeightGroup > produceWeightGroup(const EcalTPGWeightGroupRcd &)
std::unique_ptr< EcalEBPhase2TPGTimeWeightIdMap > produceTimeWeight(const EcalEBPhase2TPGTimeWeightIdMapRcd &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
std::unique_ptr< EcalTPGCrystalStatus > produceBadX(const EcalTPGCrystalStatusRcd &)
Log< level::Info, false > LogInfo
std::unique_ptr< EcalEBPhase2TPGLinearizationConst > produceLinearizationConst(const EcalEBPhase2TPGLinearizationConstRcd &)
std::unique_ptr< EcalTPGPhysicsConst > producePhysicsConst(const EcalTPGPhysicsConstRcd &)
std::map< uint32_t, std::vector< uint32_t > > mapWeight_
static const int maxSamplesUsed_
std::map< int, std::vector< unsigned int > > mapXtalToGroup_
std::map< uint32_t, std::vector< float > > mapPhys_
std::unique_ptr< EcalEBPhase2TPGPedestalsMap > producePedestals(const EcalEBPhase2TPGPedestalsRcd &)
char data[epos_bytes_allocation]
const edm::FileInPath configFilename_
GzInputStream & operator>>(GzInputStream &gis, T &var)
Log< level::Warning, false > LogWarning
std::map< int, std::vector< unsigned int > > mapXtalToLin_
EcalEBTrigPrimPhase2ESProducer(const edm::ParameterSet &)
std::map< uint32_t, std::vector< uint32_t > > mapStrip_[2]