CMS 3D CMS Logo

EcalTrigPrimESProducer.cc
Go to the documentation of this file.
1 // user include files
3 
4 #include <iostream>
5 #include <fstream>
6 #include <TMath.h>
7 #include <sstream>
8 
10 
11 //
12 // input stream from a gz file
13 //
14 
16  {
17  gzFile gzf;
18  char buffer[256] ;
19  std::istringstream iss ;
20  bool eof ;
21  GzInputStream( const char * file )
22  : eof(false)
23  {
24  gzf = gzopen(file,"rb") ;
25  if (gzf==Z_NULL)
26  {
27  eof = true ;
28  edm::LogWarning("EcalTPG") <<"Database file "<<file<<" not found!!!";
29  }
30  else readLine() ;
31  }
32  void readLine()
33  {
34  char * res = gzgets(gzf,buffer,256) ;
35  eof = (res==Z_NULL) ;
36  if (!eof)
37  {
38  iss.clear() ;
39  iss.str(buffer) ;
40  }
41  }
43  { gzclose(gzf) ; }
44  explicit operator bool() const
45  {
46  return ((eof == true) ? false : !iss.fail());
47  }
48  } ;
49 
50 template <typename T>
52  {
53  while ((bool)gis && !(gis.iss >> var))
54  { gis.readLine() ; }
55  return gis ;
56  }
57 
58 
59 //
60 // constructors and destructor
61 //
62 
64  dbFilename_(iConfig.getUntrackedParameter<std::string>("DatabaseFile","")),
65  flagPrint_(iConfig.getParameter<bool>("WriteInFile"))
66 {
67  //the following line is needed to tell the framework what
68  // data is being produced
85  //now do what ever other initialization is needed
86 }
87 
88 
90 {
91 }
92 
93 //
94 // member functions
95 //
96 
97 // ------------ method called to produce the data ------------
98 
99 
100 std::unique_ptr<EcalTPGPedestals> EcalTrigPrimESProducer::producePedestals(const EcalTPGPedestalsRcd & iRecord)
101 {
102  auto prod = std::make_unique<EcalTPGPedestals>();
103  parseTextFile() ;
104  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
105  for (it = mapXtal_.begin() ; it != mapXtal_.end() ; it++) {
106  EcalTPGPedestal item ;
107  item.mean_x12 = (it->second)[0] ;
108  item.mean_x6 = (it->second)[3] ;
109  item.mean_x1 = (it->second)[6] ;
110  prod->setValue(it->first,item) ;
111  }
112  return std::move(prod);
113 }
114 
115 std::unique_ptr<EcalTPGLinearizationConst> EcalTrigPrimESProducer::produceLinearizationConst(const EcalTPGLinearizationConstRcd & iRecord)
116 {
117  auto prod = std::make_unique<EcalTPGLinearizationConst>();
118  parseTextFile() ;
119  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
120  for (it = mapXtal_.begin() ; it != mapXtal_.end() ; it++) {
122  item.mult_x12 = (it->second)[1] ;
123  item.mult_x6 = (it->second)[4] ;
124  item.mult_x1 = (it->second)[7] ;
125  item.shift_x12 = (it->second)[2] ;
126  item.shift_x6 = (it->second)[5] ;
127  item.shift_x1 = (it->second)[8] ;
128  prod->setValue(it->first,item) ;
129  }
130  return std::move(prod);
131 }
132 
133 std::unique_ptr<EcalTPGSlidingWindow> EcalTrigPrimESProducer::produceSlidingWindow(const EcalTPGSlidingWindowRcd & iRecord)
134 {
135  auto prod = std::make_unique<EcalTPGSlidingWindow>();
136  parseTextFile() ;
137  for (int subdet=0 ; subdet<2 ; subdet++) {
138  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
139  for (it = mapStrip_[subdet].begin() ; it != mapStrip_[subdet].end() ; it++) {
140  prod->setValue(it->first,(it->second)[0]) ;
141  }
142  }
143  return std::move(prod);
144 }
145 
146 std::unique_ptr<EcalTPGFineGrainEBIdMap> EcalTrigPrimESProducer::produceFineGrainEB(const EcalTPGFineGrainEBIdMapRcd & iRecord)
147 {
148  auto prod = std::make_unique<EcalTPGFineGrainEBIdMap>();
149  parseTextFile() ;
151  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
152  for (it = mapFg_.begin() ; it != mapFg_.end() ; 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) ;
155  }
156  return std::move(prod);
157 }
158 
159 std::unique_ptr<EcalTPGFineGrainStripEE> EcalTrigPrimESProducer::produceFineGrainEEstrip(const EcalTPGFineGrainStripEERcd & iRecord)
160 {
161  auto prod = std::make_unique<EcalTPGFineGrainStripEE>();
162  parseTextFile() ;
163  // EE Strips
164  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
165  for (it = mapStrip_[1].begin() ; it != mapStrip_[1].end() ; it++) {
167  item.threshold = (it->second)[2] ;
168  item.lut = (it->second)[3] ;
169  prod->setValue(it->first,item) ;
170  }
171  // EB Strips
172  for (it = mapStrip_[0].begin() ; it != mapStrip_[0].end() ; it++) {
174  item.threshold = (it->second)[2] ;
175  item.lut = (it->second)[3] ;
176  prod->setValue(it->first,item) ;
177  }
178  return std::move(prod);
179 }
180 
181 std::unique_ptr<EcalTPGFineGrainTowerEE> EcalTrigPrimESProducer::produceFineGrainEEtower(const EcalTPGFineGrainTowerEERcd & iRecord)
182 {
183  auto prod = std::make_unique<EcalTPGFineGrainTowerEE>();
184  parseTextFile() ;
185  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
186  for (it = mapTower_[1].begin() ; it != mapTower_[1].end() ; it++) {
187  prod->setValue(it->first,(it->second)[1]) ;
188  }
189  return std::move(prod);
190 }
191 
192 std::unique_ptr<EcalTPGLutIdMap> EcalTrigPrimESProducer::produceLUT(const EcalTPGLutIdMapRcd & iRecord)
193 {
194  auto prod = std::make_unique<EcalTPGLutIdMap>();
195  parseTextFile() ;
196  EcalTPGLut lut ;
197  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
198  for (it = mapLut_.begin() ; it != mapLut_.end() ; it++) {
199  unsigned int lutArray[1024] ;
200  for (int i=0 ; i <1024 ; i++) lutArray[i] = (it->second)[i] ;
201  lut.setLut(lutArray) ;
202  prod->setValue(it->first,lut) ;
203  }
204  return std::move(prod);
205 }
206 
207 std::unique_ptr<EcalTPGWeightIdMap> EcalTrigPrimESProducer::produceWeight(const EcalTPGWeightIdMapRcd & iRecord)
208 {
209  auto prod = std::make_unique<EcalTPGWeightIdMap>();
210  parseTextFile() ;
212  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
213  for (it = mapWeight_.begin() ; it != mapWeight_.end() ; it++) {
214  weights.setValues((it->second)[0],
215  (it->second)[1],
216  (it->second)[2],
217  (it->second)[3],
218  (it->second)[4]) ;
219  prod->setValue(it->first,weights) ;
220  }
221  return std::move(prod);
222 }
223 
224 std::unique_ptr<EcalTPGWeightGroup> EcalTrigPrimESProducer::produceWeightGroup(const EcalTPGWeightGroupRcd & iRecord)
225 {
226  auto prod = std::make_unique<EcalTPGWeightGroup>();
227  parseTextFile() ;
228  for (int subdet=0 ; subdet<2 ; subdet++) {
229  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
230  for (it = mapStrip_[subdet].begin() ; it != mapStrip_[subdet].end() ; it++) {
231  prod->setValue(it->first,(it->second)[1]) ;
232  }
233  }
234  return std::move(prod);
235 }
236 
237 std::unique_ptr<EcalTPGLutGroup> EcalTrigPrimESProducer::produceLutGroup(const EcalTPGLutGroupRcd & iRecord)
238 {
239  auto prod = std::make_unique<EcalTPGLutGroup>();
240  parseTextFile() ;
241  for (int subdet=0 ; subdet<2 ; subdet++) {
242  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
243  for (it = mapTower_[subdet].begin() ; it != mapTower_[subdet].end() ; it++) {
244  prod->setValue(it->first,(it->second)[0]) ;
245  }
246  }
247  return std::move(prod);
248 }
249 
250 std::unique_ptr<EcalTPGFineGrainEBGroup> EcalTrigPrimESProducer::produceFineGrainEBGroup(const EcalTPGFineGrainEBGroupRcd & iRecord)
251 {
252  auto prod = std::make_unique<EcalTPGFineGrainEBGroup>();
253  parseTextFile() ;
254  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
255  for (it = mapTower_[0].begin() ; it != mapTower_[0].end() ; it++) {
256  prod->setValue(it->first,(it->second)[1]) ;
257  }
258  return std::move(prod);
259 }
260 
261 std::unique_ptr<EcalTPGPhysicsConst> EcalTrigPrimESProducer::producePhysicsConst(const EcalTPGPhysicsConstRcd & iRecord)
262 {
263  auto prod = std::make_unique<EcalTPGPhysicsConst>();
264  parseTextFile() ;
265  std::map<uint32_t, std::vector<float> >::const_iterator it ;
266  for (it = mapPhys_.begin() ; it != mapPhys_.end() ; it++) {
268  item.EtSat = (it->second)[0] ;
269  item.ttf_threshold_Low = (it->second)[1] ;
270  item.ttf_threshold_High = (it->second)[2] ;
271  item.FG_lowThreshold = (it->second)[3] ;
272  item.FG_highThreshold = (it->second)[4] ;
273  item.FG_lowRatio = (it->second)[5] ;
274  item.FG_highRatio = (it->second)[6] ;
275  prod->setValue(it->first,item) ;
276  }
277  return std::move(prod);
278 }
279 
280 std::unique_ptr<EcalTPGCrystalStatus> EcalTrigPrimESProducer::produceBadX(const EcalTPGCrystalStatusRcd & iRecord)
281 {
282  auto prod = std::make_unique<EcalTPGCrystalStatus>();
283  parseTextFile() ;
284  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
285  for (it = mapXtal_.begin() ; it != mapXtal_.end() ; it++) {
286 
287  EcalTPGCrystalStatusCode badXValue;
288  badXValue.setStatusCode(0);
289  prod->setValue(it->first,badXValue) ;
290  }
291  return std::move(prod);
292 
293 }
294 
295 std::unique_ptr<EcalTPGStripStatus> EcalTrigPrimESProducer::produceBadStrip(const EcalTPGStripStatusRcd & iRecord)
296 {
297  auto prod = std::make_unique<EcalTPGStripStatus>();
298  // returns an empty map
299  return std::move(prod);
300 
301 }
302 
303 std::unique_ptr<EcalTPGTowerStatus> EcalTrigPrimESProducer::produceBadTT(const EcalTPGTowerStatusRcd & iRecord)
304 {
305  auto prod = std::make_unique<EcalTPGTowerStatus>();
306  parseTextFile() ;
307  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it ;
308  //Barrel
309  for (it = mapTower_[0].begin() ; it != mapTower_[0].end() ; it++) {
310  //set the BadTT status to 0
311  prod->setValue(it->first,0) ;
312  }
313  //Endcap
314  for (it = mapTower_[1].begin() ; it != mapTower_[1].end() ; it++) {
315  //set the BadTT status to 0
316  prod->setValue(it->first,0) ;
317  }
318 
319  return std::move(prod);
320 }
321 
322 std::unique_ptr<EcalTPGSpike> EcalTrigPrimESProducer::produceSpike(const EcalTPGSpikeRcd &iRecord)
323 {
324  auto prod = std::make_unique<EcalTPGSpike>();
325  parseTextFile();
326  // Only need to do barrel
327  std::map<uint32_t, std::vector<uint32_t> >::const_iterator it;
328  for(it = mapTower_[0].begin(); it != mapTower_[0].end(); ++it)
329  {
330  prod->setValue(it->first, (it->second)[2]);
331  }
332  return std::move(prod);
333 }
334 
336 {
337  if (mapXtal_.size() != 0) return ; // just parse the file once!
338 
339  uint32_t id ;
340  std::string dataCard ;
342  std::ifstream infile ;
343  std::vector<unsigned int> param ;
344  std::vector<float> paramF ;
345  int NBstripparams[2] = {4, 4} ;
346  unsigned int data ;
347  float dataF ;
348 
349  std::string bufString;
350  std::string iString;
351  std::string fString;
352  std::string filename = "SimCalorimetry/EcalTrigPrimProducers/data/"+dbFilename_;
353  std::string finalFileName ;
354  size_t slash=dbFilename_.find("/");
355  if (slash!=0) {
356  edm::FileInPath fileInPath(filename);
357  finalFileName = fileInPath.fullPath() ;
358  }
359  else {
360  finalFileName = dbFilename_.c_str() ;
361  edm::LogWarning("EcalTPG") <<"Couldnt find database file via fileinpath, trying with pathname directly!!";
362  }
363 
364 
365  int k=0;
366 
367  GzInputStream gis(finalFileName.c_str()) ;
368  while (gis>>dataCard) {
369 
370  if (dataCard == "PHYSICS_EB" || dataCard == "PHYSICS_EE") {
371  gis>>std::dec>>id ;
372 
373  if (flagPrint_){
374  std::cout<<dataCard<<" "<<std::dec<<id <<std::endl;
375  }
376 
377  paramF.clear() ;
378 
379  std::string st1;
380  std::string st2;
381 
382  for (int i=0 ; i <7 ; i++) {
383  gis>>std::dec>>dataF ;
384  paramF.push_back(dataF) ;
385 
386  //std::cout<<", "<<std::dec<<dataF ;
387  if (flagPrint_){
388  //---------------------------------
389  if (i < 3){
390  std::ostringstream oss;
391  oss << dataF;
392  std::string result1 = oss.str();
393 
394  st1.append(result1);
395  if (i != 2)
396  st1.append(" ");
397  }
398 
399  if (i > 2){
400  std::ostringstream oss;
401  oss << dataF;
402  std::string result2 = oss.str();
403 
404  st2.append(result2);
405  if (i != 6)
406  st2.append(" ");
407  }
408  //----------------------------------
409  }
410  }
411 
412  if (flagPrint_){
413  std::cout << "" << st1 << std::endl;
414  std::cout << "" << st2 << std::endl;
415  std::cout << ""<< std::endl;
416  }
417 
418  //std::cout<<std::endl ;
419  mapPhys_[id] = paramF ;
420  }
421 
422  if (dataCard == "CRYSTAL") {
423 
424  gis>>std::dec>>id ;
425  //std::cout<<dataCard<<" "<<std::dec<<id;
426  std::string st3;
427  std::string st4;
428  std::string st5;
429 
430  if(flagPrint_){
431  //Print this comment only one time
432  if(k==0)
433  std::cout << "COMMENT ====== barrel crystals ====== " <<std::endl;
434 
435  if (k==61200)
436  std::cout << "COMMENT ====== endcap crystals ====== " <<std::endl;
437 
438  k=k+1;
439 
440  std::cout<<dataCard<<" "<<std::dec<<id << std::endl;
441  }
442 
443  param.clear() ;
444  for (int i=0 ; i <9 ; i++) {
445  gis>>std::hex>>data ;
446  //std::cout<<", "<<std::hex<<data ;
447  param.push_back(data);
448 
449  if(flagPrint_){
450  if (i<3){
451  std::ostringstream oss;
452  oss << std::hex<< data;
453  std::string result1 = oss.str();
454 
455  st3.append("0x");
456  st3.append(result1);
457  if (i !=2)
458  st3.append(" ");
459 
460  }else if(i>2 && i<6){
461  std::ostringstream oss;
462  oss << std::hex << data;
463  std::string result2 = oss.str();
464 
465  st4.append("0x");
466  st4.append(result2);
467  if (i != 5)
468  st4.append(" ");
469  }else if(i>5 && i<9){
470  std::ostringstream oss;
471  oss << std::hex<< data;
472  std::string result3 = oss.str();
473 
474  st5.append("0x");
475  st5.append(result3);
476  if (i != 8)
477  st5.append(" ");
478  }
479  }
480 
481  }//end for
482 
483  if(flagPrint_){
484  std::cout << " " << st3 << std::endl;
485  std::cout << " " << st4 << std::endl;
486  std::cout << " " << st5 << std::endl;
487  }
488 
489  //std::cout<<std::endl ;
490  mapXtal_[id] = param ;
491  }
492 
493  if (dataCard == "STRIP_EB") {
494  gis>>std::dec>>id ;
495 
496  std::string st1;
497 
498  if(flagPrint_)
499  std::cout<<dataCard<<" "<<std::dec<<id <<std::endl;
500 
501  param.clear() ;
502  for (int i=0 ; i <NBstripparams[0] ; i++) {
503  gis>>std::hex>>data ;
504  //std::cout << " data = " << data << std::endl;
505  param.push_back(data);
506 
507  if(flagPrint_){
508  if (i==0){
509  std::cout<<"0x"<<std::hex<< data << std::endl;
510  }
511  else if (i==1){
512  std::cout<<""<<std::hex<< data << std::endl;
513  }
514  else if (i>1){
515  std::ostringstream oss;
516  if (i==2){
517  oss<<"0x"<<std::hex<<data;
518  std::string result4 = oss.str();
519  st1.append(result4);
520  }else if(i==3){
521  std::ostringstream oss;
522  oss<<" 0x"<<std::hex<<data;
523  std::string result5 = oss.str();
524 
525  st1.append(result5);
526  std::cout<< "" << st1 << std::endl;
527  }
528  }
529  }
530  }
531 
532  //std::cout<<std::endl ;
533  mapStrip_[0][id] = param ;
534  }
535 
536  if (dataCard == "STRIP_EE") {
537  gis>>std::dec>>id ;
538 
539  std::string st6;
540 
541  if(flagPrint_){
542  std::cout<<dataCard<<" "<<std::dec<<id << std::endl;
543  }
544 
545  param.clear() ;
546  for (int i=0 ; i <NBstripparams[1] ; i++) {
547  gis>>std::hex>>data ;
548  param.push_back(data);
549 
550  if(flagPrint_){
551  if (i==0){
552  std::cout<<"0x"<<std::hex<<data << std::endl;
553  }else if (i==1){
554  std::cout<<" "<<std::hex<<data<< std::endl;
555  }else if (i>1){
556  std::ostringstream oss;
557  if (i==2){
558  oss<<"0x"<<std::hex<<data;
559  std::string result4 = oss.str();
560  st6.append(result4);
561  }else if(i==3){
562  std::ostringstream oss;
563  oss<<" 0x"<<std::hex<<data;
564  std::string result5 = oss.str();
565 
566  st6.append(result5);
567  std::cout<< "" << st6 << std::endl;
568  }
569  }
570  }
571  }
572 
573  //std::cout<<std::endl ;
574  mapStrip_[1][id] = param ;
575  }
576 
577  if(dataCard == "TOWER_EE"){
578  gis>>std::dec>>id ;
579 
580  if(flagPrint_)
581  std::cout<<dataCard<<" "<<std::dec<<id <<std::endl;
582 
583  param.clear() ;
584  for (int i=0 ; i <2 ; i++) {
585  gis>>std::hex>>data ;
586  param.push_back(data);
587 
588  if(flagPrint_){
589  if(i==1){
590  std::cout << "0x" <<std::dec<<data << std::endl;
591  }else{
592  std::cout << " " <<std::dec<<data << std::endl;
593  }
594  }
595  }
596 
597  //std::cout<<std::endl ;
598  mapTower_[1][id] = param ;
599  }
600 
601  if (dataCard == "TOWER_EB") {
602  gis>>std::dec>>id ;
603 
604  if(flagPrint_)
605  std::cout<<dataCard<<" "<<std::dec<<id << std::endl;
606 
607  param.clear() ;
608  for (int i=0 ; i <3 ; i++) {
609  gis>>std::dec>>data ;
610 
611  if(flagPrint_){
612  std::cout << " " << std::dec << data << std::endl;
613  }
614 
615  param.push_back(data) ;
616  }
617 
618  //std::cout<<std::endl ;
619  mapTower_[0][id] = param ;
620  }
621 
622  if (dataCard == "WEIGHT") {
623 
624  if(flagPrint_)
625  std::cout<<std::endl;
626 
627  gis>>std::hex>>id ;
628  if(flagPrint_){
629  std::cout<<dataCard<<" "<<std::dec<<id <<std::endl;
630  }
631 
632  param.clear() ;
633 
634  std::string st6;
635  for (int i=0 ; i <5 ; i++) {
636  gis>>std::hex>>data ;
637  param.push_back(data);
638 
639  if(flagPrint_){
640  std::ostringstream oss;
641  oss << std::hex<< data;
642  std::string result4 = oss.str();
643 
644  st6.append("0x");
645  st6.append(result4);
646  st6.append(" ");
647  }
648 
649  }
650 
651  if(flagPrint_){
652  std::cout << st6 << std::endl;
653  std::cout<<std::endl;
654  }
655 
656  //std::cout<<std::endl ;
657  mapWeight_[id] = param ;
658  }
659 
660  if (dataCard == "FG") {
661 
662  if(flagPrint_)
663  std::cout <<std::endl;
664 
665  gis>>std::hex>>id ;
666  if(flagPrint_)
667  std::cout<<dataCard<<" "<<std::dec<<id <<std::endl;
668 
669  param.clear() ;
670  std::string st7;
671  for (int i=0 ; i <5 ; i++) {
672  gis>>std::hex>>data ;
673  param.push_back(data);
674 
675  if(flagPrint_){
676  std::ostringstream oss;
677  oss << std::hex<< data;
678 
679  std::string result5 = oss.str();
680 
681  st7.append("0x");
682  st7.append(result5);
683  if (i != 4)
684  st7.append(" ");
685  }
686  }
687 
688  if(flagPrint_){
689  std::cout << st7 << std::endl;
690  std::cout<<std::endl ;
691  }
692 
693  mapFg_[id] = param ;
694  }
695 
696  if (dataCard == "LUT") {
697  gis>>std::hex>>id ;
698 
699  if(flagPrint_)
700  std::cout<<dataCard<<" "<<std::dec<<id <<std::endl;
701 
702  param.clear() ;
703  for (int i=0 ; i <1024 ; i++) {
704  gis>>std::hex>>data ;
705  param.push_back(data);
706 
707  if(flagPrint_){
708  std::cout<<"0x"<<std::hex<<data <<std::endl;
709  }
710  }
711 
712  if(flagPrint_) {
713  std::cout<<std::endl ;
714  std::cout<<std::endl ;
715  }
716 
717  mapLut_[id] = param ;
718  }
719  }
720 }
721 
722 std::vector<int> EcalTrigPrimESProducer::getRange(int subdet, int tccNb, int towerNbInTcc, int stripNbInTower, int xtalNbInStrip)
723 {
724  std::vector<int> range ;
725  if (subdet == 0) {
726  // Barrel
727  range.push_back(37) ; // stccNbMin
728  range.push_back(73) ; // tccNbMax
729  range.push_back(1) ; // towerNbMin
730  range.push_back(69) ; // towerNbMax
731  range.push_back(1) ; // stripNbMin
732  range.push_back(6) ; // stripNbMax
733  range.push_back(1) ; // xtalNbMin
734  range.push_back(6) ; // xtalNbMax
735  } else {
736  // Endcap eta >0
737  if (subdet >0 ) {
738  range.push_back(73) ; // tccNbMin
739  range.push_back(109) ; // tccNbMax
740  } else { //endcap eta <0
741  range.push_back(1) ; // tccNbMin
742  range.push_back(37) ; // tccNbMax
743  }
744  range.push_back(1) ; // towerNbMin
745  range.push_back(29) ; // towerNbMax
746  range.push_back(1) ; // stripNbMin
747  range.push_back(6) ; // stripNbMax
748  range.push_back(1) ; // xtalNbMin
749  range.push_back(6) ; // xtalNbMax
750  }
751 
752  if (tccNb>0) {
753  range[0] = tccNb ;
754  range[1] = tccNb+1 ;
755  }
756  if (towerNbInTcc>0) {
757  range[2] = towerNbInTcc ;
758  range[3] = towerNbInTcc+1 ;
759  }
760  if (stripNbInTower>0) {
761  range[4] = stripNbInTower ;
762  range[5] = stripNbInTower+1 ;
763  }
764  if (xtalNbInStrip>0) {
765  range[6] = xtalNbInStrip ;
766  range[7] = xtalNbInStrip+1 ;
767  }
768 
769  return range ;
770 }
771 
772 // bool EcalTrigPrimESProducer::getNextString(gzFile &gzf){
773 // size_t blank;
774 // if (bufpos_==0) {
775 // gzgets(gzf,buf_,80);
776 // if (gzeof(gzf)) return true;
777 // bufString_=std::string(buf_);
778 // }
779 // int pos=0;
780 // pos =bufpos_;
781 // // look for next non-blank
782 // while (pos<bufString_.size()) {
783 // if (!bufString_.compare(pos,1," ")) pos++;
784 // else break;
785 // }
786 // blank=bufString_.find(" ",pos);
787 // size_t end = blank;
788 // if (blank==std::string::npos) end=bufString_.size();
789 // sub_=bufString_.substr(pos,end-pos);
790 // bufpos_= blank;
791 // if (blank==std::string::npos) bufpos_=0;
792 // return false;
793 // }
794 //
795 // int EcalTrigPrimESProducer::converthex() {
796 // // converts hex dec string sub to hexa
797 // //FIXME:: find something better (istrstream?)!!!!
798 //
799 // std::string chars("0123456789abcdef");
800 // int hex=0;
801 // for (size_t i=2;i<sub_.length();++i) {
802 // size_t f=chars.find(sub_[i]);
803 // if (f==std::string::npos) break; //FIXME: length is 4 for 0x3!!
804 // hex=hex*16+chars.find(sub_[i]);
805 // }
806 // return hex;
807 // }
std::vector< int > getRange(int subdet, int smNb, int towerNbInSm, int stripNbInTower=0, int xtalNbInStrip=0)
std::unique_ptr< EcalTPGWeightGroup > produceWeightGroup(const EcalTPGWeightGroupRcd &)
std::unique_ptr< EcalTPGCrystalStatus > produceBadX(const EcalTPGCrystalStatusRcd &)
GzInputStream & operator>>(GzInputStream &gis, T &var)
void setValues(const uint32_t &ThresholdETLow, const uint32_t &ThresholdETHigh, const uint32_t &RatioLow, const uint32_t &RatioHigh, const uint32_t &LUT)
std::unique_ptr< EcalTPGLinearizationConst > produceLinearizationConst(const EcalTPGLinearizationConstRcd &)
std::map< uint32_t, std::vector< uint32_t > > mapTower_[2]
std::unique_ptr< EcalTPGFineGrainEBIdMap > produceFineGrainEB(const EcalTPGFineGrainEBIdMapRcd &)
std::unique_ptr< EcalTPGLutIdMap > produceLUT(const EcalTPGLutIdMapRcd &)
Definition: Electron.h:4
void setLut(const unsigned int *lut)
Definition: EcalTPGLut.cc:20
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::unique_ptr< EcalTPGTowerStatus > produceBadTT(const EcalTPGTowerStatusRcd &)
std::unique_ptr< EcalTPGPedestals > producePedestals(const EcalTPGPedestalsRcd &)
std::unique_ptr< EcalTPGPhysicsConst > producePhysicsConst(const EcalTPGPhysicsConstRcd &)
void setStatusCode(const uint16_t &val)
std::map< uint32_t, std::vector< uint32_t > > mapXtal_
std::unique_ptr< EcalTPGFineGrainTowerEE > produceFineGrainEEtower(const EcalTPGFineGrainTowerEERcd &)
std::unique_ptr< EcalTPGSpike > produceSpike(const EcalTPGSpikeRcd &)
int k[5][pyjets_maxn]
std::map< uint32_t, std::vector< uint32_t > > mapWeight_
std::unique_ptr< EcalTPGSlidingWindow > produceSlidingWindow(const EcalTPGSlidingWindowRcd &)
std::unique_ptr< EcalTPGFineGrainEBGroup > produceFineGrainEBGroup(const EcalTPGFineGrainEBGroupRcd &)
EcalTrigPrimESProducer(const edm::ParameterSet &)
std::unique_ptr< EcalTPGLutGroup > produceLutGroup(const EcalTPGLutGroupRcd &)
std::map< uint32_t, std::vector< uint32_t > > mapFg_
GzInputStream(const char *file)
std::map< uint32_t, std::vector< float > > mapPhys_
#define begin
Definition: vmac.h:30
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::string fullPath() const
Definition: FileInPath.cc:184
std::unique_ptr< EcalTPGFineGrainStripEE > produceFineGrainEEstrip(const EcalTPGFineGrainStripEERcd &)
std::unique_ptr< EcalTPGWeightIdMap > produceWeight(const EcalTPGWeightIdMapRcd &)
std::unique_ptr< EcalTPGStripStatus > produceBadStrip(const EcalTPGStripStatusRcd &)
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_
long double T
def move(src, dest)
Definition: eostools.py:510
std::map< uint32_t, std::vector< uint32_t > > mapStrip_[2]
std::istringstream iss