RunQualityUtil Namespace Reference

Functions

void MakeGoodRunList (const Detector::Detector_t Detector, const VldTimeStamp StartTime, const VldTimeStamp EndTime, const char *filename="runlist.good.txt")
void MakeBadRunList (const Detector::Detector_t Detector, const VldTimeStamp StartTime, const VldTimeStamp EndTime, const char *filename="runlist.bad.txt")
void MakeRunList (const Detector::Detector_t Detector, const VldTimeStamp StartTime, const VldTimeStamp EndTime, const char *filename, const Bool_t GoodBad)

Function Documentation

void RunQualityUtil::MakeBadRunList ( const Detector::Detector_t  Detector,
const VldTimeStamp  StartTime,
const VldTimeStamp  EndTime,
const char *  filename = "runlist.bad.txt" 
)

Definition at line 18 of file RunQualityUtil.cxx.

References MakeRunList().

00019 {
00020   MakeRunList(Detector,StartTime,EndTime,filename,0);
00021 }

void RunQualityUtil::MakeGoodRunList ( const Detector::Detector_t  Detector,
const VldTimeStamp  StartTime,
const VldTimeStamp  EndTime,
const char *  filename = "runlist.good.txt" 
)

Definition at line 13 of file RunQualityUtil.cxx.

References MakeRunList().

00014 {
00015   MakeRunList(Detector,StartTime,EndTime,filename,1);
00016 }

void RunQualityUtil::MakeRunList ( const Detector::Detector_t  Detector,
const VldTimeStamp  StartTime,
const VldTimeStamp  EndTime,
const char *  filename,
const Bool_t  GoodBad 
)

Definition at line 23 of file RunQualityUtil.cxx.

References DbiResultPtr< T >::GetNumRows(), DbiResultPtr< T >::GetRow(), DbuFarRunQuality::GetRun(), DbuNearRunQuality::GetRun(), DbuNearRunQuality::GetSubRun(), DbuFarRunQuality::GetSubRun(), DbuNearRunQuality::GoodRun(), DbuFarRunQuality::GoodRun(), SimFlag::kData, DbiSqlContext::kEnds, Detector::kFar, Detector::kNear, and run().

Referenced by MakeBadRunList(), and MakeGoodRunList().

00024 {
00025 
00026   // Far Detector List
00027   if( Detector==Detector::kFar ){
00028 
00029     DbiSqlContext econtext(DbiSqlContext::kEnds,StartTime,EndTime,Detector,SimFlag::kData);
00030     DbiResultPtr<DbuFarRunQuality> rsPtr("DBUFARRUNQUALITY",econtext);
00031     Int_t numRows = rsPtr.GetNumRows();
00032 
00033     std::ofstream runlist(filename);
00034 
00035     Int_t myRunNumber;
00036     Int_t myCurrRunNumber;
00037     std::vector<Int_t> vecRunNumber;
00038 
00039     for ( Int_t i=0; i<numRows; ++i ) {
00040       const DbuFarRunQuality* rowPtr = rsPtr.GetRow(i);
00041       
00042       if( rowPtr->GetRun()>10000
00043        && rowPtr->GetSubRun()<1000
00044        && rowPtr->GoodRun()==GoodBad ){
00045         myRunNumber = 1000*rowPtr->GetRun()+rowPtr->GetSubRun();
00046         vecRunNumber.push_back(myRunNumber);
00047       }
00048     }
00049 
00050     std::sort(vecRunNumber.begin(),vecRunNumber.end());
00051 
00052     myCurrRunNumber = -1;
00053     for ( UInt_t i=0; i<vecRunNumber.size(); i++ ){
00054       myRunNumber = vecRunNumber.at(i);
00055       if( myRunNumber != myCurrRunNumber ){
00056         myCurrRunNumber = myRunNumber;
00057 
00058         Int_t run = (Int_t)(myCurrRunNumber/1000.0);
00059         Int_t subrun = myCurrRunNumber - 1000*run;
00060  
00061         runlist << "F";
00062         if( run<10000000 ) runlist << "0";
00063         if( run<1000000 ) runlist << "0";
00064         if( run<100000 ) runlist << "0";
00065         runlist << run;
00066         runlist << "_";
00067         if( subrun<1000 ) runlist << "0";
00068         if( subrun<100 ) runlist << "0";
00069         if( subrun<10 ) runlist << "0";
00070         runlist << subrun;
00071         runlist << std::endl;
00072 
00073       }
00074     }
00075 
00076     runlist.close();
00077   }
00078 
00079   // Near Detector List
00080   if( Detector==Detector::kNear ){
00081     Int_t fDbiTaskNear = 0;
00082 
00083     DbiSqlContext econtext(DbiSqlContext::kEnds,StartTime,EndTime,Detector,SimFlag::kData);
00084     DbiResultPtr<DbuNearRunQuality> rsPtr("DBUNEARRUNQUALITY",econtext,fDbiTaskNear);
00085     Int_t numRows = rsPtr.GetNumRows();
00086     
00087     std::ofstream runlist(filename);
00088 
00089     Int_t myRunNumber;
00090     Int_t myCurrRunNumber;
00091     std::vector<Int_t> vecRunNumber;
00092 
00093     for ( Int_t i=0; i<numRows; ++i ) {
00094       const DbuNearRunQuality* rowPtr = rsPtr.GetRow(i);
00095 
00096       if( rowPtr->GetRun()>1000
00097        && rowPtr->GetSubRun()<1000
00098        && rowPtr->GoodRun(fDbiTaskNear)==GoodBad ){
00099         myRunNumber = 1000*rowPtr->GetRun()+rowPtr->GetSubRun();
00100         vecRunNumber.push_back(myRunNumber);
00101       }
00102     }
00103 
00104     std::sort(vecRunNumber.begin(),vecRunNumber.end());
00105 
00106     myCurrRunNumber = -1;
00107     for ( UInt_t i=0; i<vecRunNumber.size(); i++ ){
00108       myRunNumber = vecRunNumber.at(i);
00109       if( myRunNumber != myCurrRunNumber ){
00110         myCurrRunNumber = myRunNumber;
00111 
00112         Int_t run = (Int_t)(myCurrRunNumber/1000.0);
00113         Int_t subrun = myCurrRunNumber - 1000*run;
00114 
00115         runlist << "N";
00116         if( run<10000000 ) runlist << "0";
00117         if( run<1000000 ) runlist << "0";
00118         if( run<100000 ) runlist << "0";
00119         if( run<10000 ) runlist << "0";
00120         runlist << run;
00121         runlist << "_";
00122         if( subrun<1000 ) runlist << "0";
00123         if( subrun<100 ) runlist << "0";
00124         if( subrun<10 ) runlist << "0";
00125         runlist << subrun;
00126         runlist << std::endl;
00127       }
00128     }
00129 
00130     runlist.close();
00131   }
00132 
00133   return;
00134 }


Generated on 17 Jun 2018 for loon by  doxygen 1.6.1