28 using std::unique_ptr;
74 std::unique_ptr<DTConfigManager> dtConfig = std::unique_ptr<DTConfigManager>(
new DTConfigManager() );
82 dttpgConfig.setLutFromDB(tracoLutsFromDB);
83 dttpgConfig.setUseAcceptParam(useBtiAcceptParam);
88 dttpgConfig.setDTTPGDebug(dttpgdebug);
92 dttpgConfig.setLutFromDB(
false);
104 dttpgConfig.setCCBConfigValidity(
false);
106 LogVerbatim (
"DTTPG") <<
"DTConfigDBProducer::produce : Trivial : " << endl
107 <<
"configurations has been read from cfg" << endl;
109 LogVerbatim (
"DTTPG") <<
"DTConfigDBProducer::produce : " << endl
110 <<
"Configurations successfully read from OMDS" << endl;
112 LogProblem (
"DTTPG") <<
"DTConfigDBProducer::produce : " << endl
113 <<
"Wrong configuration return CODE" << endl;
157 int check_cfg_code = 0;
160 for(
int iwh=-2;iwh<=2;iwh++){
161 for(
int ise=1;ise<=12;ise++){
162 for(
int ist=1;ist<=4;ist++){
174 if((ist==1 && nbti!=168) ||
175 (ist==2 && nbti!=192) ||
176 (ist==3 && nbti!=224) ||
177 (ist==4 && (ise==1||ise==2||ise==3||ise==5||ise==6||ise==7||ise==8||ise==12) && nbti!=192) ||
178 (ist==4 && (ise==9||ise==11) && nbti!=96) ||
179 (ist==4 && ise==10 && nbti!=128) ||
180 (ist==4 && ise==4 && nbti!=160)){
182 return check_cfg_code;
186 if((ist==1 && ntraco!=13) ||
187 (ist==2 && ntraco!=16) ||
188 (ist==3 && ntraco!=20) ||
189 (ist==4 && (ise==1||ise==2||ise==3||ise==5||ise==6||ise==7||ise==8||ise==12) && ntraco!=24) ||
190 (ist==4 && (ise==9||ise==11) && ntraco!=12) ||
191 (ist==4 && ise==10 && ntraco!=16) ||
192 (ist==4 && ise==4 && ntraco!=20)){
194 return check_cfg_code;
198 if((ist==1 && ntss!=4) ||
199 (ist==2 && ntss!=4) ||
200 (ist==3 && ntss!=5) ||
201 (ist==4 && (ise==1||ise==2||ise==3||ise==5||ise==6||ise==7||ise==8||ise==12) && ntss!=6) ||
202 (ist==4 && (ise==9||ise==11) && ntss!=3) ||
203 (ist==4 && ise==10 && ntss!=4) ||
204 (ist==4 && ise==4 && ntss!=5) ){
206 return check_cfg_code;
212 return check_cfg_code;
223 for(
int ise=13;ise<=14;ise++){
232 if((ise==13 && nbti != 160) ||
233 (ise==14 && nbti != 128)){
235 return check_cfg_code;
237 if((ise==13 && ntraco != 20) ||
238 (ise==14 && ntraco != 16)){
240 return check_cfg_code;
242 if((ise==13 && ntss != 5) ||
243 (ise==14 && ntss != 4)) {
245 return check_cfg_code;
249 return check_cfg_code;
260 return check_cfg_code;
281 cout << ndata <<
" data in the container" << endl;
286 unsigned int currValidityEnd = iov.last( ).eventID().run();
289 cout <<
"valid since run " << currValidityStart
290 <<
" to run " << currValidityEnd << endl;
310 while ( iter != iend ) {
320 const DTCCBId& ccbId = iter->first;
322 cout <<
" Filling configuration for chamber : wh " << ccbId.
wheelId <<
" st " 324 << ccbId.
sectorId <<
" -> " << endl;
330 cout <<
"Chamber type : " << mbtype
331 <<
" posneg : " << posneg << endl;
335 const std::vector<int>& ccbConf = iter->second;
336 std::vector<int>::const_iterator cfgIter = ccbConf.begin();
337 std::vector<int>::const_iterator cfgIend = ccbConf.end();
340 unsigned short int tss_buffer[7][31];
341 unsigned short int tsm_buffer[9];
345 while ( cfgIter != cfgIend ) {
349 cout <<
" BRICK " <<
id << endl;
352 std::vector<std::string>
list;
356 std::vector<std::string>::const_iterator s_iter = list.begin();
357 std::vector<std::string>::const_iterator s_iend = list.end();
358 while ( s_iter != s_iend ) {
360 cout <<
" ----> " << *s_iter << endl;
364 unsigned short int buffer[100];
366 const char* cstr = str.c_str();
367 const char* ptr = cstr + 2;
368 const char*
end = cstr + str.length();
369 while ( ptr < end ) {
372 if ( ( c1 >=
'0' ) && ( c1 <=
'9' ) ) i1 = c1 -
'0';
373 if ( ( c1 >=
'a' ) && ( c1 <=
'f' ) ) i1 = 10 + c1 -
'a';
374 if ( ( c1 >=
'A' ) && ( c1 <=
'F' ) ) i1 = 10 + c1 -
'A';
377 if ( ( c2 >=
'0' ) && ( c2 <=
'9' ) ) i2 = c2 -
'0';
378 if ( ( c2 >=
'a' ) && ( c2 <=
'f' ) ) i2 = 10 + c2 -
'a';
379 if ( ( c2 >=
'A' ) && ( c2 <=
'F' ) ) i2 = 10 + c2 -
'A';
380 buffer[
c] = ( i1 * 16 ) + i2;
385 if (buffer[2]==0x54){
387 cout <<
"BTI STRING found in DB" << endl;
397 cout <<
"Not existing board ... " << brd << endl;
401 cout <<
"Not existing chip... " << chip << endl;
411 if (brd==6 || brd==7) {
415 else if ((brd<3 && chip<32) || (brd==3 && chip<8))
419 if (brd==6 || brd==7) {
423 else if (brd<4 && chip<32)
427 if (brd==6 || brd==7) {
431 else if (brd<5 && chip<32)
435 if (brd<6 && chip<32)
439 if (brd<3 && chip<32)
443 if (brd<5 && chip<32)
447 if (brd<4 && chip<32)
451 if (!PhiSL && !ThetaSL) {
452 cout <<
"MB type " << mbtype << endl;
453 cout <<
"Board " << brd <<
" chip " <<chip << endl;
454 cout <<
"Not phi SL nor Theta SL" << endl;
466 ibti=brd*16+(
int)(chip/8)*4+(chip%4);
471 ibti=brd*32+ chip-4*(
int)(chip/8);
473 ibti=brd*32+ chip+12-4*(
int)(chip/8);
482 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel() <<
483 ", st " << chambid.
station() <<
484 ", se " << chambid.
sector() <<
486 ", bti " << ibti+1 << endl;
490 if (buffer[2]==0x15){
492 cout <<
"TRACO STRING found in DB" << endl;
497 int traco_brd = buffer[3];
498 int traco_chip = buffer[4];
499 int itraco = traco_brd * 4 + traco_chip + 1;
504 cout <<
"Filling TRACO config for chamber : wh " << chambid.
wheel() <<
505 ", st " << chambid.
station() <<
506 ", se " << chambid.
sector() <<
507 ", board " << traco_brd <<
508 ", chip " << traco_chip <<
509 ", traco " << itraco << endl;
514 if (buffer[2]==0x16){
516 cout <<
"TSS STRING found in DB" << endl;
520 unsigned short int itss=buffer[3];
521 for (
int i=0;
i<31;
i++)
522 tss_buffer[itss][
i]=buffer[
i];
527 if (buffer[2]==0x17){
529 cout <<
"TSM STRING found in DB" << endl;
534 for (
int i=0;
i<9;
i++)
535 tsm_buffer[
i]=buffer[
i];
539 if (buffer[2]==0xA8){
541 cout <<
"LUT STRING found in DB" << endl;
597 int iwh = chambid.
wheel();
598 std::ostringstream os;
629 for (
int iwh=-2;iwh<=2;++iwh){
630 for (
int ist=1;ist<=4;++ist){
631 for (
int ise=1;ise<=12;++ise){
633 vector<int> nmap = conf_map.getUntrackedParameter<vector<int> >(
mapEntryName(chambid).c_str());
637 cout <<
" Filling configuration for chamber : wh " << chambid.
wheel() <<
638 ", st " << chambid.
station() <<
639 ", se " << chambid.
sector() << endl;
644 for (
int isl=1;isl<=3;isl++){
645 int ncell = nmap[isl-1];
647 for (
int ibti=0;ibti<ncell;ibti++){
650 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel() <<
651 ", st " << chambid.
station() <<
652 ", se " << chambid.
sector() <<
654 ", bti " << ibti+1 << endl;
661 int ntraco = nmap[3];
663 for (
int itraco=0;itraco<ntraco;itraco++){
666 cout <<
"Filling TRACO config for chamber : wh " << chambid.
wheel() <<
667 ", st " << chambid.
station() <<
668 ", se " << chambid.
sector() <<
669 ", traco " << itraco+1 << endl;
685 for (
int iwh=-2;iwh<=2;++iwh){
686 for (
int ise=13;ise<=14;++ise){
689 vector<int> nmap = conf_map.getUntrackedParameter<vector<int> >(
mapEntryName(chambid).c_str());
693 cout <<
" Filling configuration for chamber : wh " << chambid.
wheel() <<
694 ", st " << chambid.
station() <<
695 ", se " << chambid.
sector() << endl;
700 for (
int isl=1;isl<=3;isl++){
701 int ncell = nmap[isl-1];
703 for (
int ibti=0;ibti<ncell;ibti++){
706 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel() <<
707 ", st " << chambid.
station() <<
708 ", se " << chambid.
sector() <<
710 ", bti " << ibti+1 << endl;
717 int ntraco = nmap[3];
719 for (
int itraco=0;itraco<ntraco;itraco++){
722 cout <<
"Filling TRACO config for chamber : wh " << chambid.
wheel() <<
723 ", st " << chambid.
station() <<
724 ", se " << chambid.
sector() <<
725 ", traco " << itraco+1 << endl;
740 for (
int wh=-2;wh<=2;wh++)
741 for (
int se=1;se<=12;se++)
759 cout <<
"DTConfigTrivialProducer::buildPedestals()" << endl;
762 for (
int iwh=-2;iwh<=2;++iwh){
763 for (
int ist=1;ist<=4;++ist){
764 for (
int ise=1;ise<=14;++ise){
765 if (ise>12 && ist!=4)
continue;
775 tpgPedestals.
setES(m_tpgParams);
std::string mapEntryName(const DTChamberId &chambid) const
T getParameter(std::string const &) const
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.
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
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