SelectSpillTriggers Class Reference

#include <SelectSpillTriggers.h>

Inheritance diagram for SelectSpillTriggers:
JobCModule

List of all members.

Public Member Functions

 SelectSpillTriggers ()
 ~SelectSpillTriggers ()
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Attributes

Int_t fCheckFDTypeFlag
Int_t fFD
Int_t fND

Detailed Description

Definition at line 14 of file SelectSpillTriggers.h.


Constructor & Destructor Documentation

SelectSpillTriggers::SelectSpillTriggers (  ) 

Definition at line 22 of file SelectSpillTriggers.cxx.

References fCheckFDTypeFlag, fFD, and fND.

00023 {
00024   fFD = 1;
00025   fND = 1;
00026   fCheckFDTypeFlag = 1;
00027 }

SelectSpillTriggers::~SelectSpillTriggers (  ) 

Definition at line 31 of file SelectSpillTriggers.cxx.

00032 {
00033 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

====================================================================== Return true if the event in an SGATE snarl Return false if it's some other kind of trigger. Return kNoDecision if there is no snarl at all. ======================================================================

Reimplemented from JobCModule.

Definition at line 37 of file SelectSpillTriggers.cxx.

References fCheckFDTypeFlag, fFD, fND, MomNavigator::GetFragment(), RawRecord::GetRawHeader(), RawDaqSnarlHeader::GetTrigSrc(), Msg::kInfo, MSG, JobCResult::SetFailed(), JobCResult::SetPassed(), JobCResult::SetWarning(), TRIGGER_BIT_SPILL, and TRIGGER_BIT_SPILL_IP.

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 }

void SelectSpillTriggers::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 103 of file SelectSpillTriggers.cxx.

References fCheckFDTypeFlag, fFD, fND, and Registry::Get().

00104 {
00105   r.Get("ND",fND);
00106   r.Get("FD",fFD);
00107   r.Get("CheckFDTypeFlag",fCheckFDTypeFlag);
00108 }

const Registry & SelectSpillTriggers::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 87 of file SelectSpillTriggers.cxx.

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

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 }


Member Data Documentation

Definition at line 29 of file SelectSpillTriggers.h.

Referenced by Ana(), Config(), and SelectSpillTriggers().

Int_t SelectSpillTriggers::fFD [private]

Definition at line 30 of file SelectSpillTriggers.h.

Referenced by Ana(), Config(), and SelectSpillTriggers().

Int_t SelectSpillTriggers::fND [private]

Definition at line 31 of file SelectSpillTriggers.h.

Referenced by Ana(), Config(), and SelectSpillTriggers().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1