1720 |
// || |
// || |
1721 |
// ( runhead_time = _our_runhead_time && runtrail_time = _our_runtrail_time && nevents > 100 ) |
// ( runhead_time = _our_runhead_time && runtrail_time = _our_runtrail_time && nevents > 100 ) |
1722 |
// ) |
// ) |
1723 |
|
// || |
1724 |
|
// ( runhead_time = _our_runhead_time && runtrail_time > _our_runtrail_time && nevents > 100 ) |
1725 |
|
// ) |
1726 |
|
// || |
1727 |
|
// ( runhead_time < _our_runhead_time && runtrail_time = _our_runtrail_time && nevents > 100 ) |
1728 |
|
// ) |
1729 |
// |
// |
1730 |
oss << " SELECT ID,NEVENTS,TRK_CALIB_USED,PKT_COUNTER FROM GL_RUN WHERE " |
oss << " SELECT ID,NEVENTS,TRK_CALIB_USED,PKT_COUNTER FROM GL_RUN WHERE " |
1731 |
<< " BOOT_NUMBER=" << this->GetBOOTnumber() << " AND (" |
<< " BOOT_NUMBER=" << this->GetBOOTnumber() << " AND (" |
1742 |
<< " RUNTRAILER_OBT>=" << glrun->GetRUNTRAILER_OBT() << " OR " |
<< " RUNTRAILER_OBT>=" << glrun->GetRUNTRAILER_OBT() << " OR " |
1743 |
<< " RUNTRAILER_PKT>=" << glrun->GetRUNTRAILER_PKT() << ") OR " |
<< " RUNTRAILER_PKT>=" << glrun->GetRUNTRAILER_PKT() << ") OR " |
1744 |
<< " (RUNHEADER_TIME=" << (UInt_t)glrun->GetRUNHEADER_TIME() << " AND " // these two lines in a certain way disable the patch below... |
<< " (RUNHEADER_TIME=" << (UInt_t)glrun->GetRUNHEADER_TIME() << " AND " // these two lines in a certain way disable the patch below... |
1745 |
|
<< " RUNTRAILER_TIME=" << (UInt_t)glrun->GetRUNTRAILER_TIME() <<" AND NEVENTS>100) OR" // |
1746 |
|
<< " (RUNHEADER_TIME=" << (UInt_t)glrun->GetRUNHEADER_TIME() << " AND " // |
1747 |
|
<< " RUNTRAILER_TIME>" << (UInt_t)glrun->GetRUNTRAILER_TIME() <<" AND NEVENTS>100) OR" // |
1748 |
|
<< " (RUNHEADER_TIME<" << (UInt_t)glrun->GetRUNHEADER_TIME() << " AND " // |
1749 |
<< " RUNTRAILER_TIME=" << (UInt_t)glrun->GetRUNTRAILER_TIME() <<" AND NEVENTS>100)" // |
<< " RUNTRAILER_TIME=" << (UInt_t)glrun->GetRUNTRAILER_TIME() <<" AND NEVENTS>100)" // |
1750 |
<< " ));"; |
<< " ));"; |
1751 |
// |
// |
4704 |
if ( !result ) throw -4;; |
if ( !result ) throw -4;; |
4705 |
// |
// |
4706 |
row = result->Next(); |
row = result->Next(); |
4707 |
|
UInt_t nid = 0; |
4708 |
// |
// |
4709 |
while ( row ){ |
while ( row ){ |
4710 |
|
nid++; |
4711 |
|
if ( !(nid%1000) && nid ) printf(" %iK run scanned \n",nid/1000); |
4712 |
thisid = (UInt_t)atoll(row->GetField(0)); |
thisid = (UInt_t)atoll(row->GetField(0)); |
4713 |
thisl0id = (UInt_t)atoll(row->GetField(1)); |
thisl0id = (UInt_t)atoll(row->GetField(1)); |
4714 |
thisrht = (UInt_t)atoll(row->GetField(2)); |
thisrht = (UInt_t)atoll(row->GetField(2)); |
4720 |
// |
// |
4721 |
oss.str(""); |
oss.str(""); |
4722 |
oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!=" |
oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!=" |
4723 |
<< thisid << " AND RUNHEADER_TIME=" |
<< thisid << " AND ( RUNHEADER_TIME=" |
4724 |
<< thisrht << " AND RUNTRAILER_TIME!=" |
<< thisrht << " OR RUNTRAILER_TIME=" |
4725 |
<< thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;"; |
<< thisrtt << " ) AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;"; |
4726 |
result3 = conn->Query(oss.str().c_str()); |
result3 = conn->Query(oss.str().c_str()); |
4727 |
if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str()); |
if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str()); |
4728 |
if ( result3 ){ |
if ( result3 ){ |
|
row3 = result3->Next(); |
|
4729 |
// |
// |
4730 |
while ( row3 ){ |
oss.str(""); |
4731 |
// |
oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!=" |
4732 |
// 2 runs with same runheader |
<< thisid << " AND RUNHEADER_TIME=" |
4733 |
// |
<< thisrht << " AND RUNTRAILER_TIME!=" |
4734 |
printf(" CHECK n.4 RUNs %u and %u HAVE SAME RUNHEADER \n",thisid,(UInt_t)atoll(row3->GetField(0))); |
<< thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;"; |
4735 |
|
result3 = conn->Query(oss.str().c_str()); |
4736 |
|
if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str()); |
4737 |
|
if ( result3 ){ |
4738 |
row3 = result3->Next(); |
row3 = result3->Next(); |
4739 |
|
// |
4740 |
|
while ( row3 ){ |
4741 |
|
// |
4742 |
|
// 2 runs with same runheader |
4743 |
|
// |
4744 |
|
printf(" CHECK n.4 RUNs %u and %u HAVE SAME RUNHEADER \n",thisid,(UInt_t)atoll(row3->GetField(0))); |
4745 |
|
row3 = result3->Next(); |
4746 |
|
}; |
4747 |
}; |
}; |
|
}; |
|
|
// |
|
|
oss.str(""); |
|
|
oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!=" |
|
|
<< thisid << " AND RUNHEADER_TIME!=" |
|
|
<< thisrht << " AND RUNTRAILER_TIME=" |
|
|
<< thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;"; |
|
|
result3 = conn->Query(oss.str().c_str()); |
|
|
if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str()); |
|
|
if ( result3 ){ |
|
|
row3 = result3->Next(); |
|
4748 |
// |
// |
4749 |
while ( row3 ){ |
oss.str(""); |
4750 |
// |
oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!=" |
4751 |
// 2 runs with same runtrailer |
<< thisid << " AND RUNHEADER_TIME!=" |
4752 |
|
<< thisrht << " AND RUNTRAILER_TIME=" |
4753 |
|
<< thisrtt << " AND NEVENTS!=0 AND NEVENTS!=1 order by RUNHEADER_TIME asc;"; |
4754 |
|
result3 = conn->Query(oss.str().c_str()); |
4755 |
|
if ( IsDebug() ) printf(" query is %s \n",oss.str().c_str()); |
4756 |
|
if ( result3 ){ |
4757 |
|
row3 = result3->Next(); |
4758 |
// |
// |
4759 |
printf(" CHECK n.5 RUNs %u and %u HAVE SAME RUNTRAILER \n",thisid,(UInt_t)atoll(row3->GetField(0))); |
while ( row3 ){ |
4760 |
|
// |
4761 |
|
// 2 runs with same runtrailer |
4762 |
|
// |
4763 |
|
printf(" CHECK n.5 RUNs %u and %u HAVE SAME RUNTRAILER \n",thisid,(UInt_t)atoll(row3->GetField(0))); |
4764 |
|
row3 = result3->Next(); |
4765 |
|
}; |
4766 |
|
}; |
4767 |
|
// |
4768 |
|
oss.str(""); |
4769 |
|
oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!=" |
4770 |
|
<< thisid << " AND RUNHEADER_TIME=" |
4771 |
|
<< thisrht << " AND RUNTRAILER_TIME=" |
4772 |
|
<< thisrtt << " AND ID_RUN_FRAG!=" |
4773 |
|
<< thisid << " order by RUNHEADER_TIME asc;"; |
4774 |
|
result3 = conn->Query(oss.str().c_str()); |
4775 |
|
if ( result3 ){ |
4776 |
row3 = result3->Next(); |
row3 = result3->Next(); |
4777 |
|
// |
4778 |
|
while ( row3 ){ |
4779 |
|
// |
4780 |
|
// duplicated run |
4781 |
|
// |
4782 |
|
printf(" CHECK n.7 RUNs %u and %u HAVE SAME RUNTRAILER AND RUNHEADER (ARE THE SAME?) \n",thisid,(UInt_t)atoll(row3->GetField(0))); |
4783 |
|
row3 = result3->Next(); |
4784 |
|
}; |
4785 |
}; |
}; |
4786 |
}; |
}; |
4787 |
// |
// |
4803 |
}; |
}; |
4804 |
}; |
}; |
4805 |
// |
// |
|
oss.str(""); |
|
|
oss << "SELECT ID,ID_ROOT_L0,RUNHEADER_TIME,RUNTRAILER_TIME FROM GL_RUN WHERE ID!=" |
|
|
<< thisid << " AND RUNHEADER_TIME=" |
|
|
<< thisrht << " AND RUNTRAILER_TIME=" |
|
|
<< thisrtt << " AND ID_RUN_FRAG!=" |
|
|
<< thisid << " order by RUNHEADER_TIME asc;"; |
|
|
result3 = conn->Query(oss.str().c_str()); |
|
|
if ( result3 ){ |
|
|
row3 = result3->Next(); |
|
|
// |
|
|
while ( row3 ){ |
|
|
// |
|
|
// duplicated run |
|
|
// |
|
|
printf(" CHECK n.7 RUNs %u and %u HAVE SAME RUNTRAILER AND RUNHEADER (ARE THE SAME?) \n",thisid,(UInt_t)atoll(row3->GetField(0))); |
|
|
row3 = result3->Next(); |
|
|
}; |
|
|
}; |
|
4806 |
}; |
}; |
4807 |
// |
// |
4808 |
// if ( thisrht < prevrtt || thisrtt < prevrht || thisrht > thisrtt && !(!prevrht && !prevrtt &&!previd) ){ |
// if ( thisrht < prevrtt || thisrtt < prevrht || thisrht > thisrtt && !(!prevrht && !prevrtt &&!previd) ){ |