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

DataQualDB.h File Reference

#include "Validity/VldContext.h"
#include "StandardNtuple/NtpStRecord.h"

Go to the source code of this file.

Namespaces

namespace  DataUtil

Functions

Bool_t IsGoodData (const NtpStRecord *st)
Bool_t IsGoodData (const VldContext &cx)
Bool_t IsGoodDataRUN (const VldContext &cx)
Bool_t IsGoodDataHV (const VldContext &cx)
Bool_t IsGoodDataCOIL (const VldContext &cx)
Bool_t IsGoodDataGPS (const VldContext &cx)
Bool_t IsGoodFDData (const NtpStRecord *st)
Bool_t IsGoodFDData (const VldContext &cx)
Bool_t IsGoodFDDataRUN (const VldContext &cx)
Bool_t IsGoodFDDataHV (const VldContext &cx)
Bool_t IsGoodFDDataCOIL (const VldContext &cx)
Bool_t IsGoodFDDataGPS (const VldContext &cx)
Bool_t IsGoodNDData (const NtpStRecord *st)
Bool_t IsGoodNDData (const VldContext &cx)
Bool_t IsGoodNDDataRUN (const VldContext &cx)
Bool_t IsGoodNDDataCOIL (const VldContext &cx)


Function Documentation

Bool_t DataUtil::IsGoodData const VldContext cx  ) 
 

Definition at line 31 of file DataQualDB.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), DataUtil::IsGoodDataCOIL(), DataUtil::IsGoodDataGPS(), DataUtil::IsGoodDataHV(), and DataUtil::IsGoodDataRUN().

00032 {   
00033   // If it's not real data, return kOK
00034   // =================================
00035   if( cx.GetSimFlag() != SimFlag::kData ){
00036     return 1;
00037   }
00038 
00039   // Far Detector Data Selection
00040   // ===========================
00041   if( cx.GetDetector() == Detector::kFar ) { 
00042   
00043     // requirements for good far detector data: 
00044     //  (i)   good run - IsGoodDataRUN(cx)
00045     //  (ii)  good hv - IsGoodDataHV(cx)
00046     //  (iii) good coil - IsGoodDataCOIL(cx)
00047     //  (iv)  good gps error - IsGoodDataGPS(cx)
00048 
00049     if( IsGoodDataRUN(cx) && IsGoodDataHV(cx)
00050      && IsGoodDataCOIL(cx) && IsGoodDataGPS(cx) ) return 1;
00051     else return 0;
00052   }
00053   
00054   // Near Detector Data Selection
00055   // ============================
00056   if( cx.GetDetector() == Detector::kNear ) { 
00057   
00058     // requirements for good near detector data: 
00059     //  (i)  good run - IsGoodDataRUN(cx)
00060     //  (ii) good coil - IsGoodDataCOIL(cx)
00061 
00062     if( IsGoodDataRUN(cx) 
00063      && IsGoodDataCOIL(cx) ) return 1;
00064     else return 0;
00065   }
00066 
00067   return 1;
00068 }

Bool_t DataUtil::IsGoodData const NtpStRecord st  ) 
 

Definition at line 10 of file DataQualDB.cxx.

References RecRecordImp< T >::GetHeader(), and RecHeader::GetVldContext().

Referenced by EventQualAna::Analyze(), NuExtraction::ExtractDataQuality(), ANtpInfoObjectFiller::FillHeaderInformation(), DataUtil::IsGoodFDData(), DataUtil::IsGoodNDData(), MiniMakerPID::RunMiniMakerPID(), and Trimmer::RunTrimmer().

00010                                                  {
00011 
00012   // far detector data quality
00013   // =========================
00014   // number of crates enabled
00015   // (superseded by DbuFarRunQuality table)
00016   
00017   // Int_t cratemask = 0;
00018   // const NtpSRDataQuality *ntpDataQual;
00019   // ntpDataQual = &(st->dataquality);
00020   // cratemask = ntpDataQual->cratemask;
00021   // if( cratemask!=16 ) return 0;
00022  
00023   // get validity context
00024   // ====================
00025   const RecCandHeader* Header = &(st->GetHeader());
00026   VldContext cx = Header->GetVldContext();
00027 
00028   return IsGoodData(cx);
00029 }

Bool_t DataUtil::IsGoodDataCOIL const VldContext cx  ) 
 

Definition at line 121 of file DataQualDB.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), and CoilTools::IsOK().

Referenced by NuExtraction::ExtractDataQuality(), DataUtil::IsGoodData(), DataUtil::IsGoodFDDataCOIL(), and DataUtil::IsGoodNDDataCOIL().

00122 {
00123   // If it's not real data, return kOK
00124   // =================================
00125   if( cx.GetSimFlag() != SimFlag::kData ){
00126     return 1;
00127   }
00128 
00129   // Far Detector Data - Check Coil Status
00130   // =====================================
00131   if( cx.GetDetector() == Detector::kFar ) {
00132     return CoilTools::IsOK(cx);     
00133   }
00134   
00135   // Near Detector Data - Check Coil Status
00136   // ======================================
00137   if( cx.GetDetector() == Detector::kNear ) {
00138     return CoilTools::IsOK(cx);     
00139   }
00140 
00141   return 1;
00142 }

Bool_t DataUtil::IsGoodDataGPS const VldContext cx  ) 
 

Definition at line 144 of file DataQualDB.cxx.

References abs(), VldContext::GetDetector(), SpillServerMonFinder::GetNearestSpill(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), SpillServerMon::GetSpillTime(), SpillServerMon::GetSpillTimeError(), SpillServerMon::GetSpillType(), VldContext::GetTimeStamp(), and SpillServerMonFinder::Instance().

Referenced by NuExtraction::ExtractDataQuality(), DataUtil::IsGoodData(), and DataUtil::IsGoodFDDataGPS().

00145 {
00146   // If it's not real data, return kOK
00147   // =================================
00148   if( cx.GetSimFlag() != SimFlag::kData ){
00149     return 1;
00150   }
00151 
00152   // Far Detector Data - Check GPS Status
00153   // ====================================
00154   // get spillserver monitoring block for this snarl,
00155   // get GPS worst case uncertainty (nsec)
00156   // spill must be real and within 5 minutes
00157   if( cx.GetDetector() == Detector::kFar ) {
00158   
00159     SpillServerMonFinder& smon = SpillServerMonFinder::Instance();
00160     const SpillServerMon& spill_near = smon.GetNearestSpill(cx);
00161     VldTimeStamp dt = spill_near.GetSpillTime()-cx.GetTimeStamp();
00162 
00163     Int_t dt_sec = abs(dt.GetSec());
00164     Int_t gps_error = spill_near.GetSpillTimeError();
00165     Int_t spill_type = spill_near.GetSpillType();
00166 
00167     if( spill_type==1 && dt_sec<360 && gps_error>1000 ) return 0;
00168     else return 1;
00169   }
00170 
00171   return 1;
00172 }  

Bool_t DataUtil::IsGoodDataHV const VldContext cx  ) 
 

Definition at line 93 of file DataQualDB.cxx.

References VldContext::GetDetector(), HvStatusFinder::GetHvStatus(), VldContext::GetSimFlag(), HvStatus::Good(), and HvStatusFinder::Instance().

Referenced by NuExtraction::ExtractDataQuality(), DataUtil::IsGoodData(), and DataUtil::IsGoodFDDataHV().

00094 {
00095   // If it's not real data, return kOK
00096   // =================================
00097   if( cx.GetSimFlag() != SimFlag::kData ){
00098     return 1;
00099   }
00100 
00101   // Far Detector Data - Check HV Status
00102   // ===================================
00103   // check HV status within 60 secs of snarl
00104   // (N.B: arguments given to HvStatusFinder: 
00105   //   validity context, time window, task number)
00106   if( cx.GetDetector() == Detector::kFar ) {
00107     HvStatus::HvStatus_t hv_ok = 
00108       HvStatusFinder::Instance().GetHvStatus(cx,60,1);
00109     return HvStatus::Good(hv_ok);
00110   }
00111 
00112   // Near Detector Data, return kOK
00113   // ==============================
00114   if( cx.GetDetector() == Detector::kNear ) {
00115     return 1;
00116   }
00117 
00118   return 1;
00119 }

Bool_t DataUtil::IsGoodDataRUN const VldContext cx  ) 
 

Definition at line 70 of file DataQualDB.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), RunQualityFinder::Instance(), and RunQualityFinder::IsOK().

Referenced by NuExtraction::ExtractDataQuality(), DataUtil::IsGoodData(), DataUtil::IsGoodFDDataRUN(), and DataUtil::IsGoodNDDataRUN().

00071 {
00072   // If it's not real data, return kOK
00073   // =================================
00074   if( cx.GetSimFlag() != SimFlag::kData ){
00075     return 1;
00076   }
00077 
00078   // Far Detector Data - Check Run Status
00079   // ====================================
00080   if( cx.GetDetector() == Detector::kFar ) {
00081     return RunQualityFinder::Instance().IsOK(cx);
00082   }
00083 
00084   // Near Detector Data - Check Run Status
00085   // =====================================
00086   if( cx.GetDetector() == Detector::kNear ) {
00087     return RunQualityFinder::Instance().IsOK(cx);
00088   }
00089 
00090   return 1;
00091 }

Bool_t DataUtil::IsGoodFDData const VldContext cx  ) 
 

Definition at line 179 of file DataQualDB.cxx.

References DataUtil::IsGoodData().

00180 { 
00181   return IsGoodData(cx); 
00182 }

Bool_t DataUtil::IsGoodFDData const NtpStRecord st  ) 
 

Definition at line 174 of file DataQualDB.cxx.

References DataUtil::IsGoodData().

Referenced by ANtpEventInfoAna::Analyze(), MadTVAnalysis::CreatePAN(), MadPIDAnalysis::CreatePAN(), and Anp::FillHeader::Run().

00175 { 
00176   return IsGoodData(st); 
00177 }

Bool_t DataUtil::IsGoodFDDataCOIL const VldContext cx  ) 
 

Definition at line 194 of file DataQualDB.cxx.

References DataUtil::IsGoodDataCOIL().

00195 { 
00196   return IsGoodDataCOIL(cx); 
00197 }

Bool_t DataUtil::IsGoodFDDataGPS const VldContext cx  ) 
 

Definition at line 199 of file DataQualDB.cxx.

References DataUtil::IsGoodDataGPS().

00200 { 
00201   return IsGoodDataGPS(cx); 
00202 }

Bool_t DataUtil::IsGoodFDDataHV const VldContext cx  ) 
 

Definition at line 189 of file DataQualDB.cxx.

References DataUtil::IsGoodDataHV().

00190 { 
00191   return IsGoodDataHV(cx); 
00192 }

Bool_t DataUtil::IsGoodFDDataRUN const VldContext cx  ) 
 

Definition at line 184 of file DataQualDB.cxx.

References DataUtil::IsGoodDataRUN().

00185 { 
00186   return IsGoodDataRUN(cx); 
00187 }

Bool_t DataUtil::IsGoodNDData const VldContext cx  ) 
 

Definition at line 209 of file DataQualDB.cxx.

References DataUtil::IsGoodData().

00210 { 
00211   return IsGoodData(cx); 
00212 }

Bool_t DataUtil::IsGoodNDData const NtpStRecord st  ) 
 

Definition at line 204 of file DataQualDB.cxx.

References DataUtil::IsGoodData().

00205 { 
00206   return IsGoodData(st); 
00207 }

Bool_t DataUtil::IsGoodNDDataCOIL const VldContext cx  ) 
 

Definition at line 219 of file DataQualDB.cxx.

References DataUtil::IsGoodDataCOIL().

00220 { 
00221   return IsGoodDataCOIL(cx); 
00222 }

Bool_t DataUtil::IsGoodNDDataRUN const VldContext cx  ) 
 

Definition at line 214 of file DataQualDB.cxx.

References DataUtil::IsGoodDataRUN().

00215 { 
00216   return IsGoodDataRUN(cx); 
00217 }


Generated on Mon Feb 15 11:07:55 2010 for loon by  doxygen 1.3.9.1