27 using std::unique_ptr;
63 std::unique_ptr<DTConfigManager>
67 std::unique_ptr<DTConfigManager> dtConfig =
76 dttpgConfig.setLutFromDB(tracoLutsFromDB);
77 dttpgConfig.setUseAcceptParam(useBtiAcceptParam);
83 dttpgConfig.setDTTPGDebug(dttpgdebug);
87 dttpgConfig.setLutFromDB(
false);
99 dttpgConfig.setCCBConfigValidity(
false);
100 }
else if (code == 2) {
101 LogVerbatim(
"DTTPG") <<
"DTConfigDBProducer::produce : Trivial : " << endl
102 <<
"configurations has been read from cfg" << endl;
103 }
else if (code == 0) {
104 LogVerbatim(
"DTTPG") <<
"DTConfigDBProducer::produce : " << endl
105 <<
"Configurations successfully read from OMDS" 108 LogProblem(
"DTTPG") <<
"DTConfigDBProducer::produce : " << endl
109 <<
"Wrong configuration return CODE" << endl;
150 int check_cfg_code = 0;
153 for (
int iwh = -2; iwh <= 2; iwh++) {
154 for (
int ise = 1; ise <= 12; ise++) {
155 for (
int ist = 1; ist <= 4; ist++) {
167 if ((ist == 1 && nbti != 168) || (ist == 2 && nbti != 192) ||
168 (ist == 3 && nbti != 224) ||
170 (ise == 1 || ise == 2 || ise == 3 || ise == 5 || ise == 6 ||
171 ise == 7 || ise == 8 || ise == 12) &&
173 (ist == 4 && (ise == 9 || ise == 11) && nbti != 96) ||
174 (ist == 4 && ise == 10 && nbti != 128) ||
175 (ist == 4 && ise == 4 && nbti != 160)) {
177 return check_cfg_code;
181 if ((ist == 1 && ntraco != 13) || (ist == 2 && ntraco != 16) ||
182 (ist == 3 && ntraco != 20) ||
184 (ise == 1 || ise == 2 || ise == 3 || ise == 5 || ise == 6 ||
185 ise == 7 || ise == 8 || ise == 12) &&
187 (ist == 4 && (ise == 9 || ise == 11) && ntraco != 12) ||
188 (ist == 4 && ise == 10 && ntraco != 16) ||
189 (ist == 4 && ise == 4 && ntraco != 20)) {
191 return check_cfg_code;
195 if ((ist == 1 && ntss != 4) || (ist == 2 && ntss != 4) ||
196 (ist == 3 && ntss != 5) ||
198 (ise == 1 || ise == 2 || ise == 3 || ise == 5 || ise == 6 ||
199 ise == 7 || ise == 8 || ise == 12) &&
201 (ist == 4 && (ise == 9 || ise == 11) && ntss != 3) ||
202 (ist == 4 && ise == 10 && ntss != 4) ||
203 (ist == 4 && ise == 4 && ntss != 5)) {
205 return check_cfg_code;
211 return check_cfg_code;
224 for (
int ise = 13; ise <= 14; ise++) {
233 if ((ise == 13 && nbti != 160) || (ise == 14 && nbti != 128)) {
235 return check_cfg_code;
237 if ((ise == 13 && ntraco != 20) || (ise == 14 && ntraco != 16)) {
239 return check_cfg_code;
241 if ((ise == 13 && ntss != 5) || (ise == 14 && ntss != 4)) {
243 return check_cfg_code;
247 return check_cfg_code;
260 return check_cfg_code;
280 cout << ndata <<
" data in the container" << endl;
286 unsigned int currValidityEnd = iov.last().eventID().run();
289 cout <<
"valid since run " << currValidityStart <<
" to run " 290 << currValidityEnd << endl;
311 while (iter != iend) {
321 const DTCCBId &ccbId = iter->first;
323 cout <<
" Filling configuration for chamber : wh " << ccbId.
wheelId 333 cout <<
"Chamber type : " << mbtype <<
" posneg : " << posneg << endl;
337 const std::vector<int> &ccbConf = iter->second;
338 std::vector<int>::const_iterator cfgIter = ccbConf.begin();
339 std::vector<int>::const_iterator cfgIend = ccbConf.end();
342 unsigned short int tss_buffer[7][31];
343 unsigned short int tsm_buffer[9];
347 while (cfgIter != cfgIend) {
351 cout <<
" BRICK " <<
id << endl;
354 std::vector<std::string>
list;
358 std::vector<std::string>::const_iterator s_iter = list.begin();
359 std::vector<std::string>::const_iterator s_iend = list.end();
360 while (s_iter != s_iend) {
362 cout <<
" ----> " << *s_iter << endl;
366 unsigned short int buffer[100];
368 const char *cstr = str.c_str();
369 const char *ptr = cstr + 2;
370 const char *
end = cstr + str.length();
374 if ((c1 >=
'0') && (c1 <=
'9'))
376 if ((c1 >=
'a') && (c1 <=
'f'))
378 if ((c1 >=
'A') && (c1 <=
'F'))
382 if ((c2 >=
'0') && (c2 <=
'9'))
384 if ((c2 >=
'a') && (c2 <=
'f'))
386 if ((c2 >=
'A') && (c2 <=
'F'))
388 buffer[
c] = (i1 * 16) + i2;
393 if (buffer[2] == 0x54) {
395 cout <<
"BTI STRING found in DB" << endl;
402 int chip = buffer[4];
405 cout <<
"Not existing board ... " << brd << endl;
409 cout <<
"Not existing chip... " << chip << endl;
419 if (brd == 6 || brd == 7) {
422 }
else if ((brd < 3 && chip < 32) || (brd == 3 && chip < 8))
426 if (brd == 6 || brd == 7) {
429 }
else if (brd < 4 && chip < 32)
433 if (brd == 6 || brd == 7) {
436 }
else if (brd < 5 && chip < 32)
440 if (brd < 6 && chip < 32)
444 if (brd < 3 && chip < 32)
448 if (brd < 5 && chip < 32)
452 if (brd < 4 && chip < 32)
456 if (!PhiSL && !ThetaSL) {
457 cout <<
"MB type " << mbtype << endl;
458 cout <<
"Board " << brd <<
" chip " << chip << endl;
459 cout <<
"Not phi SL nor Theta SL" << endl;
471 ibti = brd * 16 + (
int)(chip / 8) * 4 + (chip % 4);
472 }
else if (ThetaSL) {
475 ibti = brd * 32 + chip - 4 * (
int)(chip / 8);
477 ibti = brd * 32 + chip + 12 - 4 * (
int)(chip / 8);
486 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel()
487 <<
", st " << chambid.
station() <<
", se " << chambid.
sector()
488 <<
"... sl " << isl <<
", bti " << ibti + 1 << endl;
492 if (buffer[2] == 0x15) {
494 cout <<
"TRACO STRING found in DB" << endl;
499 int traco_brd = buffer[3];
500 int traco_chip = buffer[4];
501 int itraco = traco_brd * 4 + traco_chip + 1;
506 cout <<
"Filling TRACO config for chamber : wh " << chambid.
wheel()
507 <<
", st " << chambid.
station() <<
", se " << chambid.
sector()
508 <<
", board " << traco_brd <<
", chip " << traco_chip
509 <<
", traco " << itraco << endl;
513 if (buffer[2] == 0x16) {
515 cout <<
"TSS STRING found in DB" << endl;
519 unsigned short int itss = buffer[3];
520 for (
int i = 0;
i < 31;
i++)
521 tss_buffer[itss][
i] = buffer[
i];
526 if (buffer[2] == 0x17) {
528 cout <<
"TSM STRING found in DB" << endl;
533 for (
int i = 0;
i < 9;
i++)
534 tsm_buffer[
i] = buffer[
i];
538 if (buffer[2] == 0xA8) {
540 cout <<
"LUT STRING found in DB" << endl;
600 int iwh = chambid.
wheel();
601 std::ostringstream os;
637 for (
int iwh = -2; iwh <= 2; ++iwh) {
638 for (
int ist = 1; ist <= 4; ++ist) {
639 for (
int ise = 1; ise <= 12; ++ise) {
641 vector<int> nmap = conf_map.getUntrackedParameter<vector<int>>(
645 cout <<
" Filling configuration for chamber : wh " << chambid.
wheel()
646 <<
", st " << chambid.
station() <<
", se " << chambid.
sector()
652 for (
int isl = 1; isl <= 3; isl++) {
653 int ncell = nmap[isl - 1];
655 for (
int ibti = 0; ibti < ncell; ibti++) {
659 cout <<
"Filling BTI config for chamber : wh " 661 <<
", se " << chambid.
sector() <<
"... sl " << isl
662 <<
", bti " << ibti + 1 << endl;
669 int ntraco = nmap[3];
671 for (
int itraco = 0; itraco < ntraco; itraco++) {
675 cout <<
"Filling TRACO config for chamber : wh " 676 << chambid.
wheel() <<
", st " << chambid.
station() <<
", se " 677 << chambid.
sector() <<
", traco " << itraco + 1 << endl;
691 for (
int iwh = -2; iwh <= 2; ++iwh) {
692 for (
int ise = 13; ise <= 14; ++ise) {
695 vector<int> nmap = conf_map.getUntrackedParameter<vector<int>>(
699 cout <<
" Filling configuration for chamber : wh " << chambid.
wheel()
700 <<
", st " << chambid.
station() <<
", se " << chambid.
sector()
706 for (
int isl = 1; isl <= 3; isl++) {
707 int ncell = nmap[isl - 1];
709 for (
int ibti = 0; ibti < ncell; ibti++) {
713 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel()
714 <<
", st " << chambid.
station() <<
", se " 715 << chambid.
sector() <<
"... sl " << isl <<
", bti " 723 int ntraco = nmap[3];
725 for (
int itraco = 0; itraco < ntraco; itraco++) {
729 cout <<
"Filling TRACO config for chamber : wh " << chambid.
wheel()
730 <<
", st " << chambid.
station() <<
", se " << chambid.
sector()
731 <<
", traco " << itraco + 1 << endl;
745 for (
int wh = -2; wh <= 2; wh++)
746 for (
int se = 1; se <= 12; se++)
762 cout <<
"DTConfigTrivialProducer::buildPedestals()" << endl;
765 for (
int iwh = -2; iwh <= 2; ++iwh) {
766 for (
int ist = 1; ist <= 4; ++ist) {
767 for (
int ise = 1; ise <= 14; ++ise) {
768 if (ise > 12 && ist != 4)
779 tpgPedestals.
setES(m_tpgParams);
std::string mapEntryName(const DTChamberId &chambid) const
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
T getUntrackedParameter(std::string const &, T const &) const
int readDTCCBConfig(const DTConfigManagerRcd &iRecord, DTConfigManager &dttpgConfig)
Read CCB string configuration.
void setDTConfigTSTheta(DTChamberId chambid, DTConfigTSTheta conf)
Set DTConfigTSTheta for desired chip.
ccb_config_map::const_iterator ccb_config_iterator
const EventID & eventID() const
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
void getData(const DTKeyedConfigListRcd &keyRecord, int cfgId, std::vector< std::string > &list)
void setES(DTTPGParameters const *tpgParams, DTT0 const *t0Params=nullptr)
Set parameters from ES.
DTKeyedConfigCache cfgCache
const std::string & version() const
access version
void setDebug(bool debug)
Set debug flag.
void setDebug(bool debug)
Set debug flag.
const_iterator end() const
DTConfigPedestals buildTrivialPedestals()
SV for debugging purpose ONLY.
ccb_config_map configKeyMap() const
DTConfigDBProducer(const edm::ParameterSet &)
Constructor.
int nValidTSM() const
Number of correctly configured TSS.
void setDTConfigTraco(DTTracoId, DTConfigTraco)
Set DTConfigTraco for desired chip.
std::unique_ptr< DTConfigManager > produce(const DTConfigManagerRcd &)
ES produce method.
int checkDTCCBConfig(DTConfigManager &dttpgConfig)
110629 SV function for CCB configuration check
static int getPN(int whe, int sec, int sta)
const DepRecordT getRecord() const
void setDTConfigBti(DTBtiId, DTConfigBti)
Set DTConfigBti for desired chip.
const std::map< DTBtiId, DTConfigBti > & getDTConfigBtiMap(DTChamberId) const
Get desired BTI configuration map for a given DTChamber.
void configFromCfg(DTConfigManager &dttpgConfig)
SV for debugging purpose ONLY.
void setDTConfigTSPhi(DTChamberId chambid, DTConfigTSPhi conf)
Set DTConfigTSPhi for desired chip.
void setUseT0(bool useT0)
Set t0i subtraction.
std::vector< std::pair< DTCCBId, std::vector< int > > > ccb_config_map
void setDebug(bool debug)
Set debug flag.
const std::map< DTTracoId, DTConfigTraco > & getDTConfigTracoMap(DTChamberId) const
Get desired TRACO configuration map for a given DTChamber.
void setDTConfigLUTs(DTChamberId chambid, DTConfigLUTs conf)
Set DTConfigLUTs for desired chamber.
void setDTConfigPedestals(DTConfigPedestals pedestals)
Set DTConfigPedestals configuration.
static int getCT(int whe, int sec, int sta)
void setDTConfigSectColl(DTSectCollId sectcollid, DTConfigSectColl conf)
Set DTConfigSectColl for desired chip.
void readDBPedestalsConfig(const DTConfigManagerRcd &iRecord, DTConfigManager &dttpgConfig)
Read DTTPG pedestal configuration.
bool lutFromDB() const
Lut from DB flag.
void setCCBConfigValidity(bool CCBValid)
Set the flag for CCB configuration validity.
int nValidTSS() const
Number of correctly configured TSS.
const DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.
~DTConfigDBProducer() override
Destructor.
const IOVSyncValue & first() const
int station() const
Return the station number.
void setDTConfigTrigUnit(DTChamberId chambid, DTConfigTrigUnit conf)
Set DTConfigTrigUnit for desired chamber.
int wheel() const
Return the wheel number.
ValidityInterval const & validityInterval() const
const_iterator begin() const
T const * product() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run