| 169 |
}; |
}; |
| 170 |
|
|
| 171 |
/** |
/** |
| 172 |
|
* Set the pedantic flag |
| 173 |
|
* |
| 174 |
|
*/ |
| 175 |
|
void PamelaDBOperations::SetPedantic(Bool_t dbg){ |
| 176 |
|
PEDANTIC = dbg; |
| 177 |
|
}; |
| 178 |
|
|
| 179 |
|
/** |
| 180 |
* Set the nofrag flag |
* Set the nofrag flag |
| 181 |
* |
* |
| 182 |
*/ |
*/ |
| 390 |
if ( result == NULL ) throw -4; |
if ( result == NULL ) throw -4; |
| 391 |
row = result->Next(); |
row = result->Next(); |
| 392 |
if ( !row ) return(false); |
if ( !row ) return(false); |
|
delete result; |
|
| 393 |
id = (UInt_t)atoll(row->GetField(0)); |
id = (UInt_t)atoll(row->GetField(0)); |
| 394 |
|
delete result; |
| 395 |
return(true); |
return(true); |
| 396 |
} |
} |
| 397 |
|
|
| 498 |
if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){ |
if ( (PKT(pktlast) < PKT(pktfirst) && OBT(obtlast) < OBT(obtfirst)) || (labs(PKT(pktlast)-PKT(pktfirst))<deltapkt && labs(OBT(obtlast)-OBT(obtfirst))<deltaobt) && nevent > deltapkt ){ |
| 499 |
// |
// |
| 500 |
if ( IsDebug() ) printf(" starting jump %i \n",jump); |
if ( IsDebug() ) printf(" starting jump %i \n",jump); |
| 501 |
|
if ( PEDANTIC ) throw -66; |
| 502 |
// go back |
// go back |
| 503 |
zomp = nevent - 2; |
zomp = nevent - 2; |
| 504 |
// |
// |
| 638 |
// if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth); |
// if ( IsDebug() ) printf(" k %i rhev before %i ph %u upperp %u oh %u uppero %u \n",k,rhev,pkth,spkth,obth,sobth); |
| 639 |
// |
// |
| 640 |
if ( pkth < spkth && obth < sobth ){ |
if ( pkth < spkth && obth < sobth ){ |
| 641 |
|
if ( PEDANTIC ) throw -66; |
| 642 |
if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i \n",rhev); |
if ( IsDebug() ) printf(" RH PROBLEMS determining the event repetition at the end of the file lasthead %i \n",rhev); |
| 643 |
// |
// |
| 644 |
rhev = k-1; |
rhev = k-1; |
| 698 |
// if ( IsDebug() ) printf(" k %i rtev beforev %i pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt); |
// if ( IsDebug() ) printf(" k %i rtev beforev %i pt %i upperp %i ot %llu uppero %llu \n",k,rtev,pktt,spktt,obtt,sobtt); |
| 699 |
// |
// |
| 700 |
if ( pktt < spktt && obtt < sobtt ){ |
if ( pktt < spktt && obtt < sobtt ){ |
| 701 |
|
if ( PEDANTIC ) throw -66; |
| 702 |
if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev); |
if ( IsDebug() ) printf(" RT PROBLEMS determining the event repetition at the end of the file lasttrail %i \n",rtev); |
| 703 |
// |
// |
| 704 |
rtev = k-1; |
rtev = k-1; |
| 970 |
if ( IsDebug() ) printf(" obt conversion: obt is %u obtfirst is %u (numeric_limits<UInt_t>::max()/2) is %u \n",obt,pobtfirst,(UInt_t)(numeric_limits<UInt_t>::max()/2)); |
if ( IsDebug() ) printf(" obt conversion: obt is %u obtfirst is %u (numeric_limits<UInt_t>::max()/2) is %u \n",obt,pobtfirst,(UInt_t)(numeric_limits<UInt_t>::max()/2)); |
| 971 |
// |
// |
| 972 |
if ( obt < (pobtfirst/2) && pobtfirst > (numeric_limits<UInt_t>::max()/2) ){ |
if ( obt < (pobtfirst/2) && pobtfirst > (numeric_limits<UInt_t>::max()/2) ){ |
| 973 |
if ( IsDebug() ) printf(" rise up obt %lld \n",(Long64_t)(obt+numeric_limits<UInt_t>::max())); |
if ( IsDebug() ) printf(" rise up obt %lld \n",(Long64_t)obt+(Long64_t)numeric_limits<UInt_t>::max()); |
| 974 |
return((Long64_t)(obt+numeric_limits<UInt_t>::max())); |
return((Long64_t)obt+(Long64_t)numeric_limits<UInt_t>::max()); |
| 975 |
}; |
}; |
| 976 |
// |
// |
| 977 |
if ( obt > ((Long64_t)pobtfirst*2) && obt > (numeric_limits<UInt_t>::max()/2) ){ |
if ( obt > ((Long64_t)pobtfirst*2) && obt > (numeric_limits<UInt_t>::max()/2) ){ |
| 1174 |
tsync = (UInt_t)atoll(row->GetField(2)); |
tsync = (UInt_t)atoll(row->GetField(2)); |
| 1175 |
obt0 = (UInt_t)atoll(row->GetField(1)); |
obt0 = (UInt_t)atoll(row->GetField(1)); |
| 1176 |
// |
// |
| 1177 |
|
if ( PEDANTIC ) throw -67; |
| 1178 |
return(1); |
return(1); |
| 1179 |
}; |
}; |
| 1180 |
// |
// |
| 1344 |
// |
// |
| 1345 |
if ( !existsts && obt0 ){ // insert timesync by hand |
if ( !existsts && obt0 ){ // insert timesync by hand |
| 1346 |
// |
// |
| 1347 |
|
if ( PEDANTIC ) throw -68; |
| 1348 |
if ( IsDebug() ) printf(" No incl mcmd \n"); |
if ( IsDebug() ) printf(" No incl mcmd \n"); |
| 1349 |
signal = 30; |
signal = 30; |
| 1350 |
// |
// |
| 2051 |
// |
// |
| 2052 |
} else { |
} else { |
| 2053 |
if ( IsDebug() ) printf(" The run is already present in the fragment table \n"); |
if ( IsDebug() ) printf(" The run is already present in the fragment table \n"); |
| 2054 |
|
if ( PEDANTIC ) throw -69; |
| 2055 |
return; |
return; |
| 2056 |
}; |
}; |
| 2057 |
// |
// |
| 2202 |
bpkt = PKT(ph->GetCounter()); |
bpkt = PKT(ph->GetCounter()); |
| 2203 |
bobt = OBT(ph->GetOrbitalTime()); |
bobt = OBT(ph->GetOrbitalTime()); |
| 2204 |
firstev++; |
firstev++; |
| 2205 |
|
if ( PEDANTIC ) throw -71; |
| 2206 |
}; |
}; |
| 2207 |
if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu firstev is %i\n",apkt,bpkt,aobt,bobt,firstev); |
if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu firstev is %i\n",apkt,bpkt,aobt,bobt,firstev); |
| 2208 |
// |
// |
| 2400 |
apkt = PKT(ph->GetCounter()); |
apkt = PKT(ph->GetCounter()); |
| 2401 |
aobt = OBT(ph->GetOrbitalTime()); |
aobt = OBT(ph->GetOrbitalTime()); |
| 2402 |
lastev--; |
lastev--; |
| 2403 |
|
if ( PEDANTIC ) throw -72; |
| 2404 |
}; |
}; |
| 2405 |
if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu lastev is %i\n",apkt,bpkt,aobt,bobt,lastev); |
if ( IsDebug() ) printf(" Check overlapping events done: %u %u %llu %llu lastev is %i\n",apkt,bpkt,aobt,bobt,lastev); |
| 2406 |
// |
// |
| 2487 |
// |
// |
| 2488 |
if ( row ){ |
if ( row ){ |
| 2489 |
if ( IsDebug() ) printf(" The run is already present in the GL_RUN table \n"); |
if ( IsDebug() ) printf(" The run is already present in the GL_RUN table \n"); |
| 2490 |
|
if ( PEDANTIC ) throw -70; |
| 2491 |
} else { |
} else { |
| 2492 |
if ( NoFrag() ){ |
if ( NoFrag() ){ |
| 2493 |
glrun->SetID_RUN_FRAG(glrun->GetID()); |
glrun->SetID_RUN_FRAG(glrun->GetID()); |
| 3031 |
if ( row ){ |
if ( row ){ |
| 3032 |
// |
// |
| 3033 |
if ( IsDebug() ) printf(" Calo calibration already inserted in the DB\n"); |
if ( IsDebug() ) printf(" Calo calibration already inserted in the DB\n"); |
| 3034 |
|
if ( PEDANTIC ) throw -73; |
| 3035 |
// |
// |
| 3036 |
} else { |
} else { |
| 3037 |
// |
// |
| 3119 |
} else { |
} else { |
| 3120 |
// |
// |
| 3121 |
if ( IsDebug() ) printf(" Repeated calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt); |
if ( IsDebug() ) printf(" Repeated calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt); |
| 3122 |
|
if ( PEDANTIC ) throw -74; |
| 3123 |
// |
// |
| 3124 |
}; |
}; |
| 3125 |
// |
// |
| 3208 |
if ( row ){ |
if ( row ){ |
| 3209 |
// |
// |
| 3210 |
if ( IsDebug() ) printf(" Calo pulse1 calibration already inserted in the DB\n"); |
if ( IsDebug() ) printf(" Calo pulse1 calibration already inserted in the DB\n"); |
| 3211 |
|
if ( PEDANTIC ) throw -75; |
| 3212 |
// |
// |
| 3213 |
} else { |
} else { |
| 3214 |
// |
// |
| 3299 |
} else { |
} else { |
| 3300 |
// |
// |
| 3301 |
if ( IsDebug() ) printf(" Repeated pulse1 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt); |
if ( IsDebug() ) printf(" Repeated pulse1 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt); |
| 3302 |
|
if ( PEDANTIC ) throw -76; |
| 3303 |
// |
// |
| 3304 |
}; |
}; |
| 3305 |
// |
// |
| 3364 |
if ( row ){ |
if ( row ){ |
| 3365 |
// |
// |
| 3366 |
if ( IsDebug() ) printf(" Calo pulse2 calibration already inserted in the DB\n"); |
if ( IsDebug() ) printf(" Calo pulse2 calibration already inserted in the DB\n"); |
| 3367 |
|
if ( PEDANTIC ) throw -77; |
| 3368 |
// |
// |
| 3369 |
} else { |
} else { |
| 3370 |
// |
// |
| 3498 |
} else { |
} else { |
| 3499 |
// |
// |
| 3500 |
if ( IsDebug() ) printf(" Repeated pulse2 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt); |
if ( IsDebug() ) printf(" Repeated pulse2 calo calibration for section %i at time %u obt %u pkt %u \n",section,fromtime,obt,pkt); |
| 3501 |
|
if ( PEDANTIC ) throw -78; |
| 3502 |
// |
// |
| 3503 |
}; |
}; |
| 3504 |
// |
// |
| 3559 |
if ( row ){ |
if ( row ){ |
| 3560 |
// |
// |
| 3561 |
if ( IsDebug() ) printf(" Trk calibration already inserted in the DB\n"); |
if ( IsDebug() ) printf(" Trk calibration already inserted in the DB\n"); |
| 3562 |
|
if ( PEDANTIC ) throw -80; |
| 3563 |
// |
// |
| 3564 |
} else { |
} else { |
| 3565 |
// |
// |
| 3825 |
} else { |
} else { |
| 3826 |
// |
// |
| 3827 |
if ( IsDebug() ) printf(" Repetead trk calibration1 at time %u obt %u pkt %u \n",fromtime,obt1,pkt1); |
if ( IsDebug() ) printf(" Repetead trk calibration1 at time %u obt %u pkt %u \n",fromtime,obt1,pkt1); |
| 3828 |
|
if ( PEDANTIC ) throw -79; |
| 3829 |
// |
// |
| 3830 |
}; |
}; |
| 3831 |
// |
// |
| 3924 |
if ( row ){ |
if ( row ){ |
| 3925 |
// |
// |
| 3926 |
if ( IsDebug() ) printf(" S4 calibration already inserted in the DB\n"); |
if ( IsDebug() ) printf(" S4 calibration already inserted in the DB\n"); |
| 3927 |
|
if ( PEDANTIC ) throw -81; |
| 3928 |
// |
// |
| 3929 |
} else { |
} else { |
| 3930 |
// |
// |
| 4008 |
} else { |
} else { |
| 4009 |
// |
// |
| 4010 |
if ( IsDebug() ) printf(" Repeated S4 calibration at time %u obt %u pkt %u \n",fromtime,obt,pkt); |
if ( IsDebug() ) printf(" Repeated S4 calibration at time %u obt %u pkt %u \n",fromtime,obt,pkt); |
| 4011 |
|
if ( PEDANTIC ) throw -82; |
| 4012 |
// |
// |
| 4013 |
}; |
}; |
| 4014 |
// |
// |
| 4145 |
// |
// |
| 4146 |
} else { |
} else { |
| 4147 |
if ( IsDebug() ) printf(" The already exist in the GL_RUN table! \n"); |
if ( IsDebug() ) printf(" The already exist in the GL_RUN table! \n"); |
| 4148 |
|
if ( PEDANTIC ) throw -83; |
| 4149 |
}; |
}; |
| 4150 |
if ( IsDebug() ) printf(" Delete run %s from the GL_RUN_FRAGMENTS table \n",row->GetField(0)); |
if ( IsDebug() ) printf(" Delete run %s from the GL_RUN_FRAGMENTS table \n",row->GetField(0)); |
| 4151 |
// |
// |