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";
36 unsigned long long max_since= 1;
37 Ref payload= lastPayload();
41 max_since=
tagInfo().lastInterval.first;
43 Tm max_since_tm(max_since);
48 payload->getLaserMap();
49 std::cout <<
"payload->getLaserMap(): OK " << std::endl;
50 std::cout <<
"Its size is " << laserRatiosMap.
size() << std::endl;
52 payload->getTimeMap();
53 std::cout <<
"payload->getTimeMap(): OK " << std::endl;
54 std::cout <<
"Last Object in Offline DB has SINCE = " << max_since
56 <<
" (" << max_since_tm <<
")"
57 <<
" and SIZE = " <<
tagInfo().size
61 for (
int i=0;
i<92;
i++) {
63 if( t_min > timestamp.
t1) {
68 std::cout <<
"WOW: we just retrieved the last valid record from DB "
78 std::cout <<
" which input IOV do you want " << std::endl;
81 std::ostringstream oss;
84 fWeek.open(fname.c_str());
85 if(!fWeek.is_open()) {
86 std::cout <<
"ERROR : can't open file 'weekly_" << oss.str() << std::endl;
89 std::cout <<
" file weekly_" << oss.str() <<
" opened" << std::endl;
92 std::ifstream fRunStartTime;
93 fRunStartTime.open(
"RunStartTime");
94 if(!fRunStartTime.is_open()) {
95 std::cout <<
"ERROR : cannot open file RunStartTime" << std::endl;
99 while(!fRunStartTime.eof()) {
102 fRunStartTime >> run >>
start;
105 std::cout <<
"run " << run <<
" timestamp " << start <<
"\n";
108 else if (run == fileIOV) {
109 std::cout <<
" run " << fileIOV <<
" not found in RunStartTime. Let us give up" << std::endl;
113 fRunStartTime.close();
118 t3 = t1 + 7792788661862400;
119 t2 = t1 + (t3 - t1)/2;
121 for(
size_t i = 0;
i < nLmes; ++
i){
125 corrSet->setTime(
i, t);
130 for (
int iChannel = 0; iChannel < kEBChannels; iChannel++) {
132 fWeek >> rawId >> corrp;
133 corr.
p1=corr.
p2=corr.
p3 = corrp;
134 corrSet->setValue((
int)ebId, corr );
136 for (
int iChannel = 0; iChannel < kEEChannels; iChannel++) {
138 fWeek >> rawId >> corrp;
139 corr.
p1=corr.
p2=corr.
p3 = corrp;
140 corrSet->setValue((
int)eeId, corr );
144 std::cout <<
"Write IOV " << iIov <<
" starting from " << fileIOV <<
"... "<< std::endl;
146 m_to_transfer.push_back(std::make_pair(corrSet, fileIOV));
149 std::cout <<
"Ecal -> end of getNewObjects -----------\n";
tuple start
Check for commandline option errors.
edm::Ref< Container > Ref
EcalLaser_weekly_Handler(edm::ParameterSet const &)
static EEDetId unhashIndex(int hi)
~EcalLaser_weekly_Handler()
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
TimeValue_t value() const