14 : m_name(ps.getUntrackedParameter<std::
string>(
"name",
"EcalLaser_weekly_Handler")) {
16 std::cout <<
"EcalLaser Source handler constructor\n" << std::endl;
27 const size_t nLmes = 92;
33 std::cout <<
"------- Ecal -> getNewObjects\n";
35 unsigned long long max_since = 1;
40 max_since =
tagInfo().lastInterval.since;
42 Tm max_since_tm(max_since);
47 std::cout <<
"payload->getLaserMap(): OK " << std::endl;
48 std::cout <<
"Its size is " << laserRatiosMap.
size() << std::endl;
50 std::cout <<
"payload->getTimeMap(): OK " << std::endl;
51 std::cout <<
"Last Object in Offline DB has SINCE = " << max_since <<
" -> " << max_since_tm.
cmsNanoSeconds() <<
" ("
52 << max_since_tm <<
")"
53 <<
" and SIZE = " <<
tagInfo().size << std::endl;
56 for (
int i = 0;
i < 92;
i++) {
58 if (t_min > timestamp.
t1) {
63 std::cout <<
"WOW: we just retrieved the last valid record from DB " << std::endl;
72 std::cout <<
" which input IOV do you want " << std::endl;
75 std::ostringstream oss;
78 fWeek.open(fname.c_str());
79 if (!fWeek.is_open()) {
80 std::cout <<
"ERROR : can't open file 'weekly_" << oss.str() << std::endl;
83 std::cout <<
" file weekly_" << oss.str() <<
" opened" << std::endl;
86 std::ifstream fRunStartTime;
87 fRunStartTime.open(
"RunStartTime");
88 if (!fRunStartTime.is_open()) {
89 std::cout <<
"ERROR : cannot open file RunStartTime" << std::endl;
93 while (!fRunStartTime.eof()) {
96 fRunStartTime >> run >>
start;
99 std::cout <<
"run " << run <<
" timestamp " << start <<
"\n";
101 }
else if (run == fileIOV) {
102 std::cout <<
" run " << fileIOV <<
" not found in RunStartTime. Let us give up" << std::endl;
106 fRunStartTime.close();
111 t3 = t1 + 7792788661862400;
112 t2 = t1 + (t3 - t1) / 2;
114 for (
size_t i = 0;
i < nLmes; ++
i) {
118 corrSet->setTime(
i, t);
123 for (
int iChannel = 0; iChannel <
kEBChannels; iChannel++) {
125 fWeek >> rawId >> corrp;
126 corr.
p1 = corr.
p2 = corr.
p3 = corrp;
127 corrSet->setValue((
int)ebId, corr);
129 for (
int iChannel = 0; iChannel <
kEEChannels; iChannel++) {
131 fWeek >> rawId >> corrp;
132 corr.
p1 = corr.
p2 = corr.
p3 = corrp;
133 corrSet->setValue((
int)eeId, corr);
137 std::cout <<
"Write IOV " << iIov <<
" starting from " << fileIOV <<
"... " << std::endl;
139 m_to_transfer.push_back(std::make_pair(corrSet, fileIOV));
142 std::cout <<
"Ecal -> end of getNewObjects -----------\n";
EcalLaser_weekly_Handler(edm::ParameterSet const &)
static EEDetId unhashIndex(int hi)
void getNewObjects() override
~EcalLaser_weekly_Handler() override
uint64_t cmsNanoSeconds() const
unsigned long long uint64_t
std::vector< EcalLaserTimeStamp > EcalLaserTimeStampMap
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
std::unique_ptr< EcalLaserAPDPNRatios > Ref
TimeValue_t value() const