19 std::istringstream
iss ;
24 gzf = gzopen(file,
"rb") ;
44 explicit operator bool()
const
46 return ((
eof ==
true) ?
false : !
iss.fail());
53 while ((
bool)gis && !(gis.
iss >> var))
64 dbFilename_(iConfig.getUntrackedParameter<std::
string>(
"DatabaseFile",
"")),
65 flagPrint_(iConfig.getParameter<bool>(
"WriteInFile"))
104 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
108 item.
mean_x6 = (it->second)[3] ;
109 item.
mean_x1 = (it->second)[6] ;
110 prod->setValue(it->first,item) ;
119 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
123 item.
mult_x6 = (it->second)[4] ;
124 item.
mult_x1 = (it->second)[7] ;
128 prod->setValue(it->first,item) ;
137 for (
int subdet=0 ; subdet<2 ; subdet++) {
138 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
140 prod->setValue(it->first,(it->second)[0]) ;
151 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
153 fg.
setValues((it->second)[0], (it->second)[1], (it->second)[2], (it->second)[3], (it->second)[4]) ;
154 prod->setValue(it->first,fg) ;
164 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
168 item.
lut = (it->second)[3] ;
169 prod->setValue(it->first,item) ;
175 item.
lut = (it->second)[3] ;
176 prod->setValue(it->first,item) ;
185 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
187 prod->setValue(it->first,(it->second)[1]) ;
197 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
199 unsigned int lutArray[1024] ;
200 for (
int i=0 ;
i <1024 ;
i++) lutArray[
i] = (it->second)[
i] ;
202 prod->setValue(it->first,lut) ;
212 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
219 prod->setValue(it->first,weights) ;
228 for (
int subdet=0 ; subdet<2 ; subdet++) {
229 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
231 prod->setValue(it->first,(it->second)[1]) ;
241 for (
int subdet=0 ; subdet<2 ; subdet++) {
242 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
244 prod->setValue(it->first,(it->second)[0]) ;
254 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
256 prod->setValue(it->first,(it->second)[1]) ;
265 std::map<uint32_t, std::vector<float> >::const_iterator it ;
268 item.
EtSat = (it->second)[0] ;
275 prod->setValue(it->first,item) ;
284 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
289 prod->setValue(it->first,badXValue) ;
307 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
311 prod->setValue(it->first,0) ;
316 prod->setValue(it->first,0) ;
327 std::map<uint32_t, std::vector<uint32_t> >::const_iterator it;
330 prod->setValue(it->first, (it->second)[2]);
343 std::vector<unsigned int> param ;
344 std::vector<float> paramF ;
345 int NBstripparams[2] = {4, 4} ;
357 finalFileName = fileInPath.
fullPath() ;
361 edm::LogWarning(
"EcalTPG") <<
"Couldnt find database file via fileinpath, trying with pathname directly!!";
368 while (gis>>dataCard) {
370 if (dataCard ==
"PHYSICS_EB" || dataCard ==
"PHYSICS_EE") {
382 for (
int i=0 ;
i <7 ;
i++) {
384 paramF.push_back(dataF) ;
390 std::ostringstream oss;
400 std::ostringstream oss;
422 if (dataCard ==
"CRYSTAL") {
433 std::cout <<
"COMMENT ====== barrel crystals ====== " <<std::endl;
436 std::cout <<
"COMMENT ====== endcap crystals ====== " <<std::endl;
444 for (
int i=0 ;
i <9 ;
i++) {
445 gis>>std::hex>>
data ;
447 param.push_back(data);
451 std::ostringstream oss;
452 oss << std::hex<<
data;
460 }
else if(
i>2 &&
i<6){
461 std::ostringstream oss;
462 oss << std::hex <<
data;
469 }
else if(
i>5 &&
i<9){
470 std::ostringstream oss;
471 oss << std::hex<<
data;
493 if (dataCard ==
"STRIP_EB") {
502 for (
int i=0 ;
i <NBstripparams[0] ;
i++) {
503 gis>>std::hex>>
data ;
505 param.push_back(data);
509 std::cout<<
"0x"<<std::hex<< data << std::endl;
512 std::cout<<
""<<std::hex<< data << std::endl;
515 std::ostringstream oss;
517 oss<<
"0x"<<std::hex<<
data;
521 std::ostringstream oss;
522 oss<<
" 0x"<<std::hex<<
data;
536 if (dataCard ==
"STRIP_EE") {
546 for (
int i=0 ;
i <NBstripparams[1] ;
i++) {
547 gis>>std::hex>>
data ;
548 param.push_back(data);
552 std::cout<<
"0x"<<std::hex<<data << std::endl;
554 std::cout<<
" "<<std::hex<<data<< std::endl;
556 std::ostringstream oss;
558 oss<<
"0x"<<std::hex<<
data;
562 std::ostringstream oss;
563 oss<<
" 0x"<<std::hex<<
data;
577 if(dataCard ==
"TOWER_EE"){
584 for (
int i=0 ;
i <2 ;
i++) {
585 gis>>std::hex>>
data ;
586 param.push_back(data);
601 if (dataCard ==
"TOWER_EB") {
608 for (
int i=0 ;
i <3 ;
i++) {
615 param.push_back(data) ;
622 if (dataCard ==
"WEIGHT") {
635 for (
int i=0 ;
i <5 ;
i++) {
636 gis>>std::hex>>
data ;
637 param.push_back(data);
640 std::ostringstream oss;
641 oss << std::hex<<
data;
660 if (dataCard ==
"FG") {
671 for (
int i=0 ;
i <5 ;
i++) {
672 gis>>std::hex>>
data ;
673 param.push_back(data);
676 std::ostringstream oss;
677 oss << std::hex<<
data;
696 if (dataCard ==
"LUT") {
703 for (
int i=0 ;
i <1024 ;
i++) {
704 gis>>std::hex>>
data ;
705 param.push_back(data);
708 std::cout<<
"0x"<<std::hex<<data <<std::endl;
723 std::vector<int> range ;
726 range.push_back(37) ;
727 range.push_back(73) ;
729 range.push_back(69) ;
737 range.push_back(73) ;
738 range.push_back(109) ;
741 range.push_back(37) ;
744 range.push_back(29) ;
755 if (towerNbInTcc>0) {
756 range[2] = towerNbInTcc ;
757 range[3] = towerNbInTcc+1 ;
759 if (stripNbInTower>0) {
760 range[4] = stripNbInTower ;
761 range[5] = stripNbInTower+1 ;
763 if (xtalNbInStrip>0) {
764 range[6] = xtalNbInStrip ;
765 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_
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