DSTUtil::GoodRun Namespace Reference


Functions

bool IsGood (int const run)
bool IsGoodScint (int const run)


Function Documentation

bool DSTUtil::GoodRun::IsGood ( int const   run  ) 

Definition at line 1878 of file DSTUtil.cxx.

References IsGoodScint().

01878                                          {
01879   return (IsGoodScint(run));
01880 }

bool DSTUtil::GoodRun::IsGoodScint ( int const   run  ) 

Definition at line 1883 of file DSTUtil.cxx.

References ReadSpecialData::GetHistFromFile(), and ReadSpecialData::Instance().

Referenced by IsGood().

01883                                               {
01884   //The list of good runs is keep in a histogram in ReadSpecialData
01885   //check run number against list of good/bad runs and return bool
01886   
01887   ReadSpecialData* fRead =  &ReadSpecialData::Instance();
01888   TH1* h = fRead->GetHistFromFile("hIsGoodScint","DSTUtil_GoodRun");
01889 
01890   if (!h) {
01891     cout << "Error: DSTUtil::GoodRun::IsGoodScint() failed to find "
01892          << "its data through ReadSpecialData. Bye bye." << endl;
01893     exit(-1);
01894   }
01895 
01896   int bin = h->GetXaxis()->FindBin(run);
01897   if (bin == 0 || bin == h->GetNbinsX()+1) {
01898     cout << "Warning: DSTUtil::GoodRun::IsGoodScint() histogram "
01899          << "does not contain a bin\n for run " << run 
01900          << ". Returning false." << endl;
01901     return false;
01902   }
01903   double val = h->GetBinContent(bin);
01904   if (val<0.) {
01905     //bad run, do not use.
01906     return false;
01907   } else if (val>0.) {
01908     //good run
01909     return true;
01910   }
01911   //val==0.  We did not confirm this to be a good or bad run.
01912   //Put out a warning and return true
01913   cout << "Warning: DSTUtil::GoodRun::IsGoodScint() is not sure "
01914        << "about run " << run
01915        << "\n Letting it pass, return true." << endl;
01916   return true;
01917 }


Generated on Mon Nov 23 08:05:24 2009 for MIPP(E907) by  doxygen 1.4.7