FilterRunType Class Reference

#include <FilterRunType.h>

Inheritance diagram for FilterRunType:
JobCModule

List of all members.

Public Member Functions

 FilterRunType ()
 ~FilterRunType ()
JobCResult Ana (const MomNavigator *mom)
void BeginJob ()
void EndJob ()
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Attributes

Int_t fRun
Short_t fSubRun
JobCResult fPassRun
int fPassRunType
std::string fPassRunTypeName
bool fPassPhysics
bool fPassCheckOut
bool fPassVACalibrate
bool fPassVAPedestal
bool fPassQieCalibrate
bool fPassQieMonitor
bool fOnlyFakeSpill
bool fPassTest
bool fPassModified

Detailed Description

Definition at line 17 of file FilterRunType.h.


Constructor & Destructor Documentation

FilterRunType::FilterRunType (  ) 

Definition at line 32 of file FilterRunType.cxx.

References RSMSyn.

00033 {
00034   RSMSyn << "FilterRunType::FilterRunType" << endl;
00035   fRun = 0;
00036   fSubRun = 0;
00037 
00038   fPassRun.SetPassed().SetAOK();
00039 }

FilterRunType::~FilterRunType (  ) 

Definition at line 41 of file FilterRunType.cxx.

References RSMSyn.

00042 {
00043   RSMSyn << "FilterRunType::~FilterRunType" << endl;
00044 }


Member Function Documentation

JobCResult FilterRunType::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 46 of file FilterRunType.cxx.

References RawRecord::FindRawBlock(), fOnlyFakeSpill, fPassCheckOut, fPassModified, fPassPhysics, fPassQieCalibrate, fPassQieMonitor, fPassRun, fPassRunType, fPassRunTypeName, fPassTest, fPassVACalibrate, fPassVAPedestal, fRun, fSubRun, Registry::Get(), VldContext::GetDetector(), RawRecord::GetRawBlockIter(), RawRecord::GetRawHeader(), RawSnarlHeaderBlock::GetRemoteSpillType(), RawRunConfigBlock::GetRun(), RawDaqHeader::GetRun(), RawRunConfigBlock::GetRunConfig(), RawDaqHeader::GetRunType(), RawDaqHeader::GetSubRun(), RawRunConfigBlock::GetSubRun(), RecMinos::GetTempTags(), RecMinosHdr::GetVldContext(), JobCResult::kFailed, Detector::kFar, kSpillType_Fake, UtilRSM::ParseConfigBlock(), RSMDeb, RUN_TYPE_CHECKOUT, RUN_TYPE_MASK_MODIFIED, RUN_TYPE_MASK_TEST, RUN_TYPE_MASK_TYPECODE, RUN_TYPE_PHYSICS, RUN_TYPE_QIE_CALIBRATE, RUN_TYPE_QIE_MONITOR, RUN_TYPE_VA_CALIBRATE, RUN_TYPE_VA_PEDESTAL, RUNNUM_NEW_RUNTYPES, JobCResult::SetFailed(), and JobCResult::SetPassed().

00047 {
00048   //RSMVer << "FilterRunType::Ana" << endl;
00049 
00050   RawRecord* rawrec = 0;
00051   const char* InputStream = 0;
00052 
00053   TIter momitr = const_cast<MomNavigator*>(mom)->FragmentIter();
00054   TObject* momobj = 0;
00055   while ((momobj=momitr())) {
00056     if ((rawrec=dynamic_cast<RawRecord*>(momobj))) {
00057       const RawSnarlHeaderBlock* hdrblk =
00058         dynamic_cast<const RawSnarlHeaderBlock*>
00059         (rawrec->FindRawBlock("RawSnarlHeaderBlock"));
00060 
00061       bool IsFakeSpill = false;
00062       if(hdrblk) {
00063         if(hdrblk->GetRemoteSpillType() == kSpillType_Fake) IsFakeSpill = true;
00064       }
00065       if(!IsFakeSpill && fOnlyFakeSpill) return JobCResult::kFailed;
00066 
00067       const RawDaqHeader* dhdr =
00068         dynamic_cast<const RawDaqHeader*>(rawrec->GetRawHeader());
00069   
00070       if (fRun!=dhdr->GetRun() || fSubRun!=dhdr->GetSubRun()) {
00071         if (fRun==dhdr->GetRun() && fPassRunTypeName.size()!=0) {
00072           //Don't change for just subrun changes when using RunTypeName
00073           RSMDeb << "Only SubRun Changed" <<endl;
00074           fSubRun = dhdr->GetSubRun();
00075           return fPassRun;
00076         }
00077         RSMDeb << "Run change: " <<
00078           fRun << "-" << fSubRun << " -> " <<
00079           dhdr->GetRun() << "-" << dhdr->GetSubRun() << endl;
00080   
00081         fRun = dhdr->GetRun();
00082         fSubRun = dhdr->GetSubRun();
00083         if(dhdr->GetVldContext().GetDetector()==Detector::kFar
00084            && fRun<=RUNNUM_NEW_RUNTYPES) {
00085           RSMDeb << "I can't play with early far runtypes yet" <<endl;
00086           fPassRun.SetPassed();
00087           return fPassRun;
00088         }
00089         fPassRun.SetPassed();
00090         RSMDeb << "fPassRun:" << fPassRun << endl;
00091       }
00092       else {
00093         //RSMVer << "No Run change, fPassRun:" << fPassRun << endl;
00094         return fPassRun;
00095       }
00096       Short_t RType = dhdr->GetRunType();
00097       Short_t BaseRType = RType&RUN_TYPE_MASK_TYPECODE;
00098       if (fPassRunType != 0) {
00099         if(fPassRunType!=RType || fPassRunType!=BaseRType) {
00100           fPassRun.SetFailed();
00101         }
00102         RSMDeb << "fPassRun:" << fPassRun << endl;
00103       }
00104       else {
00105         if((RType&RUN_TYPE_MASK_TEST)!=0
00106            && !fPassTest) fPassRun.SetFailed();
00107         if((RType&RUN_TYPE_MASK_MODIFIED)!=0
00108            && !fPassModified) fPassRun.SetFailed();
00109         if(BaseRType==RUN_TYPE_PHYSICS
00110            && !fPassPhysics) fPassRun.SetFailed();
00111         if(BaseRType==RUN_TYPE_CHECKOUT
00112            && !fPassCheckOut) fPassRun.SetFailed();
00113         if(BaseRType==RUN_TYPE_VA_CALIBRATE
00114            && !fPassVACalibrate) fPassRun.SetFailed();
00115         if(BaseRType==RUN_TYPE_VA_PEDESTAL
00116            && !fPassVAPedestal) fPassRun.SetFailed();
00117         if(BaseRType==RUN_TYPE_QIE_CALIBRATE
00118            && !fPassQieCalibrate) fPassRun.SetFailed();
00119         if(BaseRType==RUN_TYPE_QIE_MONITOR
00120            && !fPassQieMonitor) fPassRun.SetFailed();
00121       }
00122 
00123       if (rawrec->GetTempTags().Get("stream",InputStream)
00124            && fPassRunTypeName.size()!=0) {
00125         fPassRun.SetFailed();
00126         if (!strcmp("DaqMonitor",InputStream)) {
00127           TIter rawitr = rawrec->GetRawBlockIter();
00128           RawRunConfigBlock* rrcfgb = 0;
00129           TObject *rawobj = 0;
00130           while ((rawobj=rawitr())) {
00131             if ( (rrcfgb = dynamic_cast<RawRunConfigBlock*>(rawobj)) ) {
00132               RSMDeb << "RawRunConfigBlock for: " <<
00133                 rrcfgb->GetRun() << "-" << rrcfgb->GetSubRun() << 
00134                 endl << "[" << rrcfgb->GetRunConfig() << "]" << endl;
00135               string rtname;
00136               rtname = UtilRSM::ParseConfigBlock(rrcfgb,"runTypeName");
00137               if(fPassRunTypeName == rtname) fPassRun.SetPassed();
00138               RSMDeb << "fPassRun:" << fPassRun << endl;
00139             }
00140           }
00141         }
00142       }
00143     }
00144   }
00145   return fPassRun;
00146 }

void FilterRunType::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 148 of file FilterRunType.cxx.

References fRun, fSubRun, and RSMSyn.

00149 {
00150   RSMSyn << "FilterRunType::BeginJob" << endl;
00151   fRun = 0;
00152   fSubRun = 0;
00153 }

void FilterRunType::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 194 of file FilterRunType.cxx.

References fOnlyFakeSpill, fPassCheckOut, fPassModified, fPassPhysics, fPassQieCalibrate, fPassQieMonitor, fPassRunType, fPassRunTypeName, fPassTest, fPassVACalibrate, fPassVAPedestal, Registry::Get(), and RSMSyn.

00195 {
00196   RSMSyn << "FilterRunType::Config" << endl;
00197   int tmpi = 0;
00198   const char* tmps = 0;
00199 
00200   if(r.Get("PassPhysics",tmpi)) fPassPhysics=tmpi;
00201   if(r.Get("PassCheckOut",tmpi)) fPassCheckOut=tmpi;
00202   if(r.Get("PassVACalibrate",tmpi)) fPassVACalibrate=tmpi;
00203   if(r.Get("PassVAPedestal",tmpi)) fPassVAPedestal=tmpi;
00204   if(r.Get("PassQieCalibrate",tmpi)) fPassQieCalibrate=tmpi;
00205   if(r.Get("PassQieMonitor",tmpi)) fPassQieMonitor=tmpi;
00206   if(r.Get("OnlyFakeSpill",tmpi)) fOnlyFakeSpill=tmpi;
00207   if(r.Get("PassTest",tmpi)) fPassTest=tmpi;
00208   if(r.Get("PassModified",tmpi)) fPassModified=tmpi;
00209   if(r.Get("PassRunType",tmpi)) fPassRunType=tmpi;
00210   if(r.Get("PassRunTypeName",tmps)) fPassRunTypeName=tmps;
00211 }

const Registry & FilterRunType::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 160 of file FilterRunType.cxx.

References JobCModule::GetName(), Registry::LockValues(), RSMSyn, Registry::Set(), and Registry::UnLockValues().

00161 {
00162   RSMSyn << "FilterRunType::DefaultConfig" << endl;
00163   static Registry r;
00164 
00165   string name = this->JobCModule::GetName();
00166   r.SetName((name+".config.default").c_str());
00167 
00168   r.UnLockValues();
00169 
00170   //These are for specific RunTypes, pass all by default
00171   r.Set("PassPhysics",1);
00172   r.Set("PassCheckOut",1);
00173   r.Set("PassVACalibrate",1);
00174   r.Set("PassVAPedestal",1);
00175   r.Set("PassQieCalibrate",1);
00176   r.Set("PassQieMonitor",1);
00177   r.Set("OnlyFakeSpill",0);
00178 
00179   //These are for status bits to RunType code
00180   r.Set("PassTest",1);
00181   r.Set("PassModified",1);
00182 
00183   //Use these to specify a RunType or RunType name to pass
00184   //If one of these are set, the above Pass value will be ignored and
00185   //only RunType == PassRunType or RunTypeName == PassRunTypeName will
00186   //go through
00187   r.Set("PassRunType",0);//0 to pass all RunType
00188   r.Set("PassRunTypeName","");// Empty string to pass all RunTypeName
00189 
00190   r.LockValues();
00191   return r;
00192 }

void FilterRunType::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 155 of file FilterRunType.cxx.

References RSMSyn.

00156 {
00157   RSMSyn << "FilterRunType::EndJob" << endl;
00158 }


Member Data Documentation

Definition at line 44 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 39 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 46 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 38 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 42 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 43 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 33 of file FilterRunType.h.

Referenced by Ana().

Definition at line 36 of file FilterRunType.h.

Referenced by Ana(), and Config().

std::string FilterRunType::fPassRunTypeName [private]

Definition at line 37 of file FilterRunType.h.

Referenced by Ana(), and Config().

bool FilterRunType::fPassTest [private]

Definition at line 45 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 40 of file FilterRunType.h.

Referenced by Ana(), and Config().

Definition at line 41 of file FilterRunType.h.

Referenced by Ana(), and Config().

Int_t FilterRunType::fRun [private]

Definition at line 30 of file FilterRunType.h.

Referenced by Ana(), and BeginJob().

Short_t FilterRunType::fSubRun [private]

Definition at line 31 of file FilterRunType.h.

Referenced by Ana(), and BeginJob().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1