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,
  kRunIV = 4, kRunV = 5, kRunVI = 6, kRunVII = 7,
  kRunVIII = 8, kRunIX = 9, kRunX = 10, kMaxRun = kRunX
}

Functions

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

Enumerator:
kRunAll 
kRunI 
kRunII 
kRunIII 
kRunIV 
kRunV 
kRunVI 
kRunVII 
kRunVIII 
kRunIX 
kRunX 
kMaxRun 

Definition at line 15 of file NCRunUtil.h.

00015              {
00016   kRunAll = 0,
00017   kRunI = 1,
00018   kRunII = 2,
00019   kRunIII = 3,
00020   kRunIV = 4,
00021   kRunV = 5,
00022   kRunVI = 6,
00023   kRunVII = 7,
00024   kRunVIII = 8,
00025   kRunIX = 9,
00026   kRunX = 10,
00027   kMaxRun = kRunX
00028 };


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 70 of file NCRunUtil.cxx.

References kRunI, kRunII, kRunIII, kRunIV, kRunIX, kRunV, kRunVI, kRunVII, kRunX, month, runPeriod, and Munits::year.

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

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, SimFlag::kData, Detector::kFar, kRunI, kRunII, kRunIII, kRunV, kRunVI, kRunX, ANtpHeaderInfo::run, and ANtpRecoInfo::runPeriod.

Referenced by NCExtrapolationModule::AddEventToExtrapolations(), NCDataQualityModule::CombineDataQualityPlots(), 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       // The final run number comes from Andy's docdb 9093 and:
00052       //http://homepages.spa.umn.edu/~strait/minos/MINOS_runs
00053       else if(header->run > 17777 && header->run <= 17928) return kRunV;
00054       else if(header->run > 17982 && header->run <= 18295) return kRunVI;
00055       else if(header->run > 20925 && header->run <= 22079) return kRunX;
00056 
00057       assert(0 && "Unknown run");
00058     } // end if near det
00059   } // end if data
00060   else{
00061     // MC
00062     assert(reco);
00063     return ERunType(reco->runPeriod);
00064   }
00065 }


Generated on 16 Apr 2018 for loon by  doxygen 1.6.1