26 m_timetype(iConfig.getParameter<std::string>(
"timetype")),
31 std::string container;
39 typedef std::vector< edm::ParameterSet >
Parameters;
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) );
66 std::string container;
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") {
137 }
else if (container ==
"EcalGainRatios") {
149 }
else if (container ==
"EcalWeightXtalGroups") {
161 }
else if (container ==
"EcalTBWeights") {
173 }
else if (container ==
"EcalLaserAPDPNRatios") {
184 }
else if (container ==
"EcalLaserAPDPNRatiosRef") {
195 }
else if (container ==
"EcalLaserAlphas") {
207 std::cout <<
"it does not work yet for " << container <<
"..." << std::flush;
229 if(iEta==0)
continue;
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)) );
239 peds->
insert(std::make_pair(ebdetid.
rawId(),item));
250 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
263 if(ieta==0)
continue;
268 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
284 if(ieta==0)
continue;
289 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
309 if(ieta==0)
continue;
328 if(igrp==0)
continue;
329 for(
int itdc=1; itdc<=nMaxTDC; ++itdc) {
331 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
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;
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;
355 mat4(
i,
j)=1000+100+ww;
360 tbwgt->
setValue(std::make_pair(igrp,itdc), wgt);
381 if (
m_firstRun == i_run && (i_run == 0 || i_run == 1) ) {
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);
389 if(iEta==0)
continue;
400 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
421 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
435 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
442 for(
int i=0;
i<92;
i++){
443 if (
i< static_cast<int>(laser->
getTimeMap().size())) {
449 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (time)!" << std::endl;
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);
462 if(iEta==0)
continue;
470 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
486 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
498 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ratio)!" << std::endl;
505 for(
int i=0;
i<92;
i++){
506 if (
i< static_cast<int>(laser->
getTimeMap().size())) {
512 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (time)!" << std::endl;
534 if(iEta==0)
continue;
536 APDPNref=double(1.5);
540 if (hi< static_cast<int>(laser->
getMap().
size())) {
543 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
556 APDPNref=double(1.5);
559 if (hi< static_cast<int>(laser->
getMap().
size())) {
562 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
569 APDPNref=double(1.5);
572 if (hi< static_cast<int>(laser->
getMap().
size())) {
575 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (ref)!" << std::endl;
593 if(iEta==0)
continue;
595 Alpha = double(1.55);
599 if (hi< static_cast<int>(laser->
getMap().
size())) {
602 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
614 Alpha = double(1.55);
617 if (hi< static_cast<int>(laser->
getMap().
size())) {
620 edm::LogError(
"EcalTestDevDB") <<
"error with laser Map (alpha)!" << std::endl;
626 Alpha = double(1.55);
629 if (hi< static_cast<int>(laser->
getMap().
size())) {
632 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
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()
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
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()
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
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()