JobCResult Class Reference

#include <JobCResult.h>

List of all members.

Public Types

enum  EErrorFlag { kAOK = 0, kWarning = 1, kError = 2, kFatal = 3 }
enum  EDecisionFlag { kPassed, kFailed }
enum  EIoFlag {
  kBeginFile, kEndFile, kBeginRun, kEndRun,
  kBeginOfInputStream, kEndOfInputStream, kNonPhysicsRecord
}
typedef enum JobCResult::EErrorFlag Error_t
typedef enum
JobCResult::EDecisionFlag 
Decision_t
typedef enum JobCResult::EIoFlag IoFlag_t

Public Member Functions

 JobCResult (JobCResult::Error_t result=kAOK)
 JobCResult (JobCResult::Decision_t result)
 JobCResult (JobCResult::IoFlag_t result)
JobCResultoperator= (JobCResult::Error_t result)
JobCResultoperator= (JobCResult::Decision_t result)
JobCResultoperator= (JobCResult::IoFlag_t result)
JobCResultoperator|= (const JobCResult &rhs)
bool HaveError () const
bool HaveDecision () const
bool HaveIoFlag () const
JobCResult::Error_t ErrorLevel () const
bool Passed () const
bool Failed () const
bool BeginFile () const
bool EndFile () const
bool BeginRun () const
bool EndRun () const
bool BeginOfInputStream () const
bool EndOfInputStream () const
bool NonPhysicsRecord () const
JobCResultSetAOK ()
JobCResultSetWarning ()
JobCResultSetError ()
JobCResultSetFatal ()
JobCResultSetFailed ()
JobCResultSetPassed ()
JobCResultClearPassFail ()
JobCResultSetBeginFile ()
JobCResultSetEndFile ()
JobCResultSetBeginRun ()
JobCResultSetEndRun ()
JobCResultSetBeginOfInputStream ()
JobCResultSetEndOfInputStream ()
JobCResultSetNonPhysicsRecord ()

Private Attributes

int fResult

Static Private Attributes

static const int kErrorMask = 0x000F
static const int kAOKFlg = 0x0000
static const int kWarningFlg = 0x0001
static const int kErrorFlg = 0x0002
static const int kFatalFlg = 0x0004
static const int kDecisionMask = 0x00F0
static const int kPassFlg = 0x0010
static const int kFailFlg = 0x0020
static const int kIoMask = 0xFF00
static const int kBeginFileFlg = 0x0100
static const int kEndFileFlg = 0x0200
static const int kBeginRunFlg = 0x0400
static const int kEndRunFlg = 0x0800
static const int kEndOfInputStreamFlg = 0x1000
static const int kNonPhysicsRecordFlg = 0x2000
static const int kBeginOfInputStreamFlg = 0x4000

Friends

std::ostream & operator<< (std::ostream &os, const JobCResult &r)

Detailed Description

Definition at line 16 of file JobCResult.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kPassed 
kFailed 

Definition at line 32 of file JobCResult.h.

00032                              {
00033     kPassed,  // Record passes selection cuts
00034     kFailed   // Record fails selection cuts
00035   } Decision_t;

Enumerator:
kAOK 
kWarning 
kError 
kFatal 

Definition at line 24 of file JobCResult.h.

00024                           {
00025     kAOK     =0, // No problem -- everything is fine
00026     kWarning =1, // Something might be wrong. Keep running (by default).
00027     kError   =2, // Hey! That's not supposed to happen. Stop run.
00028     kFatal   =3  // My world is upside down!. Dump core.
00029   } Error_t;

Enumerator:
kBeginFile 
kEndFile 
kBeginRun 
kEndRun 
kBeginOfInputStream 
kEndOfInputStream 
kNonPhysicsRecord 

Definition at line 38 of file JobCResult.h.

00038                        {
00039     kBeginFile,        // Start of new file
00040     kEndFile,          // End of file
00041     kBeginRun,         // Start of new run
00042     kEndRun,           // End of run
00043     kBeginOfInputStream, // Begin of input streams
00044     kEndOfInputStream,   // End of input streams
00045     kNonPhysicsRecord  // The record represents non-physics data
00046   } IoFlag_t;


Constructor & Destructor Documentation

JobCResult::JobCResult ( JobCResult::Error_t  result = kAOK  ) 

Definition at line 30 of file JobCResult.cxx.

References fResult, kAOK, kAOKFlg, kError, kErrorFlg, kFatal, kFatalFlg, kWarning, and kWarningFlg.

00030                                                : fResult(0)
00031 {
00032 //======================================================================
00033 // Assign from an error flag
00034 //======================================================================
00035   switch (result) {
00036   case JobCResult::kAOK:     fResult = kAOKFlg;     break;
00037   case JobCResult::kWarning: fResult = kWarningFlg; break;
00038   case JobCResult::kError:   fResult = kErrorFlg;   break;
00039   case JobCResult::kFatal:   fResult = kFatalFlg;   break;
00040   };
00041 }

JobCResult::JobCResult ( JobCResult::Decision_t  result  ) 

Definition at line 44 of file JobCResult.cxx.

References fResult, kFailed, kFailFlg, kPassed, and kPassFlg.

00044                                                   : fResult(0)
00045 {
00046 //======================================================================
00047 // Assign from an pass/fail decision flag
00048 //======================================================================
00049   switch (result) {
00050   case JobCResult::kPassed: fResult = kPassFlg; break;
00051   case JobCResult::kFailed: fResult = kFailFlg; break;
00052   };
00053 }

JobCResult::JobCResult ( JobCResult::IoFlag_t  result  ) 

Definition at line 57 of file JobCResult.cxx.

References fResult, kBeginFile, kBeginFileFlg, kBeginOfInputStream, kBeginOfInputStreamFlg, kBeginRun, kBeginRunFlg, kEndFile, kEndFileFlg, kEndOfInputStream, kEndOfInputStreamFlg, kEndRun, kEndRunFlg, kNonPhysicsRecord, and kNonPhysicsRecordFlg.

00057                                                 : fResult(0)
00058 {
00059 //======================================================================
00060 // Assign from an I/O status flag
00061 //======================================================================
00062   switch (result) {
00063   case JobCResult::kBeginFile:        fResult= kBeginFileFlg;        break; 
00064   case JobCResult::kEndFile:          fResult= kEndFileFlg;          break;
00065   case JobCResult::kBeginRun:         fResult= kBeginRunFlg;         break;
00066   case JobCResult::kEndRun:           fResult= kEndRunFlg;           break;
00067   case JobCResult::kBeginOfInputStream: fResult= kBeginOfInputStreamFlg; break;
00068   case JobCResult::kEndOfInputStream: fResult= kEndOfInputStreamFlg; break;
00069   case JobCResult::kNonPhysicsRecord: fResult= kNonPhysicsRecordFlg; break;
00070   };
00071 }


Member Function Documentation

bool JobCResult::BeginFile (  )  const

Definition at line 187 of file JobCResult.cxx.

References fResult, and kBeginFileFlg.

Referenced by JobCPath::CheckResult(), JobCPath::HandleResult(), operator<<(), and IoInputModule::ReadHeader().

00188 {
00189 //======================================================================
00190 // Have we started a new file?
00191 //======================================================================
00192   return (fResult & kBeginFileFlg)!=0;
00193 }

bool JobCResult::BeginOfInputStream (  )  const

Definition at line 227 of file JobCResult.cxx.

References fResult, and kBeginOfInputStreamFlg.

Referenced by IoInputModule::GoTo(), operator<<(), and IoInputModule::Prev().

00228 { 
00229 //======================================================================
00230 // Beginning of input streams?
00231 //======================================================================
00232   return (fResult & kBeginOfInputStreamFlg)!=0; 
00233 }

bool JobCResult::BeginRun (  )  const

Definition at line 207 of file JobCResult.cxx.

References fResult, and kBeginRunFlg.

Referenced by JobCPath::CheckResult(), JobCPath::HandleResult(), and operator<<().

00208 { 
00209 //======================================================================
00210 // Have we started a new run?
00211 //======================================================================
00212   return (fResult & kBeginRunFlg)!=0; 
00213 }

JobCResult & JobCResult::ClearPassFail (  ) 

Definition at line 292 of file JobCResult.cxx.

References fResult, and kDecisionMask.

Referenced by SetFailed(), and SetPassed().

00292                                       {
00293   fResult &= (~kDecisionMask); 
00294   return *this;
00295 }

bool JobCResult::EndFile (  )  const

Definition at line 197 of file JobCResult.cxx.

References fResult, and kEndFileFlg.

Referenced by JobCPath::CheckResult(), JobCPath::HandleResult(), and operator<<().

00198 {
00199 //======================================================================
00200 // Have we finished with a file?
00201 //======================================================================
00202   return (fResult & kEndFileFlg)!=0; 
00203 }

bool JobCResult::EndOfInputStream (  )  const

Definition at line 237 of file JobCResult.cxx.

References fResult, and kEndOfInputStreamFlg.

Referenced by Jint::EndPathRun(), JobCPath::EvalInput(), JobCPath::Execute(), IoInputModule::Get(), IoInputModule::GoTo(), IoInputModule::Next(), operator<<(), IoInputModule::Prev(), JobCPath::Run(), and IoInputModuleValidate::TestGet().

00238 { 
00239 //======================================================================
00240 // Has the input stream run dry?
00241 //======================================================================
00242   return (fResult & kEndOfInputStreamFlg)!=0; 
00243 }

bool JobCResult::EndRun (  )  const

Definition at line 217 of file JobCResult.cxx.

References fResult, and kEndRunFlg.

Referenced by JobCPath::CheckResult(), JobCPath::HandleResult(), and operator<<().

00218 {
00219 //======================================================================
00220 // Have we ended a run?
00221 //======================================================================
00222   return (fResult & kEndRunFlg)!=0; 
00223 }

JobCResult::Error_t JobCResult::ErrorLevel (  )  const

Definition at line 165 of file JobCResult.cxx.

References MuELoss::e, fResult, kAOK, kError, kErrorFlg, kFatal, kFatalFlg, kWarning, and kWarningFlg.

Referenced by JobCPath::HandleError(), and operator<<().

00166 {
00167 //======================================================================
00168 // What's the severity of the error condition?
00169 //======================================================================
00170   Error_t e = kAOK;
00171   if (fResult & kWarningFlg) e = JobCResult::kWarning;
00172   if (fResult & kErrorFlg)   e = JobCResult::kError;
00173   if (fResult & kFatalFlg)   e = JobCResult::kFatal;
00174   return e;
00175 }

bool JobCResult::Failed (  )  const
bool JobCResult::HaveDecision (  )  const

Definition at line 145 of file JobCResult.cxx.

References fResult, and kDecisionMask.

00146 {
00147 //======================================================================
00148 // Are any pass/fail decision bits set?
00149 //======================================================================
00150   return (fResult & kDecisionMask) != 0;
00151 }

bool JobCResult::HaveError (  )  const

Definition at line 135 of file JobCResult.cxx.

References fResult, and kErrorMask.

Referenced by JobCPath::Execute(), and PhotonTransport::SimulateEvent().

00136 {
00137 //======================================================================
00138 // Are any error bits set?
00139 //======================================================================
00140   return (fResult & kErrorMask) != 0;
00141 }

bool JobCResult::HaveIoFlag (  )  const

Definition at line 155 of file JobCResult.cxx.

References fResult, and kIoMask.

00156 {
00157 //======================================================================
00158 // Are any I/O flags set?
00159 //======================================================================
00160   return (fResult & kIoMask) != 0;
00161 }

bool JobCResult::NonPhysicsRecord (  )  const

Definition at line 247 of file JobCResult.cxx.

References fResult, and kNonPhysicsRecordFlg.

Referenced by JobCPath::Execute().

00248 { 
00249 //======================================================================
00250 // Has the input stream delivered something besides physics events?
00251 //======================================================================
00252   return (fResult & kNonPhysicsRecordFlg)!=0; 
00253 }

JobCResult & JobCResult::operator= ( JobCResult::IoFlag_t  result  ) 

Definition at line 105 of file JobCResult.cxx.

References kBeginFile, kBeginOfInputStream, kBeginRun, kEndFile, kEndOfInputStream, kEndRun, kNonPhysicsRecord, SetBeginFile(), SetBeginOfInputStream(), SetBeginRun(), SetEndFile(), SetEndOfInputStream(), SetEndRun(), and SetNonPhysicsRecord().

00106 {
00107 //======================================================================
00108 // Set any I/O flags. These are all cumulative
00109 //======================================================================
00110   switch (result) {
00111   case kBeginFile:        this->SetBeginFile(); break;
00112   case kEndFile:          this->SetEndFile();   break;
00113   case kBeginRun:         this->SetBeginRun();  break;
00114   case kEndRun:           this->SetEndRun();    break;
00115   case kBeginOfInputStream: this->SetBeginOfInputStream();  break;
00116   case kEndOfInputStream: this->SetEndOfInputStream();  break;
00117   case kNonPhysicsRecord: this->SetNonPhysicsRecord();    break;
00118   };
00119   return *this;
00120 }

JobCResult & JobCResult::operator= ( JobCResult::Decision_t  result  ) 

Definition at line 91 of file JobCResult.cxx.

References kFailed, kPassed, SetFailed(), and SetPassed().

00092 {
00093 //======================================================================
00094 // Set the pass/fail result
00095 //======================================================================
00096   switch (result) {
00097   case JobCResult::kPassed: this->SetPassed(); break;
00098   case JobCResult::kFailed: this->SetFailed(); break;
00099   };
00100   return *this;
00101 }

JobCResult & JobCResult::operator= ( JobCResult::Error_t  result  ) 

Definition at line 75 of file JobCResult.cxx.

References fResult, kAOK, kError, kErrorMask, kFatal, kWarning, SetError(), SetFatal(), and SetWarning().

00076 {
00077 //======================================================================
00078 // Set any error flags. With the exception of AOK these are cumulative
00079 //======================================================================
00080   switch (result) {
00081   case JobCResult::kAOK:     fResult &= (~kErrorMask); break;
00082   case JobCResult::kWarning: this->SetWarning();       break;
00083   case JobCResult::kError:   this->SetError();         break;
00084   case JobCResult::kFatal:   this->SetFatal();         break;
00085   };
00086   return *this;
00087 }

JobCResult & JobCResult::operator|= ( const JobCResult rhs  ) 

Definition at line 124 of file JobCResult.cxx.

References fResult.

00125 {
00126 //======================================================================
00127 // Combine some results
00128 //======================================================================
00129   fResult |= rhs.fResult;
00130   return *this;
00131 }

bool JobCResult::Passed (  )  const

Definition at line 182 of file JobCResult.cxx.

References fResult, and kPassFlg.

Referenced by FCPCFilterModule::Ana(), BDSpliceModule::Ana(), and operator<<().

00182 { return fResult&JobCResult::kPassFlg; }

JobCResult & JobCResult::SetAOK (  ) 

Definition at line 260 of file JobCResult.cxx.

References fResult, and kErrorMask.

Referenced by PreFilter::Ana(), and AtNuFitModule::Reco().

00260                                {
00261   fResult &= (~kErrorMask); // Lower all error flags
00262   return *this;
00263 }

JobCResult & JobCResult::SetBeginFile (  ) 

Definition at line 302 of file JobCResult.cxx.

References fResult, and kBeginFileFlg.

Referenced by JobCDemoModuleA::Get(), IoInputModule::OpenStreamItr(), operator=(), and IoInputModule::ReadHeader().

00302                                      { 
00303   fResult |= kBeginFileFlg;
00304   return *this;
00305 }

JobCResult & JobCResult::SetBeginOfInputStream (  ) 

Definition at line 318 of file JobCResult.cxx.

References fResult, and kBeginOfInputStreamFlg.

Referenced by IoInputModule::OpenStreamItr(), and operator=().

00318                                               { 
00319   fResult |= kBeginOfInputStreamFlg; 
00320   return *this;
00321 }

JobCResult & JobCResult::SetBeginRun (  ) 

Definition at line 310 of file JobCResult.cxx.

References fResult, and kBeginRunFlg.

Referenced by JobCDemoModuleA::Get(), IoInputModule::OpenStreamItr(), operator=(), and IoInputModule::ReadHeader().

00310                                     {
00311   fResult |= kBeginRunFlg;
00312   return *this;
00313 }

JobCResult & JobCResult::SetEndFile (  ) 
JobCResult & JobCResult::SetEndOfInputStream (  ) 

Definition at line 322 of file JobCResult.cxx.

References fResult, and kEndOfInputStreamFlg.

Referenced by IoInputModule::CloseStreamItr(), JobCDemoModuleA::Get(), IoInputModule::Get(), IoInputModule::OpenStreamItr(), and operator=().

00322                                             { 
00323   fResult |= kEndOfInputStreamFlg; 
00324   return *this;
00325 }

JobCResult & JobCResult::SetEndRun (  ) 

Definition at line 314 of file JobCResult.cxx.

References fResult, and kEndRunFlg.

Referenced by IoInputModule::CloseStreamItr(), JobCDemoModuleA::Get(), IoInputModule::Get(), IoInputModule::OpenStreamItr(), operator=(), and IoInputModule::ReadHeader().

00314                                  { 
00315   fResult |= kEndRunFlg;
00316   return *this;
00317 }

JobCResult & JobCResult::SetError (  ) 
JobCResult & JobCResult::SetFailed (  ) 

Definition at line 282 of file JobCResult.cxx.

References ClearPassFail(), fResult, and kFailFlg.

Referenced by CondensedNtpModule::Ana(), LIStreamHunter::Ana(), DmxDeMuxModule::Ana(), DumpBadElectronics::Ana(), FCPCFilterModule::Ana(), MergeEvent::Ana(), FillBadChannelDB::Ana(), FarDetSliceListModule::Ana(), FilterRunType::Ana(), SelectSpillTriggers::Ana(), DDSPaceModule::Ana(), RemoveMuon::Ana(), DemoRecordModule::Ana(), FilterLIModule::Ana(), CDAnaModule::Ana(), ChopModule::Ana(), CondensedNtpModuleAtm::Ana(), RawLILooker::Ana(), AtNuDisplayModule::Ana(), FillNearRunQuality::Ana(), FitTrackMSListModule::Ana(), ToyMCModule::Ana(), CondensedNtpModuleNC::Ana(), FarDetShieldPlankListModule::Ana(), DmxDeMuxCosmicsModule::Ana(), FarDetStripListModule::Ana(), SelectSpillTimes::Ana(), ValidateRawChecksums::Ana(), CDPreFilterModule::Ana(), CDTrackerModule::Ana(), LISummaryAnalyser::Ana(), FillFarRunQuality::Get(), DigitListModule::Get(), FillSpillServerMon::Get(), FillHvFromSingles::Get(), RecordSetupModule::Get(), NtpStModule::Get(), LISummaryModule::GetSummaryBlocks(), operator=(), AtNuFindModule::Reco(), ClusterSRListModule::Reco(), DmxDeMuxCosmicsModule::Reco(), DigitListModule::Reco(), FitShowerEMListModule::Reco(), LISummaryModule::Reco(), TrackCamListModule::Reco(), DeMuxDigitListModule::Reco(), NtpEMModule::Reco(), ShowerSRListModule::Reco(), FarDetShieldPlankListModule::Reco(), FilterDigitListModule::Reco(), FitTrackSRListModule::Reco(), BiggestChopModule::Reco(), DemoCandNtpModule::Reco(), FarDetEventModule::Reco(), NtpSRModule::Reco(), RemoveMuon::Reco(), FitTrackCamListModule::Reco(), FitTrackMSListModule::Reco(), DemoNtupleModule::Reco(), FarDetDataQualityModule::Reco(), FarDetStripListModule::Reco(), SliceFromChopModule::Reco(), ChopModule::Reco(), DmxDeMuxFilterModule::Reco(), NtpCluster3DModule::Reco(), NtpSRFilterModule::Reco(), NtpStFilterModule::Reco(), StripSRListModule::Reco(), AltDeMuxModule::Reco(), NtpMCModule::Reco(), AtmosShowerListModule::Reco(), NtpMRModule::Reco(), TrackSRListModule::Reco(), AtNuFitModule::Reco(), ShieldPlankListModule::Reco(), ShowerEMListModule::Reco(), DemoRecordModule::Reco(), MergeEvent::Reco(), PulserFromRawFilterModule::Reco(), NtpTHModule::Reco(), PTSimModule::Reco(), SliceSRListModule::Reco(), SubShowerSRListModule::Reco(), DataQualityReader::Reco(), and FarDetSliceListModule::Reco().

00282                                   {
00283   this->ClearPassFail();
00284   fResult |= kFailFlg;
00285   return *this;
00286 }

JobCResult & JobCResult::SetFatal (  ) 

Definition at line 272 of file JobCResult.cxx.

References fResult, and kFatalFlg.

Referenced by FCPCFilterModule::Ana(), operator=(), RemoveMuon::Reco(), and MergeEvent::Reco().

00272                                  {
00273   fResult |= kFatalFlg;
00274   return *this;
00275 }

JobCResult & JobCResult::SetNonPhysicsRecord (  ) 

Definition at line 326 of file JobCResult.cxx.

References fResult, and kNonPhysicsRecordFlg.

Referenced by operator=().

00326                                             {
00327   fResult |= kNonPhysicsRecordFlg;
00328   return *this;
00329 }

JobCResult & JobCResult::SetPassed (  ) 
JobCResult & JobCResult::SetWarning (  ) 

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const JobCResult r 
) [friend]

Member Data Documentation

int JobCResult::fResult [private]
const int JobCResult::kAOKFlg = 0x0000 [static, private]

Definition at line 95 of file JobCResult.h.

Referenced by JobCResult().

const int JobCResult::kBeginFileFlg = 0x0100 [static, private]

Definition at line 105 of file JobCResult.h.

Referenced by BeginFile(), JobCResult(), and SetBeginFile().

const int JobCResult::kBeginOfInputStreamFlg = 0x4000 [static, private]

Definition at line 111 of file JobCResult.h.

Referenced by BeginOfInputStream(), JobCResult(), and SetBeginOfInputStream().

const int JobCResult::kBeginRunFlg = 0x0400 [static, private]

Definition at line 107 of file JobCResult.h.

Referenced by BeginRun(), JobCResult(), and SetBeginRun().

const int JobCResult::kDecisionMask = 0x00F0 [static, private]

Definition at line 100 of file JobCResult.h.

Referenced by ClearPassFail(), and HaveDecision().

const int JobCResult::kEndFileFlg = 0x0200 [static, private]

Definition at line 106 of file JobCResult.h.

Referenced by EndFile(), JobCResult(), and SetEndFile().

const int JobCResult::kEndOfInputStreamFlg = 0x1000 [static, private]

Definition at line 109 of file JobCResult.h.

Referenced by EndOfInputStream(), JobCResult(), and SetEndOfInputStream().

const int JobCResult::kEndRunFlg = 0x0800 [static, private]

Definition at line 108 of file JobCResult.h.

Referenced by EndRun(), JobCResult(), and SetEndRun().

const int JobCResult::kErrorFlg = 0x0002 [static, private]

Definition at line 97 of file JobCResult.h.

Referenced by ErrorLevel(), JobCResult(), and SetError().

const int JobCResult::kErrorMask = 0x000F [static, private]

Definition at line 94 of file JobCResult.h.

Referenced by HaveError(), operator=(), and SetAOK().

const int JobCResult::kFailFlg = 0x0020 [static, private]

Definition at line 102 of file JobCResult.h.

Referenced by Failed(), JobCResult(), and SetFailed().

const int JobCResult::kFatalFlg = 0x0004 [static, private]

Definition at line 98 of file JobCResult.h.

Referenced by ErrorLevel(), JobCResult(), and SetFatal().

const int JobCResult::kIoMask = 0xFF00 [static, private]

Definition at line 104 of file JobCResult.h.

Referenced by HaveIoFlag().

const int JobCResult::kNonPhysicsRecordFlg = 0x2000 [static, private]

Definition at line 110 of file JobCResult.h.

Referenced by JobCResult(), NonPhysicsRecord(), and SetNonPhysicsRecord().

const int JobCResult::kPassFlg = 0x0010 [static, private]

Definition at line 101 of file JobCResult.h.

Referenced by JobCResult(), Passed(), and SetPassed().

const int JobCResult::kWarningFlg = 0x0001 [static, private]

Definition at line 96 of file JobCResult.h.

Referenced by ErrorLevel(), JobCResult(), and SetWarning().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1