|
|
Go to the documentation of this file.
26 : m_timetype(iConfig.getParameter<
std::
string>(
"timetype")), m_cacheIDs(), m_records() {
35 typedef std::vector<edm::ParameterSet>
Parameters;
37 for (Parameters::iterator
i = toCopy.begin();
i != toCopy.end(); ++
i) {
40 m_cacheIDs.insert(std::make_pair(container, 0));
55 typedef std::map<std::string, std::string>::const_iterator recordIter;
57 container = (*i).first;
65 unsigned long nstart = 0;
72 for (
unsigned long i = nstart;
i < nrec;
i++) {
77 std::cout <<
"Infinite IOV mode" << std::endl;
81 std::cout <<
"Starting Transaction for run " << irun <<
"..." << std::flush;
83 if (container ==
"EcalPedestals") {
97 }
else if (container ==
"EcalADCToGeVConstant") {
110 }
else if (container ==
"EcalIntercalibConstants") {
122 }
else if (container ==
"EcalLinearCorrections") {
135 }
else if (container ==
"EcalGainRatios") {
148 }
else if (container ==
"EcalWeightXtalGroups") {
161 }
else if (container ==
"EcalTBWeights") {
174 }
else if (container ==
"EcalLaserAPDPNRatios") {
186 }
else if (container ==
"EcalLaserAPDPNRatiosRef") {
198 }
else if (container ==
"EcalLaserAlphas") {
211 std::cout <<
"it does not work yet for " << container <<
"..." << std::flush;
227 item.mean_x1 = 200. * ((double)
std::rand() / (double(RAND_MAX) + double(1)));
228 item.rms_x1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
229 item.mean_x6 = 1200. * ((double)
std::rand() / (double(RAND_MAX) + double(1)));
230 item.rms_x6 = 6. * ((double)
std::rand() / (double(RAND_MAX) + double(1)));
231 item.mean_x12 = 2400. * ((double)
std::rand() / (double(RAND_MAX) + double(1)));
232 item.rms_x12 = 12. * ((double)
std::rand() / (double(RAND_MAX) + double(1)));
245 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
262 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
302 ical->
setValue(eedetidpos, pairAPDPN);
306 EEDetId eedetidneg(iX, iY, -1);
313 ical->
setValue(eedetidneg, pairAPDPN);
319 for (
int i = 0;
i < 92;
i++) {
343 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
383 for (
int itdc = 1; itdc <= nMaxTDC; ++itdc) {
385 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
392 for (
size_t i = 0;
i < 3; ++
i) {
393 for (
size_t j = 0;
j < 10; ++
j) {
394 double ww = igrp * itdc *
r +
i * 10. +
j;
397 mat2(
i,
j) = 100 + ww;
402 r = (double)
std::rand() / (double(RAND_MAX) + double(1));
405 for (
size_t i = 0;
i < 10; ++
i) {
406 for (
size_t j = 0;
j < 10; ++
j) {
407 double ww = igrp * itdc *
r +
i * 10. +
j;
408 mat3(
i,
j) = 1000 + ww;
409 mat4(
i,
j) = 1000 + 100 + ww;
414 tbwgt->
setValue(std::make_pair(igrp, itdc), wgt);
432 if (
m_firstRun == i_run && (i_run == 0 || i_run == 1)) {
433 APDPNpair.
p1 = (double(1) + 1 / double(
log(
exp(1) +
double((i_run -
m_firstRun) * 10)))) /
double(2);
434 APDPNpair.
p2 = (double(1) + 1 / double(
log(
exp(1) +
double((i_run -
m_firstRun) * 10) +
double(10)))) /
double(2);
435 APDPNpair.
p3 = double(0);
448 if (
hi < static_cast<int>(
laser->getLaserMap().size())) {
449 laser->setValue(
hi, APDPNpair);
451 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
469 if (
hi < static_cast<int>(
laser->getLaserMap().size())) {
470 laser->setValue(
hi, APDPNpair);
472 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
479 EEDetId eedetidneg(iX, iY, -1);
483 if (
hi < static_cast<int>(
laser->getLaserMap().size())) {
484 laser->setValue(
hi, APDPNpair);
486 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
493 for (
int i = 0;
i < 92;
i++) {
494 if (
i < static_cast<int>(
laser->getTimeMap().size())) {
497 laser->setTime(
i, TimeStamp);
500 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (time)!" << std::endl;
506 APDPNpair.
p1 = (double(1) + 1 / double(
log(
exp(1) +
double((i_run -
m_firstRun) * 10)))) /
double(2);
507 APDPNpair.
p2 = (double(1) + 1 / double(
log(
exp(1) +
double((i_run -
m_firstRun) * 10) +
double(10)))) /
double(2);
508 APDPNpair.
p3 = double(0);
518 if (
hi < static_cast<int>(
laser->getLaserMap().size())) {
519 laser->setValue(
hi, APDPNpair);
521 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
534 if (
hi < static_cast<int>(
laser->getLaserMap().size())) {
535 laser->setValue(
hi, APDPNpair);
537 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
544 EEDetId eedetidneg(iX, iY, -1);
546 if (
hi < static_cast<int>(
laser->getLaserMap().size())) {
547 laser->setValue(
hi, APDPNpair);
549 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
556 for (
int i = 0;
i < 92;
i++) {
557 if (
i < static_cast<int>(
laser->getTimeMap().size())) {
560 laser->setTime(
i, TimeStamp);
563 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (time)!" << std::endl;
584 APDPNref = double(1.5);
588 if (
hi < static_cast<int>(
laser->getMap().size())) {
591 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
602 APDPNref = double(1.5);
605 if (
hi < static_cast<int>(
laser->getMap().size())) {
608 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
614 EEDetId eedetidneg(iX, iY, -1);
615 APDPNref = double(1.5);
618 if (
hi < static_cast<int>(
laser->getMap().size())) {
621 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
641 Alpha = double(1.55);
645 if (
hi < static_cast<int>(
laser->getMap().size())) {
648 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
659 Alpha = double(1.55);
662 if (
hi < static_cast<int>(
laser->getMap().size())) {
665 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
670 EEDetId eedetidneg(iX, iY, -1);
671 Alpha = double(1.55);
674 if (
hi < static_cast<int>(
laser->getMap().size())) {
677 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
EcalWeightXtalGroups * generateEcalWeightXtalGroups()
int hashedIndex() const
get a compact index for arrays
EcalTBWeights * generateEcalTBWeights()
EcalLaserAPDPNRatiosRefMap EcalLaserAPDPNRatiosRef
void setGain6Over1(const float &g)
cond::Time_t beginOfTime() const
std::map< std::string, std::string > m_records
EcalLaserAlphaMap EcalLaserAlphas
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
EcalGainRatioMap EcalGainRatios
EcalLinearCorrections * generateEcalLinearCorrections()
EcalTestDevDB(const edm::ParameterSet &iConfig)
math::Matrix< 3, 10 >::type EcalWeightMatrix
EcalLaserAPDPNRatiosRef * generateEcalLaserAPDPNRatiosRef()
void setValue(const EcalXtalGroupId &groupId, const EcalTDCId &tdcId, const EcalWeightSet &weight)
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
void setValue(uint32_t rawId, const Values &value)
EcalLaserAPDPNRatios * generateEcalLaserAPDPNRatios(uint32_t i_run)
static const int MAX_IPHI
EcalIntercalibConstantMap EcalIntercalibConstants
EcalWeightMatrix & getWeightsAfterGainSwitch()
EcalPedestalsMap EcalPedestals
void setGain12Over6(const float &g)
EcalWeightMatrix & getWeightsBeforeGainSwitch()
void setValue(const uint32_t id, const Item &item)
const EventID & eventID() const
static const IOVSyncValue & endOfTime()
EcalCondObjectContainer< EcalXtalGroupId > EcalWeightXtalGroups
std::map< std::string, unsigned long long > m_cacheIDs
void setTime(int hashedIndex, const Times &value)
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
EcalTimeDependentCorrections EcalLinearCorrections
EcalChi2WeightMatrix & getChi2WeightsAfterGainSwitch()
static Timestamp endOfTime()
static const int MAX_HASH
EcalIntercalibConstants * generateEcalIntercalibConstants()
EcalLaserAlphas * generateEcalLaserAlphas()
cond::Time_t endOfTime() const
static bool validDetId(int i, int j)
check if a valid index combination
T getParameter(std::string const &) const
EcalADCToGeVConstant * generateEcalADCToGeVConstant()
void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup) override
EcalGainRatios * generateEcalGainRatios()
constexpr uint32_t rawId() const
get the raw id
void insert(std::pair< uint32_t, Item > const &a)
~EcalTestDevDB() override
bool isNewTagRequest(const std::string &recordName)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
vector< ParameterSet > Parameters
static const int MAX_IETA
EcalPedestals * generateEcalPedestals()
static const int MIN_IPHI