CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalTestDevDB.cc
Go to the documentation of this file.
3 
7 
9 
13 
15 
17 
19 
20 #include <map>
21 #include <vector>
22 
23 using namespace std;
24 
26  m_timetype(iConfig.getParameter<std::string>("timetype")),
27  m_cacheIDs(),
28  m_records()
29 {
30 
31  std::string container;
32  std::string tag;
33  std::string record;
34 
35  m_firstRun=static_cast<unsigned long>(atoi( iConfig.getParameter<std::string>("firstRun").c_str()));
36  m_lastRun=static_cast<unsigned long>(atoi( iConfig.getParameter<std::string>("lastRun").c_str()));
37  m_interval=static_cast<unsigned long>(atoi( iConfig.getParameter<std::string>("interval").c_str()));
38 
39  typedef std::vector< edm::ParameterSet > Parameters;
40  Parameters toCopy = iConfig.getParameter<Parameters>("toCopy");
41  for(Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) {
42  container = i->getParameter<std::string>("container");
43  record = i->getParameter<std::string>("record");
44  m_cacheIDs.insert( std::make_pair(container, 0) );
45  m_records.insert( std::make_pair(container, record) );
46  }
47 
48 }
49 
50 
52 {
53 
54 }
55 
56 void EcalTestDevDB::analyze( const edm::Event& evt, const edm::EventSetup& evtSetup)
57 {
58 
60  if ( !dbOutput.isAvailable() ) {
61  throw cms::Exception("PoolDBOutputService is not available");
62  }
63 
64 
65 
66  std::string container;
67  std::string record;
68  typedef std::map<std::string, std::string>::const_iterator recordIter;
69  for (recordIter i = m_records.begin(); i != m_records.end(); ++i) {
70  container = (*i).first;
71  record = (*i).second;
72 
73  std::string recordName = m_records[container];
74 
75 
76  // Loop through each of the runs
77 
78  unsigned long nrec=(m_lastRun-m_firstRun)/m_interval+1;
79  unsigned long nstart=0;
80  if (m_firstRun == 0 && m_lastRun == 0) {
81  // it should do at least once the loop
82  nstart=0;
83  nrec=1;
84  }
85 
86  for(unsigned long i=nstart; i<nrec; i++) {
87  unsigned long irun=m_firstRun+i*m_interval;
88 
89 
90  // Arguments 0 0 mean infinite IOV
91  if (m_firstRun == 0 && m_lastRun == 0) {
92  std::cout << "Infinite IOV mode" << std::endl;
94  }
95 
96  std::cout << "Starting Transaction for run " << irun << "..." << std::flush;
97 
98  if (container == "EcalPedestals") {
99  EcalPedestals* condObject= generateEcalPedestals();
100 
101  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
102  // create new
103  std::cout<<"First One "<<std::endl;
104  dbOutput->createNewIOV<const EcalPedestals>( condObject, dbOutput->beginOfTime(),dbOutput->endOfTime() ,recordName);
105  } else {
106  // append
107  std::cout<<"Old One "<<std::endl;
108  dbOutput->appendSinceTime<const EcalPedestals>( condObject, irun , recordName);
109  }
110 
111  } else if (container == "EcalADCToGeVConstant") {
112 
114  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
115  // create new
116  std::cout<<"First One "<<std::endl;
117  dbOutput->createNewIOV<const EcalADCToGeVConstant>( condObject, dbOutput->beginOfTime(),dbOutput->endOfTime() ,recordName);
118  } else {
119  // append
120  std::cout<<"Old One "<<std::endl;
121  dbOutput->appendSinceTime<const EcalADCToGeVConstant>( condObject, irun , recordName);
122  }
123 
124 
125  } else if (container == "EcalIntercalibConstants") {
127  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
128  // create new
129  std::cout<<"First One "<<std::endl;
130  dbOutput->createNewIOV<const EcalIntercalibConstants>( condObject, dbOutput->beginOfTime(),dbOutput->endOfTime() ,recordName);
131  } else {
132  // append
133  std::cout<<"Old One "<<std::endl;
134  dbOutput->appendSinceTime<const EcalIntercalibConstants>( condObject, irun , recordName);
135  }
136 
137  } else if (container == "EcalGainRatios") {
138  EcalGainRatios* condObject= generateEcalGainRatios();
139  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
140  // create new
141  std::cout<<"First One "<<std::endl;
142  dbOutput->createNewIOV<const EcalGainRatios>( condObject,dbOutput->beginOfTime(), dbOutput->endOfTime() ,recordName);
143  } else {
144  // append
145  std::cout<<"Old One "<<std::endl;
146  dbOutput->appendSinceTime<const EcalGainRatios>( condObject, irun , recordName);
147  }
148 
149  } else if (container == "EcalWeightXtalGroups") {
151  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
152  // create new
153  std::cout<<"First One "<<std::endl;
154  dbOutput->createNewIOV<const EcalWeightXtalGroups>( condObject, dbOutput->beginOfTime(), dbOutput->endOfTime() ,recordName);
155  } else {
156  // append
157  std::cout<<"Old One "<<std::endl;
158  dbOutput->appendSinceTime<const EcalWeightXtalGroups>( condObject, irun , recordName);
159  }
160 
161  } else if (container == "EcalTBWeights") {
162  EcalTBWeights* condObject= generateEcalTBWeights();
163  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
164  // create new
165  std::cout<<"First One "<<std::endl;
166  dbOutput->createNewIOV<const EcalTBWeights>( condObject, dbOutput->beginOfTime(), dbOutput->endOfTime() ,recordName);
167  } else {
168  // append
169  std::cout<<"Old One "<<std::endl;
170  dbOutput->appendSinceTime<const EcalTBWeights>( condObject, irun , recordName);
171  }
172 
173  } else if (container == "EcalLaserAPDPNRatios") {
175  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
176  // create new
177  std::cout<<"First One "<<std::endl;
178  dbOutput->createNewIOV<const EcalLaserAPDPNRatios>( condObject,dbOutput->beginOfTime(), dbOutput->endOfTime() ,recordName);
179  } else {
180  // append
181  std::cout<<"Old One "<<std::endl;
182  dbOutput->appendSinceTime<const EcalLaserAPDPNRatios>( condObject, irun , recordName);
183  }
184  } else if (container == "EcalLaserAPDPNRatiosRef") {
186  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
187  // create new
188  std::cout<<"First One "<<std::endl;
189  dbOutput->createNewIOV<const EcalLaserAPDPNRatiosRef>( condObject, dbOutput->beginOfTime(), dbOutput->endOfTime() ,recordName);
190  } else {
191  // append
192  std::cout<<"Old One "<<std::endl;
193  dbOutput->appendSinceTime<const EcalLaserAPDPNRatiosRef>( condObject, irun , recordName);
194  }
195  } else if (container == "EcalLaserAlphas") {
197  if(irun==m_firstRun && dbOutput->isNewTagRequest(recordName)) {
198  // create new
199  std::cout<<"First One "<<std::endl;
200  dbOutput->createNewIOV<const EcalLaserAlphas>( condObject,dbOutput->beginOfTime(), dbOutput->endOfTime() ,recordName);
201  } else {
202  // append
203  std::cout<<"Old One "<<std::endl;
204  dbOutput->appendSinceTime<const EcalLaserAlphas>( condObject, irun , recordName);
205  }
206  } else {
207  std::cout << "it does not work yet for " << container << "..." << std::flush;
208 
209  }
210 
211 
212  }
213 
214 
215  }
216 
217 
218 }
219 
220 
221 //-------------------------------------------------------------
224 //-------------------------------------------------------------
225 
226  EcalPedestals* peds = new EcalPedestals();
227  EcalPedestals::Item item;
228  for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
229  if(iEta==0) continue;
230  for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
231  item.mean_x1 = 200.*( (double)std::rand()/(double(RAND_MAX)+double(1)) );
232  item.rms_x1 = (double)std::rand()/(double(RAND_MAX)+double(1));
233  item.mean_x6 = 1200.*( (double)std::rand()/(double(RAND_MAX)+double(1)) );
234  item.rms_x6 = 6.*( (double)std::rand()/(double(RAND_MAX)+double(1)) );
235  item.mean_x12 = 2400.*( (double)std::rand()/(double(RAND_MAX)+double(1)) );
236  item.rms_x12 = 12.*( (double)std::rand()/(double(RAND_MAX)+double(1)) );
237 
238  EBDetId ebdetid(iEta,iPhi);
239  peds->insert(std::make_pair(ebdetid.rawId(),item));
240  }
241  }
242  return peds;
243 }
244 
245 //-------------------------------------------------------------
248 //-------------------------------------------------------------
249 
250  double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
251  EcalADCToGeVConstant* agc = new EcalADCToGeVConstant(36.+r*4., 60.+r*4);
252  return agc;
253 }
254 
255 //-------------------------------------------------------------
258 //-------------------------------------------------------------
259 
261 
262  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
263  if(ieta==0) continue;
264  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId:: MAX_IPHI; ++iphi) {
265 
266  EBDetId ebid(ieta,iphi);
267 
268  double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
269  ical->setValue( ebid.rawId(), 0.85 + r*0.3 );
270  } // loop over phi
271  } // loop over eta
272  return ical;
273 }
274 
275 //-------------------------------------------------------------
278 //-------------------------------------------------------------
279 
280  // create gain ratios
281  EcalGainRatios* gratio = new EcalGainRatios;
282 
283  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
284  if(ieta==0) continue;
285  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId:: MAX_IPHI; ++iphi) {
286 
287  EBDetId ebid(ieta,iphi);
288 
289  double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
290 
292  gr.setGain12Over6( 1.9 + r*0.2 );
293  gr.setGain6Over1( 5.9 + r*0.2 );
294 
295  gratio->setValue( ebid.rawId(), gr );
296 
297  } // loop over phi
298  } // loop over eta
299  return gratio;
300 }
301 
302 //-------------------------------------------------------------
305 //-------------------------------------------------------------
306 
307  EcalWeightXtalGroups* xtalGroups = new EcalWeightXtalGroups();
308  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
309  if(ieta==0) continue;
310  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId:: MAX_IPHI; ++iphi) {
311  EBDetId ebid(ieta,iphi);
312  xtalGroups->setValue(ebid.rawId(), EcalXtalGroupId(ieta) ); // define rings in eta
313  }
314  }
315  return xtalGroups;
316 }
317 
318 //-------------------------------------------------------------
321 //-------------------------------------------------------------
322 
323  EcalTBWeights* tbwgt = new EcalTBWeights();
324 
325  // create weights for each distinct group ID
326  int nMaxTDC = 10;
327  for(int igrp=-EBDetId::MAX_IETA; igrp<=EBDetId::MAX_IETA; ++igrp) {
328  if(igrp==0) continue;
329  for(int itdc=1; itdc<=nMaxTDC; ++itdc) {
330  // generate random number
331  double r = (double)std::rand()/( double(RAND_MAX)+double(1) );
332 
333  // make a new set of weights
334  EcalWeightSet wgt;
337 
338  for(size_t i=0; i<3; ++i) {
339  for(size_t j=0; j<10; ++j) {
340  double ww = igrp*itdc*r + i*10. + j;
341  //std::cout << "row: " << i << " col: " << j << " - val: " << ww << std::endl;
342  mat1(i,j)=ww;
343  mat2(i,j)=100+ww;
344  }
345  }
346 
347  // fill the chi2 matrcies
348  r = (double)std::rand()/( double(RAND_MAX)+double(1) );
351  for(size_t i=0; i<10; ++i) {
352  for(size_t j=0; j<10; ++j) {
353  double ww = igrp*itdc*r + i*10. + j;
354  mat3(i,j)=1000+ww;
355  mat4(i,j)=1000+100+ww;
356  }
357  }
358 
359  // put the weight in the container
360  tbwgt->setValue(std::make_pair(igrp,itdc), wgt);
361  }
362  }
363  return tbwgt;
364 }
365 
366 
367 
368 //--------------------------------------------------------------
371 //--------------------------------------------------------------
372 
374 
377 
378  // if((m_firstRun == 0 && i_run == 0) || (m_firstRun == 1 && i_run == 1)){
379 
380  std::cout << "First & last run: " << i_run << " " << m_firstRun << " " << m_lastRun << " " << std::endl;
381  if (m_firstRun == i_run && (i_run == 0 || i_run == 1) ) {
382 
383  APDPNpair.p1= (double(1)+1/double(log(exp(1)+double((i_run-m_firstRun)*10))))/double(2);
384  APDPNpair.p2= (double(1)+1/double(log(exp(1)+double((i_run-m_firstRun)*10)+double(10))))/double(2);
385  APDPNpair.p3= double(0);
386  std::cout << i_run << " " << m_firstRun << " " << APDPNpair.p1 << " " << APDPNpair.p2 << std::endl;
387 
388  for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
389  if(iEta==0) continue;
390  for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
391  //APDPNpair.p1= double(1);
392  //APDPNpair.p2= double(1);
393 
394  EBDetId ebid(iEta,iPhi);
395  int hi = ebid.hashedIndex();
396 
397  if (hi< static_cast<int>(laser->getLaserMap().size())) {
398  laser->setValue(hi, APDPNpair);
399  } else {
400  edm::LogError("EcalTestDevDB") << "error with laser Map (ratio)!" << std::endl;
401  continue;
402  }
403  }
404  }
405 
406  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
407  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
408  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
409 
410  if (!EEDetId::validDetId(iX,iY,1))
411  continue;
412 
413  EEDetId eedetidpos(iX,iY,1);
414  //APDPNpair.p1 = double(1);
415  //APDPNpair.p2 = double(1);
416 
417  int hi = eedetidpos.hashedIndex() + EBDetId::MAX_HASH + 1;
418  if (hi< static_cast<int>(laser->getLaserMap().size())) {
419  laser->setValue(hi, APDPNpair);
420  } else {
421  edm::LogError("EcalTestDevDB") << "error with laser Map (ratio)!" << std::endl;
422  continue;
423  }
424 
425  if (!EEDetId::validDetId(iX,iY,-1))
426  continue;
427 
428  EEDetId eedetidneg(iX,iY,-1);
429  //APDPNpair.p1 = double(1);
430  //APDPNpair.p2 = double(1);
431  hi = eedetidneg.hashedIndex() + EBDetId::MAX_HASH + 1;
432  if (hi< static_cast<int>(laser->getLaserMap().size())) {
433  laser->setValue(hi, APDPNpair);
434  } else {
435  edm::LogError("EcalTestDevDB") << "error with laser Map (ratio)!" << std::endl;
436  continue;
437  }
438  }
439  }
440 
441  std::cout << std::endl;
442  for(int i=0; i<92; i++){
443  if (i< static_cast<int>(laser->getTimeMap().size())) {
444  TimeStamp.t1 = edm::Timestamp(1380*(i_run-m_firstRun) + 15*i);
445  TimeStamp.t2 = edm::Timestamp(1380*(i_run-m_firstRun + 1) + 15*i);
446  laser->setTime(i, TimeStamp);
447  //std::cout << " Timestamp for " << i << " : " << TimeStamp.t1.value() << " , " << TimeStamp.t2.value() << std::endl;
448  } else {
449  edm::LogError("EcalTestDevDB") << "error with laser Map (time)!" << std::endl;
450  continue;
451  }
452  }
453 
454  }else{
455 
456  APDPNpair.p1= (double(1)+1/double(log(exp(1)+double((i_run-m_firstRun)*10))))/double(2);
457  APDPNpair.p2= (double(1)+1/double(log(exp(1)+double((i_run-m_firstRun)*10)+double(10))))/double(2);
458  APDPNpair.p3= double(0);
459  std::cout << i_run << " " << m_firstRun << " " << APDPNpair.p1 << " " << APDPNpair.p2 << std::endl;
460 
461  for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
462  if(iEta==0) continue;
463  for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
464  EBDetId ebid(iEta,iPhi);
465  int hi = ebid.hashedIndex();
466 
467  if (hi< static_cast<int>(laser->getLaserMap().size())) {
468  laser->setValue(hi, APDPNpair);
469  } else {
470  edm::LogError("EcalTestDevDB") << "error with laser Map (ratio)!" << std::endl;
471  }
472  }
473  }
474  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
475  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
476  // make an EEDetId since we need EEDetId::rawId() to be used as the key for the pedestals
477 
478  if (!EEDetId::validDetId(iX,iY,1))
479  continue;
480 
481  EEDetId eedetidpos(iX,iY,1);
482  int hi = eedetidpos.hashedIndex() + EBDetId::MAX_HASH + 1;
483  if (hi< static_cast<int>(laser->getLaserMap().size())) {
484  laser->setValue(hi, APDPNpair);
485  } else {
486  edm::LogError("EcalTestDevDB") << "error with laser Map (ratio)!" << std::endl;
487  continue;
488  }
489 
490  if (!EEDetId::validDetId(iX,iY,-1))
491  continue;
492 
493  EEDetId eedetidneg(iX,iY,-1);
494  hi = eedetidneg.hashedIndex() + EBDetId::MAX_HASH + 1;
495  if (hi< static_cast<int>(laser->getLaserMap().size())) {
496  laser->setValue(hi, APDPNpair);
497  } else {
498  edm::LogError("EcalTestDevDB") << "error with laser Map (ratio)!" << std::endl;
499  continue;
500  }
501  }
502  }
503 
504  std::cout << std::endl;
505  for(int i=0; i<92; i++){
506  if (i< static_cast<int>(laser->getTimeMap().size())) {
507  TimeStamp.t1 = edm::Timestamp(1380*(i_run-m_firstRun) + 15*i);
508  TimeStamp.t2 = edm::Timestamp(1380*(i_run-m_firstRun + 1) + 15*i);
509  laser->setTime(i, TimeStamp);
510  //std::cout << " Timestamp for " << i << " : " << TimeStamp.t1.value() << " , " << TimeStamp.t2.value() << std::endl;
511  } else {
512  edm::LogError("EcalTestDevDB") << "error with laser Map (time)!" << std::endl;
513  continue;
514  }
515  }
516 
517  }
518 
519  return laser;
520 }
521 
522 
523 //--------------------------------------------------------------
526 //--------------------------------------------------------------
527 
529 
530  EcalLaserAPDPNref APDPNref;
531 
532 
533  for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
534  if(iEta==0) continue;
535  for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
536  APDPNref=double(1.5);
537  EBDetId ebid(iEta,iPhi);
538 
539  int hi = ebid.hashedIndex();
540  if (hi< static_cast<int>(laser->getMap().size())) {
541  laser->setValue(hi, APDPNref);
542  } else {
543  edm::LogError("EcalTestDevDB") << "error with laser Map (ref)!" << std::endl;
544  }
545 
546  }
547  }
548 
549  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
550  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
551 
552  if (!EEDetId::validDetId(iX,iY,1))
553  continue;
554 
555  EEDetId eedetidpos(iX,iY,1);
556  APDPNref=double(1.5);
557 
558  int hi = eedetidpos.hashedIndex() + EBDetId::MAX_HASH + 1;
559  if (hi< static_cast<int>(laser->getMap().size())) {
560  laser->setValue(hi, APDPNref);
561  } else {
562  edm::LogError("EcalTestDevDB") << "error with laser Map (ref)!" << std::endl;
563  }
564 
565  if (!EEDetId::validDetId(iX,iY,-1))
566  continue;
567 
568  EEDetId eedetidneg(iX,iY,-1);
569  APDPNref=double(1.5);
570 
571  hi = eedetidneg.hashedIndex() + EBDetId::MAX_HASH + 1;
572  if (hi< static_cast<int>(laser->getMap().size())) {
573  laser->setValue(hi, APDPNref);
574  } else {
575  edm::LogError("EcalTestDevDB") << "error with laser Map (ref)!" << std::endl;
576  }
577  }
578  }
579 
580  return laser;
581 }
582 
583 //--------------------------------------------------------------
586 //--------------------------------------------------------------
587 
588  EcalLaserAlphas* laser = new EcalLaserAlphas();
589 
590  EcalLaserAlpha Alpha;
591 
592  for(int iEta=-EBDetId::MAX_IETA; iEta<=EBDetId::MAX_IETA ;++iEta) {
593  if(iEta==0) continue;
594  for(int iPhi=EBDetId::MIN_IPHI; iPhi<=EBDetId::MAX_IPHI; ++iPhi) {
595  Alpha = double(1.55);
596  EBDetId ebid(iEta,iPhi);
597 
598  int hi = ebid.hashedIndex();
599  if (hi< static_cast<int>(laser->getMap().size())) {
600  laser->setValue(hi, Alpha);
601  } else {
602  edm::LogError("EcalTestDevDB") << "error with laser Map (alpha)!" << std::endl;
603  }
604  }
605  }
606 
607  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
608  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
609 
610  if (!EEDetId::validDetId(iX,iY,1))
611  continue;
612 
613  EEDetId eedetidpos(iX,iY,1);
614  Alpha = double(1.55);
615 
616  int hi = eedetidpos.hashedIndex() + EBDetId::MAX_HASH + 1;
617  if (hi< static_cast<int>(laser->getMap().size())) {
618  laser->setValue(hi, Alpha);
619  } else {
620  edm::LogError("EcalTestDevDB") << "error with laser Map (alpha)!" << std::endl;
621  }
622 
623  if (!EEDetId::validDetId(iX,iY,-1))
624  continue;
625  EEDetId eedetidneg(iX,iY,-1);
626  Alpha = double(1.55);
627 
628  hi = eedetidneg.hashedIndex() + EBDetId::MAX_HASH + 1;
629  if (hi< static_cast<int>(laser->getMap().size())) {
630  laser->setValue(hi, Alpha);
631  } else {
632  edm::LogError("EcalTestDevDB") << "error with laser Map (alpha)!" << std::endl;
633  }
634  }
635  }
636 
637  return laser;
638 }
RunNumber_t run() const
Definition: EventID.h:42
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
Definition: EcalWeightSet.h:29
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
float EcalLaserAlpha
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:73
static const int MIN_IPHI
Definition: EBDetId.h:121
const EventID & eventID() const
Definition: IOVSyncValue.h:42
JetCorrectorParameters::Record record
Definition: classes.h:11
const self & getMap() const
static const int MAX_HASH
Definition: EBDetId.h:136
EcalLaserAlphas * generateEcalLaserAlphas()
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
EcalCondObjectContainer< EcalXtalGroupId > EcalWeightXtalGroups
EcalLaserAPDPNRatiosRefMap EcalLaserAPDPNRatiosRef
std::map< std::string, std::string > m_records
Definition: EcalTestDevDB.h:61
void setValue(const EcalXtalGroupId &groupId, const EcalTDCId &tdcId, const EcalWeightSet &weight)
EcalLaserAPDPNRatiosRef * generateEcalLaserAPDPNRatiosRef()
static const int IX_MIN
Definition: EEDetId.h:271
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
unsigned long m_lastRun
Definition: EcalTestDevDB.h:63
float EcalLaserAPDPNref
static const int IY_MIN
Definition: EEDetId.h:275
void setGain12Over6(const float &g)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void setValue(const uint32_t id, const Item &item)
EcalTestDevDB(const edm::ParameterSet &iConfig)
const EcalLaserAPDPNRatiosMap & getLaserMap() const
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
void setTime(int hashedIndex, const EcalLaserTimeStamp &value)
vector< ParameterSet > Parameters
EcalGainRatioMap EcalGainRatios
bool isNewTagRequest(const std::string &recordName)
EcalLaserAlphaMap EcalLaserAlphas
bool isAvailable() const
Definition: Service.h:47
int j
Definition: DBlmapReader.cc:9
EcalChi2WeightMatrix & getChi2WeightsAfterGainSwitch()
Definition: EcalWeightSet.h:30
EcalWeightXtalGroups * generateEcalWeightXtalGroups()
EcalLaserAPDPNRatios * generateEcalLaserAPDPNRatios(uint32_t i_run)
EcalWeightMatrix & getWeightsAfterGainSwitch()
Definition: EcalWeightSet.h:28
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
void insert(std::pair< uint32_t, Item > const &a)
unsigned int m_interval
Definition: EcalTestDevDB.h:64
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
Definition: EcalWeightSet.h:21
static const int IX_MAX
Definition: EEDetId.h:279
EcalPedestalsMap EcalPedestals
Definition: EcalPedestals.h:38
unsigned long m_firstRun
Definition: EcalTestDevDB.h:62
int hashedIndex() const
Definition: EEDetId.h:177
static const int MAX_IPHI
Definition: EBDetId.h:123
EcalWeightMatrix & getWeightsBeforeGainSwitch()
Definition: EcalWeightSet.h:27
const EcalLaserTimeStampMap & getTimeMap() const
EcalTBWeights * generateEcalTBWeights()
static const int MAX_IETA
Definition: EBDetId.h:122
void setValue(uint32_t rawId, const EcalLaserAPDPNpair &value)
EcalIntercalibConstantMap EcalIntercalibConstants
EcalGainRatios * generateEcalGainRatios()
virtual void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup)
Signal rand(Signal arg)
Definition: vlib.cc:442
math::Matrix< 3, 10 >::type EcalWeightMatrix
Definition: EcalWeightSet.h:20
EcalPedestals * generateEcalPedestals()
EcalADCToGeVConstant * generateEcalADCToGeVConstant()
tuple cout
Definition: gather_cfg.py:121
static const int IY_MAX
Definition: EEDetId.h:283
std::map< std::string, unsigned long long > m_cacheIDs
Definition: EcalTestDevDB.h:60
void setGain6Over1(const float &g)
EcalIntercalibConstants * generateEcalIntercalibConstants()