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

SelectSpillTriggers.cxx

Go to the documentation of this file.
00001 
00002 // $Id: SelectSpillTriggers.cxx,v 1.2 2007/03/01 17:02:25 rhatcher Exp $
00003 //
00004 // Simple filter module to select spill triggers.
00005 //
00006 //
00007 // n.tagg1@physics.ox.ac.uk
00009 #include "SpillTiming/SelectSpillTriggers.h"
00010 #include "MessageService/MsgService.h"
00011 #include "MinosObjectMap/MomNavigator.h"
00012 #include "JobControl/JobCModuleRegistry.h" // For JOBMODULE macro
00013 #include "OnlineUtil/mdTriggerCodes.h"
00014 #include "RawData/RawRecord.h"
00015 #include "RawData/RawDaqSnarlHeader.h"
00016 
00017 JOBMODULE(SelectSpillTriggers, "SelectSpillTriggers",
00018           "Passes ND SGATE events. Fails non-SGATE events.");
00019 CVSID("$Id: SelectSpillTriggers.cxx,v 1.2 2007/03/01 17:02:25 rhatcher Exp $");
00020 //......................................................................
00021 
00022 SelectSpillTriggers::SelectSpillTriggers()
00023 {
00024   fFD = 1;
00025   fND = 1;
00026   fCheckFDTypeFlag = 1;
00027 }
00028 
00029 //......................................................................
00030 
00031 SelectSpillTriggers::~SelectSpillTriggers()
00032 {
00033 }
00034 
00035 //......................................................................
00036 
00037 JobCResult SelectSpillTriggers::Ana(const MomNavigator* mom)
00038 {
00044 
00045   JobCResult result;
00046 
00047   // Find raw data.
00048   const RawRecord* rr = dynamic_cast<const RawRecord*>(mom->GetFragment("RawRecord"));
00049   if(rr==0){
00050     MSG("SpillTiming",Msg::kInfo) << "No RawRecord in mom" << endl;
00051     result.SetWarning();
00052     return result;
00053   }
00054 
00055   const RawDaqSnarlHeader* snarlHead= dynamic_cast<const RawDaqSnarlHeader*>(rr->GetRawHeader());
00056   if(snarlHead==0) {
00057     MSG("SpillTiming",Msg::kInfo) << "No Snarl header in RawRecord." << endl;
00058     result.SetWarning();
00059     return result;
00060   }
00061 
00062   UInt_t trigSrc = snarlHead->GetTrigSrc();
00063 
00064   result.SetFailed();
00065  
00066   // Look for ND spill trigger bit
00067   if(fND) 
00068     if(trigSrc & TRIGGER_BIT_SPILL) result.SetPassed();
00069 
00070   // Look for FD spill trigger. Only flag it if
00071   // it's got the right subtype (if that check is turned on)
00072   if(fFD) {
00073     if(trigSrc & TRIGGER_BIT_SPILL_IP){
00074       if(fCheckFDTypeFlag) {
00075         // FIXME!
00076         if(true) result.SetPassed();
00077       } else {
00078         result.SetPassed();
00079       }
00080     }
00081   }
00082     
00083   return result;
00084 }
00085 
00086 
00087 const Registry& SelectSpillTriggers::DefaultConfig() const
00088 {
00089   static Registry r;
00090   std::string name=this->GetName();
00091   name += ".config.default";
00092   r.SetName(name.c_str());
00093 
00094   r.UnLockValues();
00095 
00096   r.Set("ND",1);
00097   r.Set("FD",1);
00098   r.Set("CheckFDTypeFlag",1);
00099   
00100   return r;
00101 }
00102 
00103 void  SelectSpillTriggers::Config(const Registry& r)
00104 {
00105   r.Get("ND",fND);
00106   r.Get("FD",fFD);
00107   r.Get("CheckFDTypeFlag",fCheckFDTypeFlag);
00108 }
00109 

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