20 std::istringstream
iss ;
25 gzf = gzopen(file,
"rb") ;
46 {
return ((
eof==
true)?((
void*)0):
iss) ; }
52 while ((gis)&&(!(gis.
iss>>var)))
63 dbFilename_(iConfig.getUntrackedParameter<std::string>(
"DatabaseFile",
"")),
64 flagPrint_(iConfig.getParameter<bool>(
"WriteInFile"))
103 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
107 item.
mean_x6 = (it->second)[3] ;
108 item.
mean_x1 = (it->second)[6] ;
109 prod->setValue(it->first,item) ;
118 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
122 item.
mult_x6 = (it->second)[4] ;
123 item.
mult_x1 = (it->second)[7] ;
127 prod->setValue(it->first,item) ;
136 for (
int subdet=0 ; subdet<2 ; subdet++) {
137 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
139 prod->setValue(it->first,(it->second)[0]) ;
150 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
152 fg.
setValues((it->second)[0], (it->second)[1], (it->second)[2], (it->second)[3], (it->second)[4]) ;
153 prod->setValue(it->first,fg) ;
163 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
167 item.
lut = (it->second)[3] ;
168 prod->setValue(it->first,item) ;
174 item.
lut = (it->second)[3] ;
175 prod->setValue(it->first,item) ;
184 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
186 prod->setValue(it->first,(it->second)[1]) ;
196 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
198 unsigned int lutArray[1024] ;
199 for (
int i=0 ;
i <1024 ;
i++) lutArray[
i] = (it->second)[
i] ;
201 prod->setValue(it->first,lut) ;
211 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
218 prod->setValue(it->first,weights) ;
227 for (
int subdet=0 ; subdet<2 ; subdet++) {
228 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
230 prod->setValue(it->first,(it->second)[1]) ;
240 for (
int subdet=0 ; subdet<2 ; subdet++) {
241 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
243 prod->setValue(it->first,(it->second)[0]) ;
253 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
255 prod->setValue(it->first,(it->second)[1]) ;
264 std::map<uint32_t, std::vector<float> >::const_iterator it ;
267 item.
EtSat = (it->second)[0] ;
274 prod->setValue(it->first,item) ;
283 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
288 prod->setValue(it->first,badXValue) ;
306 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
310 prod->setValue(it->first,0) ;
315 prod->setValue(it->first,0) ;
326 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it;
329 prod->setValue(it->first, (it->second)[2]);
339 std::string dataCard ;
342 std::vector<unsigned int> param ;
343 std::vector<float> paramF ;
344 int NBstripparams[2] = {4, 4} ;
348 std::string bufString;
352 std::string finalFileName ;
356 finalFileName = fileInPath.
fullPath() ;
360 edm::LogWarning(
"EcalTPG") <<
"Couldnt find database file via fileinpath, trying with pathname directly!!";
367 while (gis>>dataCard) {
369 if (dataCard ==
"PHYSICS_EB" || dataCard ==
"PHYSICS_EE") {
373 std::cout<<dataCard<<
" "<<std::dec<<
id <<std::endl;
381 for (
int i=0 ;
i <7 ;
i++) {
382 gis>>std::dec>>dataF ;
383 paramF.push_back(dataF) ;
389 std::ostringstream oss;
391 std::string result1 = oss.str();
399 std::ostringstream oss;
401 std::string result2 = oss.str();
421 if (dataCard ==
"CRYSTAL") {
432 std::cout <<
"COMMENT ====== barrel crystals ====== " <<std::endl;
435 std::cout <<
"COMMENT ====== endcap crystals ====== " <<std::endl;
439 std::cout<<dataCard<<
" "<<std::dec<<
id << std::endl;
443 for (
int i=0 ;
i <9 ;
i++) {
444 gis>>std::hex>>
data ;
446 param.push_back(data);
450 std::ostringstream oss;
451 oss << std::hex<<
data;
452 std::string result1 = oss.str();
459 }
else if(
i>2 &&
i<6){
460 std::ostringstream oss;
461 oss << std::hex <<
data;
462 std::string result2 = oss.str();
468 }
else if(
i>5 &&
i<9){
469 std::ostringstream oss;
470 oss << std::hex<<
data;
471 std::string result3 = oss.str();
492 if (dataCard ==
"STRIP_EB") {
498 std::cout<<dataCard<<
" "<<std::dec<<
id <<std::endl;
501 for (
int i=0 ;
i <NBstripparams[0] ;
i++) {
502 gis>>std::hex>>
data ;
504 param.push_back(data);
508 std::cout<<
"0x"<<std::hex<< data << std::endl;
511 std::cout<<
""<<std::hex<< data << std::endl;
514 std::ostringstream oss;
516 oss<<
"0x"<<std::hex<<
data;
517 std::string result4 = oss.str();
520 std::ostringstream oss;
521 oss<<
" 0x"<<std::hex<<
data;
522 std::string result5 = oss.str();
535 if (dataCard ==
"STRIP_EE") {
541 std::cout<<dataCard<<
" "<<std::dec<<
id << std::endl;
545 for (
int i=0 ;
i <NBstripparams[1] ;
i++) {
546 gis>>std::hex>>
data ;
547 param.push_back(data);
551 std::cout<<
"0x"<<std::hex<<data << std::endl;
553 std::cout<<
" "<<std::hex<<data<< std::endl;
555 std::ostringstream oss;
557 oss<<
"0x"<<std::hex<<
data;
558 std::string result4 = oss.str();
561 std::ostringstream oss;
562 oss<<
" 0x"<<std::hex<<
data;
563 std::string result5 = oss.str();
576 if(dataCard ==
"TOWER_EE"){
580 std::cout<<dataCard<<
" "<<std::dec<<
id <<std::endl;
583 for (
int i=0 ;
i <2 ;
i++) {
584 gis>>std::hex>>
data ;
585 param.push_back(data);
589 std::cout <<
"0x" <<std::dec<<data << std::endl;
591 std::cout <<
" " <<std::dec<<data << std::endl;
600 if (dataCard ==
"TOWER_EB") {
604 std::cout<<dataCard<<
" "<<std::dec<<
id << std::endl;
607 for (
int i=0 ;
i <3 ;
i++) {
608 gis>>std::dec>>
data ;
611 std::cout <<
" " << std::dec << data << std::endl;
614 param.push_back(data) ;
621 if (dataCard ==
"WEIGHT") {
628 std::cout<<dataCard<<
" "<<std::dec<<
id <<std::endl;
634 for (
int i=0 ;
i <5 ;
i++) {
635 gis>>std::hex>>
data ;
636 param.push_back(data);
639 std::ostringstream oss;
640 oss << std::hex<<
data;
641 std::string result4 = oss.str();
659 if (dataCard ==
"FG") {
666 std::cout<<dataCard<<
" "<<std::dec<<
id <<std::endl;
670 for (
int i=0 ;
i <5 ;
i++) {
671 gis>>std::hex>>
data ;
672 param.push_back(data);
675 std::ostringstream oss;
676 oss << std::hex<<
data;
678 std::string result5 = oss.str();
695 if (dataCard ==
"LUT") {
699 std::cout<<dataCard<<
" "<<std::dec<<
id <<std::endl;
702 for (
int i=0 ;
i <1024 ;
i++) {
703 gis>>std::hex>>
data ;
704 param.push_back(data);
707 std::cout<<
"0x"<<std::hex<<data <<std::endl;
722 std::vector<int> range ;
725 range.push_back(37) ;
726 range.push_back(73) ;
728 range.push_back(69) ;
736 range.push_back(73) ;
737 range.push_back(109) ;
740 range.push_back(37) ;
743 range.push_back(29) ;
754 if (towerNbInTcc>0) {
755 range[2] = towerNbInTcc ;
756 range[3] = towerNbInTcc+1 ;
758 if (stripNbInTower>0) {
759 range[4] = stripNbInTower ;
760 range[5] = stripNbInTower+1 ;
762 if (xtalNbInStrip>0) {
763 range[6] = xtalNbInStrip ;
764 range[7] = xtalNbInStrip+1 ;
std::vector< int > getRange(int subdet, int smNb, int towerNbInSm, int stripNbInTower=0, int xtalNbInStrip=0)
std::auto_ptr< EcalTPGLutGroup > produceLutGroup(const EcalTPGLutGroupRcd &)
void setValues(const uint32_t &ThresholdETLow, const uint32_t &ThresholdETHigh, const uint32_t &RatioLow, const uint32_t &RatioHigh, const uint32_t &LUT)
std::auto_ptr< EcalTPGTowerStatus > produceBadTT(const EcalTPGTowerStatusRcd &)
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
std::auto_ptr< EcalTPGSpike > produceSpike(const EcalTPGSpikeRcd &)
void setLut(const unsigned int *lut)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
std::auto_ptr< EcalTPGStripStatus > produceBadStrip(const EcalTPGStripStatusRcd &)
void setStatusCode(const uint16_t &val)
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
std::auto_ptr< EcalTPGFineGrainTowerEE > produceFineGrainEEtower(const EcalTPGFineGrainTowerEERcd &)
std::auto_ptr< EcalTPGCrystalStatus > produceBadX(const EcalTPGCrystalStatusRcd &)
EcalTPGCrystalStatusMap EcalTPGCrystalStatus
~EcalTrigPrimESProducer()
std::auto_ptr< EcalTPGFineGrainStripEE > produceFineGrainEEstrip(const EcalTPGFineGrainStripEERcd &)
std::map< uint32_t, std::vector< uint32_t > > mapWeight_
std::auto_ptr< EcalTPGFineGrainEBIdMap > produceFineGrainEB(const EcalTPGFineGrainEBIdMapRcd &)
std::auto_ptr< EcalTPGSlidingWindow > produceSlidingWindow(const EcalTPGSlidingWindowRcd &)
std::auto_ptr< EcalTPGPedestals > producePedestals(const EcalTPGPedestalsRcd &)
EcalTrigPrimESProducer(const edm::ParameterSet &)
std::auto_ptr< EcalTPGLinearizationConst > produceLinearizationConst(const EcalTPGLinearizationConstRcd &)
std::map< uint32_t, std::vector< uint32_t > > mapFg_
std::auto_ptr< EcalTPGLutIdMap > produceLUT(const EcalTPGLutIdMapRcd &)
double ttf_threshold_High
std::istream & operator>>(std::istream &input, CLHEP::HepGenMatrix &matrix)
std::map< uint32_t, std::vector< float > > mapPhys_
char data[epos_bytes_allocation]
std::auto_ptr< EcalTPGWeightGroup > produceWeightGroup(const EcalTPGWeightGroupRcd &)
std::string fullPath() const
void setValues(const uint32_t &w0, const uint32_t &w1, const uint32_t &w2, const uint32_t &w3, const uint32_t &w4)
std::map< uint32_t, std::vector< uint32_t > > mapLut_
EcalTPGPedestalsMap EcalTPGPedestals
std::auto_ptr< EcalTPGPhysicsConst > producePhysicsConst(const EcalTPGPhysicsConstRcd &)
std::auto_ptr< EcalTPGFineGrainEBGroup > produceFineGrainEBGroup(const EcalTPGFineGrainEBGroupRcd &)
std::auto_ptr< EcalTPGWeightIdMap > produceWeight(const EcalTPGWeightIdMapRcd &)
std::map< uint32_t, std::vector< uint32_t > > mapStrip_[2]
EcalTPGLinearizationConstMap EcalTPGLinearizationConst