406 cout <<
" *IceDB2Root GetMuDaqData* Database " <<
fDBName.Data() <<
" could not be accessed." << endl;
418 fMuDaqdb->SetNameTitle(
"MuDaq-OMDBASE",
"The MuDaq OM geometry, calib. etc... database");
423 TF1 fadccal(
"fadccal",
"(x-[1])*[0]");
424 TF1 fadcdecal(
"fadcdecal",
"(x/[0])+[1]");
425 fadccal.SetParName(0,
"BETA-ADC");
426 fadccal.SetParName(1,
"PED-ADC");
427 fadcdecal.SetParName(0,
"BETA-ADC");
428 fadcdecal.SetParName(1,
"PED-ADC");
430 TF1 ftdccal(
"ftdccal",
"(x*[0])-[1]-([0]-1.)*32767.-[2]/sqrt([3])");
431 TF1 ftdcdecal(
"ftdcdecal",
"(x+([0]-1.)*32767.+[1]+[2]/sqrt([3]))/[0]");
432 ftdccal.SetParName(0,
"BETA-TDC");
433 ftdccal.SetParName(1,
"T0");
434 ftdccal.SetParName(2,
"ALPHA-TDC");
435 ftdccal.SetParName(3,
"ADC-SLEW");
436 ftdcdecal.SetParName(0,
"BETA-TDC");
437 ftdcdecal.SetParName(1,
"T0");
438 ftdcdecal.SetParName(2,
"ALPHA-TDC");
439 ftdcdecal.SetParName(3,
"ADC-SLEW");
441 TF1 ftotcal(
"ftotcal",
"x*[0]");
442 TF1 ftotdecal(
"ftotdecal",
"x/[0]");
443 ftotcal.SetParName(0,
"BETA-TOT");
444 ftotdecal.SetParName(0,
"BETA-TOT");
447 TF1 fxtalkp(
"fxtalkp",
"(1.+[2]-[2]+[3]-[3])/(1.+exp(([0]-x)/[1]))");
448 fxtalkp.SetParName(0,
"C");
449 fxtalkp.SetParName(1,
"B");
450 fxtalkp.SetParName(2,
"dLE-min");
451 fxtalkp.SetParName(3,
"dLE-max");
483 Double_t pos[3]={0,0,0};
484 Float_t ped, beta, alpha;
486 Float_t c, b, dlemin, dlemax;
498 for(omid=0; omid<=681; omid++) revision[omid]=0;
499 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, X, Y, Z, AmandaOm.TypeId, Orientation FROM GeometryOm INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE GeometryOm.StringId=AmandaOm.StringId AND GeometryOm.TubeId=AmandaOm.TubeId AND GeometryOm.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=2;");
502 cout <<
" *IceDB2Root GetMuDaqData* Positions could not be read from DB" << endl;
507 while(st->NextResultRow())
510 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
511 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
515 revision[omid]=st->GetInt(2);
521 omx->SetUniqueID(omid);
525 pos[0]=st->GetDouble(4)+dx;
526 pos[1]=st->GetDouble(5)+dy;
527 pos[2]=st->GetDouble(6)+dz;
529 type=(Float_t)st->GetInt(7);
531 costh=(Float_t)st->GetInt(8);
538 for(omid=0; omid<=681; omid++) revision[omid]=0;
539 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id, sc_sensit, sc_thresh FROM AmandaStatusOm INNER JOIN CalibrationDetail WHERE AmandaStatusOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=804;");
542 cout <<
" *IceDB2Root GetMuDaqData* Sensitivity/threshold could not be read from DB" << endl;
547 while(st->NextResultRow())
550 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
551 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
555 revision[omid]=st->GetInt(2);
561 omx->SetUniqueID(omid);
565 thresh=(Float_t)st->GetDouble(4);
566 sensit=(Float_t)st->GetDouble(5);
574 for(omid=0; omid<=681; omid++) revision[omid]=0;
575 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, CableType FROM AmandaTWRCableType INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE AmandaTWRCableType.StringId=AmandaOm.StringId AND AmandaTWRCableType.TubeId=AmandaOm.TubeId AND AmandaTWRCableType.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=853;");
578 cout <<
" *IceDB2Root GetMuDaqData* Readout types could not be read from DB" << endl;
583 while(st->NextResultRow())
586 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
587 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
591 revision[omid]=st->GetInt(2);
597 omx->SetUniqueID(omid);
601 if(st->GetUInt(4) == 0) readout=1;
602 else if(st->GetUInt(4) == 10) readout=2;
610 for(omid=0; omid<=681; omid++) revision[omid]=0;
611 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id, ac_pedestal, ac_spepeak FROM AmandaAmplOm INNER JOIN CalibrationDetail WHERE AmandaAmplOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=802;");
614 cout <<
" *IceDB2Root GetMuDaqData* Amplitude calibrations could not be read from DB" << endl;
619 while(st->NextResultRow())
622 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
623 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
627 revision[omid]=st->GetInt(2);
633 omx->SetUniqueID(omid);
640 ped=(Float_t)st->GetDouble(4);
641 if (st->GetDouble(5)>0) beta=(Float_t)(1/st->GetDouble(5));
644 if (ped<-1e5 || beta<=0)
655 fcal->SetParameter(0,beta);
656 fcal->SetParameter(1,ped);
660 fdecal->SetParameter(0,beta);
661 if (!beta) fdecal->SetParameter(0,1);
662 fdecal->SetParameter(1,ped);
669 for(omid=0; omid<=681; omid++) revision[omid]=0;
670 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id, tc_tzero, tc_beta_t, tc_alpha_t FROM AmandaTimeOm INNER JOIN CalibrationDetail WHERE AmandaTimeOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=805;");
673 cout <<
" *IceDB2Root GetMuDaqData* Time calibrations could not be read from DB" << endl;
678 while(st->NextResultRow())
681 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
682 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
686 revision[omid]=st->GetInt(2);
692 omx->SetUniqueID(omid);
701 ped=(Float_t)st->GetDouble(4);
702 beta=(Float_t)st->GetDouble(5);
703 alpha=(Float_t)st->GetDouble(6);
705 if (ped<-1e5 || beta<=0 || alpha<0)
719 fcal->SetParameter(0,beta);
720 fcal->SetParameter(1,ped);
721 fcal->SetParameter(2,alpha);
722 fcal->SetParameter(3,1.e20);
726 fdecal->SetParameter(0,beta);
727 if (!beta) fdecal->SetParameter(0,1);
728 fdecal->SetParameter(1,ped);
729 fdecal->SetParameter(2,alpha);
730 fdecal->SetParameter(3,1.e20);
736 fcal->SetParameter(0,beta);
740 fdecal->SetParameter(0,beta);
747 for(omid=0; omid<=681; omid++) revision[omid]=0;
748 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_talker_id, om_receiver_id, threshold, width, timelow, timehigh FROM AmandaXtalkOm INNER JOIN CalibrationDetail WHERE AmandaXtalkOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=807;");
751 cout <<
" *IceDB2Root GetMuDaqData* Xtalk probability constants could not be read from DB" << endl;
756 while(st->NextResultRow())
759 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
760 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
761 jtrans=st->GetInt(3);
764 revision[jtrans]=st->GetInt(2);
771 omx->SetUniqueID(jtrans);
772 fMuDaqdb->EnterObject(jtrans,1,omx);
775 c=(Float_t)st->GetDouble(5);
776 b=(Float_t)st->GetDouble(6);
777 dlemin=(Float_t)st->GetDouble(7);
778 dlemax=(Float_t)st->GetDouble(8);
780 TF1* fx=
new TF1(fxtalkp);
781 fx->SetParameter(0,c);
782 if (b) fx->SetParameter(1,b);
783 else fx->SetParameter(1,1);
784 fx->SetParameter(2,dlemin);
785 fx->SetParameter(3,dlemax);
786 fMuDaqdb->EnterObject(jtrans,jrec+1,fx);
792 for(omid=0; omid<=681; omid++) revision[omid]=0;
793 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id FROM AmandaBadOm INNER JOIN CalibrationDetail WHERE AmandaBadOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=803;");
796 cout <<
" *IceDB2Root GetMuDaqData* Bad OM list could not be read from DB" << endl;
801 while(st->NextResultRow())
804 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
805 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
809 revision[omid]=st->GetInt(2);
815 omx->SetUniqueID(omid);
846 cout <<
" *IceDB2Root GetTWRDaqData* Database " <<
fDBName.Data() <<
" could not be accessed." << endl;
858 fTWRDaqdb->SetNameTitle(
"TWRDaq-OMDBASE",
"The TWRDaq OM geometry, calib. etc... database");
868 TF1 fadccal(
"fadccal",
"x*(5./4096.)/(50.*[0])");
869 TF1 fadcdecal(
"fadcdecal",
"x*(50.*[0])/(5./4096.)");
870 fadccal.SetParName(0,
"nC/PE");
871 fadcdecal.SetParName(0,
"nC/PE");
873 TF1 ftdccal(
"ftdccal",
"x-[0]");
874 TF1 ftdcdecal(
"ftdcdecal",
"x+[0]");
875 ftdccal.SetParName(0,
"T0");
876 ftdcdecal.SetParName(0,
"T0");
878 TF1 ftotcal(
"ftotcal",
"x");
879 TF1 ftotdecal(
"ftotdecal",
"x");
882 TF1 fxtalkp(
"fxtalkp",
"(1.+[2]-[2]+[3]-[3])/(1.+exp(([0]-x)/[1]))");
883 fxtalkp.SetParName(0,
"C");
884 fxtalkp.SetParName(1,
"B");
885 fxtalkp.SetParName(2,
"dLE-min");
886 fxtalkp.SetParName(3,
"dLE-max");
924 Double_t pos[3]={0,0,0};
925 Float_t peArea, twrT0;
927 Float_t c, b, dlemin, dlemax;
934 for(omid=0; omid<=681; omid++) revision[omid]=0;
935 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, X, Y, Z, AmandaOm.TypeId, Orientation FROM GeometryOm INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE GeometryOm.StringId=AmandaOm.StringId AND GeometryOm.TubeId=AmandaOm.TubeId AND GeometryOm.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=2;");
938 cout <<
" *IceDB2Root GetTWRDaqData* Positions could not be read from DB" << endl;
943 while(st->NextResultRow())
946 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
947 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
951 revision[omid]=st->GetInt(2);
957 omx->SetUniqueID(omid);
961 pos[0]=st->GetDouble(4);
962 pos[1]=st->GetDouble(5);
963 pos[2]=st->GetDouble(6);
965 type=(Float_t)st->GetInt(7);
967 costh=(Float_t)st->GetInt(8);
974 for(omid=0; omid<=681; omid++) revision[omid]=0;
975 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id, sc_sensit, sc_thresh FROM AmandaStatusOm INNER JOIN CalibrationDetail WHERE AmandaStatusOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=804;");
978 cout <<
" *IceDB2Root GetTWRDaqData* Sensitivity/threshold could not be read from DB" << endl;
983 while(st->NextResultRow())
986 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
987 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
991 revision[omid]=st->GetInt(2);
997 omx->SetUniqueID(omid);
1001 thresh=(Float_t)st->GetDouble(4);
1002 sensit=(Float_t)st->GetDouble(5);
1010 for(omid=0; omid<=681; omid++) revision[omid]=0;
1011 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, CableType FROM AmandaTWRCableType INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE AmandaTWRCableType.StringId=AmandaOm.StringId AND AmandaTWRCableType.TubeId=AmandaOm.TubeId AND AmandaTWRCableType.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=853;");
1014 cout <<
" *IceDB2Root GetTWRDaqData* Readout types could not be read from DB" << endl;
1019 while(st->NextResultRow())
1022 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1023 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1027 revision[omid]=st->GetInt(2);
1033 omx->SetUniqueID(omid);
1037 if(st->GetUInt(4) == 0) readout=1;
1038 else if(st->GetUInt(4) == 10) readout=2;
1046 for(omid=0; omid<=681; omid++) revision[omid]=0;
1047 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, BinSize, StopDelay FROM AmandaTWRStandard INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE AmandaTWRStandard.StringId=AmandaOm.StringId AND AmandaTWRStandard.TubeId=AmandaOm.TubeId AND AmandaTWRStandard.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=852;");
1050 cout <<
" *IceDB2Root GetTWRDaqData* Bin size and stop delays could not be read from DB" << endl;
1055 while(st->NextResultRow())
1058 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1059 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1063 revision[omid]=st->GetInt(2);
1069 omx->SetUniqueID(omid);
1073 binsize=(Float_t)st->GetInt(4);
1074 stopdelay=(Float_t)st->GetInt(5);
1082 for(omid=0; omid<=681; omid++) revision[omid]=0;
1083 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, peArea, twrT0 FROM AmandaTWRCalibration INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE AmandaTWRCalibration.StringId=AmandaOm.StringId AND AmandaTWRCalibration.TubeId=AmandaOm.TubeId AND AmandaTWRCalibration.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=854;");
1086 cout <<
" *IceDB2Root GetTWRDaqData* Bin size and stop delays could not be read from DB" << endl;
1091 while(st->NextResultRow())
1094 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1095 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1099 revision[omid]=st->GetInt(2);
1105 omx->SetUniqueID(omid);
1116 peArea=(Float_t)st->GetDouble(4);
1117 twrT0=(Float_t)st->GetDouble(5);
1119 if (peArea<=0 || omx->GetSignal(
"BINSIZE")<=0)
1135 fcal->SetParameter(0,peArea/omx->
GetSignal(
"BINSIZE"));
1139 fdecal->SetParameter(0,peArea/omx->
GetSignal(
"BINSIZE"));
1140 if (!peArea) fdecal->SetParameter(0,1);
1154 fcal->SetParameter(0,twrT0);
1158 fdecal->SetParameter(0,twrT0);
1165 for(omid=0; omid<=681; omid++) revision[omid]=0;
1166 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_talker_id, om_receiver_id, threshold, width, timelow, timehigh FROM AmandaXtalkOm INNER JOIN CalibrationDetail WHERE AmandaXtalkOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=807;");
1169 cout <<
" *IceDB2Root GetTWRDaqData* Xtalk probability constants could not be read from DB" << endl;
1174 while(st->NextResultRow())
1177 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1178 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1179 jtrans=st->GetInt(3);
1182 revision[jtrans]=st->GetInt(2);
1189 omx->SetUniqueID(jtrans);
1193 c=(Float_t)st->GetDouble(5);
1194 b=(Float_t)st->GetDouble(6);
1195 dlemin=(Float_t)st->GetDouble(7);
1196 dlemax=(Float_t)st->GetDouble(8);
1198 TF1* fx=
new TF1(fxtalkp);
1199 fx->SetParameter(0,c);
1200 if (b) fx->SetParameter(1,b);
1201 else fx->SetParameter(1,1);
1202 fx->SetParameter(2,dlemin);
1203 fx->SetParameter(3,dlemax);
1204 fTWRDaqdb->EnterObject(jtrans,jrec+1,fx);
1210 for(omid=0; omid<=681; omid++) revision[omid]=0;
1211 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id FROM AmandaBadOm INNER JOIN CalibrationDetail WHERE AmandaBadOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=803;");
1214 cout <<
" *IceDB2Root GetTWRDaqData* Bad OM list could not be read from DB" << endl;
1219 while(st->NextResultRow())
1222 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1223 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1227 revision[omid]=st->GetInt(2);
1233 omx->SetUniqueID(omid);
1264 cout <<
" *IceDB2Root GetJEBTDaqData* Database " <<
fDBName.Data() <<
" could not be accessed." << endl;
1276 fJEBTDaqdb->SetNameTitle(
"JEBTDaq-OMDBASE",
"The JEBTDaq OM geometry, calib. etc... database");
1286 TF1 fadccal(
"fadccal",
"x*(5./4096.)/(50.*[0])");
1287 TF1 fadcdecal(
"fadcdecal",
"x*(50.*[0])/(5./4096.)");
1288 fadccal.SetParName(0,
"nC/PE");
1289 fadcdecal.SetParName(0,
"nC/PE");
1291 TF1 ftdccal(
"ftdccal",
"x-[0]");
1292 TF1 ftdcdecal(
"ftdcdecal",
"x+[0]");
1293 ftdccal.SetParName(0,
"T0");
1294 ftdcdecal.SetParName(0,
"T0");
1296 TF1 ftotcal(
"ftotcal",
"x");
1297 TF1 ftotdecal(
"ftotdecal",
"x");
1300 TF1 fxtalkp(
"fxtalkp",
"(1.+[2]-[2]+[3]-[3])/(1.+exp(([0]-x)/[1]))");
1301 fxtalkp.SetParName(0,
"C");
1302 fxtalkp.SetParName(1,
"B");
1303 fxtalkp.SetParName(2,
"dLE-min");
1304 fxtalkp.SetParName(3,
"dLE-max");
1337 Float_t stopdelay=0;
1341 Float_t twri3offset=0;
1342 om.
SetSignal(twri3offset,
"TWRI3OFFSET");
1348 Double_t pos[3]={0,0,0};
1349 Float_t peArea, twrT0;
1351 Float_t c, b, dlemin, dlemax;
1355 Int_t revision[682];
1358 st=server->Statement(
"SELECT TWRGlobalT0, TWRI3TimeOffset FROM AmandaTWRGlobalConstants;");
1361 cout <<
" *IceDB2Root GetJEBTDaqData* Global TWR time offsets could not be read from DB" << endl;
1366 st->NextResultRow();
1367 globalt0=st->GetDouble(0);
1368 twri3offset=st->GetDouble(1);
1372 for(omid=0; omid<=681; omid++) revision[omid]=0;
1373 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, X, Y, Z, AmandaOm.TypeId, Orientation FROM GeometryOm INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE GeometryOm.StringId=AmandaOm.StringId AND GeometryOm.TubeId=AmandaOm.TubeId AND GeometryOm.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=2;");
1376 cout <<
" *IceDB2Root GetJEBTDaqData* Positions could not be read from DB" << endl;
1381 while(st->NextResultRow())
1384 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1385 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1389 revision[omid]=st->GetInt(2);
1395 omx->SetUniqueID(omid);
1399 pos[0]=st->GetDouble(4);
1400 pos[1]=st->GetDouble(5);
1401 pos[2]=st->GetDouble(6);
1403 type=(Float_t)st->GetInt(7);
1405 costh=(Float_t)st->GetInt(8);
1407 if(globalt0) omx->
SetSignal(globalt0,
"GLOBALT0");
1408 if(twri3offset) omx->
SetSignal(twri3offset,
"TWRI3OFFSET");
1414 for(omid=0; omid<=681; omid++) revision[omid]=0;
1415 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id, sc_sensit, sc_thresh FROM AmandaStatusOm INNER JOIN CalibrationDetail WHERE AmandaStatusOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=804;");
1418 cout <<
" *IceDB2Root GetJEBTDaqData* Sensitivity/threshold could not be read from DB" << endl;
1423 while(st->NextResultRow())
1426 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1427 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1431 revision[omid]=st->GetInt(2);
1437 omx->SetUniqueID(omid);
1441 thresh=(Float_t)st->GetDouble(4);
1442 sensit=(Float_t)st->GetDouble(5);
1450 for(omid=0; omid<=681; omid++) revision[omid]=0;
1451 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, CableType FROM AmandaTWRCableType INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE AmandaTWRCableType.StringId=AmandaOm.StringId AND AmandaTWRCableType.TubeId=AmandaOm.TubeId AND AmandaTWRCableType.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=853;");
1454 cout <<
" *IceDB2Root GetJEBTDaqData* Readout types could not be read from DB" << endl;
1459 while(st->NextResultRow())
1462 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1463 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1467 revision[omid]=st->GetInt(2);
1473 omx->SetUniqueID(omid);
1477 if(st->GetUInt(4) == 0) readout=1;
1478 else if(st->GetUInt(4) == 10) readout=2;
1486 for(omid=0; omid<=681; omid++) revision[omid]=0;
1487 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, BinSize, StopDelay FROM AmandaTWRStandard INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE AmandaTWRStandard.StringId=AmandaOm.StringId AND AmandaTWRStandard.TubeId=AmandaOm.TubeId AND AmandaTWRStandard.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=852;");
1490 cout <<
" *IceDB2Root GetJEBTDaqData* Bin size and stop delays could not be read from DB" << endl;
1495 while(st->NextResultRow())
1498 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1499 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1503 revision[omid]=st->GetInt(2);
1509 omx->SetUniqueID(omid);
1513 binsize=(Float_t)st->GetInt(4);
1514 stopdelay=(Float_t)st->GetInt(5);
1522 for(omid=0; omid<=681; omid++) revision[omid]=0;
1523 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, OmId, peArea, twrT0 FROM AmandaTWRCalibration INNER JOIN AmandaOm INNER JOIN CalibrationDetail WHERE AmandaTWRCalibration.StringId=AmandaOm.StringId AND AmandaTWRCalibration.TubeId=AmandaOm.TubeId AND AmandaTWRCalibration.CaId=CalibrationDetail.CaId AND CalibrationDetail.TypeId=854;");
1526 cout <<
" *IceDB2Root GetJEBTDaqData* Bin size and stop delays could not be read from DB" << endl;
1531 while(st->NextResultRow())
1534 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1535 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1539 revision[omid]=st->GetInt(2);
1545 omx->SetUniqueID(omid);
1556 peArea=(Float_t)st->GetDouble(4);
1557 twrT0=(Float_t)st->GetDouble(5);
1559 if (peArea<=0 || omx->GetSignal(
"BINSIZE")<=0)
1575 fcal->SetParameter(0,peArea/omx->
GetSignal(
"BINSIZE"));
1579 fdecal->SetParameter(0,peArea/omx->
GetSignal(
"BINSIZE"));
1580 if (!peArea) fdecal->SetParameter(0,1);
1594 fcal->SetParameter(0,twrT0);
1598 fdecal->SetParameter(0,twrT0);
1605 for(omid=0; omid<=681; omid++) revision[omid]=0;
1606 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_talker_id, om_receiver_id, threshold, width, timelow, timehigh FROM AmandaXtalkOm INNER JOIN CalibrationDetail WHERE AmandaXtalkOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=807;");
1609 cout <<
" *IceDB2Root GetJEBTDaqData* Xtalk probability constants could not be read from DB" << endl;
1614 while(st->NextResultRow())
1617 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1618 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1619 jtrans=st->GetInt(3);
1622 revision[jtrans]=st->GetInt(2);
1629 omx->SetUniqueID(jtrans);
1633 c=(Float_t)st->GetDouble(5);
1634 b=(Float_t)st->GetDouble(6);
1635 dlemin=(Float_t)st->GetDouble(7);
1636 dlemax=(Float_t)st->GetDouble(8);
1638 TF1* fx=
new TF1(fxtalkp);
1639 fx->SetParameter(0,c);
1640 if (b) fx->SetParameter(1,b);
1641 else fx->SetParameter(1,1);
1642 fx->SetParameter(2,dlemin);
1643 fx->SetParameter(3,dlemax);
1650 for(omid=0; omid<=681; omid++) revision[omid]=0;
1651 st=server->Statement(
"SELECT ValidityStartDate, ValidityEndDate, RevisionId, om_id FROM AmandaBadOm INNER JOIN CalibrationDetail WHERE AmandaBadOm.ca_id=CalibrationDetail.CaId AND CalibrationDetail.TypeId=803;");
1654 cout <<
" *IceDB2Root GetJEBTDaqData* Bad OM list could not be read from DB" << endl;
1659 while(st->NextResultRow())
1662 validitystart.
SetUT(st->GetYear(0),st->GetMonth(0),st->GetDay(0),st->GetHour(0),st->GetMinute(0),st->GetSecond(0));
1663 validityend.
SetUT(st->GetYear(1),st->GetMonth(1),st->GetDay(1),st->GetHour(1),st->GetMinute(1),st->GetSecond(1));
1667 revision[omid]=st->GetInt(2);
1673 omx->SetUniqueID(omid);