19 std::istringstream
iss ;
24 gzf = gzopen(file,
"rb") ;
45 {
return ((
eof==
true)?((
void*)0):
iss) ; }
51 while ((gis)&&(!(gis.
iss>>var)))
62 dbFilename_(iConfig.getUntrackedParameter<std::
string>(
"DatabaseFile",
"")),
63 flagPrint_(iConfig.getParameter<bool>(
"WriteInFile"))
102 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
106 item.
mean_x6 = (it->second)[3] ;
107 item.
mean_x1 = (it->second)[6] ;
108 prod->setValue(it->first,item) ;
117 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
121 item.
mult_x6 = (it->second)[4] ;
122 item.
mult_x1 = (it->second)[7] ;
126 prod->setValue(it->first,item) ;
135 for (
int subdet=0 ; subdet<2 ; subdet++) {
136 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
138 prod->setValue(it->first,(it->second)[0]) ;
149 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
151 fg.
setValues((it->second)[0], (it->second)[1], (it->second)[2], (it->second)[3], (it->second)[4]) ;
152 prod->setValue(it->first,fg) ;
162 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
166 item.
lut = (it->second)[3] ;
167 prod->setValue(it->first,item) ;
173 item.
lut = (it->second)[3] ;
174 prod->setValue(it->first,item) ;
183 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
185 prod->setValue(it->first,(it->second)[1]) ;
195 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
197 unsigned int lutArray[1024] ;
198 for (
int i=0 ;
i <1024 ;
i++) lutArray[
i] = (it->second)[
i] ;
200 prod->setValue(it->first,lut) ;
210 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
217 prod->setValue(it->first,weights) ;
226 for (
int subdet=0 ; subdet<2 ; subdet++) {
227 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
229 prod->setValue(it->first,(it->second)[1]) ;
239 for (
int subdet=0 ; subdet<2 ; subdet++) {
240 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
242 prod->setValue(it->first,(it->second)[0]) ;
252 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
254 prod->setValue(it->first,(it->second)[1]) ;
263 std::map<uint32_t, std::vector<float> >::const_iterator it ;
266 item.
EtSat = (it->second)[0] ;
273 prod->setValue(it->first,item) ;
282 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
287 prod->setValue(it->first,badXValue) ;
305 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
309 prod->setValue(it->first,0) ;
314 prod->setValue(it->first,0) ;
325 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it;
328 prod->setValue(it->first, (it->second)[2]);
341 std::vector<unsigned int> param ;
342 std::vector<float> paramF ;
343 int NBstripparams[2] = {4, 4} ;
355 finalFileName = fileInPath.
fullPath() ;
359 edm::LogWarning(
"EcalTPG") <<
"Couldnt find database file via fileinpath, trying with pathname directly!!";
366 while (gis>>dataCard) {
368 if (dataCard ==
"PHYSICS_EB" || dataCard ==
"PHYSICS_EE") {
380 for (
int i=0 ;
i <7 ;
i++) {
382 paramF.push_back(dataF) ;
388 std::ostringstream oss;
398 std::ostringstream oss;
420 if (dataCard ==
"CRYSTAL") {
431 std::cout <<
"COMMENT ====== barrel crystals ====== " <<std::endl;
434 std::cout <<
"COMMENT ====== endcap crystals ====== " <<std::endl;
442 for (
int i=0 ;
i <9 ;
i++) {
443 gis>>std::hex>>
data ;
445 param.push_back(data);
449 std::ostringstream oss;
450 oss << std::hex<<
data;
458 }
else if(
i>2 &&
i<6){
459 std::ostringstream oss;
460 oss << std::hex <<
data;
467 }
else if(
i>5 &&
i<9){
468 std::ostringstream oss;
469 oss << std::hex<<
data;
491 if (dataCard ==
"STRIP_EB") {
500 for (
int i=0 ;
i <NBstripparams[0] ;
i++) {
501 gis>>std::hex>>
data ;
503 param.push_back(data);
507 std::cout<<
"0x"<<std::hex<< data << std::endl;
510 std::cout<<
""<<std::hex<< data << std::endl;
513 std::ostringstream oss;
515 oss<<
"0x"<<std::hex<<
data;
519 std::ostringstream oss;
520 oss<<
" 0x"<<std::hex<<
data;
534 if (dataCard ==
"STRIP_EE") {
544 for (
int i=0 ;
i <NBstripparams[1] ;
i++) {
545 gis>>std::hex>>
data ;
546 param.push_back(data);
550 std::cout<<
"0x"<<std::hex<<data << std::endl;
552 std::cout<<
" "<<std::hex<<data<< std::endl;
554 std::ostringstream oss;
556 oss<<
"0x"<<std::hex<<
data;
560 std::ostringstream oss;
561 oss<<
" 0x"<<std::hex<<
data;
575 if(dataCard ==
"TOWER_EE"){
582 for (
int i=0 ;
i <2 ;
i++) {
583 gis>>std::hex>>
data ;
584 param.push_back(data);
599 if (dataCard ==
"TOWER_EB") {
606 for (
int i=0 ;
i <3 ;
i++) {
613 param.push_back(data) ;
620 if (dataCard ==
"WEIGHT") {
633 for (
int i=0 ;
i <5 ;
i++) {
634 gis>>std::hex>>
data ;
635 param.push_back(data);
638 std::ostringstream oss;
639 oss << std::hex<<
data;
658 if (dataCard ==
"FG") {
669 for (
int i=0 ;
i <5 ;
i++) {
670 gis>>std::hex>>
data ;
671 param.push_back(data);
674 std::ostringstream oss;
675 oss << std::hex<<
data;
694 if (dataCard ==
"LUT") {
701 for (
int i=0 ;
i <1024 ;
i++) {
702 gis>>std::hex>>
data ;
703 param.push_back(data);
706 std::cout<<
"0x"<<std::hex<<data <<std::endl;
721 std::vector<int> range ;
724 range.push_back(37) ;
725 range.push_back(73) ;
727 range.push_back(69) ;
735 range.push_back(73) ;
736 range.push_back(109) ;
739 range.push_back(37) ;
742 range.push_back(29) ;
753 if (towerNbInTcc>0) {
754 range[2] = towerNbInTcc ;
755 range[3] = towerNbInTcc+1 ;
757 if (stripNbInTower>0) {
758 range[4] = stripNbInTower ;
759 range[5] = stripNbInTower+1 ;
761 if (xtalNbInStrip>0) {
762 range[6] = xtalNbInStrip ;
763 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 &)
volatile std::atomic< bool > shutdown_flag false
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