75 std::auto_ptr<DTConfigManager> dtConfig = std::auto_ptr<DTConfigManager>(
new DTConfigManager() );
83 dttpgConfig.setLutFromDB(tracoLutsFromDB);
84 dttpgConfig.setUseAcceptParam(useBtiAcceptParam);
89 dttpgConfig.setDTTPGDebug(dttpgdebug);
93 dttpgConfig.setLutFromDB(
false);
105 dttpgConfig.setCCBConfigValidity(
false);
107 LogVerbatim (
"DTTPG") <<
"DTConfigDBProducer::produce : Trivial : " << endl
108 <<
"configurations has been read from cfg" << endl;
110 LogVerbatim (
"DTTPG") <<
"DTConfigDBProducer::produce : " << endl
111 <<
"Configurations successfully read from OMDS" << endl;
113 LogProblem (
"DTTPG") <<
"DTConfigDBProducer::produce : " << endl
114 <<
"Wrong configuration return CODE" << endl;
158 int check_cfg_code = 0;
161 for(
int iwh=-2;iwh<=2;iwh++){
162 for(
int ise=1;ise<=12;ise++){
163 for(
int ist=1;ist<=4;ist++){
175 if((ist==1 && nbti!=168) ||
176 (ist==2 && nbti!=192) ||
177 (ist==3 && nbti!=224) ||
178 (ist==4 && (ise==1||ise==2||ise==3||ise==5||ise==6||ise==7||ise==8||ise==12) && nbti!=192) ||
179 (ist==4 && (ise==9||ise==11) && nbti!=96) ||
180 (ist==4 && ise==10 && nbti!=128) ||
181 (ist==4 && ise==4 && nbti!=160)){
183 return check_cfg_code;
187 if((ist==1 && ntraco!=13) ||
188 (ist==2 && ntraco!=16) ||
189 (ist==3 && ntraco!=20) ||
190 (ist==4 && (ise==1||ise==2||ise==3||ise==5||ise==6||ise==7||ise==8||ise==12) && ntraco!=24) ||
191 (ist==4 && (ise==9||ise==11) && ntraco!=12) ||
192 (ist==4 && ise==10 && ntraco!=16) ||
193 (ist==4 && ise==4 && ntraco!=20)){
195 return check_cfg_code;
199 if((ist==1 && ntss!=4) ||
200 (ist==2 && ntss!=4) ||
201 (ist==3 && ntss!=5) ||
202 (ist==4 && (ise==1||ise==2||ise==3||ise==5||ise==6||ise==7||ise==8||ise==12) && ntss!=6) ||
203 (ist==4 && (ise==9||ise==11) && ntss!=3) ||
204 (ist==4 && ise==10 && ntss!=4) ||
205 (ist==4 && ise==4 && ntss!=5) ){
207 return check_cfg_code;
213 return check_cfg_code;
224 for(
int ise=13;ise<=14;ise++){
233 if((ise==13 && nbti != 160) ||
234 (ise==14 && nbti != 128)){
236 return check_cfg_code;
238 if((ise==13 && ntraco != 20) ||
239 (ise==14 && ntraco != 16)){
241 return check_cfg_code;
243 if((ise==13 && ntss != 5) ||
244 (ise==14 && ntss != 4)) {
246 return check_cfg_code;
250 return check_cfg_code;
261 return check_cfg_code;
267 using namespace edm::eventsetup;
275 int ndata = std::distance( ccb_conf->begin(), ccb_conf->end() );
282 cout << ccb_conf->version() << endl;
283 cout << ndata <<
" data in the container" << endl;
287 unsigned int currValidityStart =
iov.first().eventID().run();
288 unsigned int currValidityEnd =
iov.last( ).eventID().run();
291 cout <<
"valid since run " << currValidityStart
292 <<
" to run " << currValidityEnd << endl;
308 if(ccb_conf->configKeyMap().size() != 250)
312 while ( iter != iend ) {
322 const DTCCBId& ccbId = iter->first;
324 cout <<
" Filling configuration for chamber : wh " << ccbId.
wheelId <<
" st "
326 << ccbId.
sectorId <<
" -> " << endl;
332 cout <<
"Chamber type : " << mbtype
333 <<
" 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;
355 cfgCache->getData( keyRecord,
id, 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;
365 std::string str = *s_iter++;
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();
371 while ( ptr < end ) {
374 if ( ( c1 >=
'0' ) && ( c1 <=
'9' ) ) i1 = c1 -
'0';
375 if ( ( c1 >=
'a' ) && ( c1 <=
'f' ) ) i1 = 10 + c1 -
'a';
376 if ( ( c1 >=
'A' ) && ( c1 <=
'F' ) ) i1 = 10 + c1 -
'A';
379 if ( ( c2 >=
'0' ) && ( c2 <=
'9' ) ) i2 = c2 -
'0';
380 if ( ( c2 >=
'a' ) && ( c2 <=
'f' ) ) i2 = 10 + c2 -
'a';
381 if ( ( c2 >=
'A' ) && ( c2 <=
'F' ) ) i2 = 10 + c2 -
'A';
382 buffer[
c] = ( i1 * 16 ) + i2;
387 if (buffer[2]==0x54){
389 cout <<
"BTI STRING found in DB" << endl;
399 cout <<
"Not existing board ... " << brd << endl;
403 cout <<
"Not existing chip... " << chip << endl;
413 if (brd==6 || brd==7) {
417 else if ((brd<3 && chip<32) || (brd==3 && chip<8))
421 if (brd==6 || brd==7) {
425 else if (brd<4 && chip<32)
429 if (brd==6 || brd==7) {
433 else if (brd<5 && chip<32)
437 if (brd<6 && chip<32)
441 if (brd<3 && chip<32)
445 if (brd<5 && chip<32)
449 if (brd<4 && chip<32)
453 if (!PhiSL && !ThetaSL) {
454 cout <<
"MB type " << mbtype << endl;
455 cout <<
"Board " << brd <<
" chip " <<chip << endl;
456 cout <<
"Not phi SL nor Theta SL" << endl;
468 ibti=brd*16+(int)(chip/8)*4+(chip%4);
473 ibti=brd*32+ chip-4*(
int)(chip/8);
475 ibti=brd*32+ chip+12-4*(int)(chip/8);
484 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel() <<
485 ", st " << chambid.
station() <<
486 ", se " << chambid.
sector() <<
488 ", 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() <<
508 ", se " << chambid.
sector() <<
509 ", board " << traco_brd <<
510 ", chip " << traco_chip <<
511 ", traco " << itraco << endl;
516 if (buffer[2]==0x16){
518 cout <<
"TSS STRING found in DB" << endl;
522 unsigned short int itss=buffer[3];
523 for (
int i=0;
i<31;
i++)
524 tss_buffer[itss][
i]=buffer[
i];
529 if (buffer[2]==0x17){
531 cout <<
"TSM STRING found in DB" << endl;
536 for (
int i=0;
i<9;
i++)
537 tsm_buffer[
i]=buffer[
i];
541 if (buffer[2]==0xA8){
543 cout <<
"LUT STRING found in DB" << endl;
599 int iwh = chambid.
wheel();
600 std::ostringstream os;
631 for (
int iwh=-2;iwh<=2;++iwh){
632 for (
int ist=1;ist<=4;++ist){
633 for (
int ise=1;ise<=12;++ise){
635 vector<int> nmap = conf_map.getUntrackedParameter<vector<int> >(
mapEntryName(chambid).c_str());
639 cout <<
" Filling configuration for chamber : wh " << chambid.
wheel() <<
640 ", st " << chambid.
station() <<
641 ", se " << chambid.
sector() << endl;
646 for (
int isl=1;isl<=3;isl++){
647 int ncell = nmap[isl-1];
649 for (
int ibti=0;ibti<ncell;ibti++){
652 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel() <<
653 ", st " << chambid.
station() <<
654 ", se " << chambid.
sector() <<
656 ", bti " << ibti+1 << endl;
663 int ntraco = nmap[3];
665 for (
int itraco=0;itraco<ntraco;itraco++){
668 cout <<
"Filling TRACO config for chamber : wh " << chambid.
wheel() <<
669 ", st " << chambid.
station() <<
670 ", se " << chambid.
sector() <<
671 ", traco " << itraco+1 << endl;
687 for (
int iwh=-2;iwh<=2;++iwh){
688 for (
int ise=13;ise<=14;++ise){
691 vector<int> nmap = conf_map.getUntrackedParameter<vector<int> >(
mapEntryName(chambid).c_str());
695 cout <<
" Filling configuration for chamber : wh " << chambid.
wheel() <<
696 ", st " << chambid.
station() <<
697 ", se " << chambid.
sector() << endl;
702 for (
int isl=1;isl<=3;isl++){
703 int ncell = nmap[isl-1];
705 for (
int ibti=0;ibti<ncell;ibti++){
708 cout <<
"Filling BTI config for chamber : wh " << chambid.
wheel() <<
709 ", st " << chambid.
station() <<
710 ", se " << chambid.
sector() <<
712 ", bti " << ibti+1 << endl;
719 int ntraco = nmap[3];
721 for (
int itraco=0;itraco<ntraco;itraco++){
724 cout <<
"Filling TRACO config for chamber : wh " << chambid.
wheel() <<
725 ", st " << chambid.
station() <<
726 ", se " << chambid.
sector() <<
727 ", traco " << itraco+1 << endl;
742 for (
int wh=-2;wh<=2;wh++)
743 for (
int se=1;se<=12;se++)
761 cout <<
"DTConfigTrivialProducer::buildPedestals()" << endl;
764 for (
int iwh=-2;iwh<=2;++iwh){
765 for (
int ist=1;ist<=4;++ist){
766 for (
int ise=1;ise<=14;++ise){
767 if (ise>12 && ist!=4)
continue;
777 tpgPedestals.
setES(m_tpgParams);
std::string mapEntryName(const DTChamberId &chambid) const
std::auto_ptr< DTConfigManager > produce(const DTConfigManagerRcd &)
ES produce method.
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.
~DTConfigDBProducer()
Destructor.
ccb_config_map::const_iterator ccb_config_iterator
int nValidTSS()
Number of correctly configured TSS.
int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit)
void setDebug(bool debug)
Set debug flag.
void setDebug(bool debug)
Set debug flag.
DTConfigPedestals buildTrivialPedestals()
SV for debugging purpose ONLY.
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
DTConfigDBProducer(const edm::ParameterSet &)
Constructor.
void setDTConfigTraco(DTTracoId, DTConfigTraco)
Set DTConfigTraco for desired chip.
const DepRecordT & getRecord() const
int checkDTCCBConfig(DTConfigManager &dttpgConfig)
110629 SV function for CCB configuration check
static int getPN(int whe, int sec, int sta)
void setES(DTTPGParameters const *tpgParams, DTT0 const *t0Params=0)
Set parameters from ES.
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.
T const * product() const
bool lutFromDB() const
Lut from DB flag.
void setCCBConfigValidity(bool CCBValid)
Set the flag for CCB configuration validity.
int nValidTSM()
Number of correctly configured TSS.
static DTConfigAbstractHandler * getInstance()
get static object
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
DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.
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