26 m_timetype(iConfig.getParameter<std::
string>(
"timetype")),
39 typedef std::vector< edm::ParameterSet >
Parameters;
41 for(Parameters::iterator
i = toCopy.begin();
i != toCopy.end(); ++
i) {
44 m_cacheIDs.insert( std::make_pair(container, 0) );
45 m_records.insert( std::make_pair(container, record) );
68 typedef std::map<std::string, std::string>::const_iterator recordIter;
70 container = (*i).first;
79 unsigned long nstart=0;
86 for(
unsigned long i=nstart;
i<nrec;
i++) {
92 std::cout <<
"Infinite IOV mode" << std::endl;
96 std::cout <<
"Starting Transaction for run " << irun <<
"..." << std::flush;
98 if (container ==
"EcalPedestals") {
111 }
else if (container ==
"EcalADCToGeVConstant") {
125 }
else if (container ==
"EcalIntercalibConstants") {
136 }
else if (container ==
"EcalLinearCorrections") {
148 }
else if (container ==
"EcalGainRatios") {
160 }
else if (container ==
"EcalWeightXtalGroups") {
172 }
else if (container ==
"EcalTBWeights") {
184 }
else if (container ==
"EcalLaserAPDPNRatios") {
195 }
else if (container ==
"EcalLaserAPDPNRatiosRef") {
206 }
else if (container ==
"EcalLaserAlphas") {
218 std::cout <<
"it does not work yet for " << container <<
"..." << std::flush;
240 if(iEta==0)
continue;
250 peds->
insert(std::make_pair(ebdetid.
rawId(),item));
261 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
274 if(ieta==0)
continue;
279 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
294 if(ieta==0)
continue;
321 ical->
setValue( eedetidpos, pairAPDPN );
333 ical->
setValue( eedetidneg, pairAPDPN );
339 for(
int i=0;
i<92;
i++){
365 if(ieta==0)
continue;
370 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
390 if(ieta==0)
continue;
409 if(igrp==0)
continue;
410 for(
int itdc=1; itdc<=nMaxTDC; ++itdc) {
412 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
419 for(
size_t i=0;
i<3; ++
i) {
420 for(
size_t j=0;
j<10; ++
j) {
421 double ww = igrp*itdc*r +
i*10. +
j;
429 r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
432 for(
size_t i=0;
i<10; ++
i) {
433 for(
size_t j=0;
j<10; ++
j) {
434 double ww = igrp*itdc*r +
i*10. +
j;
436 mat4(
i,
j)=1000+100+ww;
441 tbwgt->
setValue(std::make_pair(igrp,itdc), wgt);
462 if (
m_firstRun == i_run && (i_run == 0 || i_run == 1) ) {
464 APDPNpair.
p1= (double(1)+1/double(
log(
exp(1)+
double((i_run-
m_firstRun)*10))))/
double(2);
465 APDPNpair.
p2= (double(1)+1/double(
log(
exp(1)+
double((i_run-
m_firstRun)*10)+
double(10))))/
double(2);
466 APDPNpair.
p3= double(0);
470 if(iEta==0)
continue;
481 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
502 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
516 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
523 for(
int i=0;
i<92;
i++){
524 if (
i< static_cast<int>(laser->
getTimeMap().size())) {
530 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (time)!" << std::endl;
537 APDPNpair.
p1= (double(1)+1/double(
log(
exp(1)+
double((i_run-
m_firstRun)*10))))/
double(2);
538 APDPNpair.
p2= (double(1)+1/double(
log(
exp(1)+
double((i_run-
m_firstRun)*10)+
double(10))))/
double(2);
539 APDPNpair.
p3= double(0);
543 if(iEta==0)
continue;
551 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
567 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
579 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
586 for(
int i=0;
i<92;
i++){
587 if (
i< static_cast<int>(laser->
getTimeMap().size())) {
593 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (time)!" << std::endl;
615 if(iEta==0)
continue;
617 APDPNref=double(1.5);
621 if (hi< static_cast<int>(laser->
getMap().
size())) {
624 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
637 APDPNref=double(1.5);
640 if (hi< static_cast<int>(laser->
getMap().
size())) {
643 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
650 APDPNref=double(1.5);
653 if (hi< static_cast<int>(laser->
getMap().
size())) {
656 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
674 if(iEta==0)
continue;
676 Alpha = double(1.55);
680 if (hi< static_cast<int>(laser->
getMap().
size())) {
683 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
695 Alpha = double(1.55);
698 if (hi< static_cast<int>(laser->
getMap().
size())) {
701 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
707 Alpha = double(1.55);
710 if (hi< static_cast<int>(laser->
getMap().
size())) {
713 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
T getParameter(std::string const &) const
int hashedIndex() const
get a compact index for arrays
static const int MIN_IPHI
static Timestamp endOfTime()
static std::vector< std::string > checklist log
void setValue(uint32_t rawId, const Values &value)
const EventID & eventID() const
const self & getMap() const
static const int MAX_HASH
EcalLaserAlphas * generateEcalLaserAlphas()
static const IOVSyncValue & endOfTime()
EcalCondObjectContainer< EcalXtalGroupId > EcalWeightXtalGroups
EcalLaserAPDPNRatiosRefMap EcalLaserAPDPNRatiosRef
std::map< std::string, std::string > m_records
void setValue(const EcalXtalGroupId &groupId, const EcalTDCId &tdcId, const EcalWeightSet &weight)
EcalLaserAPDPNRatiosRef * generateEcalLaserAPDPNRatiosRef()
EcalTimeDependentCorrections EcalLinearCorrections
void setTime(int hashedIndex, const Times &value)
static bool validDetId(int i, int j)
check if a valid index combination
void setGain12Over6(const float &g)
uint32_t rawId() const
get the raw id
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
cond::Time_t beginOfTime() const
EcalChi2WeightMatrix & getChi2WeightsAfterGainSwitch()
EcalWeightXtalGroups * generateEcalWeightXtalGroups()
EcalLinearCorrections * generateEcalLinearCorrections()
EcalLaserAPDPNRatios * generateEcalLaserAPDPNRatios(uint32_t i_run)
EcalWeightMatrix & getWeightsAfterGainSwitch()
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)
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
EcalPedestalsMap EcalPedestals
static const int MAX_IPHI
EcalWeightMatrix & getWeightsBeforeGainSwitch()
const EcalLaserTimeStampMap & getTimeMap() const
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
EcalTBWeights * generateEcalTBWeights()
static const int MAX_IETA
void setValue(uint32_t rawId, const EcalLaserAPDPNpair &value)
cond::Time_t endOfTime() const
EcalIntercalibConstantMap EcalIntercalibConstants
EcalGainRatios * generateEcalGainRatios()
virtual void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup)
math::Matrix< 3, 10 >::type EcalWeightMatrix
EcalPedestals * generateEcalPedestals()
EcalADCToGeVConstant * generateEcalADCToGeVConstant()
std::map< std::string, unsigned long long > m_cacheIDs
void setGain6Over1(const float &g)
EcalIntercalibConstants * generateEcalIntercalibConstants()