Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

NC::RunUtil Namespace Reference

Utilities to determine what run a file is and whether it is a good run. More...


Enumerations

enum  ERunType {
  kRunAll = 0, kRunI = 1, kRunII = 2, kRunIII = 3,
  kMaxRun = kRunIII
}

Functions

bool IsNDRunGood (int run, int subrun)
ERunType FindRunType (ANtpHeaderInfo *header, ANtpRecoInfo *reco=0)
 Take an ANtpHeaderInfo and an ANtpRecoInfo and work out what ERunType it is from.
ERunType FindRunType (TString fileName)
 Takes a filename and works out what ERunType it is from.


Detailed Description

Utilities to determine what run a file is and whether it is a good run.

Enumeration Type Documentation

enum ERunType
 

Enumeration values:
kRunAll 
kRunI 
kRunII 
kRunIII 
kMaxRun 

Definition at line 15 of file NCRunUtil.h.

Referenced by MicroDSTMaker::Config(), and FindRunType().

00015              {
00016   kRunAll = 0,
00017   kRunI = 1,
00018   kRunII = 2,
00019   kRunIII = 3,
00020   kMaxRun = kRunIII
00021 };


Function Documentation

ERunType NC::RunUtil::FindRunType TString  fileName  ) 
 

Takes a filename and works out what ERunType it is from.

It does this based on the date. MC files are considered to be RunI

Definition at line 64 of file NCRunUtil.cxx.

References ERunType, month, and runPeriod.

00065 {
00066 
00067   // Yay for string processing in C and its evil spawn. In perl these
00068   // five lines would be:
00069   // /(20\d\d)-(\d\d)/ and $epochMonth=100*$1+$2;
00070   // or something like that
00071 
00072   // Match something that looks like a month in yyyy-mm format between 2000 and 2100
00073   TRegexp re("20[0-9][0-9]-[0-9][0-9]");
00074   // TString::operator()(TRegexp) returns the TSubString that matches the regexp
00075   TString date=TString(fileName(re));
00076   if(date.Length()==7){
00077     // The filename had a month number in it - must be a data file
00078     int year=TString(date(0, 4)).Atoi();
00079     // Brief worry that this would try octal if the month has a
00080     // leading zero, but man 3 atoi assures me that it always uses base 10
00081     int month=TString(date(5, 2)).Atoi();
00082     
00083     int epochMonth=100*year+month;
00084     
00085     // May 2005 - Feb 2006: Run I
00086     // May 2006 - Aug 2007: Run II
00087     // Nov 2007 - Jun 2009: Run III
00088     if (epochMonth >= 2005*100 + 5  && epochMonth <= 2006*100 + 2) return kRunI;
00089     if (epochMonth >= 2006*100 + 5  && epochMonth <= 2007*100 + 8) return kRunII;
00090     if (epochMonth >= 2007*100 + 11 && epochMonth <= 2006*100 + 6) return kRunIII;
00091 
00092     assert(0 && "fileName with date outside known range");
00093   }
00094   else{
00095     // Must be an MC file. No harm in checking
00096     assert(fileName.Contains("mc") ||
00097            fileName.Contains("tau") ||
00098            fileName.Contains("electron") ||
00099            fileName.Contains("mock"));
00100 
00101     TRegexp runRE("run[0-9]");
00102     TString runPeriodStr=TString(fileName(runRE));
00103     assert(runPeriodStr.Length()==4);
00104     int runPeriod=TString(runPeriodStr(3,1)).Atoi();
00105     return ERunType(runPeriod);
00106   }
00107 }

ERunType NC::RunUtil::FindRunType ANtpHeaderInfo header,
ANtpRecoInfo reco = 0
 

Take an ANtpHeaderInfo and an ANtpRecoInfo and work out what ERunType it is from.

It does this based on the run number for data, and reco->runPeriod for MC

Definition at line 21 of file NCRunUtil.cxx.

References ANtpHeaderInfo::dataType, ANtpHeaderInfo::detector, ERunType, ANtpHeaderInfo::run, and ANtpRecoInfo::runPeriod.

Referenced by NCExtrapolationModule::AddEventToExtrapolations(), NCDataQualityModule::CombineDataQualityPlots(), NCExtrapolationModule::FillDataQualityPlotsSpecial(), and NCPOTCounter::GetListOfFiles().

00022 {
00023   assert(header);
00024 
00025   if(header->dataType == SimFlag::kData){
00026     if(header->detector == Detector::kFar){
00027       if     (header->run <= 35723) return kRunI;
00028       // According to Robert P., the last run in the run period is
00029       // 38449, while the last LE run is 38420. Be more inclusive here
00030       // in case we ever run on non-LE data
00031       else if(header->run > 35723 && header->run <= 38449) return kRunII;
00032       // TODO: Just used the end of run II as the start of run III,
00033       // but this includes shutdown. Probably not a problem
00034       //
00035       // The final run number comes from Justin
00036       else if(header->run > 38449 && header->run <= 43639) return kRunIII;
00037       assert(0 && "Unknown run");
00038     }
00039     else{
00040       // Near detector
00041       if     (header->run <= 10159) return kRunI;
00042       // According to Robert P., the last run in the run period is
00043       // 12623, while the last LE run is 12578. Be more inclusive here
00044       // in case we ever run on non-LE data
00045       else if(header->run > 10159 && header->run <= 12623) return kRunII;
00046       // TODO: Just used the end of run II as the start of run III,
00047       // but this includes shutdown. Probably not a problem
00048       //
00049       // The final run number comes from Andy's docdb 6572
00050       else if(header->run > 12623 && header->run <= 16502) return kRunIII;
00051       assert(0 && "Unknown run");
00052     } // end if near det
00053   } // end if data
00054   else{
00055     // MC
00056     assert(reco);
00057     return ERunType(reco->runPeriod);
00058   }
00059 }

bool NC::RunUtil::IsNDRunGood int  run,
int  subrun
 

Definition at line 165 of file NCRunUtil.cxx.

References badRunHelper, BadRunHelper::IsNDRunGood(), and run().

Referenced by MicroDSTMaker::ExtractNCCC(), NCExtrapolationModule::FinalEventCheck(), and NCEventInfo::FinalEventCheck().

00166 {
00167   return badRunHelper.IsNDRunGood(run, subrun);
00168 }


Generated on Mon Nov 23 05:33:48 2009 for loon by  doxygen 1.3.9.1